Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortle2011-12-22 12:57:30 -0500
committertle2011-12-22 12:57:30 -0500
commitcfedcaa2441a7be9bed2aa6755c12dfde6f770cb (patch)
tree94c1a6f48fe186ff54da778869c7a8f166fe7a65
parent309fa5a165e4d259267f630631aaf13b2f74251b (diff)
downloadwebtools.dali-cfedcaa2441a7be9bed2aa6755c12dfde6f770cb.tar.gz
webtools.dali-cfedcaa2441a7be9bed2aa6755c12dfde6f770cb.tar.xz
webtools.dali-cfedcaa2441a7be9bed2aa6755c12dfde6f770cb.zip
Added tests of required jars
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java13
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java27
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java9
3 files changed, 41 insertions, 8 deletions
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
index 123ed57146..86faa8d47d 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
@@ -13,6 +13,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+
+import org.eclipse.jpt.jaxb.core.tests.internal.JaxbCoreTests;
import org.eclipse.jpt.jaxb.core.tests.internal.resource.java.JaxbJavaResourceModelTests;
@@ -21,9 +23,14 @@ public class JaxbCoreResourceModelTests extends TestCase
public static Test suite() {
TestSuite suite = new TestSuite(JaxbCoreResourceModelTests.class.getName());
- suite.addTestSuite(JaxbIndexResourceTests.class);
- suite.addTestSuite(JaxbPropertiesResourceTests.class);
- suite.addTest(JaxbJavaResourceModelTests.suite());
+ if (JaxbCoreTests.requiredJarsExists()) {
+ suite.addTestSuite(JaxbIndexResourceTests.class);
+ suite.addTestSuite(JaxbPropertiesResourceTests.class);
+ suite.addTest(JaxbJavaResourceModelTests.suite());
+ }
+ else {
+ suite.addTest(TestSuite.warning(JaxbCoreTests.buildMissingJarErrorMessage()));
+ }
return suite;
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java
index 1906a28948..233d80ca4e 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java
@@ -10,8 +10,10 @@
package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal;
import java.io.File;
+
import junit.framework.Test;
import junit.framework.TestSuite;
+
import org.eclipse.jpt.jaxb.core.tests.internal.projects.TestJaxbProject;
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbCoreContextModelTests;
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.ELJaxbCoreResourceModelTests;
@@ -27,19 +29,36 @@ public class ELJaxbCoreTests {
}
public static boolean requiredJarsExists() {
- return elJaxbJarPropertyExists() && elJaxbJarFileExists();
+ return jaxbJarPropertyExists()
+ && jaxbJarFileExists()
+ && eclipselinkJarPropertyExists()
+ && eclipselinkJarFileExists();
+ }
+
+ public static boolean jaxbJarPropertyExists() {
+ return getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY) != null;
}
- public static boolean elJaxbJarPropertyExists() {
+ public static boolean jaxbJarFileExists() {
+ return (new File(getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY))).exists();
+ }
+
+ public static boolean eclipselinkJarPropertyExists() {
return getSystemProperty(TestJaxbProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY) != null;
}
- public static boolean elJaxbJarFileExists() {
+ public static boolean eclipselinkJarFileExists() {
return (new File(getSystemProperty(TestJaxbProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY))).exists();
}
public static String buildMissingJarErrorMessage() {
- if( ! elJaxbJarPropertyExists()) {
+ if( ! jaxbJarPropertyExists()) {
+ return errorMissingProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY);
+ }
+ else if( ! jaxbJarFileExists()) {
+ return errorJarFileDoesNotExist(getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY));
+ }
+ else if( ! eclipselinkJarPropertyExists()) {
return errorMissingProperty(TestJaxbProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
}
return errorJarFileDoesNotExist(getSystemProperty(TestJaxbProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY));
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java
index 11842ba139..12a00c2ed6 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java
@@ -12,6 +12,8 @@ package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+
+import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.ELJaxbCoreTests;
import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java.ELJaxbJavaResourceModelTests;
@@ -21,7 +23,12 @@ public class ELJaxbCoreResourceModelTests
public static Test suite() {
TestSuite suite = new TestSuite(ELJaxbCoreResourceModelTests.class.getName());
- suite.addTest(ELJaxbJavaResourceModelTests.suite());
+ if (ELJaxbCoreTests.requiredJarsExists()) {
+ suite.addTest(ELJaxbJavaResourceModelTests.suite());
+ }
+ else {
+ suite.addTest(TestSuite.warning(ELJaxbCoreTests.buildMissingJarErrorMessage()));
+ }
return suite;
}

Back to the top