Examples of OpString


Examples of org.rioproject.impl.opstring.OpString

                                                    1);
        PFEListener listener = new PFEListener();
        BasicEventConsumer eventConsumer = new BasicEventConsumer(ProvisionFailureEvent.getEventDescriptor(), listener);
        eventConsumer.register(monitorItems[0]);

        OpString opString = new OpString(opStringName, null);
        opString.addService(element);
        Assert.assertNotNull(monitor);
        testManager.deploy(opString, monitor);
        for(int i=0; i<10; i++) {
            if(listener.failed!=null) {
                break;
View Full Code Here

Examples of org.rioproject.impl.opstring.OpString

        AssociationDescriptor descriptor = new AssociationDescriptor(AssociationType.REQUIRES, "DependsOn");
        descriptor.setMatchOnName(true);
        descriptor.setOperationalStringName(element2.getOperationalStringName());
        descriptor.setGroups(testManager.getGroups());
        element1.addAssociationDescriptors(descriptor);
        OpString opString = new OpString(opStringName, null);
        opString.addService(element1);
        opString.addService(element2);
        OperationalStringManager manager = testManager.deploy(opString, monitor);
        Assert.assertNotNull(manager);
        testManager.waitForDeployment(manager);

        PMEListener listener = new PMEListener(ProvisionMonitorEvent.Action.SERVICE_BEAN_DECREMENTED);
View Full Code Here

Examples of org.rioproject.impl.opstring.OpString

        AssociationDescriptor descriptor = new AssociationDescriptor(AssociationType.REQUIRES, "DependsOn");
        descriptor.setMatchOnName(true);
        descriptor.setOperationalStringName(element2.getOperationalStringName());
        descriptor.setGroups(testManager.getGroups());
        element1.addAssociationDescriptors(descriptor);
        OpString opString = new OpString("FooBar", null);
        opString.addService(element1);
        opString.addService(element2);
        OperationalStringManager manager = testManager.deploy(opString, monitor);
        Assert.assertNotNull(manager);
        ServiceBeanInstance[] instances = new ServiceBeanInstance[0];
        for(int i=0; i<10; i++) {
            instances = cybernode.getServiceBeanInstances(element1);
View Full Code Here

Examples of org.rioproject.impl.opstring.OpString

        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];
        service.setPlanned(maintain);
        service.setProvisionType(provisionType);               

        int[] counts = CybernodeUtils.calcServices(cyberMon.getServices(),
                                                   Simple.class);
View Full Code Here

Examples of org.rioproject.impl.opstring.OpString

        // 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);
        service.setMaxPerMachine(maxPerMachine);
        service.setProvisionType(fixed? ServiceElement.ProvisionType.FIXED: ServiceElement.ProvisionType.DYNAMIC);

        prevCounts = CybernodeUtils.calcServices(cyberMon.getServices(),Simple.class);
View Full Code Here

Examples of org.rioproject.impl.opstring.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);
        service.setMaxPerMachine(maxPerMachine);
            service.setProvisionType(fixed?
                                     ServiceElement.ProvisionType.FIXED:
                                     ServiceElement.ProvisionType.DYNAMIC);
View Full Code Here

Examples of org.rioproject.impl.opstring.OpString

        // 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];
        service.setProvisionType(fixed? ServiceElement.ProvisionType.FIXED : ServiceElement.ProvisionType.DYNAMIC);
        if (maintain < 0) {
            try {
                service.setPlanned(maintain);
                Assert.fail("IllegalArgumentException expected but not thrown");
            } catch (IllegalArgumentException e) {
            }
            logger.info("checkState, prevFixed: "+prevFixed+", prevMaintainInt: "+prevMaintainInt+", cybernode service count: "+cyberMon.getServices().size());
            checkState(prevFixed, prevMaintainInt, cyberMon.getServices());
        } else {
            logger.info(service.getName()+" set planned="+maintain);
            service.setPlanned(maintain);
            logger.info("Deploy "+opstring.getName());
            testManager.deploy(opstring, monitor);
            logger.info("Deployed "+opstring.getName());
            checkState(fixed, maintain, cyberMon.getServices());
            prevFixed = fixed;
            prevMaintainInt = maintain;
        }
    }
View Full Code Here

Examples of org.rioproject.impl.opstring.OpString

    public void testAssociationManagementParsing() {
        File file = new File("src/test/resources/opstrings/association_management.groovy");
        OpStringParser dslParser = new GroovyDSLOpStringParser();
        List<OpString> opstrings = dslParser.parse(file, null, null, null);
        Assert.assertEquals("There should be one and only one opstring", 1, opstrings.size());
        OpString opstring = opstrings.get(0);
        ServiceElement serviceElement = opstring.getServices()[0];
        Assert.assertEquals(15, serviceElement.getAssociationDescriptors()[0].getServiceDiscoveryTimeout());
        Assert.assertEquals(TimeUnit.SECONDS, serviceElement.getAssociationDescriptors()[0].getServiceDiscoveryTimeUnits());
        Assert.assertEquals("net.foo.space.SomeProxy", serviceElement.getAssociationDescriptors()[0].getProxyClass());
        Assert.assertEquals(Utilization.class.getName(), serviceElement.getAssociationDescriptors()[0].getServiceSelectionStrategy());
View Full Code Here

Examples of org.rioproject.impl.opstring.OpString

* @author Dennis Reedy
*/
public class OpStringManagerControllerTest {
    @Test
    public void testAddRemove() throws Exception {
        OperationalString opString = new OpString("test", null);
        opString.addService(TestUtil.makeServiceElement("foo", "test"));
        Configuration config = new DynamicConfiguration();
        OpStringManagerController opStringManagerController = new OpStringManagerController();
        opStringManagerController.setServiceProxy(TestUtil.createProvisionMonitor());
        opStringManagerController.setEventProcessor(new ProvisionMonitorEventProcessor(config));
        opStringManagerController.setConfig(config);
View Full Code Here

Examples of org.rioproject.impl.opstring.OpString

    @Test
    public void concurrentCreationTest() throws ExecutionException, InterruptedException {
        OpStringManagerController opStringManagerController = new OpStringManagerController();
        opStringManagerController.setConfig(new DynamicConfiguration());
        OperationalString opString = new OpString("concurrent", null);

        List<Future<OpStringManager>> futures = new ArrayList<Future<OpStringManager>>();
        for(int i=0; i<50; i++) {
            Callable<OpStringManager> deployer = new Deployer(opStringManagerController, opString);
            FutureTask<OpStringManager> task = new FutureTask<OpStringManager>(deployer);
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.