Examples of DateQuery


Examples of org.drools.repository.RulesRepository.DateQuery

               new String[]{"testQueryXXX42", "wankle"} );
        q.put( AssetItem.SOURCE_PROPERTY_NAME,
               new String[]{"database", "wankle"} );
        results = iteratorToList( repo.query( q,
                                              false,
                                              new DateQuery[]{new DateQuery( "jcr:created",
                                                                             "1974-07-10T00:00:00.000-05:00",
                                                                             "3074-07-10T00:00:00.000-05:00" )} ) );
        assertEquals( 1,
                      results.size() );
        as = results.get( 0 );
        assertEquals( "testQuery",
                      as.getName() );

        q = new HashMap<String, String[]>();
        q.put( "drools:subject",
               new String[]{"testQueryXXX42", "wankle"} );
        q.put( AssetItem.SOURCE_PROPERTY_NAME,
               new String[]{"database", "wankle"} );
        results = iteratorToList( repo.query( q,
                                              false,
                                              new DateQuery[]{new DateQuery( "jcr:created",
                                                                             "1974-07-10T00:00:00.000-05:00",
                                                                             null )} ) );
        assertEquals( 1,
                      results.size() );
        as = results.get( 0 );
        assertEquals( "testQuery",
                      as.getName() );

        q = new HashMap<String, String[]>();
        q.put( "drools:subject",
               new String[]{"testQueryXXX42", "wankle"} );
        q.put( AssetItem.SOURCE_PROPERTY_NAME,
               new String[]{"database", "wankle"} );
        results = iteratorToList( repo.query( q,
                                              false,
                                              new DateQuery[]{new DateQuery( "jcr:created",
                                                                             null,
                                                                             "3074-07-10T00:00:00.000-05:00" )} ) );
        assertEquals( 1,
                      results.size() );
        as = results.get( 0 );
        assertEquals( "testQuery",
                      as.getName() );

        //should return nothing:
        q = new HashMap<String, String[]>();
        q.put( "drools:subject",
               new String[]{"testQueryXXX42", "wankle"} );
        q.put( AssetItem.SOURCE_PROPERTY_NAME,
               new String[]{"database", "wankle"} );
        results = iteratorToList( repo.query( q,
                                              false,
                                              new DateQuery[]{new DateQuery( "jcr:created",
                                                                             "3074-07-10T00:00:00.000-05:00",
                                                                             null )} ) );
        assertEquals( 0,
                      results.size() );

        q = new HashMap<String, String[]>();
        q.put( "drools:subject",
               new String[]{"testQueryXXX42", "wankle"} );
        q.put( AssetItem.SOURCE_PROPERTY_NAME,
               new String[]{"database", "wankle"} );
        results = iteratorToList( repo.query( q,
                                              false,
                                              new DateQuery[]{new DateQuery( "jcr:created",
                                                                             null,
                                                                             "1974-07-10T00:00:00.000-05:00" )} ) );
        assertEquals( 0,
                      results.size() );
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.