Skip to content

Commit

Permalink
Improved failing OSGiCommandsITest
Browse files Browse the repository at this point in the history
  • Loading branch information
dmatej committed Apr 13, 2022
1 parent 9f43a95 commit 7510041
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.List;
import java.util.Set;

import org.glassfish.main.admin.test.tool.AsadminResultMatcher;
import org.glassfish.main.admin.test.tool.asadmin.Asadmin;
import org.glassfish.main.admin.test.tool.asadmin.AsadminResult;
import org.glassfish.main.admin.test.tool.asadmin.GlassFishTestEnvironment;
Expand All @@ -35,6 +36,7 @@
import static org.glassfish.main.admin.test.tool.AsadminResultMatcher.asadminOK;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down Expand Up @@ -102,9 +104,11 @@ public void osgiShell() throws IOException {
try (PrintStream ps = new PrintStream(new FileOutputStream(cmdFile))) {
ps.println("help");
ps.println("lb");
AsadminResult value = ASADMIN.exec("osgi-shell", "--file", cmdFile.getAbsolutePath());
assertTrue(value.getStdOut().contains("System Bundle"));
}
AsadminResult result = ASADMIN.exec("osgi-shell", "--file", cmdFile.getAbsolutePath());
assertThat(result.getStdOut(),
stringContainsInOrder("cm:createFactoryConfiguration", "System Bundle", "Apache Felix Gogo Runtime"));
assertThat(result, AsadminResultMatcher.asadminOK());
}


Expand Down

0 comments on commit 7510041

Please sign in to comment.