Package org.drools.repository

Examples of org.drools.repository.RulesRepository.loadModule()


        ruleNODSL.updateFormat( AssetFormats.BUSINESS_RULE );

        ruleNODSL.updateContent( BRXMLPersistence.getInstance().marshal( model ) );
        ruleNODSL.checkin( "" );

        pkg = repo.loadModule( "testBRLWithDSLMixedIn" );
        PackageAssembler asm = new PackageAssembler();
        asm.init(pkg, null);
        asm.compile();
        assertFalse( asm.hasErrors() );
       
View Full Code Here


        ruleNODSL.updateFormat( AssetFormats.BUSINESS_RULE );

        ruleNODSL.updateContent( BRXMLPersistence.getInstance().marshal( model ) );
        ruleNODSL.checkin( "" );

        pkg = repo.loadModule( "testBRLWithDSLMixedIn" );
        PackageAssembler asm = new PackageAssembler();
        asm.init(pkg, null);
        asm.compile();
        assertFalse( asm.hasErrors() );
       
View Full Code Here

        String s = new String(a.getBinaryContentAsBytes());
        assertEquals("qed", s);
        assertEquals("a comment", a.getCheckinComment());
        assertEquals("xls", a.getFormat());

        List<AssetItem> assets = RulesRepositoryTest.iteratorToList(repo.loadModule("testRestPost").listAssetsByFormat(new String[] {"drl", "xls"}));
        assertEquals(2, assets.size());

    }

    @Test
View Full Code Here

    public void testPostNewPackage() throws Exception {
        RulesRepository repo = RepositorySessionUtil.getRepository();
        RestAPI api = new RestAPI(repo);

        api.post("/packages/testPostNewPackage/.package", new ByteArrayInputStream("qaz".getBytes()), "This is a new package");
        ModuleItem pkg = repo.loadModule("testPostNewPackage");
        assertEquals("qaz", pkg.getStringProperty(ModuleItem.HEADER_PROPERTY_NAME));

        assertEquals("This is a new package", pkg.getCheckinComment());
    }
View Full Code Here

        assertEquals("a new comment", asset2_.getCheckinComment());
        assertTrue(asset2_.getLastModified().after(cd));

        //now check updating the package header
        api.put("packages/testRestPut/.package", Calendar.getInstance(), new ByteArrayInputStream("whee".getBytes()), "hey");
        pkg = repo.loadModule("testRestPut");
        assertEquals("whee", pkg.getStringProperty(ModuleItem.HEADER_PROPERTY_NAME));

        try {
            api.put("packages/testRestPut/asset1.drl", cd, new ByteArrayInputStream("qaz".getBytes()), "a new comment");
            fail("should not be able to do this as it is stale timestamp.");
View Full Code Here

        assertTrue(mig.needsMigration(repo));
        mig.migrate(repo);
        assertFalse(repo.getSession().hasPendingChanges());
        assertFalse(mig.needsMigration(repo));
        pkg = repo.loadModule("testMigratePackage");
        assertTrue(pkg.containsAsset("drools"));
        AssetItem as = pkg.loadAsset("drools");
        assertEquals("some header", as.getContent());

View Full Code Here

        String s = new String(a.getBinaryContentAsBytes());
        assertEquals("qed", s);
        assertEquals("a comment", a.getCheckinComment());
        assertEquals("xls", a.getFormat());

        List<AssetItem> assets = RulesRepositoryTest.iteratorToList(repo.loadModule("testRestPost").listAssetsByFormat(new String[] {"drl", "xls"}));
        assertEquals(2, assets.size());

    }

    @Test
View Full Code Here

    public void testPostNewPackage() throws Exception {
        RulesRepository repo = RepositorySessionUtil.getRepository();
        RestAPI api = new RestAPI(repo);
        api.setAssetValidator(new AssetValidator());
        api.post("/packages/testPostNewPackage/.package", new ByteArrayInputStream("qaz".getBytes()), "This is a new package");
        ModuleItem pkg = repo.loadModule("testPostNewPackage");
        assertEquals("qaz", pkg.getStringProperty(ModuleItem.HEADER_PROPERTY_NAME));

        assertEquals("This is a new package", pkg.getCheckinComment());
    }
View Full Code Here

        assertEquals("a new comment", asset2_.getCheckinComment());
        assertTrue(asset2_.getLastModified().after(cd));

        //now check updating the package header
        api.put("packages/testRestPut/.package", Calendar.getInstance(), new ByteArrayInputStream("whee".getBytes()), "hey");
        pkg = repo.loadModule("testRestPut");
        assertEquals("whee", pkg.getStringProperty(ModuleItem.HEADER_PROPERTY_NAME));

        try {
            api.put("packages/testRestPut/asset1.drl", cd, new ByteArrayInputStream("qaz".getBytes()), "a new comment");
            fail("should not be able to do this as it is stale timestamp.");
View Full Code Here

        ruleNODSL.updateFormat( AssetFormats.BUSINESS_RULE );

        ruleNODSL.updateContent( BRXMLPersistence.getInstance().marshal( model ) );
        ruleNODSL.checkin( "" );

        pkg = repo.loadModule( "testBRLWithDSLMixedIn" );
        PackageAssembler asm = new PackageAssembler();
        asm.init(pkg, null);
        asm.compile();
        assertFalse( asm.hasErrors() );
       
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.