2 Replies Latest reply on Mar 5, 2009 8:59 AM by wachtda.scsi.gmx.ch

    SeamTest Asynchronous

    wachtda.scsi.gmx.ch

      Hello together


      I have to test a seamCompononet which is annotated with @Asynchronous.
      Cause this component will be running in a different thread, I have to wait to test the result. Is there any solution (rather than make a sleep) to wait until this thread (which is under control of seam) is finished?


      Thanks very very much for any answer...

        • 1. Re: SeamTest Asynchronous
          hcgpragt

          I'm probably missing something here because you can always do a callback?


          interface callback {
              public abstract postResult(int result);
          }
          
          class test implements callback{
          
          Logic logic = new Logic();
          int result = -1;
          
          public void aSyncTest {
              logic.setTest(this);
              logic.callAsync();
              while (result == -1) try{Thread.sleep(20)}catch(InterruptedException e){}
              System.out.println("result :" + result);
          }
          
          public void postResult(int result) {
              this.result = result;
          }
          
          }
          



          Hugo

          • 2. Re: SeamTest Asynchronous
            wachtda.scsi.gmx.ch

            You can call me stupid, but I really don't understand your answer solution...