Skip to content

Commit

Permalink
Fixed StartStopITest - Windows vs. * asterisk - attempt2
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Oct 2, 2023
1 parent 63de5d7 commit 31d4f67
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,33 @@
import org.glassfish.main.itest.tools.GlassFishTestEnvironment;
import org.glassfish.main.itest.tools.asadmin.Asadmin;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;

import static org.glassfish.main.itest.tools.asadmin.AsadminResultMatcher.asadminOK;
import static org.hamcrest.MatcherAssert.assertThat;

/**
* {@link GlassFishTestEnvironment} starts the domain, we execute the command and then
* {@link GlassFishTestEnvironment} stops the server automatically.
*
* @author David Matejcek
*/
class StartStopITest {

private static final Asadmin ASADMIN = GlassFishTestEnvironment.getAsadmin();

/**
* {@link GlassFishTestEnvironment} starts the domain, we execute the command and then
* {@link GlassFishTestEnvironment} stops the server automatically.
*/
@Test
void asadminGet() {
assertThat(ASADMIN.exec("get", "'*'"), asadminOK());
@DisabledOnOs(OS.WINDOWS)
void asadminGet_Linux() {
assertThat(ASADMIN.exec("get", "*"), asadminOK());
}


@Test
@EnabledOnOs(OS.WINDOWS)
void asadminGet_Windows() {
assertThat(ASADMIN.exec("get", "\"*\""), asadminOK());
}
}

0 comments on commit 31d4f67

Please sign in to comment.