KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > tools > WSDLToJavaTest


1 package org.objectweb.celtix.tools;
2
3 import java.io.*;
4 import java.net.URL JavaDoc;
5
6 import org.objectweb.celtix.tools.common.ToolTestBase;
7
8 public class WSDLToJavaTest extends ToolTestBase {
9
10     private File output;
11     
12     public void setUp() {
13         super.setUp();
14         try {
15             URL JavaDoc url = WSDLToJavaTest.class.getResource(".");
16             output = new File(url.getFile());
17             output = new File(output, "/resources");
18             
19             if (!output.exists()) {
20                 output.mkdir();
21             }
22         } catch (Exception JavaDoc e) {
23             // complete
24
}
25     }
26
27     public void tearDown() {
28         output.deleteOnExit();
29         output = null;
30     }
31
32     public void testVersionOutput() throws Exception JavaDoc {
33         String JavaDoc[] args = new String JavaDoc[]{"-v"};
34         WSDLToJava.main(args);
35         assertNotNull(getStdOut());
36     }
37
38     public void testHelpOutput() {
39         String JavaDoc[] args = new String JavaDoc[]{"-help"};
40         WSDLToJava.main(args);
41         assertNotNull(getStdOut());
42     }
43
44     public void testBadUsage() {
45         String JavaDoc[] args = new String JavaDoc[]{"-bad"};
46         WSDLToJava.main(args);
47         assertNotNull(getStdOut());
48     }
49
50     public void testWSDLToJava() throws Exception JavaDoc {
51         String JavaDoc[] args = new String JavaDoc[]{"-ant", "-V", "-d", output.getCanonicalPath(), wsdlLocation.getFile()};
52         WSDLToJava.main(args);
53         assertNotNull(getStdOut());
54     }
55 }
56
Popular Tags