You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andrea Smyth (JIRA)" <ji...@apache.org> on 2006/11/28 09:11:21 UTC

[jira] Created: (CXF-270) Asynchronous invocations not working

Asynchronous invocations not working
------------------------------------

                 Key: CXF-270
                 URL: http://issues.apache.org/jira/browse/CXF-270
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime
            Reporter: Andrea Smyth


With an implementor that sleeps 3 seconds in String greetMe(String name) I was expecting the following system test to pass:

public void testAsync() {
       GreeterService service = new GreeterService();
       Greeter greeter = service.getGreeterPort();
             long before = System.currentTimeMillis();
             Response<GreetMeResponse> r1 = greeter.greetMeAsync("one");
       Response<GreetMeResponse> r2 = greeter.greetMeAsync("two");
             long after = System.currentTimeMillis();
             assertTrue("Duration of calls exceeded 6000 ms", after - before < 6000);
             // first time round, responses should not be available yet
       assertFalse("Response already available.", r1.isDone());
       assertFalse("Response already available.", r2.isDone());
             // after three seconds responses should be available
       long waited = 0;
       while (waited < 5000) {
           try {
               Thread.sleep(500);
           } catch (InterruptedException ex) {
              // ignore
           }
           if (r1.isDone() && r2.isDone()) {
               break;
           }
           waited += 500;
       }
       assertTrue("Response is  not available.", r1.isDone());
       assertTrue("Response is  not available.", r2.isDone());
   }

However the test fails as the second invocation is apparently only made after the first one has returned a response, i.e. it fails with
junit.framework.AssertionFailedError: Duration of calls exceeded 6000 ms.
There are system tests in place, but these seem to not verify that at some point after the initial (async) invocation, the response is NOT yet available - they only test that it will eventually become available. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (CXF-270) Asynchronous invocations not working

Posted by "Bozhong Lin (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/CXF-270?page=all ]

Bozhong Lin closed CXF-270.
---------------------------

    Resolution: Fixed

> Asynchronous invocations not working
> ------------------------------------
>
>                 Key: CXF-270
>                 URL: http://issues.apache.org/jira/browse/CXF-270
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>            Reporter: Andrea Smyth
>         Assigned To: Freeman Fang
>
> With an implementor that sleeps 3 seconds in String greetMe(String name) I was expecting the following system test to pass:
> public void testAsync() {
>        GreeterService service = new GreeterService();
>        Greeter greeter = service.getGreeterPort();
>              long before = System.currentTimeMillis();
>              Response<GreetMeResponse> r1 = greeter.greetMeAsync("one");
>        Response<GreetMeResponse> r2 = greeter.greetMeAsync("two");
>              long after = System.currentTimeMillis();
>              assertTrue("Duration of calls exceeded 6000 ms", after - before < 6000);
>              // first time round, responses should not be available yet
>        assertFalse("Response already available.", r1.isDone());
>        assertFalse("Response already available.", r2.isDone());
>              // after three seconds responses should be available
>        long waited = 0;
>        while (waited < 5000) {
>            try {
>                Thread.sleep(500);
>            } catch (InterruptedException ex) {
>               // ignore
>            }
>            if (r1.isDone() && r2.isDone()) {
>                break;
>            }
>            waited += 500;
>        }
>        assertTrue("Response is  not available.", r1.isDone());
>        assertTrue("Response is  not available.", r2.isDone());
>    }
> However the test fails as the second invocation is apparently only made after the first one has returned a response, i.e. it fails with
> junit.framework.AssertionFailedError: Duration of calls exceeded 6000 ms.
> There are system tests in place, but these seem to not verify that at some point after the initial (async) invocation, the response is NOT yet available - they only test that it will eventually become available. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (CXF-270) Asynchronous invocations not working

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/CXF-270?page=all ]

Freeman Fang reassigned CXF-270:
--------------------------------

    Assignee: Freeman Fang

> Asynchronous invocations not working
> ------------------------------------
>
>                 Key: CXF-270
>                 URL: http://issues.apache.org/jira/browse/CXF-270
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>            Reporter: Andrea Smyth
>         Assigned To: Freeman Fang
>
> With an implementor that sleeps 3 seconds in String greetMe(String name) I was expecting the following system test to pass:
> public void testAsync() {
>        GreeterService service = new GreeterService();
>        Greeter greeter = service.getGreeterPort();
>              long before = System.currentTimeMillis();
>              Response<GreetMeResponse> r1 = greeter.greetMeAsync("one");
>        Response<GreetMeResponse> r2 = greeter.greetMeAsync("two");
>              long after = System.currentTimeMillis();
>              assertTrue("Duration of calls exceeded 6000 ms", after - before < 6000);
>              // first time round, responses should not be available yet
>        assertFalse("Response already available.", r1.isDone());
>        assertFalse("Response already available.", r2.isDone());
>              // after three seconds responses should be available
>        long waited = 0;
>        while (waited < 5000) {
>            try {
>                Thread.sleep(500);
>            } catch (InterruptedException ex) {
>               // ignore
>            }
>            if (r1.isDone() && r2.isDone()) {
>                break;
>            }
>            waited += 500;
>        }
>        assertTrue("Response is  not available.", r1.isDone());
>        assertTrue("Response is  not available.", r2.isDone());
>    }
> However the test fails as the second invocation is apparently only made after the first one has returned a response, i.e. it fails with
> junit.framework.AssertionFailedError: Duration of calls exceeded 6000 ms.
> There are system tests in place, but these seem to not verify that at some point after the initial (async) invocation, the response is NOT yet available - they only test that it will eventually become available. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira