Examples of CategoryItem


Examples of org.drools.repository.CategoryItem

        impl.getRulesRepository().loadDefaultPackage();
        impl.getRulesRepository().createPackage( "another",
                                                 "woot" );

        CategoryItem cat = impl.getRulesRepository().loadCategory( "/" );
        cat.addCategory( "testAddRule",
                         "yeah" );

        String result = impl.createNewRule( "test AddRule",
                                            "a description",
                                            "testAddRule",
View Full Code Here

Examples of org.drools.repository.CategoryItem

    }

    @Test
    public void testAttemptDupeRule() throws Exception {
        ServiceImplementation impl = getServiceImplementation();
        CategoryItem cat = impl.getRulesRepository().loadCategory( "/" );
        cat.addCategory( "testAttemptDupeRule",
                         "yeah" );

        impl.getRulesRepository().createPackage( "dupes",
                                                 "yeah" );
View Full Code Here

Examples of org.drools.repository.CategoryItem

        RepositoryCategoryService repositoryCategoryService = getRepositoryCategoryService();
        TableConfig conf = impl.loadTableConfig( ExplorerNodeConfig.RULE_LIST_TABLE_ID );
        assertNotNull( conf.headers );
        assertNotNull( conf.headerTypes );

        CategoryItem cat = impl.getRulesRepository().loadCategory( "/" );
        cat.addCategory( "testRuleTableLoad",
                         "yeah" );

        impl.getRulesRepository().createPackage( "testRuleTableLoad",
                                                 "yeah" );
        impl.createNewRule( "testRuleTableLoad",
View Full Code Here

Examples of org.drools.repository.CategoryItem

        impl.getRulesRepository().createPackage( "testBuiltInSelectorPackage",
                                       "woot" );
        impl.getRulesRepository().createState( "Dev" );
        impl.getRulesRepository().createState( "QA" );

        CategoryItem cat = impl.getRulesRepository().loadCategory( "/" );
        cat.addCategory( "testBuiltInSelectorCat1",
                         "yeah" );
        cat.addCategory( "testBuiltInSelectorCat2",
                         "yeah" );

        String uuid1 = impl.createNewRule( "test AddRule1",
                                           "a description",
                                           "testBuiltInSelectorCat1",
View Full Code Here

Examples of org.drools.repository.CategoryItem



    public void testTagItem() throws Exception {

            final CategoryItem root = getRepo().loadCategory( "/" );

            root.addCategory( "TestTag", "nothing to see" );



            CategoryItem tagItem1 = getRepo().loadCategory("TestTag");
            assertNotNull(tagItem1);
            assertEquals("TestTag", tagItem1.getName());

            CategoryItem tagItem2 = getRepo().loadCategory("TestTag");
            assertNotNull(tagItem2);
            assertEquals("TestTag", tagItem2.getName());
            assertEquals(tagItem1, tagItem2);

            List originalCats = getRepo().loadCategory( "/" ).getChildTags(); //listCategoryNames();
            assertTrue(originalCats.size() > 0);

            CategoryItem rootCat = (CategoryItem) originalCats.get( 0 );
            assertNotNull(rootCat.getName());
            assertNotNull(rootCat.getFullPath());

            root.addCategory( "FootestTagItem", "nothing" );

            List cats = root.getChildTags();
            assertEquals(originalCats.size() + 1, cats.size());

            boolean found = false;
            for ( Iterator iter = cats.iterator(); iter.hasNext(); ) {
                CategoryItem element = (CategoryItem) iter.next();
                if (element.getName().equals( "FootestTagItem" )) {
                    found = true; break;
                }
            }

            assertTrue(found);
View Full Code Here

Examples of org.drools.repository.CategoryItem

    public void testCreateCateories() throws Exception {
        RulesRepository repo = getRepo();

        //load the root
        CategoryItem root = repo.loadCategory( "/" );

        CategoryItem item = root.addCategory("testCreateCategories", "this is a top level one");
        assertEquals("testCreateCategories", item.getName());
        assertEquals("testCreateCategories", item.getFullPath());

        item = repo.loadCategory( "testCreateCategories" );
        assertEquals("testCreateCategories", item.getName());

        item.remove();
        repo.save();

        try {
            repo.loadCategory( "testCreateCategories" );
            fail("this should not exist");
View Full Code Here

Examples of org.drools.repository.CategoryItem

            assertNotNull(e.getCause());
        }
    }

    public void testGetChildTags() {
            CategoryItem tagItem1 = getRepo().loadCategory("TestTag");
            assertNotNull(tagItem1);
            assertEquals("TestTag", tagItem1.getName());

            List childTags = tagItem1.getChildTags();
            assertNotNull(childTags);
            assertEquals(0, childTags.size());

            tagItem1.addCategory( "TestChildTag1", "description" );

            childTags = tagItem1.getChildTags();
            assertNotNull(childTags);
            assertEquals(1, childTags.size());
            assertEquals("TestChildTag1", ((CategoryItem)childTags.get(0)).getName());

            tagItem1.addCategory( "AnotherChild", "ignore me" );

            childTags = tagItem1.getChildTags();
            assertNotNull(childTags);
            assertEquals(2, childTags.size());
    }
View Full Code Here

Examples of org.drools.repository.CategoryItem

            assertNotNull(childTags);
            assertEquals(2, childTags.size());
    }

    public void testGetChildTag() {
            CategoryItem root = getRepo().loadCategory( "/" );
            CategoryItem tagItem1 = root.addCategory("testGetChildTag", "yeah");
            assertNotNull(tagItem1);
            assertEquals("testGetChildTag", tagItem1.getName());

            //test that child is added if not already in existence
            List childTags = tagItem1.getChildTags();
            assertNotNull(childTags);
            assertEquals(0, childTags.size());

            CategoryItem childTagItem1 = tagItem1.addCategory("TestChildTag1", "woo");
            assertNotNull(childTagItem1);
            assertEquals("TestChildTag1", childTagItem1.getName());

            //test that if already there, it is returned
            CategoryItem childTagItem2 = getRepo().loadCategory( "testGetChildTag/TestChildTag1");
            assertNotNull(childTagItem2);
            assertEquals("TestChildTag1", childTagItem2.getName());
            assertEquals(childTagItem1, childTagItem2);
    }
View Full Code Here

Examples of org.drools.repository.CategoryItem

            assertEquals(childTagItem1, childTagItem2);
    }

    public void testGetFullPath() {

            CategoryItem root = getRepo().loadCategory( "/" );

            CategoryItem tagItem1 = root.addCategory("testGetFullPath", "foo");
            assertNotNull(tagItem1);
            assertEquals("testGetFullPath", tagItem1.getFullPath());

            CategoryItem childTagItem1 = tagItem1.addCategory("TestChildTag1", "foo");
            assertNotNull(childTagItem1);
            assertEquals("testGetFullPath/TestChildTag1", childTagItem1.getFullPath());

            CategoryItem childTagItem2 = childTagItem1.addCategory("TestChildTag2", "wee");
            assertNotNull(childTagItem2);
            assertEquals("testGetFullPath/TestChildTag1/TestChildTag2", childTagItem2.getFullPath());



    }
View Full Code Here

Examples of org.drools.repository.CategoryItem

    impl.repository.loadDefaultPackage();
    impl.repository.createPackage("testBuiltInSelectorPackage", "woot");
    impl.repository.createState("Dev");
    impl.repository.createState("QA");
   
    CategoryItem cat = impl.repository.loadCategory("/");
    cat.addCategory("testBuiltInSelectorCat1", "yeah");
    cat.addCategory("testBuiltInSelectorCat2", "yeah");

    String uuid1 = impl.createNewRule("test AddRule1", "a description",
        "testBuiltInSelectorCat1", "testBuiltInSelectorPackage", "txt");
    AssetItem item1 = impl.repository.loadAssetByUUID(uuid1);   
    item1.updateState("Dev");
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.