Package org.drools.core.test.model

Examples of org.drools.core.test.model.Person


        data.onAdd( null, ClassLoaderUtil.getClassLoader( null, getClass(), false ) );
       
        extractor.compile( data );
       
       
        person[0] = new Person( "bob",
                                30 );
        business[0] = new Address( "Business Street",
                                   "999",
                                   null );
        home[0] = new Address( "Home Street",
                               "555",
                               "55555555" );
        person[0].getAddresses().put( "business",
                                      business[0] );
        person[0].getAddresses().put( "home",
                                      home[0] );

        person[1] = new Person( "mark",
                                35 );
        business[1] = new Address( "Another Business Street",
                                   "999",
                                   null );
        home[1] = new Address( "Another Home Street",
View Full Code Here


    @Test
    public void testObjectIterator() {
        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        final StatefulSession session = ruleBase.newStatefulSession();

        session.insert( new Person( "bob", 35) );
        session.insert( new Cheese( "stilton", 35) );
        session.insert( new Cheese( "brie", 35) );
        session.insert( new Person( "steve", 55) );
        session.insert( new Person( "tom", 100) );

        int i = 0;
        for ( Iterator it = session.iterateFactHandles(); it.hasNext(); ) {
            Object object = it.next();
            if ( i++ > 5 ) {
View Full Code Here

        assertNotNull( wm );
        assertNotNull( handles );

        assertEquals( 5,
                      handles.size() );
        Person p = new Person( "darth", 36);
        p.setAge( 36 );
        p.setCity( "la" );
        p.setState( "ca" );
       
        List<Integer> list = new ArrayList<Integer>();
        list.add( 2 );

        assertEquals( 1,
View Full Code Here

        data.onAdd( null, ProjectClassLoader.createProjectClassLoader() );
       
        extractor.compile( data );
       
       
        person[0] = new Person( "bob",
                                30 );
        business[0] = new Address( "Business Street",
                                   "999",
                                   null );
        home[0] = new Address( "Home Street",
                               "555",
                               "55555555" );
        person[0].getAddresses().put( "business",
                                      business[0] );
        person[0].getAddresses().put( "home",
                                      home[0] );

        person[1] = new Person( "mark",
                                35 );
        business[1] = new Address( "Another Business Street",
                                   "999",
                                   null );
        home[1] = new Address( "Another Home Street",
View Full Code Here

    @Test
    public void testObjectIterator() {
        InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase();
        KieSession ksession = kBase.newKieSession();

        ksession.insert( new Person( "bob", 35) );
        ksession.insert( new Cheese( "stilton", 35) );
        ksession.insert( new Cheese( "brie", 35) );
        ksession.insert( new Person( "steve", 55) );
        ksession.insert( new Person( "tom", 100) );

        int i = 0;
        for ( FactHandle fh : ksession.getFactHandles()) {
            if ( i++ > 5 ) {
                fail( "should not iterate for than 3 times" );
View Full Code Here

                                                                 buildContext);

        final MockObjectSink sink = new MockObjectSink();
        objectTypeNode.addObjectSink(sink);

        final Object person = new Person("bob",
                                         25);

        final InternalFactHandle handle1 = (InternalFactHandle) workingMemory.insert(person);

        // should assert as ObjectType matches
View Full Code Here

        assertNotNull( wm );
        assertNotNull( handles );

        assertEquals( 5,
                      handles.size() );
        Person p = new Person( "darth", 36);
        p.setAge( 36 );
        p.setCity( "la" );
        p.setState( "ca" );
       
        List<Integer> list = new ArrayList<Integer>();
        list.add( 2 );

        assertEquals( 1,
View Full Code Here

                                                                 buildContext);

        final MockObjectSink sink = new MockObjectSink();
        objectTypeNode.addObjectSink(sink);

        final Object person = new Person("bob",
                                         25);

        final InternalFactHandle handle1 = (InternalFactHandle) ksession.insert(person);

        // should assert as ObjectType matches
View Full Code Here

    @Test
    public void testObjectIterator() {
        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        final StatefulSession session = ruleBase.newStatefulSession();

        session.insert( new Person( "bob", 35) );
        session.insert( new Cheese( "stilton", 35) );
        session.insert( new Cheese( "brie", 35) );
        session.insert( new Person( "steve", 55) );
        session.insert( new Person( "tom", 100) );

        int i = 0;
        for ( Iterator it = session.iterateFactHandles(); it.hasNext(); ) {
            Object object = it.next();
            if ( i++ > 5 ) {
View Full Code Here

TOP

Related Classes of org.drools.core.test.model.Person

Copyright © 2018 www.massapicom. 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.