Examples of parseOperationalString()


Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

    public void testOpStringLoader() throws Exception {
        OpStringLoader opStringLoader = new OpStringLoader();
        opStringLoader.setDefaultGroups("banjo");
        String baseDir = System.getProperty("user.dir");
        File calculator = new File(baseDir, "src/test/resources/opstrings/opstringloadertest.groovy");
        OperationalString[] opStrings = opStringLoader.parseOperationalString(calculator);
        Assert.assertNotNull(opStrings);
        Assert.assertEquals("Should have only 1 opstring", 1, opStrings.length);
        Assert.assertEquals("Should have 1 service", 1, opStrings[0].getServices().length);
        Assert.assertEquals(1, opStrings[0].getServices()[0].getServiceBeanConfig().getGroups().length);
        Assert.assertEquals("banjo", opStrings[0].getServices()[0].getServiceBeanConfig().getGroups()[0]);
View Full Code Here

Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

    public Map<String, Object> activate(File opstring, String... beans) throws Exception {
         if(opstring==null)
            throw new IllegalArgumentException("opstring file must not be null");
        Map<String, Object> map = new HashMap<String, Object>();
        OpStringLoader opl = new OpStringLoader();
        OperationalString[] opStrings = opl.parseOperationalString(opstring);
        for(OperationalString ops : opStrings) {
            if(beans!=null && beans.length>0)
                map.putAll(activate(ops, beans));
            else
                map.putAll(activate(ops));
View Full Code Here

Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

                    + "maintain:      {}",
                    provisionType,maintain);

        OpStringLoader loader = new OpStringLoader();
        OperationalString[] opstrings =
            loader.parseOperationalString(
                new File("src/test/resources/opstring/simple_opstring.groovy"));
        Assert.assertEquals(1, opstrings.length);
        OpString opstring = (OpString)opstrings[0];
        Assert.assertEquals(1, opstring.getServices().length);
        ServiceElement service = opstring.getServices()[0];
View Full Code Here

Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

        testManager.undeployAll(monitor);

        // Prepare OpString
        OpStringLoader loader = new OpStringLoader();
        OperationalString[] opstrings =
            loader.parseOperationalString(new File("src/test/resources/opstring/simple_opstring.groovy"));
        org.junit.Assert.assertEquals(1, opstrings.length);
        OpString opstring = (OpString)opstrings[0];
        org.junit.Assert.assertEquals(1, opstring.getServices().length);
        ServiceElement service = opstring.getServices()[0];
        service.setPlanned(maintain);
View Full Code Here

Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

        testManager.undeployAll(monitor);
       
        // Prepare OpString
        OpStringLoader loader = new OpStringLoader();
        OperationalString[] opstrings =
            loader.parseOperationalString(
                new File("src/test/resources/opstring/simple_opstring.groovy"));
        org.junit.Assert.assertEquals(1, opstrings.length);
        OpString opstring = (OpString)opstrings[0];
        org.junit.Assert.assertEquals(1, opstring.getServices().length);
        ServiceElement service = opstring.getServices()[0];
View Full Code Here

Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

        int prevMaintainInt = 0;

        // Prepare OpString
        OpStringLoader loader = new OpStringLoader();
        OperationalString[] opstrings =
            loader.parseOperationalString(new File("src/test/resources/opstring/simple_opstring.groovy"));
        org.junit.Assert.assertEquals(1, opstrings.length);
        OpString opstring = (OpString)opstrings[0];
        logger.info("Loaded "+opstring.getName());
        org.junit.Assert.assertEquals(1, opstring.getServices().length);
        ServiceElement service = opstring.getServices()[0];
View Full Code Here

Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

        return graphView;
    }

    private OperationalString[] parseOperationalString(File file) throws Exception {
        OpStringLoader loader = new OpStringLoader();
        return(loader.parseOperationalString(file));
    }
}
View Full Code Here

Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

            if(deploymentURL == null)
                throw new IllegalArgumentException("Deployment URL cannot be null");
            try {
                /* Get the OperationalString loader */
                OpStringLoader opStringLoader = new OpStringLoader(this.getClass().getClassLoader());
                OperationalString[] opStrings = opStringLoader.parseOperationalString(deploymentURL);
                if(opStrings != null) {
                    for (OperationalString opString : opStrings) {
                        logger.debug("Activating Deployment [{}]", opString.getName());
                        ServiceElement[] services = opString.getServices();
                        for (ServiceElement service : services) {
View Full Code Here

Examples of org.rioproject.impl.opstring.OpStringLoader.parseOperationalString()

    static OperationalString loadDeployment(final String deployment) throws Exception {
        OperationalString deploy = null;
        File deployFile = getDeploymentFile(deployment);
        if (deployFile.exists()) {
            OpStringLoader opStringLoader = new OpStringLoader(new GroovyClassLoader(CLI.class.getClassLoader()));
            OperationalString[] opstrings = opStringLoader.parseOperationalString(deployFile);
            deploy = opstrings[0];
        }
        return (deploy);
    }
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.