summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-03-01 15:25:55 (EST)
committerSteffen Pingel2012-03-01 15:25:55 (EST)
commit4c1742b8c9bf062066ad742e4251fa3ac476ef3d (patch)
tree4ff063c2bc3af0a2803eaf8432ec06503a478f19
parent433aaea7bbe20e5d3dc10d0b9a518276fcb8ca63 (diff)
downloadorg.eclipse.mylyn.commons-4c1742b8c9bf062066ad742e4251fa3ac476ef3d.zip
org.eclipse.mylyn.commons-4c1742b8c9bf062066ad742e4251fa3ac476ef3d.tar.gz
org.eclipse.mylyn.commons-4c1742b8c9bf062066ad742e4251fa3ac476ef3d.tar.bz2
NEW - bug 372971: setup integration tests on slave7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372971 Change-Id: Iea0cd83c360d4d16722d5a39a2ecb2e7c0940402
-rw-r--r--org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java12
-rw-r--r--org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java9
-rw-r--r--org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestConfiguration.java74
-rw-r--r--org.eclipse.mylyn.discovery.tests/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.discovery.tests/src/org/eclipse/mylyn/discovery/tests/AllDiscoveryTests.java7
5 files changed, 97 insertions, 8 deletions
diff --git a/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java b/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java
index 326d28b..56595b6 100644
--- a/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java
+++ b/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java
@@ -49,7 +49,11 @@ public class CommonHttpClientTest {
@Test
public void testCertificateAuthenticationCertificate() throws Exception {
if (CommonTestUtil.isCertificateAuthBroken()) {
- System.err.println("Skipped CommonHttpClientTest.testCertificateAuthenticationCertificate");
+ System.err.println("Skipped CommonHttpClientTest.testCertificateAuthenticationCertificate() due to incompatible JVM");
+ return; // skip test
+ }
+ if (CommonTestUtil.hasCertificateCredentials()) {
+ System.err.println("Skipped CommonHttpClientTest.testCertificateAuthenticationCertificate() due to missing credentials");
return; // skip test
}
@@ -73,9 +77,13 @@ public class CommonHttpClientTest {
if (CommonTestUtil.isCertificateAuthBroken()
|| NetUtil.getProxyForUrl("https://mylyn.org/secure/index.txt") != null) {
// bug 369805
- System.err.println("Skipped CommonHttpClientTest.testCertificateAuthenticationCertificateReset");
+ System.err.println("Skipped CommonHttpClientTest.testCertificateAuthenticationCertificateReset due to incompatible JVM");
throw new SSLException(""); // skip test
}
+ if (CommonTestUtil.hasCertificateCredentials()) {
+ System.err.println("Skipped CommonHttpClientTest.testCertificateAuthenticationCertificate() due to missing credentials");
+ return; // skip test
+ }
RepositoryLocation location = new RepositoryLocation();
location.setUrl("https://mylyn.org/secure/index.txt");
diff --git a/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java b/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java
index d0b4f32..bd6c0dd 100644
--- a/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java
+++ b/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/CommonTestUtil.java
@@ -440,4 +440,13 @@ public class CommonTestUtil {
return new VersionRange("[0.0.0,1.6.0.25]").isIncluded(CoreUtil.getRuntimeVersion());
}
+ public static boolean hasCertificateCredentials() {
+ try {
+ CommonTestUtil.getCertificateCredentials();
+ return true;
+ } catch (AssertionFailedError error) {
+ return false;
+ }
+ }
+
}
diff --git a/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestConfiguration.java b/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestConfiguration.java
index 93d7c18..3cd36a9 100644
--- a/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestConfiguration.java
+++ b/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestConfiguration.java
@@ -11,20 +11,90 @@
package org.eclipse.mylyn.commons.sdk.util;
+import java.util.EnumSet;
+
+import org.eclipse.core.runtime.Assert;
+
/**
* @author Steffen Pingel
*/
public class TestConfiguration {
+ public enum TestKind {
+ UNIT, COMPONENT, INTEGRATION, SYSTEM
+ };
+
+ public static TestConfiguration defaultConfiguration;
+
private static final String SERVER = System.getProperty("mylyn.test.server", "mylyn.org");
+ public static TestConfiguration getDefault() {
+ if (defaultConfiguration == null) {
+ defaultConfiguration = new TestConfiguration(TestKind.UNIT);
+ defaultConfiguration.setDefaultOnly(CommonTestUtil.runHeartbeatTestsOnly());
+ }
+ return defaultConfiguration;
+ }
+
public static String getRepositoryUrl(String service) {
- return getRepositoryUrl(service, false);
+ return getDefault().getUrl(service);
}
public static String getRepositoryUrl(String service, boolean secure) {
- // FIXME support https
+ return getDefault().getUrl(service, secure);
+ }
+
+ public static void setDefault(TestConfiguration defaultConfiguration) {
+ TestConfiguration.defaultConfiguration = defaultConfiguration;
+ }
+
+ private final EnumSet<TestKind> kinds;
+
+ private boolean localOnly;
+
+ private boolean defaultOnly;
+
+ private boolean headless;
+
+ public TestConfiguration(TestKind firstKind, TestKind... moreKinds) {
+ Assert.isNotNull(firstKind);
+ this.kinds = EnumSet.of(firstKind, moreKinds);
+ }
+
+ public String getUrl(String service) {
+ return getUrl(service, false);
+ }
+
+ public String getUrl(String service, boolean secure) {
return ((secure) ? "https://" : "http://") + SERVER + "/" + service;
}
+ public boolean hasKind(TestKind kind) {
+ return kinds.contains(kind);
+ }
+
+ public boolean isDefaultOnly() {
+ return defaultOnly;
+ }
+
+ public boolean isHeadless() {
+ return headless;
+ }
+
+ public boolean isLocalOnly() {
+ return localOnly;
+ }
+
+ public void setDefaultOnly(boolean heartbeat) {
+ this.defaultOnly = heartbeat;
+ }
+
+ public void setHeadless(boolean headless) {
+ this.headless = headless;
+ }
+
+ public void setLocalOnly(boolean localOnly) {
+ this.localOnly = localOnly;
+ }
+
}
diff --git a/org.eclipse.mylyn.discovery.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.discovery.tests/META-INF/MANIFEST.MF
index e6db487..d24191d 100644
--- a/org.eclipse.mylyn.discovery.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.discovery.tests/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Require-Bundle: org.eclipse.mylyn.discovery.core;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="3.1.0",
org.eclipse.ui;bundle-version="3.1.0",
org.eclipse.mylyn.commons.net,
- org.eclipse.mylyn.commons.core
+ org.eclipse.mylyn.commons.core,
+ org.eclipse.mylyn.commons.sdk.util
Export-Package: org.eclipse.mylyn.discovery.tests;x-internal:=true,
org.eclipse.mylyn.discovery.tests.core;x-internal:=true,
org.eclipse.mylyn.discovery.tests.core.mock;x-internal:=true,
diff --git a/org.eclipse.mylyn.discovery.tests/src/org/eclipse/mylyn/discovery/tests/AllDiscoveryTests.java b/org.eclipse.mylyn.discovery.tests/src/org/eclipse/mylyn/discovery/tests/AllDiscoveryTests.java
index 8c4e192..265bfee 100644
--- a/org.eclipse.mylyn.discovery.tests/src/org/eclipse/mylyn/discovery/tests/AllDiscoveryTests.java
+++ b/org.eclipse.mylyn.discovery.tests/src/org/eclipse/mylyn/discovery/tests/AllDiscoveryTests.java
@@ -14,6 +14,7 @@ package org.eclipse.mylyn.discovery.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.mylyn.commons.sdk.util.TestConfiguration;
import org.eclipse.mylyn.discovery.tests.core.BundleDiscoveryStrategyTest;
import org.eclipse.mylyn.discovery.tests.core.ConnectorDiscoveryRemoteTest;
import org.eclipse.mylyn.discovery.tests.core.ConnectorDiscoveryTest;
@@ -26,15 +27,15 @@ import org.eclipse.mylyn.discovery.tests.core.RemoteBundleDiscoveryStrategyTest;
public class AllDiscoveryTests {
public static Test suite() {
- return suite(false);
+ return suite(TestConfiguration.getDefault());
}
- public static Test suite(boolean localOnly) {
+ public static Test suite(TestConfiguration configuration) {
TestSuite suite = new TestSuite(AllDiscoveryTests.class.getName());
suite.addTestSuite(ConnectorDiscoveryTest.class);
suite.addTestSuite(DirectoryParserTest.class);
suite.addTestSuite(BundleDiscoveryStrategyTest.class);
- if (!localOnly) {
+ if (!configuration.isLocalOnly()) {
suite.addTestSuite(RemoteBundleDiscoveryStrategyTest.class);
suite.addTestSuite(ConnectorDiscoveryRemoteTest.class);
}