1 23 package com.sun.enterprise.cli.commands; 24 25 31 import com.sun.enterprise.cli.framework.*; 32 import junit.framework.*; 38 import junit.textui.TestRunner; 39 import java.util.Vector ; 40 41 42 43 48 49 54 55 public class StartAppservCommandTest extends TestCase { 56 57 public void testrunCommandNoDomains() throws Exception { 58 try{ 59 testCommand.setOption("domaindir", System.getProperty("java.io.tmpdir")); 60 testCommand.runCommand(); 61 } catch (Exception e) 62 { 63 assertEquals(e.getMessage(), "Key not found (NoDomainsToStart)"); 65 } 66 } 67 68 public StartAppservCommandTest(String name){ 69 super(name); 70 } 71 72 StartAppservCommand testCommand = null; 73 74 protected void setUp() throws Exception { 75 final CLIDescriptorsReader cliDescriptorsReader = CLIDescriptorsReader.getInstance(); 76 ValidCommand validCommand = cliDescriptorsReader.getCommand(null); 77 LocalStringsManagerFactory.setCommandLocalStringsManagerProperties( 78 CLIDescriptorsReader.getInstance().getProperties()); 79 testCommand = new StartAppservCommand(); 80 testCommand.setName("sampleCommand"); 81 } 82 83 84 85 protected void tearDown() { 86 } 87 88 private void nyi(){ 89 fail("Not Yet Implemented"); 90 } 91 92 public static Test suite(){ 93 TestSuite suite = new TestSuite(StartAppservCommandTest.class); 94 return suite; 95 } 96 97 public static void main(String args[]) throws Exception { 98 final TestRunner runner= new TestRunner(); 99 final TestResult result = runner.doRun(StartAppservCommandTest.suite(), false); 100 System.exit(result.errorCount() + result.failureCount()); 101 } 102 } 103 104 | Popular Tags |