ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote Messenger.java Server.java
Date Fri, 01 Feb 2002 22:18:38 GMT
sbailliez    02/02/01 14:18:38

  Modified:    proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit
                        RJUnitTask.java ServerElement.java
               proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote
                        Messenger.java Server.java
  Log:
  Socket error occurs when running multiple times...there must be something
  wrong with the shutdown
  
  Revision  Changes    Path
  1.2       +1 -0      jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/RJUnitTask.java
  
  Index: RJUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/RJUnitTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RJUnitTask.java	27 Jan 2002 11:39:52 -0000	1.1
  +++ RJUnitTask.java	1 Feb 2002 22:18:38 -0000	1.2
  @@ -158,6 +158,7 @@
           public void run() {
               try {
                   server.execute();
  +                System.out.println("PANIC !!!!!!");
               } catch (Exception e) {
                   caught = e;
               }
  
  
  
  1.4       +9 -2      jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/ServerElement.java
  
  Index: ServerElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/ServerElement.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServerElement.java	27 Jan 2002 14:06:39 -0000	1.3
  +++ ServerElement.java	1 Feb 2002 22:18:38 -0000	1.4
  @@ -90,6 +90,8 @@
       /** the parent task */
       private RJUnitTask parent;
   
  +    private Server server;
  +
       /** create a new server */
       public ServerElement(RJUnitTask value) {
           parent = value;
  @@ -98,7 +100,7 @@
       /** start the server and block until client has finished */
       public void execute() throws BuildException {
           // configure the server...
  -        Server server = new Server(port);
  +        server = new Server(port);
           Enumeration listeners = formatterElements.elements();
           while (listeners.hasMoreElements()) {
               FormatterElement fe = (FormatterElement)listeners.nextElement();
  @@ -106,7 +108,12 @@
               server.addListener( formatter );
           }
           // and run it. It will stop once a client has finished.
  -        server.start();
  +        try {
  +            server.start(true);
  +            server.shutdown();
  +        } catch (InterruptedException e){
  +            throw new BuildException(e);
  +        }
       }
   
       /** set the port to listen to */
  
  
  
  1.3       +4 -4      jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote/Messenger.java
  
  Index: Messenger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote/Messenger.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Messenger.java	1 Feb 2002 19:55:48 -0000	1.2
  +++ Messenger.java	1 Feb 2002 22:18:38 -0000	1.3
  @@ -79,14 +79,14 @@
       }
   
       public void close() throws IOException {
  -        if (in != null) {
  -            in.close();
  -            in = null;
  -        }
           if (out != null) {
               out.flush();
               out.close();
               out = null;
  +        }
  +        if (in != null) {
  +            in.close();
  +            in = null;
           }
       }
   
  
  
  
  1.9       +11 -0     jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote/Server.java
  
  Index: Server.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/junit/src/main/org/apache/tools/ant/taskdefs/optional/junit/remote/Server.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Server.java	1 Feb 2002 21:39:13 -0000	1.8
  +++ Server.java	1 Feb 2002 22:18:38 -0000	1.9
  @@ -117,8 +117,19 @@
   
       /** start a server to the specified port */
       public void start() {
  +        try {
  +            start(false);
  +        } catch (InterruptedException e){
  +        }
  +    }
  +
  +    /** start a server to the specified port and wait for end */
  +    public void start(boolean flag) throws InterruptedException {
           Worker worker = new Worker();
           worker.start();
  +        if (flag){
  +            worker.join();
  +        }
       }
   
       /** cancel the connection to the client */
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message