FileDocCategorySizeDatePackage
BaseTransformationRuleCommandTest.javaAPI DocGlassfish v2 API5874Fri May 04 22:25:18 BST 2007com.sun.enterprise.cli.commands

BaseTransformationRuleCommandTest

public class BaseTransformationRuleCommandTest extends TestCase
Execute these tests using gmake (and Ant) by: cd gmake ANT_TARGETS=CommandTest.java

Fields Summary
BaseTransformationRuleCommand
testCommand
Constructors Summary
public BaseTransformationRuleCommandTest(String name)

        super(name);
    
Methods Summary
public static voidmain(java.lang.String[] args)

        final TestRunner runner= new TestRunner();
        final TestResult result = runner.doRun(BackupCommandsTest.suite(), false);
        System.exit(result.errorCount() + result.failureCount());
    
private voidnyi()

        fail("Not Yet Implemented");
    
protected voidsetUp()


        
        //Properties systemProperties = new java.util.Propertis();
        //systemProperties.put("com.sun.aas.configRoot",)
        //String configProperty = SystemPropertyConstants.CONFIG_ROOT_PROPERTY;
        //System.out.println(configProperty + " = " + System.getProperty(configProperty));
        final CLIDescriptorsReader cliDescriptorsReader = CLIDescriptorsReader.getInstance();
        ValidCommand validCommand = cliDescriptorsReader.getCommand(null);
        LocalStringsManagerFactory.setCommandLocalStringsManagerProperties(
            CLIDescriptorsReader.getInstance().getProperties());
        testCommand = new BaseTransformationRuleCommand() {
                public void runCommand()
                    throws CommandException, CommandValidationException
                {
                }
                public boolean validateOptions() throws CommandValidationException
                {
                    return true;
                }
            };
        testCommand.setName("sampleCommand");
    
public static junit.framework.Testsuite()

        TestSuite suite = new TestSuite(BackupCommandsTest.class);
        return suite;
    
protected voidtearDown()

    
public voidtestvalidateWebServiceNameWhenInvalid1()

        try{
            testCommand.validateWebServiceName("webserviceNameWithoutHash", true);
        }
        catch (CommandValidationException cve){
//            System.out.println("message = " + cve.getMessage());
            assertEquals(cve.getMessage(), "CLI186 Invalid format entered for the webservice name. Valid format for an endpoint in an application is <app-name>#<module-name>#<endpoint-name>. Valid format for an endpoint in a deployed standalone module is <module-name>#<endpoint-name>.");
        }
    
public voidtestvalidateWebServiceNameWhenInvalid2()

        try{
            testCommand.validateWebServiceName("webserviceNameWithHashAtEnd#", true);
        }
        catch (CommandValidationException cve){
            assertEquals(cve.getMessage(), "CLI186 Invalid format entered for the webservice name. Valid format for an endpoint in an application is <app-name>#<module-name>#<endpoint-name>. Valid format for an endpoint in a deployed standalone module is <module-name>#<endpoint-name>.");
        }
    
public voidtestvalidateWebServiceNameWhenValid()

        testCommand.validateWebServiceName("webserviceName#With#Hash", true);