Package org.rioproject.impl.config

Examples of org.rioproject.impl.config.DynamicConfiguration$Entry


    }

    @Test
    public void testGetPlatformCapabilities() throws Exception {
        PlatformCapability[] pCaps = systemCapabilities.getPlatformCapabilities(new DynamicConfiguration());
        Assert.assertTrue("Expected at least 7", pCaps.length>=7);

        ProcessorArchitecture processorArchitecture = getCapability(ProcessorArchitecture.class, pCaps);
        Assert.assertNotNull(processorArchitecture);
        log(processorArchitecture);
View Full Code Here


                ids, wdrs, collectionSizes});
        for (Object[] combination : combinations) {
            String id = (String) combination[0];
            WatchDataReplicator wdr = (WatchDataReplicator) combination[1];
            int collectionSize = (Integer) combination[2];
            DynamicConfiguration config = new DynamicConfiguration();
            if (collectionSize != 666) {
                config.setEntry("org.rioproject.watch",
                                "collectionSize",
                                collectionSize);
            }
            WatchDataSourceImpl impl = new WatchDataSourceImpl(id, config);
            boolean added = impl.addWatchDataReplicator(wdr);
            if(wdr!=null)
                Assert.assertTrue("Expected to add "+wdr.getClass().getName(),
                                  added);
            else
                Assert.assertFalse("Expected to not add a null WatchDataReplicator",
                                   added);

            Assert.assertSame(id, impl.getID());
            if (wdr == null) {
                Assert.assertNotNull(impl.getWatchDataReplicators());
                Assert.assertTrue(impl.getWatchDataReplicators().length==0);
            } else {
                Assert.assertSame(wdr, impl.getWatchDataReplicators()[0]);
            }
            if (collectionSize == 666 || collectionSize < 1
                || collectionSize > MCS) {
                Assert.assertEquals(DCS, impl.getMaxSize());
            } else {
                Assert.assertEquals(collectionSize, impl.getMaxSize());
            }

            Assert.assertNull(impl.getProxy());
            assertAddCalculableWorks(impl,
                                     Math.min(Math.max(collectionSize, 0), 10),
                                     true);

            impl.close();
        }

        try {
            new WatchDataSourceImpl(null, new DynamicConfiguration());
            Assert.fail("IllegalArgumentException expected but not thrown");
        } catch (IllegalArgumentException e) {
        }
        try {
            new WatchDataSourceImpl("watch", null);
View Full Code Here

            impl.close();
        }

        {   // Non-default initial size
            DynamicConfiguration config = new DynamicConfiguration();
            config.setEntry("org.rioproject.watch", "collectionSize",
                            DCS + 15);
            WatchDataSourceImpl impl = new WatchDataSourceImpl();
            impl.setID("watch");
            impl.setConfiguration(config);
            impl.initialize();
View Full Code Here

                LoggingWatchDataReplicator wdr;
                if(wdrClass.equals(RemoteWDR.class.getName()))
                    wdr = new RemoteWDR();
                else
                    wdr = new LoggingWatchDataReplicator();
                DynamicConfiguration config = new DynamicConfiguration();
                config.setEntry("org.rioproject.watch", "collectionSize", collectionSize);

                WatchDataSourceImpl impl = new WatchDataSourceImpl();
                impl.setID("watch");
                impl.setConfiguration(config);
                if(wdrClass.equals(RemoteWDR.class.getName()))
View Full Code Here

     */
    @Test public void testGetWatchDataReplicator() throws Exception {
        WatchDataReplicator wdr1 = new LoggingWatchDataReplicator();
        WatchDataSourceImpl impl = new WatchDataSourceImpl();
        impl.setID("watch");
        impl.setConfiguration(new DynamicConfiguration());
        impl.addWatchDataReplicator(wdr1);
        Assert.assertSame(wdr1, impl.getWatchDataReplicators()[0]);

        WatchDataReplicator wdr2 = new LoggingWatchDataReplicator();
        impl.addWatchDataReplicator(wdr2);
View Full Code Here

     * @throws Exception if the test fails
     */
    @Test public void testAddWatchDataReplicator() throws Exception {
        WatchDataSourceImpl impl = new WatchDataSourceImpl();
        impl.setID("watch");
        impl.setConfiguration(new DynamicConfiguration());

        WatchDataReplicator wdr1 = new LoggingWatchDataReplicator();
        impl.addWatchDataReplicator(wdr1);
        Assert.assertSame(wdr1, impl.getWatchDataReplicators()[0]);

View Full Code Here

        }
        return found;
    }

    private void startLookup(String... groups) throws Exception {
        DynamicConfiguration configuration = new DynamicConfiguration();
        configuration.setEntry("com.sun.jini.reggie", "initialMemberGroups", String[].class, groups);
        registrar = new Reggie(configuration, null);
        listener = new DL();
        discoveryManagement = new LookupDiscoveryManager(new String[]{"foo"}, null, listener);
        deploymentVerifier = new DeploymentVerifier(EmptyConfiguration.INSTANCE, discoveryManagement);
    }
View Full Code Here

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);
        opStringManagerController.setServiceProvisioner(new ServiceProvisioner(config,
View Full Code Here

    }

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

        ComputeResourceUtilization resourceUtilization = new ComputeResourceUtilization("test",
                                                                                        sbi.inetAddress.getHostAddress(),
                                                                                        sbi.inetAddress.getHostName(),
                                                                                        measuredResources);
        SystemCapabilities systemCapabilities = new SystemCapabilities();
        PlatformCapability[] platformCapabilities = systemCapabilities.getPlatformCapabilities(new DynamicConfiguration());
        ResourceCapability resourceCapability = new ResourceCapability(sbi.inetAddress.getHostAddress(),
                                                                       sbi.inetAddress.getHostName(),
                                                                       true,
                                                                       platformCapabilities,
                                                                       resourceUtilization);
        instantiatorResource = new InstantiatorResource(null,
                                                        sbi,
                                                        "test",
                                                        sbi.uuid,
                                                        null,
                                                        resourceCapability,
                                                        50);
        service = createServiceElement();
        OperationalString opString = new OpString("test", null);

        opString.addService(service);
        OpStringManager parent = null;
        boolean active = true;
        Configuration config = new DynamicConfiguration();
        OpStringManagerController opStringManagerController = new OpStringManagerController();
        manager = new DefaultOpStringManager(opString,
                                             parent,
                                             active,
                                             config,
View Full Code Here

TOP

Related Classes of org.rioproject.impl.config.DynamicConfiguration$Entry

Copyright © 2018 www.massapicom. 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.