01: package org.objectweb.celtix.tools;
02:
03: import java.io.*;
04: import java.net.URL;
05:
06: import org.objectweb.celtix.tools.common.ToolTestBase;
07:
08: public class WSDLToJavaTest extends ToolTestBase {
09:
10: private File output;
11:
12: public void setUp() {
13: super .setUp();
14: try {
15: URL 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 e) {
23: // complete
24: }
25: }
26:
27: public void tearDown() {
28: output.deleteOnExit();
29: output = null;
30: }
31:
32: public void testVersionOutput() throws Exception {
33: String[] args = new String[] { "-v" };
34: WSDLToJava.main(args);
35: assertNotNull(getStdOut());
36: }
37:
38: public void testHelpOutput() {
39: String[] args = new String[] { "-help" };
40: WSDLToJava.main(args);
41: assertNotNull(getStdOut());
42: }
43:
44: public void testBadUsage() {
45: String[] args = new String[] { "-bad" };
46: WSDLToJava.main(args);
47: assertNotNull(getStdOut());
48: }
49:
50: public void testWSDLToJava() throws Exception {
51: String[] args = new String[] { "-ant", "-V", "-d",
52: output.getCanonicalPath(), wsdlLocation.getFile() };
53: WSDLToJava.main(args);
54: assertNotNull(getStdOut());
55: }
56: }
|