Package org.apache.felix.cm.integration.helper

Examples of org.apache.felix.cm.integration.helper.Log.info()


    @Test
    public void test_ConcurrentManagedServicesWithConcurrentConfigurations()
    {
        final Log log = new Log(bundleContext);
        log.info("starting test_ConcurrentManagedServicesWithConcurrentConfigurations");
        // Use at least 10 parallel threads, or take all available processors if the running host contains more than 10 processors.
        int parallelism = Math.max(10, Runtime.getRuntime().availableProcessors());
        final ConfigurationAdmin ca = getConfigurationAdmin();
        final ExecutorService executor = Executors.newFixedThreadPool(parallelism);
        try
View Full Code Here


                final CountDownLatch managedServiceUpdated = new CountDownLatch(MANAGED_SERVICES);
                final CountDownLatch managedServiceUnregistered = new CountDownLatch(MANAGED_SERVICES);

                // Create some ManagedServices concurrently
                log.info("registering aspects concurrently");
                final CopyOnWriteArrayList<ServiceRegistration> managedServices = new CopyOnWriteArrayList<ServiceRegistration>();
                final CopyOnWriteArrayList<Configuration> confs = new CopyOnWriteArrayList<Configuration>();

                for (int i = 0; i < MANAGED_SERVICES; i++)
                {
View Full Code Here

                if (!managedServiceUpdated.await(MAXWAIT, TimeUnit.MILLISECONDS))
                {
                    TestCase.fail("Detected errors logged during concurrent test");
                    break;
                }
                log.info("all managed services updated");

                // Unregister managed services concurrently
                log.info("unregistering services concurrently");
                for (final ServiceRegistration sr : managedServices)
                {
View Full Code Here

                    break;
                }
                log.info("all managed services updated");

                // Unregister managed services concurrently
                log.info("unregistering services concurrently");
                for (final ServiceRegistration sr : managedServices)
                {
                    executor.execute(new Runnable()
                    {
                        public void run()
View Full Code Here

                        }
                    });
                }

                // Unregister configuration concurrently
                log.info("unregistering configuration concurrently");
                for (final Configuration c : confs)
                {
                    c.delete();
                }
View Full Code Here

                {
                    TestCase.fail("Detected errors logged during concurrent test");
                    break;
                }

                log.info("finished one test loop");
                if ((loop + 1) % 100 == 0)
                {
                    long duration = System.currentTimeMillis() - timeStamp;
                    System.out.println(String.format("Performed %d tests in %d ms.", (loop + 1), duration));
                    timeStamp = System.currentTimeMillis();
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.