Examples of TestEndpoint


Examples of com.sun.jini.test.spec.jeri.connection.util.TestEndpoint

        TestServerEndpoint tse = new TestServerEndpoint(getListenPort());
        BasicJeriExporter exporter =
            new BasicJeriExporter(tse, new BasicILFactory());
        TestServiceImpl service = new TestServiceImpl();
        TestService stub = (TestService) exporter.export(service);
        TestEndpoint te = tse.getTestEndpoint();
        //make a call
        stub.doSomething();
        //Verify that the 3-arg connect method is called
        if (methodCalls.get(connect2)==null) {
            throw new TestException("The ConnectionManager"
                + " did not call 3-arg connect on the ConnectionEndpoint");
        }
        //Verify that the 1-arg connect method is called
        if (methodCalls.get(connect1)==null) {
            throw new TestException("The ConnectionManager"
                + " did not call 1-arg connect on the ConnectionEndpoint");
        }
        //Verify that writeRequestData is called
        if (methodCalls.get(writeRequestData)==null) {
            throw new TestException("The ConnectionManager"
                + " did not call writeRequestData on the Connection");
        }
        //Verify that readResponseData is called
        if (methodCalls.get(readResponseData)==null) {
            throw new TestException("The ConnectionManager"
                + " did not call readResponseData on the Connection");
        }
        //Verify that populateContext is called
        if (methodCalls.get(populateContext)==null) {
            throw new TestException("The ConnectionManager"
                + " did not call populateContext on the Connection");
        }
        //Verify that getUnfulfilledConstraints is called
        if (methodCalls.get(getUnfulfilledConstraints)==null) {
            throw new TestException("The ConnectionManager"
                + " did not call getUnfulfilledConstraints on the"
                + " Connection");
        }
        //Verify that the single-arg connect is not called if the 3-arg
        //connect is called
        clearMethodCalls();
        stub.doSomething();
        //Verify that the 3-arg connect method is called
        if (methodCalls.get(connect2)==null) {
            throw new TestException("The ConnectionManager"
                + " did not call 3-arg connect on the ConnectionEndpoint");
        }
        //Verify that the single-arg connect method is not called
        if (methodCalls.get(connect1)!=null) {
            throw new TestException("The ConnectionManager called"
                + " 1-arg connect even though a connection was returned on"
                + " call to 3-arg connect");
        }
        //Check exceptions
        clearMethodCalls();
        te.setException("connect");
        boolean exceptionThrown = false;
        try {
           stub.doSomething();
        } catch (Exception e) {
            if (e.getMessage().equals("Bogus Exception")) {
                exceptionThrown = true;
            } else {
                e.printStackTrace();
            }
        }
        if (!exceptionThrown) {
            throw new TestException("The ConnectionManager"
                + " does not propagate an exception thrown in"
                + " ConnectionEndpoint.connect");
        }
        clearMethodCalls();
        te.setException("writeRequestData");
        exceptionThrown = false;
        try {
           stub.doSomething();
        } catch (Exception e) {
            if (e.getMessage().equals("Bogus Exception")) {
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.webserviceref.TestEndpoint

    * Customize service-class-name, service-qname
    */
   public String testService1(String reqStr) throws Exception
   {
      TestEndpointService service = (TestEndpointService)iniCtx.lookup("java:comp/env/Service1");
      TestEndpoint port = service.getTestEndpointPort();
      return port.echo(reqStr);
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.webserviceref.TestEndpoint

    */
   public String testService2(String reqStr) throws Exception
   {
      Service service = (Service)iniCtx.lookup("java:comp/env/Service2");

      TestEndpoint port = service.getPort(TestEndpoint.class);
      //verifyConfig((ConfigProvider)port);
     
      return port.echo(reqStr);
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.webserviceref.TestEndpoint

   /**
    * Customize service-class-name, service-qname
    */
   public String testService3(String reqStr) throws Exception
   {
      TestEndpoint port = ((TestEndpointService)service3).getTestEndpointPort();
      String resStr1 = port.echo(reqStr);
     
      TestEndpointService service = (TestEndpointService)iniCtx.lookup("java:comp/env/Service3");
      port = service.getTestEndpointPort();
     
      String resStr2 = port.echo(reqStr);
     
      return resStr1 + resStr2;
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.webserviceref.TestEndpoint

   /**
    * Customize config-name, config-file
    */
   public String testService4(String reqStr) throws Exception
   {
      TestEndpoint port = service4.getTestEndpointPort();
      String resStr1 = port.echo(reqStr);
      //verifyConfig((ConfigProvider)port);
     
      TestEndpointService service = (TestEndpointService)iniCtx.lookup("java:comp/env/Service4");
      port = service.getTestEndpointPort();
      //verifyConfig((ConfigProvider)port);
     
      String resStr2 = port.echo(reqStr);
     
      return resStr1 + resStr2;
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.webserviceref.TestEndpoint

   /**
    * Customize port-info: port-qname, config-name, config-file
    */
   public String testPort1(String reqStr) throws Exception
   {
      TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port1");
      //verifyConfig((ConfigProvider)port);
     
      return port.echo(reqStr);
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.webserviceref.TestEndpoint

   public String testPort2(String reqStr) throws Exception
   {
      //verifyConfig((ConfigProvider)port2);
      String resStr1 = port2.echo(reqStr);

      TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port2");
      //verifyConfig((ConfigProvider)port);
     
      String resStr2 = port.echo(reqStr);
     
      return resStr1 + resStr2;
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.webserviceref.TestEndpoint

      String resStr1 = port3.echo(reqStr);
     
      BindingProvider bp = (BindingProvider)port3;
      verifyProperties(bp.getRequestContext());

      TestEndpoint port = (TestEndpoint)iniCtx.lookup("java:comp/env/Port3");
      String resStr2 = port.echo(reqStr);
     
      return resStr1 + resStr2;
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.webserviceref.TestEndpoint

    * Customize service-class-name, service-qname
    */
   public String testService1(String reqStr) throws Exception
   {
      TestEndpointService service = (TestEndpointService)org.jboss.test.ws.jaxws.webserviceref.TestEndpointClientTwo.iniCtx.lookup("java:comp/env/Service1");
      TestEndpoint port = service.getTestEndpointPort();
      return port.echo(reqStr);
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.webserviceref.TestEndpoint

    */
   public String testService2(String reqStr) throws Exception
   {
      Service service = (Service)org.jboss.test.ws.jaxws.webserviceref.TestEndpointClientTwo.iniCtx.lookup("java:comp/env/Service2");

      TestEndpoint port = service.getPort(TestEndpoint.class);
      //verifyConfig((ConfigProvider)port);

      return port.echo(reqStr);
   }
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.