Examples of AssetValidator


Examples of org.drools.repository.utils.AssetValidator

        AssetItem ass = pkg.addAsset("some space", "");
        ass.updateFormat("drl");
        ass.checkin("hey");

        RestAPI api = new RestAPI(repo);
       api.setAssetValidator(new AssetValidator());
        String url = "packages/testRestGetSpaces";
        Response res = api.get(url);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        res.writeData(out);
View Full Code Here

Examples of org.drools.repository.utils.AssetValidator

        assertTrue(asset3.isBinary());
        assertFalse(asset1.isBinary());

        RestAPI api = new RestAPI(repo);
        api.setAssetValidator(new AssetValidator());

        //this should get us the package configuration

        String url = "packages/testRestGetBasics/.package";
        Response res = api.get(url);
View Full Code Here

Examples of org.drools.repository.utils.AssetValidator

    @Test
    public void testGetMisc() throws Exception {
        RulesRepository repo = RepositorySessionUtil.getRepository();
        RestAPI api = new RestAPI(repo);
        api.setAssetValidator(new AssetValidator());
        api.get("");
        api.get("/");
        api.get("packages");
        api.get("snapshots");
        api.get("snapshots/defaultPackage");
View Full Code Here

Examples of org.drools.repository.utils.AssetValidator

        asset1.checkin("This is something");

        assertEquals(1, asset1.getVersionNumber());

        RestAPI api = new RestAPI(repo);
        api.setAssetValidator(new AssetValidator());
        Response res = api.get("packages/testRestGetVersionHistory/asset1.drl?version=all");
        ByteArrayOutputStream out = new ByteArrayOutputStream();

        res.writeData(out);
        String d = new String(out.toByteArray());
View Full Code Here

Examples of org.drools.repository.utils.AssetValidator

        asset2.checkin("This is another");

        assertEquals(1, asset1.getVersionNumber());

        RestAPI api = new RestAPI(repo);
        api.setAssetValidator(new AssetValidator());
        Text res = (Text) api.get("packages/testVersionHistoryAndArchived");
        System.err.println(res.data);
        assertTrue(res.data.indexOf("asset2.drl") > -1);

        asset2.archiveItem(true);
View Full Code Here

Examples of org.drools.repository.utils.AssetValidator

        ModuleItem pkg = repo.createModule("testRestPost", "", ModuleItem.MODULE_FORMAT);
        pkg.updateStringProperty("This is some header", ModuleItem.HEADER_PROPERTY_NAME);
        repo.save();

        RestAPI api = new RestAPI(repo);
        api.setAssetValidator(new AssetValidator());
        ByteArrayInputStream in = new ByteArrayInputStream("abc".getBytes());
        api.post("/packages/testRestPost/asset1.drl", in, "a comment");

        AssetItem a = pkg.loadAsset("asset1");
        assertFalse(a.isBinary());
View Full Code Here

Examples of org.drools.repository.utils.AssetValidator

    @Test
    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

Examples of org.drools.repository.utils.AssetValidator

        asset2.updateBinaryContentAttachment(in);
        asset2.updateFormat("xls");
        asset2.checkin("");

        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());
View Full Code Here

Examples of org.drools.repository.utils.AssetValidator

        asset1.updateContent("this is content");
        asset1.updateFormat("drl");
        asset1.checkin("");

        RestAPI api = new RestAPI(repo);
        api.setAssetValidator(new AssetValidator());
        api.delete("packages/testRestDelete/asset1.drl");

        List l = RulesRepositoryTest.iteratorToList(pkg.listAssetsByFormat(new String[] {"drl"}));
        assertEquals(0, l.size());
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.