Package org.drools.guvnor.server.repository

Examples of org.drools.guvnor.server.repository.UserInbox


    public void testTrackRecentOpenedChanged() throws Exception {
        try {
            RepositoryStartupService.registerCheckinListener();
            ServiceImplementation impl = getServiceImplementation();
            RepositoryCategoryService repositoryCategoryService = getRepositoryCategoryService();
            UserInbox ib = new UserInbox( impl.getRulesRepository() );
            ib.clearAll();
            impl.getRulesRepository().createPackage( "testTrackRecentOpenedChanged",
                                                     "desc" );
            repositoryCategoryService.createCategory( "",
                                                      "testTrackRecentOpenedChanged",
                                                      "this is a cat" );

            String id = impl.createNewRule( "myrule",
                                            "desc",
                                            "testTrackRecentOpenedChanged",
                                            "testTrackRecentOpenedChanged",
                                            "drl" );
            RepositoryAssetService repositoryAssetService = getRepositoryAssetService();
            RuleAsset ass = repositoryAssetService.loadRuleAsset( id );

            repositoryAssetService.checkinVersion( ass );

            List<InboxEntry> es = ib.loadRecentEdited();
            assertEquals( 1,
                          es.size() );
            assertEquals( ass.getUuid(),
                          es.get( 0 ).assetUUID );
            assertEquals( ass.getName(),
                          es.get( 0 ).note );

            ib.clearAll();

            repositoryAssetService.loadRuleAsset( ass.getUuid() );
            es = ib.loadRecentEdited();
            assertEquals( 0,
                          es.size() );

            //now check they have it in their opened list...
            es = ib.loadRecentOpened();
            assertEquals( 1,
                          es.size() );
            assertEquals( ass.getUuid(),
                          es.get( 0 ).assetUUID );
            assertEquals( ass.getName(),
                          es.get( 0 ).note );

            assertEquals( 0,
                          ib.loadRecentEdited().size() );
        } finally {
            RepositoryStartupService.removeListeners();
        }
    }
View Full Code Here


        try {
            RepositoryStartupService.registerCheckinListener();
            ServiceImplementation serv = getServiceImplementation();
            RepositoryCategoryService repositoryCategoryService = getRepositoryCategoryService();
            RepositoryPackageService repositoryPackageService = getRepositoryPackageService();
            UserInbox ib = new UserInbox( serv.getRulesRepository() );
            List<InboxEntry> inbox = ib.loadRecentEdited();

            repositoryPackageService.listPackages();

            repositoryCategoryService.createCategory( "/",
                                                      "testCheckinCategory",
                                                      "this is a description" );
            repositoryCategoryService.createCategory( "/",
                                                      "testCheckinCategory2",
                                                      "this is a description" );
            repositoryCategoryService.createCategory( "testCheckinCategory",
                                                      "deeper",
                                                      "description" );

            String uuid = serv.createNewRule( "testChecking",
                                              "this is a description",
                                              "testCheckinCategory",
                                              RulesRepository.DEFAULT_PACKAGE,
                                              AssetFormats.DRL );
            RepositoryAssetService repositoryAssetService = getRepositoryAssetService();
            RuleAsset asset = repositoryAssetService.loadRuleAsset( uuid );

            assertNotNull( asset.getLastModified() );

            asset.getMetaData().setCoverage( "boo" );
            asset.setContent( new RuleContentText() );
            ((RuleContentText) asset.getContent()).content = "yeah !";
            asset.setDescription( "Description 1" );

            Date start = new Date();
            Thread.sleep( 100 );

            String uuid2 = repositoryAssetService.checkinVersion( asset );
            assertEquals( uuid,
                          uuid2 );

            assertTrue( ib.loadRecentEdited().size() > inbox.size() );

            RuleAsset asset2 = repositoryAssetService.loadRuleAsset( uuid );
            assertNotNull( asset2.getLastModified() );
            assertTrue( asset2.getLastModified().after( start ) );
View Full Code Here

        final int PAGE_SIZE = 2;

        ServiceImplementation impl = getServiceImplementation();
        RepositoryCategoryService repositoryCategoryService = getRepositoryCategoryService();
        UserInbox ib = new UserInbox( impl.getRulesRepository() );
        ib.clearAll();

        @SuppressWarnings("unused")
        RuleAsset asset;
        String uuid;
        impl.getRulesRepository().createPackage( "testLoadInboxPackage",
View Full Code Here

    @Test
    public void testLoadInboxFullResults() throws Exception {

        ServiceImplementation impl = getServiceImplementation();
        RepositoryCategoryService repositoryCategoryService = getRepositoryCategoryService();
        UserInbox ib = new UserInbox( impl.getRulesRepository() );

        ib.clearAll();

        @SuppressWarnings("unused")
        RuleAsset asset;
        String uuid;
        impl.getRulesRepository().createPackage( "testLoadInboxPackage",
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.repository.UserInbox

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.