Package org.drools.repository

Examples of org.drools.repository.CategoryItem


    }

    private String findParentCategory(AssetItem asset,
                                      String currentCat) {
        //Start your search at the top
        CategoryItem item = asset.getRulesRepository().loadCategory("/");
        return findCategoryInChild(item,
                currentCat);
    }
View Full Code Here


//    @BeforeClass
    // Unreliable HACK
    // Fixable after this is fixed: https://issues.jboss.org/browse/ARQ-540
    @Test
    public void startServers() throws Exception {
        CategoryItem cat = rulesRepository.loadCategory("/");
        cat.addCategory("AssetPackageResourceTestCategory",
                "yeah");
        cat.addCategory("AssetPackageResourceTestCategory2",
        "yeah");       
       
        rulesRepository.createState( "Dev" );
       
        //Package version 1(Initial version)
View Full Code Here

    @Test
    public void testBuiltInSelector() throws Exception {
        RulesRepository repo = rulesRepository;

        CategoryItem rootCat = repo.loadCategory( "/" );
        CategoryItem testBuiltInSelectorCategory1 = rootCat.addCategory( "testBuiltInSelectorCategory1",
                                                                         "yeah" );
        testBuiltInSelectorCategory1.addCategory( "testBuiltInSelectorCategory1Child",
                                                  "yeah" );
        CategoryItem testBuiltInSelectorCategory2 = rootCat.addCategory( "testBuiltInSelectorCategory2",
                                                                         "yeah" );
        testBuiltInSelectorCategory2.addCategory( "testBuiltInSelectorCategory2Child",
                                                  "yeah" );

        //create our package
        ModuleItem pkg = repo.createModule( "testBuiltInSelector",
                                            "" );
View Full Code Here

        rulesRepository.loadDefaultModule();
        rulesRepository.createModule( "anotherPackage",
                                      "woot" );

        CategoryItem cat = rulesRepository.loadCategory( "/" );
        cat.addCategory( "testDeleteUnversioned",
                         "yeah" );

        String uuid = serviceImplementation.createNewRule( "test Delete Unversioned",
                                                           "a description",
                                                           "testDeleteUnversioned",
View Full Code Here

        rulesRepository.loadDefaultModule();
        rulesRepository.createModule( "another",
                                      "woot" );

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

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

                      dtItem.getBinaryContentAsBytes().length );
    }

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

        rulesRepository.createModule( "dupes",
                                      "yeah" );
View Full Code Here

    public void testRuleTableLoad() throws Exception {
        TableConfig conf = serviceImplementation.loadTableConfig( ExplorerNodeConfig.RULE_LIST_TABLE_ID );
        assertNotNull( conf.headers );
        assertNotNull( conf.headerTypes );

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

        rulesRepository.createModule( "testRuleTableLoad",
                                      "yeah" );
        serviceImplementation.createNewRule( "testRuleTableLoad",
View Full Code Here

    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    @Test
    public void testLoadChildCategories() {
        CategoryItem categoryItem = mock( CategoryItem.class );
        when( rulesRepository.loadCategory( "categorypath" ) ).thenReturn( categoryItem );
        List childTags = new ArrayList();
        CategoryItem categoryItemNode = mock( CategoryItem.class );
        childTags.add( categoryItemNode );
        when( categoryItemNode.getName() ).thenReturn( "categoryNodeName" );
        when( categoryItem.getChildTags() ).thenReturn( childTags );
        assertArrayEquals( repositoryCategoryOperations.loadChildCategories( "categorypath" ),
                           new String[]{"categoryNodeName"} );
    }
View Full Code Here

    }

    public void testAndVerifyCreateCategory(final String createPath,
                                            final String loadPath) {
        initSession();
        CategoryItem categoryItem = mock( CategoryItem.class );
        when( rulesRepository.loadCategory( loadPath ) ).thenReturn( categoryItem );
        repositoryCategoryOperations.createCategory( createPath,
                                                     "name",
                                                     "description" );
        verify( rulesRepository ).loadCategory( loadPath );
View Full Code Here

    }
   
    @Test
    public void testRemoveCategory() throws SerializationException {
        initSession();
        CategoryItem categoryItem = mock( CategoryItem.class );
        when( rulesRepository.loadCategory( "/path" ) ).thenReturn( categoryItem );

        repositoryCategoryOperations.removeCategory( "/path" );
        verify( rulesRepository ).loadCategory( "/path" );
        verify( categoryItem ).remove();
View Full Code Here

TOP

Related Classes of org.drools.repository.CategoryItem

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.