This project has retired. For details please refer to its
Attic page.
App xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.apache.juddi.tckrunner;
16
17 import java.io.BufferedWriter;
18 import java.io.File;
19 import java.io.FileWriter;
20 import java.text.SimpleDateFormat;
21 import java.util.Date;
22 import org.junit.runner.JUnitCore;
23 import org.junit.runner.Result;
24
25
26
27
28
29
30
31
32
33 public class App {
34
35 public static void main(String[] args) throws Exception {
36 System.out.println("_________________________________________________");
37 System.out.println("Configure options using uddi.xml and tck.properties");
38 System.out.println("java -Duddi.client.xml=uddi.xml -jar juddi-tck-runner-{VERSION}-SNAPSHOT-jar-with-dependencies.jar");
39 System.out.println("_________________________________________________");
40 System.out.println();
41 System.out.println("Options");
42 System.out.println("-Dtests=TestClass1,TestClass2 Comma delimited set of focused tests to run");
43 System.out.println("_________________________________________________");
44 System.out.println("Running! this can take anywhere from 2-5 minutes!");
45 System.out.println("");
46 if (!new File("tck.properties").exists()) {
47 System.out.println("tck.properties was not found! I give up!");
48 System.exit(1);
49 }
50 String s = System.getProperty("uddi.client.xml");
51 if (s == null || !new File(s).exists()) {
52 System.out.println("The value for option -Duddi.client.xml=" + s + " is either null or the file doesn't exist! I give up!");
53 System.exit(1);
54 }
55 String focusedTests = System.getProperty("tests");
56 Result result = null;
57 JUnitCore junit = new JUnitCore();
58 Class[] cs = null;
59 if (focusedTests != null) {
60 String[] items = focusedTests.split(",");
61 cs = new Class[items.length];
62 for (int i = 0; i < items.length; i++) {
63 cs[i] = Class.forName(items[i]);
64 }
65 } else {
66 cs = new Class[]{
67
68 org.apache.juddi.v2.tck.UDDI_020_TmodelIntegrationTest.class,
69 org.apache.juddi.v2.tck.UDDI_030_BusinessEntityIntegrationTest.class,
70 org.apache.juddi.v2.tck.UDDI_040_BusinessServiceIntegrationTest.class,
71 org.apache.juddi.v2.tck.UDDI_050_BindingTemplateIntegrationTest.class,
72 org.apache.juddi.v2.tck.UDDI_060_PublisherAssertionIntegrationTest.class,
73 org.apache.juddi.v2.tck.UDDI_070_FindEntityIntegrationTest.class,
74 org.apache.juddi.v3.bpel.BPEL_010_IntegrationTest.class,
75 org.apache.juddi.v3.bpel.BPEL_020_IntegrationTest.class,
76 org.apache.juddi.v3.tck.JUDDI_010_PublisherIntegrationTest.class,
77 org.apache.juddi.v3.tck.JUDDI_100_ClientSubscriptionInfoIntegrationTest.class,
78 org.apache.juddi.v3.tck.JUDDI_300_MultiNodeIntegrationTest.class,
79 org.apache.juddi.v3.tck.UDDI_010_PublisherIntegrationTest.class,
80 org.apache.juddi.v3.tck.UDDI_020_TmodelIntegrationTest.class,
81 org.apache.juddi.v3.tck.UDDI_030_BusinessEntityIntegrationTest.class,
82 org.apache.juddi.v3.tck.UDDI_030_BusinessEntityLoadIntegrationTest.class,
83 org.apache.juddi.v3.tck.UDDI_040_BusinessServiceIntegrationTest.class,
84 org.apache.juddi.v3.tck.UDDI_040_PerformanceIntegrationTest.class,
85 org.apache.juddi.v3.tck.UDDI_040_BusinessServiceLoadIntegrationTest.class,
86 org.apache.juddi.v3.tck.UDDI_050_BindingTemplateIntegrationTest.class,
87 org.apache.juddi.v3.tck.UDDI_060_PublisherAssertionIntegrationTest.class,
88 org.apache.juddi.v3.tck.UDDI_070_FindEntityIntegrationTest.class,
89 org.apache.juddi.v3.tck.UDDI_080_SubscriptionIntegrationTest.class,
90
91
92
93 org.apache.juddi.v3.tck.UDDI_090_HttpExternalTest.class,
94 org.apache.juddi.v3.tck.UDDI_090_Smtp_ExternalTest.class,
95 org.apache.juddi.v3.tck.UDDI_090_RMIIntegrationTest.class,
96
97
98 org.apache.juddi.v3.tck.UDDI_110_FindBusinessIntegrationTest.class,
99 org.apache.juddi.v3.tck.UDDI_120_CombineCategoryBagsFindServiceIntegrationTest.class,
100 org.apache.juddi.v3.tck.UDDI_130_CombineCategoryBagsFindBusinessIntegrationTest.class,
101 org.apache.juddi.v3.tck.UDDI_140_NegativePublicationIntegrationTest.class,
102 org.apache.juddi.v3.tck.UDDI_141_JIRAIntegrationTest.class,
103 org.apache.juddi.v3.tck.UDDI_142_DigitalSignatureIntegrationTest.class,
104 org.apache.juddi.v3.tck.UDDI_150_CustodyTransferIntegrationTest.class,
105 org.apache.juddi.v3.tck.UDDI_160_RESTIntergrationTest.class,
106 org.apache.juddi.v3.tck.UDDI_170_ValueSetValidationIntegrationTest.class
107 };
108 }
109
110 result = junit.run(cs);
111
112 String filename = "uddi-tck-results-" + new SimpleDateFormat("yyyyMMddhhmm").format(new Date()) + ".txt";
113 FileWriter fw = new FileWriter(filename);
114
115 BufferedWriter bw = new BufferedWriter(fw);
116 bw.write("UDDI-TCK Test Results generated " + new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()));
117 bw.newLine();
118 bw.write("____________________________________________");
119 bw.newLine();
120 bw.write("Summary");
121 bw.newLine();
122 bw.write("Failed Test Cases: " + result.getFailureCount());
123 bw.newLine();
124 bw.write("Skipped Test Cases: " + result.getIgnoreCount());
125 bw.newLine();
126 bw.write("Ran Test Cases: " + result.getRunCount());
127 bw.newLine();
128 bw.write("Time: " + result.getRunTime());
129 bw.newLine();
130 bw.write("____________________________________________");
131
132 bw.newLine();
133 bw.write("Tests Ran");
134 bw.newLine();
135 for (int i = 0; i < cs.length; i++) {
136 bw.write(cs[i].getCanonicalName());
137 bw.newLine();
138 }
139 bw.write("____________________________________________");
140 bw.newLine();
141 bw.write("Failed Test cases");
142 bw.newLine();
143 bw.write("____________________________________________");
144 bw.newLine();
145 for (int i = 0; i < result.getFailures().size(); i++) {
146 try {
147 try {
148 bw.write(result.getFailures().get(i).getTestHeader());
149 } catch (Exception ex) {
150 bw.write(ex.getMessage());
151 }
152 bw.newLine();
153 try {
154 bw.write(result.getFailures().get(i).getDescription().getClassName());
155 }
156 catch (Exception ex) {
157 bw.write(ex.getMessage());
158 }
159 bw.newLine();
160 try {
161 bw.write(result.getFailures().get(i).getDescription().getMethodName() == null ? "null method!" : result.getFailures().get(i).getDescription().getMethodName());
162 } catch (Exception ex) {
163 bw.write(ex.getMessage());
164 }
165 bw.newLine();
166 try {
167 bw.write(result.getFailures().get(i).getMessage() == null ? "no message" : result.getFailures().get(i).getMessage());
168 } catch (Exception ex) {
169 bw.write(ex.getMessage());
170 }
171 bw.newLine();
172
173 try {
174 bw.write(result.getFailures().get(i).getTrace());
175 } catch (Exception ex) {
176 bw.write(ex.getMessage());
177 }
178 bw.newLine();
179 bw.write("____________________________________________");
180 bw.newLine();
181 } catch (Exception ex) {
182 ex.printStackTrace();
183 }
184 }
185 System.out.println("____________________________________________");
186 System.out.println("Summary");
187 System.out.println("Failed Test Cases: " + result.getFailureCount());
188 System.out.println("Skipped Test Cases: " + result.getIgnoreCount());
189 System.out.println("Ran Test Cases: " + result.getRunCount());
190 System.out.println("Time: " + result.getRunTime() + "ms which is " +
191 org.apache.commons.lang.time.DurationFormatUtils.formatDurationHMS(result.getRunTime()));
192 System.out.println("-------------------------------------");
193 System.out.println("Results written to " + filename);
194
195 bw.close();
196 fw.close();
197 junit = null;
198 System.out.println("Exit code: " + result.getFailureCount());
199 System.exit(result.getFailureCount());
200 }
201 }