Package org.drools.repository

Examples of org.drools.repository.ModuleItem.loadAsset()


        assertEquals("a comment", a.getCheckinComment());


        in = new ByteArrayInputStream("qed".getBytes());
        api.post("/packages/testRestPost/asset2.xls", in, "a comment");
        a = pkg.loadAsset("asset2");

        assertTrue(a.isBinary());
        String s = new String(a.getBinaryContentAsBytes());
        assertEquals("qed", s);
        assertEquals("a comment", a.getCheckinComment());
View Full Code Here


        RestAPI api = new RestAPI(repo);
        api.setAssetValidator(new AssetValidator());
        Thread.sleep(42);
        api.put("packages/testRestPut/asset1.drl", Calendar.getInstance(), new ByteArrayInputStream("qaz".getBytes()), "a new comment");

        AssetItem asset1_ = pkg.loadAsset("asset1");
        assertEquals("qaz", asset1_.getContent());
        assertEquals("a new comment", asset1_.getCheckinComment());
        assertTrue(asset1_.getLastModified().after(cd));

        api.put("packages/testRestPut/asset2.xls", Calendar.getInstance(), new ByteArrayInputStream("def".getBytes()), "a new comment");
View Full Code Here

        assertEquals("qaz", asset1_.getContent());
        assertEquals("a new comment", asset1_.getCheckinComment());
        assertTrue(asset1_.getLastModified().after(cd));

        api.put("packages/testRestPut/asset2.xls", Calendar.getInstance(), new ByteArrayInputStream("def".getBytes()), "a new comment");
        AssetItem asset2_ = pkg.loadAsset("asset2");
        assertEquals("def", new String(asset2_.getBinaryContentAsBytes()));
        assertEquals("a new comment", asset2_.getCheckinComment());
        assertTrue(asset2_.getLastModified().after(cd));

        //now check updating the package header
View Full Code Here

        assertEquals(1, l.size());


        //now test it back from the dead
        api.post("packages/testRestDelete/asset1.drl", new ByteArrayInputStream("123".getBytes()), "new comment");
        AssetItem ass = pkg.loadAsset("asset1");
        assertEquals("123", ass.getContent());
        assertEquals("new comment", ass.getCheckinComment());
        assertFalse(ass.isArchived());
        l = RulesRepositoryTest.iteratorToList(pkg.listAssetsByFormat(new String[] {"drl"}));
        assertEquals(1, l.size());
View Full Code Here

        drl = "package testClassicDRLImport\n import blah \n rule 'ola' \n when CHANGED\n then \n end \n rule 'hola' \n when \n then \n end";
        in = new ByteArrayInputStream( drl.getBytes() );
        fileManagerService.importClassicDRL(in,
                null);
        pkg = rulesRepository.loadModule("testClassicDRLImport");
        AssetItem asset = pkg.loadAsset( "ola" );

        assertTrue( asset.getContent().indexOf( "CHANGED" ) > 0 );
        assertEquals( ver + 1,
                      asset.getVersionNumber() );
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.