Package org.jnp.server

Examples of org.jnp.server.ExecutorEventMgr$Dispatcher


* Created by Tronok on 29.04.14.
*/
public class DispatcherTest {
    @Test
    public void testDispatcherNormal2Threads() throws InterruptedException, ExecutionException, IOException {
        Dispatcher dispatcher = new Dispatcher("multicoreTest.txt", 2);
        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
        dispatcher = new Dispatcher("multicoreTest_1_by_1.txt", 2);
        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
    }
View Full Code Here


        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
    }

    @Test
    public void testDispatcherNormal3Threads() throws InterruptedException, ExecutionException, IOException {
        Dispatcher dispatcher = new Dispatcher("multicoreTest.txt", 3);
        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
        dispatcher = new Dispatcher("multicoreTest_1_by_1.txt", 3);
        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
    }
View Full Code Here

        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
    }

    @Test
    public void testDispatcherNormal4Threads() throws InterruptedException, ExecutionException, IOException {
        Dispatcher dispatcher = new Dispatcher("multicoreTest.txt", 4);
        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
        dispatcher = new Dispatcher("multicoreTest_1_by_1.txt", 4);
        Assert.assertArrayEquals(new int[]{1, 2, 2, 3, 5, 5, 6, 8, 9, 34}, dispatcher.sort());
    }
View Full Code Here

      super.setUp();
      log.info("+++ setUp, creating NamingBean");
      namingBean = new NamingBeanImpl();
      namingBean.setInstallGlobalService(true);
      namingBean.setUseGlobalService(false);
      namingBean.setEventMgr(new ExecutorEventMgr());
      namingBean.start();


      Properties env = new Properties();
      env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
View Full Code Here

   {
      super.setUp();
      namingBean = new NamingBeanImpl();
      namingBean.setUseGlobalService(false);
      namingBean.setInstallGlobalService(true);
      namingBean.setEventMgr(new ExecutorEventMgr());
      namingBean.start();
   }
View Full Code Here

   protected void setUp() throws Exception
   {
      super.setUp();
      namingBean = new NamingBeanImpl();
      namingBean.setInstallGlobalService(true);
      namingBean.setEventMgr(new ExecutorEventMgr());
      namingBean.start();
   }
View Full Code Here

TOP

Related Classes of org.jnp.server.ExecutorEventMgr$Dispatcher

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.