Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused ee10-demo-realm files and add distro test #9886

Merged
merged 2 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ext
ee10-servlets
ee10-websocket-jakarta
ee10-websocket-jetty
ee10-demo-realm
demo-realm
ee10-demo-rewrite

[files]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jdbc
ee10-jsp
ee10-annotations
ext
ee10-demo-realm
demo-realm
ee10-demo-mock-resources

[files]
Expand Down

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions jetty-home/src/main/resources/modules/ee10-demo-realm.mod

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,51 @@ private static Stream<Arguments> provideEnvironmentsToTest()
return Arrays.stream(envsToTest.split(",")).map(Arguments::of);
}

@ParameterizedTest
@MethodSource("provideEnvironmentsToTest")
public void testAuthentication(String env) throws Exception
{
Path jettyBase = newTestJettyBaseDirectory();
String jettyVersion = System.getProperty("jettyVersion");
JettyHomeTester distribution = JettyHomeTester.Builder.newInstance()
.jettyVersion(jettyVersion)
.jettyBase(jettyBase)
.mavenLocalRepository(System.getProperty("mavenRepoPath"))
.build();

int httpPort = distribution.freePort();

String[] argsConfig = {
"--add-modules=http," + toEnvironment("demos", env)
};

String baseURI = "http://localhost:%d/%s-test".formatted(httpPort, env);
try (JettyHomeTester.Run runConfig = distribution.start(argsConfig))
{
assertTrue(runConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runConfig.getExitValue());

String[] argsStart =
{
"jetty.http.port=" + httpPort
};

try (JettyHomeTester.Run runStart = distribution.start(argsStart))
{
assertTrue(runStart.awaitConsoleLogsFor("Started oejs.Server@", START_TIMEOUT, TimeUnit.SECONDS));

startHttpClient();
ContentResponse response = client.GET(baseURI + "/dump/auth/admin/info");
Fields fields = new Fields();
fields.put("j_username", "admin");
fields.put("j_password", "admin");
response = client.FORM(baseURI + "/j_security_check", fields);
assertEquals(HttpStatus.OK_200, response.getStatus(), new ResponseDetails(response));;
assertThat(response.getContentAsString(), containsString("Dump Servlet"));
}
}
}

@ParameterizedTest
@MethodSource("provideEnvironmentsToTest")
public void testDemoAddServerClasses(String env) throws Exception
Expand Down