2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
23 import org
.testng
.remote
.RemoteTestNG
;
25 import java
.io
.BufferedReader
;
27 import java
.io
.FileReader
;
29 import java
.util
.Vector
;
31 public class RemoteTestNGStarter
{
32 public static void main(String
[] args
) throws Exception
{
34 Vector resultArgs
= new Vector();
35 for (; i
< args
.length
; i
++) {
37 if (arg
.equals("-temp")) {
43 File temp
= new File(args
[++i
]);
45 while (temp
.length() == 0){
46 //wait for test classes
49 BufferedReader reader
= new BufferedReader(new FileReader(temp
));
52 final String cantRunMessage
= "CantRunException";
54 String line
= reader
.readLine();
55 while (line
== null) {
57 line
= reader
.readLine();
60 if (line
.startsWith(cantRunMessage
) && !new File(line
).exists()){
61 System
.err
.println(line
.substring(cantRunMessage
.length()));
65 if (line
.equals("end")) break;
74 Map commandLineArgs
= TestNGCommandLineArgs
.parseCommandLine((String
[])resultArgs
.toArray(new String
[resultArgs
.size()]));
76 RemoteTestNG testNG
= new RemoteTestNG();
77 testNG
.configure(commandLineArgs
);
78 testNG
.initializeSuitesAndJarFile();