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 StopDomainCommandTest extends TestCase { 56 57 public void testrunCommandNoDomains() throws Exception { 58 try{ 59 Vector operands = new Vector (); 60 operands.add("UndefinedDomain"); 61 testCommand.setOperands(operands); 62 testCommand.runCommand(); 63 } catch (Exception e) 64 { 65 assertEquals(e.getMessage(), "CLI157 Could not stop the domain UndefinedDomain."); 66 } 67 } 68 69 public StopDomainCommandTest(String name){ 70 super(name); 71 } 72 73 StopDomainCommand testCommand = null; 74 75 protected void setUp() throws Exception { 76 final CLIDescriptorsReader cliDescriptorsReader = CLIDescriptorsReader.getInstance(); 77 ValidCommand validCommand = cliDescriptorsReader.getCommand(null); 78 LocalStringsManagerFactory.setCommandLocalStringsManagerProperties( 79 CLIDescriptorsReader.getInstance().getProperties()); 80 testCommand = new StopDomainCommand(); 81 testCommand.setName("sampleCommand"); 82 } 83 84 85 86 protected void tearDown() { 87 } 88 89 private void nyi(){ 90 fail("Not Yet Implemented"); 91 } 92 93 public static Test suite(){ 94 TestSuite suite = new TestSuite(StopDomainCommandTest.class); 95 return suite; 96 } 97 98 public static void main(String args[]) throws Exception { 99 final TestRunner runner= new TestRunner(); 100 final TestResult result = runner.doRun(StopDomainCommandTest.suite(), false); 101 System.exit(result.errorCount() + result.failureCount()); 102 } 103 } 104 105 | Popular Tags |