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 import java.io.File ; 41 import java.io.PrintWriter ; 42 import java.io.OutputStreamWriter ; 43 import java.io.FileOutputStream ; 44 import javax.management.MBeanServerConnection ; 45 46 47 48 53 54 59 60 public class ListSubComponentsCommandTest extends TestCase { 61 62 public void testvalidateOptionsInvalidType() throws Exception { 63 testCommand.setOption("type", "invalidType"); 64 try{ 65 testCommand.validateOptions(); 66 }catch (CommandValidationException cve){ 67 assertEquals(cve.getMessage(), "CLI165 Invalid type option value. "); 69 } 70 } 71 72 public ListSubComponentsCommandTest(String name){ 73 super(name); 74 } 75 76 ListSubComponentsCommand testCommand = null; 77 78 protected void setUp() throws Exception { 79 final CLIDescriptorsReader cliDescriptorsReader = CLIDescriptorsReader.getInstance(); 84 ValidCommand validCommand = cliDescriptorsReader.getCommand(null); 85 LocalStringsManagerFactory.setCommandLocalStringsManagerProperties( 86 CLIDescriptorsReader.getInstance().getProperties()); 87 testCommand = new ListSubComponentsCommand(); 88 testCommand.setName("sampleCommand"); 89 } 90 91 92 93 protected void tearDown() { 94 } 95 96 private void nyi(){ 97 fail("Not Yet Implemented"); 98 } 99 100 public static Test suite(){ 101 TestSuite suite = new TestSuite(ListSubComponentsCommandTest.class); 102 return suite; 103 } 104 105 public static void main(String args[]) throws Exception { 106 final TestRunner runner= new TestRunner(); 107 final TestResult result = runner.doRun(ListSubComponentsCommandTest.suite(), false); 108 System.exit(result.errorCount() + result.failureCount()); 109 } 110 } 111 112 | Popular Tags |