Ensure file paths for osgi config files are correct urls
This commit is contained in:
Jan Bartel 2017-03-10 11:57:45 +11:00
parent b747b7fb2f
commit 72fe2a88c2
5 changed files with 62 additions and 63 deletions

View File

@ -86,21 +86,21 @@ public class TestJettyOSGiBootContextAsService
public static List<Option> configureJettyHomeAndPort(String jettySelectorFileName)
{
File etcFolder = new File("src/test/config/etc");
String etc = "file://" + etcFolder.getAbsolutePath();
File etc = new File("src/test/config/etc");
StringBuffer xmlConfigs = new StringBuffer();
xmlConfigs.append(new File(etc, "jetty.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, jettySelectorFileName).toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc,"jetty-deployer.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-testrealm.xml").toURI());
List<Option> options = new ArrayList<Option>();
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(etc + "/jetty.xml;"
+ etc
+ "/"
+ jettySelectorFileName
+ ";"
+ etc
+ "/jetty-deployer.xml;"
+ etc
+ "/jetty-testrealm.xml"));
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs.toString()));
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()));
options.add(systemProperty("jetty.home").value(etc.getParentFile().getAbsolutePath()));
return options;
}

View File

@ -76,7 +76,7 @@ public class TestJettyOSGiBootHTTP2
File checkALPNBoot = new File(alpnBoot);
if (!checkALPNBoot.exists()) { throw new IllegalStateException("Unable to find the alpn boot jar here: " + alpnBoot); }
res.add(CoreOptions.vmOptions("-Xbootclasspath/p:" + alpnBoot));
res.add(CoreOptions.vmOptions("-Xbootclasspath/p:" + checkALPNBoot.getAbsolutePath()));
res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-alpn").versionAsInProject().noStart());
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-server").versionAsInProject().start());

View File

@ -90,21 +90,21 @@ public class TestJettyOSGiBootWebAppAsService
public static List<Option> configureJettyHomeAndPort(String jettySelectorFileName)
{
File etcFolder = new File("src/test/config/etc");
String etc = "file://" + etcFolder.getAbsolutePath();
File etc = new File("src/test/config/etc");
StringBuffer xmlConfigs = new StringBuffer();
xmlConfigs.append(new File(etc, "jetty.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, jettySelectorFileName).toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-deployer.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-testrealm.xml").toURI());
List<Option> options = new ArrayList<Option>();
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(etc + "/jetty.xml;"
+ etc
+ "/"
+ jettySelectorFileName
+ ";"
+ etc
+ "/jetty-deployer.xml;"
+ etc
+ "/jetty-testrealm.xml"));
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs.toString()));
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()));
options.add(systemProperty("jetty.home").value(etc.getParentFile().getAbsolutePath()));
return options;
}

View File

@ -83,27 +83,26 @@ public class TestJettyOSGiBootWithAnnotations
public static List<Option> configureJettyHomeAndPort(String jettySelectorFileName)
{
File etcFolder = new File("src/test/config/etc");
String etc = "file://" + etcFolder.getAbsolutePath();
File etc = new File("src/test/config/etc");
List<Option> options = new ArrayList<Option>();
String xmlConfigs = etc + "/jetty.xml;"
+ etc
+ "/"
+ jettySelectorFileName
+ ";"
+ etc
+ "/jetty-ssl.xml;"
+ etc
+ "/jetty-https.xml;"
+ etc
+ "/jetty-deployer.xml;"
+ etc
+ "/jetty-testrealm.xml";
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs));
StringBuffer xmlConfigs = new StringBuffer();
xmlConfigs.append(new File(etc, "jetty.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc,jettySelectorFileName).toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-ssl.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-https.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-deployer.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-testrealm.xml").toURI());
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs.toString()));
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()));
options.add(systemProperty("jetty.home").value(etc.getParentFile().getAbsolutePath()));
return options;
}

View File

@ -78,31 +78,31 @@ public class TestJettyOSGiBootWithJsp
public static List<Option> configureJettyHomeAndPort(boolean ssl,String jettySelectorFileName)
{
File etcFolder = new File("src/test/config/etc");
String etc = "file://" + etcFolder.getAbsolutePath();
File etc = new File("src/test/config/etc");
List<Option> options = new ArrayList<Option>();
String xmlConfigs = etc + "/jetty.xml";
StringBuffer xmlConfigs = new StringBuffer();
xmlConfigs.append(new File(etc, "jetty.xml").toURI());
xmlConfigs.append(";");
if (ssl)
xmlConfigs += ";"
+ etc
+ "/jetty-ssl.xml;"
+ etc
+ "/jetty-https.xml;";
xmlConfigs+= ";"
+ etc
+ "/"
+ jettySelectorFileName
+ ";"
+ etc
+ "/jetty-deployer.xml;"
+ etc
+ "/jetty-testrealm.xml";
{
xmlConfigs.append(new File(etc, "jetty-ssl.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-https.xml").toURI());
xmlConfigs.append(";");
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs));
}
xmlConfigs.append(new File(etc, jettySelectorFileName).toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-deployer.xml").toURI());
xmlConfigs.append(";");
xmlConfigs.append(new File(etc, "jetty-testrealm.xml").toURI());
options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs.toString()));
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()));
options.add(systemProperty("jetty.base").value(etcFolder.getParentFile().getAbsolutePath()));
options.add(systemProperty("jetty.home").value(etc.getParentFile().getAbsolutePath()));
options.add(systemProperty("jetty.base").value(etc.getParentFile().getAbsolutePath()));
return options;
}