Examples of Echo


Examples of org.jboss.as.test.integration.osgi.xservice.api.Echo

            try {
                Bundle bundle = getTargetBundle();
                bundle.start();
                BundleContext context = bundle.getBundleContext();
                ServiceReference sref = context.getServiceReference(Echo.class.getName());
                Echo service = (Echo) context.getService(sref);
                return service.echo(message);
            } catch (BundleException ex) {
                throw new IllegalStateException("Cannot invoke target service", ex);
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.test.integration.osgi.xservice.api.Echo

    @Test
    public void testTargetBundle() throws Exception {
        bundle.start();
        BundleContext context = bundle.getBundleContext();
        ServiceReference sref = context.getServiceReference(Echo.class.getName());
        Echo service = (Echo) context.getService(sref);
        assertEquals("foo", service.echo("foo"));
    }
View Full Code Here

Examples of org.jboss.as.test.integration.osgi.xservice.api.Echo

    @Test
    public void testStatelessBean() throws Exception {
        deployer.deploy(EJB3_DEPLOYMENT_NAME);
        try {
            String jndiname = "java:global/ejb3-osgi/SimpleStatelessSessionBean!org.jboss.as.test.integration.osgi.ejb3.SimpleStatelessSessionBean";
            Echo service = (Echo) new InitialContext().lookup(jndiname);
            assertNotNull("StatelessBean not null", service);
            assertEquals("ejb3-osgi-target", service.echo(BUNDLE_SYMBOLICNAME));
            assertEquals("foo", service.echo("foo"));
        } finally {
            deployer.undeploy(EJB3_DEPLOYMENT_NAME);
        }
    }
View Full Code Here

Examples of org.jboss.as.test.integration.osgi.xservice.api.Echo

      @Override
      public void start(StartContext context) throws StartException
      {
         BundleContext systemContext = injectedBundleContext.getValue();
         ServiceReference sref = systemContext.getServiceReference(Echo.class.getName());
         Echo service = (Echo)systemContext.getService(sref);
         service.echo("hello world");
      }
View Full Code Here

Examples of org.jboss.as.test.integration.osgi.xservice.api.Echo

      }

      @Override
      public void start(StartContext context) throws StartException
      {
         Echo service = injectedService.getValue();
         service.echo("hello world");
      }
View Full Code Here

Examples of org.jboss.test.ejb3.jboss51xsd.Echo

      // Yes, it's a weird method name for testing that the deployment
      // did not throw errors during deployment :)
      serverFound();
     
      // Now just do a simple test of the EJBs - lookup and invoke a method
      Echo bean = (Echo) this.getInitialContext().lookup("JBAS-7231-BeanJNDINameFromJBossXml");
      String msg = "JBAS-7231 is now fixed!!";
      String returnedMessage = bean.echo(msg);
     
      assertEquals("Bean returned unexpected value", msg, returnedMessage);
     
   }
View Full Code Here

Examples of org.jboss.test.managed.bean.Echo

    * @throws Exception
    */
   public void testManagedBeanInvocation() throws Exception
   {
      // get hold of the bean which internally invokes on the managed bean
      Echo bean = (Echo) this.getInitialContext().lookup(DelegateSLSB.JNDI_NAME);
      String message = "No new message!";
      String echoedMessage = bean.echo(message);
      Assert.assertEquals("Unexpected message returned", message, echoedMessage);
   }
View Full Code Here

Examples of org.jboss.tutorial.asynch.bean.Echo

public class Client
{
   public static void main(String[] args) throws Exception
   {
      InitialContext ctx = new InitialContext();
      Echo echo = (Echo) ctx.lookup("EchoBean/remote");
      System.out.println("-------- Synchronous call");
      String ret = echo.echo("normal call");
      System.out.println(ret);

      // Create the asynchronous proxy
      Echo asynchEcho = AsyncUtils.mixinAsync(echo);
      System.out.println("-------- Asynchronous call");
      ret = asynchEcho.echo("asynchronous call");
      System.out.println("Direct return of async invocation is: " + ret);

      System.out.println("-------- Synchronous call");
      ret = echo.echo("normal call 2");
      System.out.println(ret);
View Full Code Here

Examples of org.knowhowlab.osgi.testing.it.commons.testbundle.service.Echo

                "(&(" + Constants.OBJECTCLASS + "=org.knowhowlab.osgi.testing.it.commons.testbundle.service.Echo)" +
                        "(testkey=testvalue))"), null);
        serviceTracker2.open();
        Assert.assertTrue(serviceTracker2.size() > 0);
        // gets service by class and filter
        Echo echo = (Echo) serviceTracker2.getService();
        // asserts service method call
        Assert.assertEquals("test", echo.echo("test"));
        // stops bundle
        bundle.stop();
        // asserts that test bundle is resolved
        Assert.assertEquals(Bundle.RESOLVED, bundle.getState());
        // asserts that test service is unregistered
View Full Code Here

Examples of org.knowhowlab.osgi.testing.it.commons.testbundle.service.Echo

        // asserts that test service is available within 2 seconds
        assertServiceAvailable("org.knowhowlab.osgi.testing.it.commons.testbundle.service.Echo", 2, TimeUnit.SECONDS);
        // asserts that test service with custom properties is available
        assertServiceAvailable(and(create(Echo.class), eq("testkey", "testvalue")));
        // gets service by class and filter
        Echo echo = ServiceUtils.getService(bc, Echo.class, eq("testkey", "testvalue"));
        // asserts service method call
        Assert.assertEquals("test", echo.echo("test"));
        // stops bundle
        bundle.stop();
        // asserts that test bundle is resolved
        assertBundleState(Bundle.RESOLVED, "org.knowhowlab.osgi.testing.it.commons.test.bundle");
        // asserts that test service is unregistered
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.