Examples of GetFactHandlesCommand


Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

    public FactHandle getFactHandle(Object object) {
        return this.commandService.execute( new GetFactHandleCommand( object ) );
    }

    public <T extends org.kie.runtime.rule.FactHandle> Collection<T> getFactHandles() {
        return (Collection<T>) this.commandService.execute( new GetFactHandlesCommand() );

    }
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

        return (Collection<T>) this.commandService.execute( new GetFactHandlesCommand() );

    }

    public <T extends org.kie.runtime.rule.FactHandle> Collection<T> getFactHandles(ObjectFilter filter) {
        return (Collection<T>) this.commandService.execute( new GetFactHandlesCommand( filter ) );
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

       ksession.dispose();
    }
   
    @Test
    public void getEmptyFactHandlesTest() {
        GetFactHandlesCommand command = new GetFactHandlesCommand();
        Object result = commandService.execute(command);
        if( result instanceof Collection<?> ) {
            assertNotNull(result);
            assertTrue(((Collection<?>) result).isEmpty());
        }
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

   
    @Test
    public void getOneFactHandleTest() {
        String randomFact = "" + random.nextLong();
        ksession.insert(randomFact);
        GetFactHandlesCommand command = new GetFactHandlesCommand();
        Object result = commandService.execute(command);
       
        verifyThatCollectionContains1FactHandleWithThisFact(randomFact, result);
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

        }
        for( String fact : factSet ) {
            ksession.insert(fact);
        }
       
        GetFactHandlesCommand command = new GetFactHandlesCommand();
        Object result = commandService.execute(command);
       
        verifyThatCollectionContainsTheseFactHandle(factSet, result);
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

        verifyThatCollectionContainsTheseFactHandle(factSet, result);
    }

    @Test
    public void getEmptyDisconnectedFactHandlesTest() {
        GetFactHandlesCommand command = new GetFactHandlesCommand(true);
        Object result = commandService.execute(command);
        if( result instanceof Collection<?> ) {
            assertNotNull(result);
            assertTrue(((Collection<?>) result).isEmpty());
        }
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

        System.out.println( Thread.currentThread().getStackTrace()[1].getMethodName() );
        String randomFact = "" + random.nextLong();
        ksession.insert(randomFact);
       
        // Retrieve and verify fact handle collections
        GetFactHandlesCommand command = new GetFactHandlesCommand(false);
        Object result = commandService.execute(command);
        verifyThatCollectionContains1FactHandleWithThisFact(randomFact, result);
        FactHandle factHandle = (FactHandle) ((Collection<FactHandle>) result).toArray()[0];
       
        command = new GetFactHandlesCommand(false);
        result = commandService.execute(command);
        verifyThatCollectionContains1FactHandleWithThisFact(randomFact, result);
        FactHandle connectedFactHandle = (FactHandle) ((Collection<FactHandle>) result).toArray()[0];
       
        command = new GetFactHandlesCommand(true);
        result = commandService.execute(command);
        verifyThatCollectionContains1FactHandleWithThisFact(randomFact, result);
        FactHandle disconnectedFactHandle = (FactHandle) ((Collection<FactHandle>) result).toArray()[0];
     
        // Test fact handle collections
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

        }
        for( String fact : factSet ) {
            ksession.insert(fact);
        }
       
        GetFactHandlesCommand command = new GetFactHandlesCommand(false);
        Object result = commandService.execute(command);
        verifyThatCollectionContainsTheseFactHandle(factSet, result);
        Collection<FactHandle> factHandles = ((Collection<FactHandle>) result);
       
        command = new GetFactHandlesCommand(false);
        result = commandService.execute(command);
        verifyThatCollectionContainsTheseFactHandle(factSet, result);
        Collection<FactHandle> connectedFactHandles = ((Collection<FactHandle>) result);
       
        command = new GetFactHandlesCommand(true);
        result = commandService.execute(command);
        verifyThatCollectionContainsTheseFactHandle(factSet, result);
        Collection<FactHandle> disconnectedFactHandles = ((Collection<FactHandle>) result);
      
        // Test fact handle collections
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

       ksession.dispose();
    }
   
    @Test
    public void getEmptyFactHandlesTest() {
        GetFactHandlesCommand command = new GetFactHandlesCommand();
        Object result = commandService.execute(command);
        if( result instanceof Collection<?> ) {
            assertNotNull(result);
            assertTrue(((Collection<?>) result).isEmpty());
        }
View Full Code Here

Examples of org.drools.command.runtime.rule.GetFactHandlesCommand

   
    @Test
    public void getOneFactHandleTest() {
        String randomFact = "" + random.nextLong();
        ksession.insert(randomFact);
        GetFactHandlesCommand command = new GetFactHandlesCommand();
        Object result = commandService.execute(command);
       
        verifyThatCollectionContains1FactHandleWithThisFact(randomFact, result);
    }
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.