Package org.superbiz.load

Examples of org.superbiz.load.Load


    public void testEJBMulticast()
    {
        //Remote lookup
            Properties p = new Properties();
            p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
            Load loadRemote = null;          
           
            //Multicast
            p.setProperty(Context.PROVIDER_URL,"multicast://239.255.3.2:6142?group=cluster1");
            Context context1;
            try {
                context1 = new InitialContext(p);
                loadRemote =(Load) context1.lookup("LoadBeanRemote");
                Assert.assertEquals(p.getProperty(Context.PROVIDER_URL),"multicast://239.255.3.2:6142?group=cluster1");
                Assert.assertNotNull(loadRemote.getNodeName());
                Assert.assertEquals(loadRemote.add(1, 2), 3);         
                Assert.assertEquals(loadRemote.sum(1,2,1), 4);
            } catch (NamingException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();            }
           
           
            p.setProperty(Context.PROVIDER_URL,"failover:ejbd://127.0.0.1:4202,ejbd://127.0.0.1:4211,multicast://239.255.3.2:6142");
           
            try {
                Context context3 = new InitialContext(p);
                loadRemote =(Load) context3.lookup("LoadBeanRemote");
                Assert.assertEquals(p.getProperty(Context.PROVIDER_URL),"failover:ejbd://127.0.0.1:4202,ejbd://127.0.0.1:4211,multicast://239.255.3.2:6142");
                Assert.assertNotNull(loadRemote.getNodeName());               
                Assert.assertEquals(loadRemote.add(1, 2), 3);         
                Assert.assertEquals(loadRemote.sum(1,2,1), 4);
            } catch (NamingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
           
View Full Code Here


    public void testEJBSinglepoint()
    {
        //Remote lookup
            Properties p = new Properties();
            p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
            Load loadRemote = null;            
            p.setProperty(Context.PROVIDER_URL,"failover:ejbd://127.0.0.1:4202,ejbd://127.0.0.1:4211");           
            try {
                Context context3 = new InitialContext(p);
                loadRemote =(Load) context3.lookup("LoadBeanRemote");
                Assert.assertEquals(p.getProperty(Context.PROVIDER_URL),"failover:ejbd://127.0.0.1:4202,ejbd://127.0.0.1:4211");
                Assert.assertNotNull(loadRemote.getNodeName());               
                Assert.assertEquals(loadRemote.add(1, 2), 3);
                Assert.assertEquals(loadRemote.sum(1,2,1), 4);
            } catch (NamingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
           
View Full Code Here

    public void testEJBMultipoint()
    {
        //Remote lookup
            Properties p = new Properties();
            p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
            Load loadRemote = null;            
            p.setProperty(Context.PROVIDER_URL,"ejbd://127.0.0.1:4202");           
            try {
                Context context3 = new InitialContext(p);
                loadRemote =(Load) context3.lookup("LoadBeanRemote");
                Assert.assertEquals(p.getProperty(Context.PROVIDER_URL),"ejbd://127.0.0.1:4202");
                Assert.assertNotNull(loadRemote.getNodeName());               
                Assert.assertEquals(loadRemote.add(1, 2), 3);
                Assert.assertEquals(loadRemote.sum(1,2,1), 4);
            } catch (NamingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
           
View Full Code Here

TOP

Related Classes of org.superbiz.load.Load

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.