aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Valovy2014-07-16 02:49:59 (EDT)
committerTomas Kraus2014-07-21 08:12:30 (EDT)
commit211303606523e2db13202e1a2124a2d2cdeaf18a (patch)
treea7aa293985a1c66af1549b51822a1fe4db247b9b
parentf0734e0c75356e2633b0d74a8ee97af6c140d932 (diff)
downloadeclipselink.runtime-211303606523e2db13202e1a2124a2d2cdeaf18a.zip
eclipselink.runtime-211303606523e2db13202e1a2124a2d2cdeaf18a.tar.gz
eclipselink.runtime-211303606523e2db13202e1a2124a2d2cdeaf18a.tar.bz2
Fixed DBWS Builder test scripts. Unified naming conventions between JPA test and MOXy test build scripts. + Minor change to BeanValidationRuntimeTestCase, now it is locale independent.
Signed-off-by: Marcel Valovy <marcel.valovy@oracle.com>
-rw-r--r--jpa/eclipselink.jpa.test/antbuild.properties5
-rw-r--r--jpa/eclipselink.jpa.test/antbuild.xml22
-rw-r--r--jpa/eclipselink.jpa.test/test.properties14
-rw-r--r--moxy/eclipselink.moxy.test/antbuild.properties2
-rw-r--r--moxy/eclipselink.moxy.test/antbuild.xml6
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/BeanValidationRuntimeTestCase.java38
-rw-r--r--moxy/org.eclipse.persistence.moxy/antbuild.properties12
-rw-r--r--utils/eclipselink.dbws.builder.test/antbuild.properties1
-rw-r--r--utils/eclipselink.dbws.builder.test/antbuild.xml4
9 files changed, 59 insertions, 45 deletions
diff --git a/jpa/eclipselink.jpa.test/antbuild.properties b/jpa/eclipselink.jpa.test/antbuild.properties
index 2d34fd6..b401008 100644
--- a/jpa/eclipselink.jpa.test/antbuild.properties
+++ b/jpa/eclipselink.jpa.test/antbuild.properties
@@ -143,8 +143,9 @@ eclipselink.jpa.spring.test=../eclipselink.jpa.spring.test
# BeanValidationJUnitTest Dependency Definitions
----------------------------------------------
-beanvalidation.jar=javax.validation_1.1.0.v201304101302.jar
-validation.impl.jar=hibernate-validator-5.1.0.Final.jar
+javax.validation.jar=javax.validation_1.1.0.v201304101302.jar
+validation-impl.jar=hibernate-validator-5.1.0.Final.jar
+# Required by the hibernate-validator.
jboss-logging.jar=jboss-logging-3.1.4.GA.jar
javax.el-api.jar=javax.el-api-2.2.jar
javax.el.jar=javax.el-2.2.2.jar
diff --git a/jpa/eclipselink.jpa.test/antbuild.xml b/jpa/eclipselink.jpa.test/antbuild.xml
index b680e20..84a0b6c 100644
--- a/jpa/eclipselink.jpa.test/antbuild.xml
+++ b/jpa/eclipselink.jpa.test/antbuild.xml
@@ -223,7 +223,7 @@
<available file="${jpatest.2.common.plugins.dir}/${modelgen.jar}" property="modelgen.jar.exist"/>
- <available file="../../../extension.lib.external/${validation.impl.jar}" property="validate.jar.exist"/>
+ <available file="${jpatest.2.common.plugins.dir}/${validation-impl.jar}" property="validate.jar.exist"/>
<target name="set-server-properties">
<property file="${user.home}/${server.name}.properties"/>
@@ -394,7 +394,7 @@
<echo message=" '${jpatest.2.coretest.dir}/${coretest.jar}'"/>
<echo message=" '${jpatest.2.coretest.dir}/${coretest.framework.jar}'"/>
<echo message=" '${jpatest.2.jpa.plugins.dir}/${persistence20.jar}'"/>
- <echo message=" '${jpatest.2.common.plugins.dir}/${beanvalidation.jar}'"/>
+ <echo message=" '${jpatest.2.common.plugins.dir}/${javax.validation.jar}'"/>
<echo message=" '${jpatest.2.base.dir}/${eclipselink.jar}'"/>
<echo message=" '${jpatest.2.common.plugins.dir}/${ejb.jar}'"/>
<echo message=" '${jpatest.2.common.plugins.dir}/${transaction.jar}'"/>
@@ -409,7 +409,7 @@
<pathelement path="${jpatest.2.coretest.dir}/${coretest.jar}"/>
<pathelement path="${jpatest.2.coretest.dir}/${coretest.framework.jar}"/>
<pathelement path="${jpatest.2.jpa.plugins.dir}/${persistence20.jar}"/>
- <pathelement path="${jpatest.2.common.plugins.dir}/${beanvalidation.jar}"/>
+ <pathelement path="${jpatest.2.common.plugins.dir}/${javax.validation.jar}"/>
<pathelement path="${jpatest.2.base.dir}/${eclipselink.jar}"/>
<pathelement path="${jpatest.2.common.plugins.dir}/${ejb.jar}"/>
<pathelement path="${jpatest.2.common.plugins.dir}/${transaction.jar}"/>
@@ -432,7 +432,7 @@
<echo message=" '${jpatest.2.coretest.dir}/${coretest.jar}'"/>
<echo message=" '${jpatest.2.coretest.dir}/${coretest.framework.jar}'"/>
<echo message=" '${jpatest.2.jpa.plugins.dir}/${persistence21.jar}'"/>
- <echo message=" '${jpatest.2.common.plugins.dir}/${beanvalidation.jar}'"/>
+ <echo message=" '${jpatest.2.common.plugins.dir}/${javax.validation.jar}'"/>
<echo message=" '${jpatest.2.base.dir}/${eclipselink.jar}'"/>
<echo message=" '${jpatest.2.common.plugins.dir}/${ejb.jar}'"/>
<echo message=" '${jpatest.2.common.plugins.dir}/${transaction.jar}'"/>
@@ -446,7 +446,7 @@
<pathelement path="${jpatest.2.coretest.dir}/${coretest.jar}"/>
<pathelement path="${jpatest.2.coretest.dir}/${coretest.framework.jar}"/>
<pathelement path="${jpatest.2.jpa.plugins.dir}/${persistence21.jar}"/>
- <pathelement path="${jpatest.2.common.plugins.dir}/${beanvalidation.jar}"/>
+ <pathelement path="${jpatest.2.common.plugins.dir}/${javax.validation.jar}"/>
<pathelement path="${jpatest.2.base.dir}/${eclipselink.jar}"/>
<pathelement path="${jpatest.2.common.plugins.dir}/${ejb.jar}"/>
<pathelement path="${jpatest.2.common.plugins.dir}/${transaction.jar}"/>
@@ -1404,10 +1404,12 @@
</path>
<path id="run.bean.validation.classpath">
<path refid="run.classpath"/>
- <pathelement path="../../../extension.lib.external/${validation.impl.jar}"/>
- <pathelement path="../../../extension.lib.external/${slf4j.api.jar}"/>
- <pathelement path="../../../extension.lib.external/${slf4j.jdk.jar}"/>
- <pathelement path="../../../extension.lib.external/${validation.api.jar}"/>
+ <pathelement path="${jpatest.2.common.plugins.dir}/${validation-impl.jar}"/>
+ <pathelement path="${jpatest.2.common.plugins.dir}/${jboss-logging.jar}"/>
+ <pathelement path="${jpatest.2.common.plugins.dir}/${javax.el-api.jar}"/>
+ <pathelement path="${jpatest.2.common.plugins.dir}/${javax.el.jar}"/>
+ <pathelement path="${jpatest.2.common.plugins.dir}/${classmate.jar}"/>
+ <pathelement path="${jpatest.2.common.plugins.dir}/${javax.validation.jar}"/>
</path>
<path id="run.jpa21.classpath">
<pathelement path="${jpatest.basedir}/${classes21.dir}"/>
@@ -1573,7 +1575,7 @@
<antcall target="generate-report" inheritRefs="true"/>
</target>
- <!-- Runs JPA 2.0 BeanValidation tests, make sure you have validate jar which includes javax.validation.*, validate classes, slfj jdk and api classes under your classpath -->
+ <!-- Runs JPA 2.0 BeanValidation tests. -->
<target name="run-bean-validation-tests" depends="config-classpath" if="validate.jar.exist">
<antcall target="run-test" inheritRefs="true">
<param name="TEST_CLASS" value="org.eclipse.persistence.testing.tests.jpa.beanvalidation.BeanValidationJunitTest"/>
diff --git a/jpa/eclipselink.jpa.test/test.properties b/jpa/eclipselink.jpa.test/test.properties
index 0e75b74..37fd6a3 100644
--- a/jpa/eclipselink.jpa.test/test.properties
+++ b/jpa/eclipselink.jpa.test/test.properties
@@ -104,13 +104,13 @@ is.JTA=true
test.class=org.eclipse.persistence.testing.tests.jpa.FullRegressionTestSuite
# test.class=org.eclipse.persistence.testing.tests.jpa.advanced.EntityManagerJUnitTestSuite
# test.class=org.eclipse.persistence.testing.tests.jpa.AllCMP3TestRunModel
-
-# Test runner properties.
-run.dir=run
-report.dir=report
-# This is relative to the run directory.
-eclipselink.jar.run=../../../eclipselink.jar
-
+
+# Test runner properties.
+run.dir=run
+report.dir=reports
+# This is relative to the run directory.
+eclipselink.jar.run=../../../eclipselink.jar
+
# Server properties
# Valid values of server.name are weblogic, websphere, jboss, oc4j, glassfish ..., valid value of server.version will be 2 or 3 for glassfish...
# For jboss, server.version=eap means Enterprise Application Platform, if you don't put value for server.version, that means the default community version
diff --git a/moxy/eclipselink.moxy.test/antbuild.properties b/moxy/eclipselink.moxy.test/antbuild.properties
index fbc0fc1..6fce674 100644
--- a/moxy/eclipselink.moxy.test/antbuild.properties
+++ b/moxy/eclipselink.moxy.test/antbuild.properties
@@ -18,7 +18,7 @@ jaxb-core.jar=jaxb-core_2.2.11.v201406210428.jar
jaxb-impl.jar=com.sun.xml.bind_2.2.11.v201406210428.jar
javax.validation.jar=javax.validation_1.1.0.v201304101302.jar
-hibernate-validator.jar=hibernate-validator-5.1.0.Final.jar
+validation-impl.jar=hibernate-validator-5.1.0.Final.jar
# Required by the hibernate-validator.
jboss-logging.jar=jboss-logging-3.1.4.GA.jar
javax.el-api.jar=javax.el-api-2.2.jar
diff --git a/moxy/eclipselink.moxy.test/antbuild.xml b/moxy/eclipselink.moxy.test/antbuild.xml
index 3adae45..22d3823 100644
--- a/moxy/eclipselink.moxy.test/antbuild.xml
+++ b/moxy/eclipselink.moxy.test/antbuild.xml
@@ -85,7 +85,7 @@
<property name="jaxb-impl.lib" value="${moxytest.2.common.plugins.dir}/${jaxb-impl.jar}"/>
<property name="jaxb-core.lib" value="${moxytest.2.common.plugins.dir}/${jaxb-core.jar}"/>
<property name="javax.validation.lib" value="${moxytest.2.common.plugins.dir}/${javax.validation.jar}"/>
- <property name="hibernate-validator.lib" value="${moxytest.2.common.plugins.dir}/${hibernate-validator.jar}"/>
+ <property name="validation-impl.lib" value="${moxytest.2.common.plugins.dir}/${validation-impl.jar}"/>
<property name="jboss-logging.lib" value="${moxytest.2.common.plugins.dir}/${jboss-logging.jar}"/>
<property name="javax.el-api.lib" value="${moxytest.2.common.plugins.dir}/${javax.el-api.jar}"/>
<property name="javax.el.lib" value="${moxytest.2.common.plugins.dir}/${javax.el.jar}"/>
@@ -135,7 +135,7 @@
<pathelement path="${jaxb-xjc.lib}"/>
<pathelement path="${jaxb-impl.lib}"/>
<pathelement path="${jaxb-core.lib}"/>
- <pathelement path="${hibernate-validator.lib}"/>
+ <pathelement path="${validation-impl.lib}"/>
<pathelement path="${jboss-logging.lib}"/>
<pathelement path="${javax.el-api.lib}"/>
<pathelement path="${javax.el.lib}"/>
@@ -210,7 +210,7 @@
<pathelement path="${jaxb-impl.lib}"/>
<pathelement path="${jaxb-core.lib}"/>
<pathelement path="${javax.validation.lib}"/>
- <pathelement path="${hibernate-validator.lib}"/>
+ <pathelement path="${validation-impl.lib}"/>
<pathelement path="${jboss-logging.lib}"/>
<pathelement path="${javax.el-api.lib}"/>
<pathelement path="${javax.el.lib}"/>
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/BeanValidationRuntimeTestCase.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/BeanValidationRuntimeTestCase.java
index 9395056..d0dc9f4 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/BeanValidationRuntimeTestCase.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/BeanValidationRuntimeTestCase.java
@@ -64,7 +64,13 @@ public class BeanValidationRuntimeTestCase extends junit.framework.TestCase {
private static final File FILE_JSON_VALID = new File("org/eclipse/persistence/testing/jaxb/beanvalidation/rt/employee.json");
private static final File FILE_JSON_INVALID = new File("org/eclipse/persistence/testing/jaxb/beanvalidation/rt/employeeInvalid.json");
private static final Class[] EMPLOYEE = new Class[]{Employee.class};
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
+ private static final String JAVAX_VALIDATION_CONSTRAINTS_NOT_NULL_MESSAGE = "{javax.validation.constraints.NotNull.message}";
+ private static final String JAVAX_VALIDATION_CONSTRAINTS_MIN_MESSAGE = "{javax.validation.constraints.Min.message}";
+ private static final String JAVAX_VALIDATION_CONSTRAINTS_SIZE_MESSAGE = "{javax.validation.constraints.Size.message}";
+ private static final String JAVAX_VALIDATION_CONSTRAINTS_PATTERN_MESSAGE = "{javax.validation.constraints.Pattern.message}";
+ private static final String JAVAX_VALIDATION_CONSTRAINTS_FUTURE_MESSAGE = "{javax.validation.constraints.Future.message}";
+ private static final String JAVAX_VALIDATION_CONSTRAINTS_DIGITS_MESSAGE = "{javax.validation.constraints.Digits.message}";
private boolean toggle = true; // Value is sensitive to the order of methods in testBeanValidation() method.
private ValidatorFactory preferredValidatorFactory;
@@ -86,20 +92,20 @@ public class BeanValidationRuntimeTestCase extends junit.framework.TestCase {
.withDrivingLicense(new DrivingLicense(1234567, new GregorianCalendar(2010, 5, 20).getTime()));
private AbstractSequentialList<String> violationMessages = new LinkedList<String>(){ // Order is good just for debug. The CVs themselves aren't ordered.
{
- add("may not be null"); // id
- add("must be greater than or equal to 18"); // age
- add("size must be between 3 and 15"); // personalName
- add("must match \"\\(\\d{3}\\)\\d{3}-\\d{4}\""); // phoneNumber
- add("may not be null"); // department
- add("must be in the future"); // drivingLicense.validThrough
- add("numeric value out of bounds (<6 digits>.<0 digits> expected)"); // drivingLicense.id
+ add(JAVAX_VALIDATION_CONSTRAINTS_NOT_NULL_MESSAGE); // id
+ add(JAVAX_VALIDATION_CONSTRAINTS_MIN_MESSAGE); // age
+ add(JAVAX_VALIDATION_CONSTRAINTS_SIZE_MESSAGE); // personalName
+ add(JAVAX_VALIDATION_CONSTRAINTS_PATTERN_MESSAGE); // phoneNumber
+ add(JAVAX_VALIDATION_CONSTRAINTS_NOT_NULL_MESSAGE); // department
+ add(JAVAX_VALIDATION_CONSTRAINTS_FUTURE_MESSAGE); // drivingLicense.validThrough
+ add(JAVAX_VALIDATION_CONSTRAINTS_DIGITS_MESSAGE); // drivingLicense.id
}};
private AbstractSequentialList<String> violationMessagesWithoutGroup = new LinkedList<String>(){
{
- add("may not be null"); // id
- add("size must be between 3 and 15"); // personalName
- add("must match \"\\(\\d{3}\\)\\d{3}-\\d{4}\""); // phoneNumber
- add("may not be null"); // department
+ add(JAVAX_VALIDATION_CONSTRAINTS_NOT_NULL_MESSAGE); // id
+ add(JAVAX_VALIDATION_CONSTRAINTS_SIZE_MESSAGE); // personalName
+ add(JAVAX_VALIDATION_CONSTRAINTS_PATTERN_MESSAGE); // phoneNumber
+ add(JAVAX_VALIDATION_CONSTRAINTS_NOT_NULL_MESSAGE); // department
}};
@@ -176,8 +182,9 @@ public class BeanValidationRuntimeTestCase extends junit.framework.TestCase {
private void checkValidationMessages(Set<? extends ConstraintViolation<?>> constraintViolations, List<String> expectedMessages) {
List<String> violationMessages = new ArrayList<String>();
- for (ConstraintViolation<?> cv : constraintViolations)
- violationMessages.add(cv.getMessage());
+ for (final ConstraintViolation<?> cv : constraintViolations)
+ violationMessages.add(cv.getMessageTemplate());
+
assertSame(expectedMessages.size(), violationMessages.size());
assertTrue(violationMessages.containsAll(expectedMessages));
}
@@ -211,7 +218,7 @@ public class BeanValidationRuntimeTestCase extends junit.framework.TestCase {
marshallerValidOn = (JAXBMarshaller) ctx.createMarshaller();
marshallerValidOn.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshallerValidOff = (JAXBMarshaller) ctx.createMarshaller();
- marshallerValidOff.setProperty(UnmarshallerProperties.BEAN_VALIDATION_MODE, BeanValidationMode.NONE); // tests setting the property through mar
+ marshallerValidOff.setProperty(MarshallerProperties.BEAN_VALIDATION_MODE, BeanValidationMode.NONE); // tests setting the property through mar
marshallerValidOff.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
JAXBContext ctxValidationOff = JAXBContextFactory.createContext(EMPLOYEE,
@@ -236,5 +243,4 @@ public class BeanValidationRuntimeTestCase extends junit.framework.TestCase {
preferredValidatorFactory = null;
}
-
}
diff --git a/moxy/org.eclipse.persistence.moxy/antbuild.properties b/moxy/org.eclipse.persistence.moxy/antbuild.properties
index 0713c9d..80d1bef 100644
--- a/moxy/org.eclipse.persistence.moxy/antbuild.properties
+++ b/moxy/org.eclipse.persistence.moxy/antbuild.properties
@@ -20,9 +20,9 @@ src.dir=src
moxy.plugins=../plugins
asm=org.eclipse.persistence.asm
-
-# for dependencies found it trunk/plugins (global plugins) dir
-persistence20.jar=javax.persistence_2.0.6.v201308211412.jar
+
+# for dependencies found it trunk/plugins (global plugins) dir
+persistence20.jar=javax.persistence_2.0.6.v201308211412.jar
persistence10.jar=javax.persistence_1.0.0.v200905011740.jar
unsigned.persistence10.jar=javax.persistence_unsigned_for_testing_1.0.0.jar
jaxb-api.jar=javax.xml.bind_2.2.0.v201105210648.jar
@@ -37,8 +37,8 @@ javax.validation.src.jar=javax.validation_1.1.0.Final-sources.jar
commonj.sdo.jar=commonj.sdo_2.1.1.v201112051852.jar
commonj.sdo.src.zip=commonj.sdo.source_2.1.1.v201112051852.jar
wsdl.jar=javax.wsdl_1.6.2.v201012040545.jar
-resource.jar=javax.resource_1.6.0.v201204270900.jar
-ejb3.jar=javax.ejb_3.0.0.v200906010428.jar
+resource.jar=javax.resource_1.6.0.v201204270900.jar
+ejb3.jar=javax.ejb_3.0.0.v200906010428.jar
jms.jar=javax.jms_1.1.0.v200906010428.jar
transaction.jar=javax.transaction_1.1.0.v201002051055.jar
@@ -46,4 +46,4 @@ eclipselink.global.depend=${activation.jar},${resource.jar},${ejb3.jar},${jms.ja
bin.includes = .,\
META-INF/
-source.. = src/
+source.. = src/
diff --git a/utils/eclipselink.dbws.builder.test/antbuild.properties b/utils/eclipselink.dbws.builder.test/antbuild.properties
index 56ef50b..faa2312 100644
--- a/utils/eclipselink.dbws.builder.test/antbuild.properties
+++ b/utils/eclipselink.dbws.builder.test/antbuild.properties
@@ -42,6 +42,7 @@ wsdl.prefix=javax.wsdl
activation.prefix=javax.activation
mail.prefix=javax.mail
soap.prefix=javax.xml.soap
+javax.validation.jar=javax.validation_1.1.0.v201304101302.jar
# Upper limit 5.0.0 simply to allow room, could be 10.0
# Will find latest checked in version (as long as lower than upper limit).
diff --git a/utils/eclipselink.dbws.builder.test/antbuild.xml b/utils/eclipselink.dbws.builder.test/antbuild.xml
index ee460ae..7691df7 100644
--- a/utils/eclipselink.dbws.builder.test/antbuild.xml
+++ b/utils/eclipselink.dbws.builder.test/antbuild.xml
@@ -140,6 +140,7 @@
<property name="ddlparser.lib" value="${dbwsbldrtest.2.plugins.dir}/${ddlparser.jar}"/>
<property name="wsdl.lib" value="${dbwsbldrtest.2.plugins.dir}/${wsdl.jar}"/>
<property name="persistence.lib" value="${dbwsbldrtest.2.common.plugins.dir}/${persistence.jar}"/>
+ <property name="javax.validation.lib" value="${dbwsbldrtest.2.common.plugins.dir}/${javax.validation.jar}"/>
<!-- dependency tests -->
<available file="${junit.lib}" property="junit.lib.exist"/>
@@ -150,6 +151,7 @@
<available file="${wsdl.lib}" property="wsdl.lib.exist"/>
<available file="${ddlparser.lib}" property="ddlparser.lib.exist"/>
<available file="${dbwsbldr.lib}" property="dbwsbldr.lib.exist"/>
+ <available file="${javax.validation.lib}" property="javax.validation.lib.exist"/>
<fail message="Cannot find: '${junit.lib}'" unless="junit.lib.exist"/>
<fail message="Cannot find: '${eclipselink.lib}'" unless="eclipselink.exist"/>
<fail message="Cannot find: '${persistence.lib}'" unless="persistence.exist"/>
@@ -158,6 +160,7 @@
<fail message="Cannot find: '${wsdl.lib}'" unless="wsdl.lib.exist"/>
<fail message="Cannot find: '${ddlparser.lib}'" unless="ddlparser.lib.exist"/>
<fail message="Cannot find: '${dbwsbldr.lib}'" unless="dbwsbldr.lib.exist"/>
+ <fail message="Cannot find: '${javax.validation.lib}'" unless="javax.validation.lib.exist"/>
<!-- Set Compile Path -->
<path id="dbwsbldrtest.compile.path">
@@ -198,6 +201,7 @@
<pathelement path="./${dbwsbldrtest.jar}"/>
<pathelement path="${activation.lib}"/>
<pathelement path="${mail.lib}"/>
+ <pathelement path="${javax.validation.lib}"/>
</path>
<!-- Set Run Condition -->