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 49 50 55 56 public class WebServiceRegistryCommandTest extends TestCase { 57 58 public void testcreateStringArrayParam() throws Exception { 59 String [] params = testCommand.createStringArrayParam("value1,value2"); 60 assertEquals(params[0], "value1"); 61 assertEquals(params[1], "value2"); 62 } 63 64 public void testcreateStringArrayParamWithVariable() throws Exception { 65 testCommand.setOption("registryjndinames", "value1,value2"); 66 String [] params = testCommand.createStringArrayParam("{$registryjndinames}"); 67 assertEquals(params[0], "value1"); 68 assertEquals(params[1], "value2"); 69 } 70 71 public WebServiceRegistryCommandTest(String name){ 72 super(name); 73 } 74 75 WebServiceRegistryCommand testCommand = null; 76 77 protected void setUp() throws Exception { 78 final CLIDescriptorsReader cliDescriptorsReader = CLIDescriptorsReader.getInstance(); 83 ValidCommand validCommand = cliDescriptorsReader.getCommand(null); 84 LocalStringsManagerFactory.setCommandLocalStringsManagerProperties( 85 CLIDescriptorsReader.getInstance().getProperties()); 86 testCommand = new WebServiceRegistryCommand(); 87 testCommand.setName("sampleCommand"); 88 } 89 90 91 92 protected void tearDown() { 93 } 94 95 private void nyi(){ 96 fail("Not Yet Implemented"); 97 } 98 99 public static Test suite(){ 100 TestSuite suite = new TestSuite(WebServiceRegistryCommandTest.class); 101 return suite; 102 } 103 104 public static void main(String args[]) throws Exception { 105 final TestRunner runner= new TestRunner(); 106 final TestResult result = runner.doRun(WebServiceRegistryCommandTest.suite(), false); 107 System.exit(result.errorCount() + result.failureCount()); 108 } 109 } 110 111 | Popular Tags |