Search in sources :

Example 1 with WrappedAdminCommand

use of org.glassfish.api.admin.WrappedAdminCommand in project Payara by payara.

the class WrappedAdminCommandTest method getParamValueTest.

/*
     * Test getParamValue from wrapped command.
     */
@Test
public void getParamValueTest() {
    DummyAdminCommand dac = new DummyAdminCommand();
    dac.foo = "test";
    WrappedAdminCommand wrappedCommand = new WrappedAdminCommand(dac) {

        @Override
        public void execute(AdminCommandContext context) {
        // nothing todo
        }
    };
    assertEquals("set param value", "test", CommandSupport.getParamValue(wrappedCommand, "foo"));
    // note, after resolver it must be not null
    assertNull("unset param value must be null", CommandSupport.getParamValue(wrappedCommand, "foobar"));
    assertNull("non existent param value must be null", CommandSupport.getParamValue(wrappedCommand, "dummy"));
}
Also used : WrappedAdminCommand(org.glassfish.api.admin.WrappedAdminCommand) AdminCommandContext(org.glassfish.api.admin.AdminCommandContext) Test(org.junit.Test)

Aggregations

AdminCommandContext (org.glassfish.api.admin.AdminCommandContext)1 WrappedAdminCommand (org.glassfish.api.admin.WrappedAdminCommand)1 Test (org.junit.Test)1