Examples of addCriterion()


Examples of org.apache.oodt.cas.filemgr.structs.Query.addCriterion()

       
        Query query = new Query();
        TermQueryCriteria termQuery = new TermQueryCriteria();
        termQuery.setElementName("DataVersion");
        termQuery.setValue("4.0");
        query.addCriterion(termQuery);
        query = fmClient.getCatalogQuery(query, genericFile);
        assertEquals("04.00", ((TermQueryCriteria) query.getCriteria().get(0)).getValue());
    }
   
    private static Product getTestProduct() throws MalformedURLException {
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.Query.addCriterion()

        bqc.addTerm(tqc);
      }catch (Exception e){
        e.printStackTrace();
            fail(e.getMessage());
      }
      query.addCriterion(bqc);
     
      // Perform the query and validate results
      ProductPage page = null;
      try{
        page = myCat.pagedQuery(query, testProduct.getProductType(), 1);
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.Query.addCriterion()

        bqc.addTerm(tqc);
      }catch (Exception e){
        e.printStackTrace();
            fail(e.getMessage());
      }
      query.addCriterion(bqc);
     
      // Perform the query and validate results
      ProductPage page = null;
      try{
        page = myCat.pagedQuery(query, testProduct.getProductType(), 1);
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.Query.addCriterion()

        prodMet.replaceMetadata("DataVersion", "4.6");
        myCat.addMetadata(prodMet, testProduct);

        // perform first query
        Query query = new Query();
        query
                .addCriterion(SqlParser
                        .parseSqlWhereClause("CAS.ProductName != 'TestFile3' AND (Filename == 'test-file-1.txt' OR Filename == 'test-file-2.txt') AND CAS.ProductName != 'TestFile2'"));
        System.out.println(query);
        List<String> productIds = myCat.query(query, testProduct
                .getProductType());
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.Query.addCriterion()

        System.out.println(productIds);
        assertEquals("[23]", productIds.toString());

        // perform second query
        query = new Query();
        query
                .addCriterion(SqlParser
                        .parseSqlWhereClause("Filename == 'test-file-1.txt' OR (Filename == 'test-file-2.txt' AND CAS.ProductName != 'TestFile2')"));
        System.out.println(query);
        productIds = myCat.query(query, testProduct.getProductType());
        System.out.println(productIds);
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.Query.addCriterion()

        System.out.println(productIds);
        assertEquals("[25, 23]", productIds.toString());

        // perform second query
        query = new Query();
        query
                .addCriterion(SqlParser
                        .parseSqlWhereClause("NominalDate == '2008-01-20' AND DataVersion >= '3.6' AND DataVersion <= '4.0'"));
        System.out.println(query);
        productIds = myCat.query(query, testProduct.getProductType());
        System.out.println(productIds);
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.query.ComplexQuery.addCriterion()

        List<String> fromValuesList = Arrays.asList(fromValues);
        if (!fromValuesList.contains("*"))
            sq.setReducedProductTypeNames(fromValuesList);
       
        if (splitSqlStatement.length > 3)
            sq.addCriterion(parseStatement(toPostFix(splitSqlStatement[3]
                    .trim())));
        return sq;
    }
   
    public static QueryCriteria parseSqlWhereClause(String sqlWhereClause)
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.query.ComplexQuery.addCriterion()

        List<String> productTypeNames = new Vector<String>();
        productTypeNames.add("GenericFile");
        complexQuery.setReducedProductTypeNames(productTypeNames);
        complexQuery.setSortByMetKey(CoreMetKeys.FILENAME);
        complexQuery.setToStringResultFormat("$" + CoreMetKeys.FILENAME);
        complexQuery.addCriterion(SqlParser.parseSqlWhereClause("Filename != 'test.txt'"));
        XmlRpcFileManagerClient fmc = new XmlRpcFileManagerClient(new URL(
                "http://localhost:" + FM_PORT));
        List<QueryResult> queryResults = fmc.complexQuery(complexQuery);
        assertEquals("[test-file-1.txt, test-file-2.txt]", queryResults.toString());
    }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.query.ComplexQuery.addCriterion()

        List<String> productTypeNames = new Vector<String>();
        productTypeNames.add("GenericFile");
        complexQuery.setReducedProductTypeNames(productTypeNames);
        complexQuery.setSortByMetKey(CoreMetKeys.FILENAME);
        complexQuery.setToStringResultFormat("$" + CoreMetKeys.FILENAME);
        complexQuery.addCriterion(SqlParser.parseSqlWhereClause("Filename != 'test.txt'"));
        XmlRpcFileManagerClient fmc = new XmlRpcFileManagerClient(new URL(
                "http://localhost:" + FM_PORT));
        List<QueryResult> queryResults = fmc.complexQuery(complexQuery);
        assertEquals("[test-file-1.txt, test-file-2.txt]", queryResults.toString());
    }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.query.ComplexQuery.addCriterion()

        List<String> productTypeNames = new Vector<String>();
        productTypeNames.add("GenericFile");
        complexQuery.setReducedProductTypeNames(productTypeNames);
        complexQuery.setSortByMetKey(CoreMetKeys.FILENAME);
        complexQuery.setToStringResultFormat("$" + CoreMetKeys.FILENAME);
        complexQuery.addCriterion(SqlParser.parseSqlWhereClause("Filename != 'test.txt'"));
        XmlRpcFileManagerClient fmc = new XmlRpcFileManagerClient(new URL(
                "http://localhost:" + FM_PORT));
        List<QueryResult> queryResults = fmc.complexQuery(complexQuery);
        assertEquals("[test-file-1.txt, test-file-2.txt]", queryResults.toString());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.