A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / reporthandling / ConnectionListener.java
1 /*************************************************************************
2  * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
3  *
4  * Plugin for PHP unit Testing.
5  * www.phpeclipse.de
6  * 
7  *************************************************************************/
8
9 package net.sourceforge.phpeclipse.phpunit.reporthandling;
10
11 import java.net.ServerSocket;
12 import java.net.Socket;
13
14 import net.sourceforge.phpeclipse.phpunit.PHPUnitView;
15
16 public class ConnectionListener extends Thread {
17
18         private ServerSocket sSocket = null;
19
20         private Socket serviceSocket = null;
21
22         private PHPUnitView view;
23
24         public void start(PHPUnitView view) {
25
26                 this.view = view;
27                 super.start();
28         }
29
30         public void run() {
31
32                 try {
33
34                         // reportArea.append("listening at port 12345");
35
36                         sSocket = new ServerSocket(12345);
37
38                         // accept connection from test reporter.
39                         serviceSocket = sSocket.accept();
40
41                         (new ReportListener(serviceSocket, this.view)).start();
42
43                         sSocket.close();
44
45                 } catch (Exception e) {
46
47                         e.printStackTrace();
48
49                 }
50
51         } // end of run()
52
53         public static void main(String[] args) {
54
55                 (new ConnectionListener()).start(new PHPUnitView());
56         }
57
58 }