mirror of
https://github.com/jetty/jetty.project.git
synced 2025-02-28 19:09:10 +00:00
Adding optionalRemoteDebug feature to test-jetty-osgi
This commit is contained in:
parent
5b959f17af
commit
f5b3ddc1a5
@ -18,15 +18,8 @@
|
|||||||
|
|
||||||
package org.eclipse.jetty.osgi.test;
|
package org.eclipse.jetty.osgi.test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
|
|
||||||
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.eclipse.jetty.client.HttpClient;
|
import org.eclipse.jetty.client.HttpClient;
|
||||||
@ -41,6 +34,12 @@ import org.ops4j.pax.exam.Option;
|
|||||||
import org.ops4j.pax.exam.junit.PaxExam;
|
import org.ops4j.pax.exam.junit.PaxExam;
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
|
||||||
|
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pax-Exam to make sure the jetty-osgi-boot can be started along with the
|
* 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
|
* httpservice web-bundle. Then make sure we can deploy an OSGi service on the
|
||||||
@ -59,6 +58,7 @@ public class TestJettyOSGiBootWithAnnotations
|
|||||||
public static Option[] configure()
|
public static Option[] configure()
|
||||||
{
|
{
|
||||||
ArrayList<Option> options = new ArrayList<>();
|
ArrayList<Option> options = new ArrayList<>();
|
||||||
|
options.add(TestOSGiUtil.optionalRemoteDebug());
|
||||||
options.add(CoreOptions.junitBundles());
|
options.add(CoreOptions.junitBundles());
|
||||||
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-annotations.xml"));
|
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-annotations.xml"));
|
||||||
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
|
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
|
||||||
|
@ -18,20 +18,12 @@
|
|||||||
|
|
||||||
package org.eclipse.jetty.osgi.test;
|
package org.eclipse.jetty.osgi.test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
|
|
||||||
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@ -51,6 +43,13 @@ import org.osgi.framework.BundleContext;
|
|||||||
import org.osgi.framework.ServiceReference;
|
import org.osgi.framework.ServiceReference;
|
||||||
import org.osgi.service.http.HttpService;
|
import org.osgi.service.http.HttpService;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
|
||||||
|
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper methods for pax-exam tests
|
* Helper methods for pax-exam tests
|
||||||
*/
|
*/
|
||||||
@ -99,8 +98,13 @@ public class TestOSGiUtil
|
|||||||
res.addAll(coreJettyDependencies());
|
res.addAll(coreJettyDependencies());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Option optionalRemoteDebug()
|
||||||
|
{
|
||||||
|
return CoreOptions.when(Boolean.getBoolean("pax.exam.debug.remote"))
|
||||||
|
.useOptions(CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"));
|
||||||
|
}
|
||||||
|
|
||||||
public static List<Option> coreJettyDependencies()
|
public static List<Option> coreJettyDependencies()
|
||||||
{
|
{
|
||||||
List<Option> res = new ArrayList<>();
|
List<Option> res = new ArrayList<>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user