Package org.jboss.test.cluster.invokerha

Examples of org.jboss.test.cluster.invokerha.HAServiceRemote


         "org.jnp.interfaces.NamingContextFactory");
      env.setProperty(Context.PROVIDER_URL, urls[0]);
      Context ctx = new InitialContext(env);
      getLog().debug("Got InitialContext with " + urls[0]);
     
      HAServiceRemote remote = (HAServiceRemote) ctx.lookup(jndiName);
      getLog().debug("Found " + jndiName);
      assertEquals("Hello", remote.hello());
      String nodeA = remote.getClusterNode();
      assertNotNull("Got clusterNode", nodeA);
      getLog().debug("nodeA OK");
      // Invoke again to check it works with load balancing
      assertFalse("Requests load balanced", nodeA.equals(remote.getClusterNode()));
      getLog().debug("nodeA load balanced OK");
     
      // Undeploy from one node
      reconfigureCluster();
     
      // Test for JBAS-5164
      try
      {
         ctx.lookup(jndiName);
         fail("Known issue JBAS-5164.  Proxy not removed from JNDI on undeployed node");
      }
      catch (NamingException good) {}
     
      // Check it still works
      try
      {
         assertEquals("Hello", remote.hello());
         getLog().debug("OK after reconfigure");
      }
      catch (ServiceUnavailableException sue)
      {
         fail("Known issue JBAS-3194: " + sue.getMessage());
View Full Code Here


   }

   public void testHello()
      throws Exception
   {
      HAServiceRemote remote = (HAServiceRemote) getInitialContext().lookup("jmx/HAService");
      assertEquals("Hello", remote.hello());
   }
View Full Code Here

         "org.jnp.interfaces.NamingContextFactory");
      env.setProperty(Context.PROVIDER_URL, urls[0]);
      Context ctx = new InitialContext(env);
      getLog().debug("Got InitialContext with " + urls[0]);
     
      HAServiceRemote remote = (HAServiceRemote) ctx.lookup(jndiName);
      getLog().debug("Found " + jndiName);
      assertEquals("Hello", remote.hello());
      String nodeA = remote.getClusterNode();
      assertNotNull("Got clusterNode", nodeA);
      getLog().debug("nodeA OK");
      // Invoke again to check it works with load balancing
      assertFalse("Requests load balanced", nodeA.equals(remote.getClusterNode()));
      getLog().debug("nodeA load balanced OK");
     
      // Undeploy from one node
      reconfigureCluster();
     
      // Test for JBAS-5164
      try
      {
         ctx.lookup(jndiName);
         fail("Known issue JBAS-5164.  Proxy not removed from JNDI on undeployed node");
      }
      catch (NamingException good) {}
     
      // Check it still works
      try
      {
         assertEquals("Hello", remote.hello());
         getLog().debug("OK after reconfigure");
      }
      catch (ServiceUnavailableException sue)
      {
         fail("Known issue JBAS-3194: " + sue.getMessage());
View Full Code Here

TOP

Related Classes of org.jboss.test.cluster.invokerha.HAServiceRemote

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.