diff options
Diffstat (limited to 'jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java')
-rw-r--r-- | jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java index d893aba57d..4aacdfd11c 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java @@ -18,17 +18,10 @@ package org.eclipse.jetty.osgi.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.ops4j.pax.exam.CoreOptions.mavenBundle; -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.systemProperty; - import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.List; - import javax.inject.Inject; import org.eclipse.jetty.client.HttpClient; @@ -45,6 +38,12 @@ import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.osgi.framework.BundleContext; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.ops4j.pax.exam.CoreOptions.mavenBundle; +import static org.ops4j.pax.exam.CoreOptions.options; +import static org.ops4j.pax.exam.CoreOptions.systemProperty; + /** * Pax-Exam to make sure the jetty-osgi-boot can be started along with the * httpservice web-bundle. Then make sure we can deploy an OSGi service on the @@ -62,10 +61,9 @@ public class TestJettyOSGiBootWithAnnotations @Configuration public static Option[] configure() { - ArrayList<Option> options = new ArrayList<Option>(); options.add(CoreOptions.junitBundles()); - options.addAll(configureJettyHomeAndPort("jetty-selector.xml")); + options.addAll(configureJettyHomeAndPort("jetty-http.xml")); options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*")); options.add(CoreOptions.systemPackages("com.sun.org.apache.xalan.internal.res","com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal", @@ -75,7 +73,7 @@ public class TestJettyOSGiBootWithAnnotations options.addAll(Arrays.asList(options(systemProperty("pax.exam.logging").value("none")))); options.addAll(Arrays.asList(options(systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(LOG_LEVEL)))); options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.annotations.LEVEL").value(LOG_LEVEL)))); - //options.addAll(TestJettyOSGiBootCore.consoleDependencies()); + // options.addAll(TestJettyOSGiBootCore.consoleDependencies()); options.addAll(jspDependencies()); options.addAll(annotationDependencies()); return options.toArray(new Option[options.size()]); @@ -101,7 +99,8 @@ public class TestJettyOSGiBootWithAnnotations + "/jetty-testrealm.xml"; options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs)); - options.add(systemProperty("jetty.port").value(String.valueOf(TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT))); + options.add(systemProperty("jetty.http.port").value(String.valueOf(TestJettyOSGiBootCore.DEFAULT_HTTP_PORT))); + options.add(systemProperty("jetty.ssl.port").value(String.valueOf(TestJettyOSGiBootCore.DEFAULT_SSL_PORT))); options.add(systemProperty("jetty.home").value(etcFolder.getParentFile().getAbsolutePath())); return options; } @@ -135,7 +134,7 @@ public class TestJettyOSGiBootWithAnnotations @Test public void testHttpService() throws Exception { - TestOSGiUtil.testHttpServiceGreetings(bundleContext, "http", TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT); + TestOSGiUtil.testHttpServiceGreetings(bundleContext, "http", TestJettyOSGiBootCore.DEFAULT_HTTP_PORT); } @@ -143,17 +142,18 @@ public class TestJettyOSGiBootWithAnnotations @Test public void testIndex() throws Exception { + // TestOSGiUtil.debugBundles(bundleContext); HttpClient client = new HttpClient(); try { client.start(); - ContentResponse response = client.GET("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT + "/index.html"); + ContentResponse response = client.GET("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_HTTP_PORT + "/index.html"); assertEquals(HttpStatus.OK_200, response.getStatus()); String content = new String(response.getContent()); assertTrue(content.contains("<h1>Servlet 3.1 Test WebApp</h1>")); - Request req = client.POST("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_JETTY_HTTP_PORT + "/test"); + Request req = client.POST("http://127.0.0.1:" + TestJettyOSGiBootCore.DEFAULT_HTTP_PORT + "/test"); response = req.send(); content = new String(response.getContent()); assertTrue(content.contains("<p><b>Result: <span class=\"pass\">PASS</span></p>")); |