1 package org.objectweb.celtix.tools.common.toolspec; 2 3 import junit.framework.TestCase; 4 import org.objectweb.celtix.tools.common.ToolException; 5 public class AbstractToolContainerTest extends TestCase { 6 private DummyToolContainer dummyTool; 7 8 public AbstractToolContainerTest(String name) { 9 super(name); 10 } 11 12 public void setUp() throws Exception { 13 String tsSource = "/org/objectweb/celtix/tools/common/toolspec/parser/resources/testtool.xml"; 14 ToolSpec toolspec = new ToolSpec(getClass().getResourceAsStream(tsSource), false); 15 dummyTool = new DummyToolContainer(toolspec); 16 } 17 18 public void testQuietMode() { 19 try { 21 dummyTool.setCommandLine(new String [] {"-q"}); 22 } catch (Exception e) { 23 } 25 assertNotNull("Fail to redirect err output:", dummyTool.getErrOutputStream()); 26 assertNotNull("Fail to redirect output:", dummyTool.getOutOutputStream()); 27 } 28 29 public void testInit() { 30 try { 31 dummyTool.init(); 32 } catch (ToolException e) { 33 assertEquals("Tool specification has to be set before initializing", e.getMessage()); 34 return; 35 } 36 assertTrue(true); 37 } 38 39 public void testToolRunner() throws Exception { 40 String tsSource = "/org/objectweb/celtix/tools/common/toolspec/parser/resources/testtool.xml"; 41 String [] args = {"-r", "wsdlurl=dfd"}; 42 ToolRunner.runTool(DummyToolContainer.class, getClass().getResourceAsStream(tsSource), false, args); 43 } 44 } 45 | Popular Tags |