aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vojtek2014-07-20 12:58:37 (EDT)
committerTomas Kraus2014-07-23 05:48:44 (EDT)
commit8ce90900b5aef659f7037063fc6b5aafaeba2b18 (patch)
treeca2df91a4c0ed27d0143460e9e25433093097458
parent7712b99d7d02d5b7132f8afb21d136379a2af85a (diff)
downloadeclipselink.runtime-8ce90900b5aef659f7037063fc6b5aafaeba2b18.zip
eclipselink.runtime-8ce90900b5aef659f7037063fc6b5aafaeba2b18.tar.gz
eclipselink.runtime-8ce90900b5aef659f7037063fc6b5aafaeba2b18.tar.bz2
Fixed JDK7 MOXy tests.
Signed-off-by: Martin Vojtek <martin.vojtek@oracle.com>
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/Employee.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/classlevel/upper/Employee.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/upper/Employee.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/rt_dom/DrivingLicense.java4
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/EmployeeNoWrapper.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee_B.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnametransformer/Employee.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/javadoc/xmlschematype/USPrice.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/XMLMappingTestCases.java42
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directcollection/Employee.java65
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directtofield/leafelement/Employee.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/typeddirect/TestObject.java72
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DatatypeEmployee.java14
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DateAndTimeTestCases.java388
15 files changed, 425 insertions, 376 deletions
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/Employee.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/Employee.java
index 4cf95cf..b5a65df 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/Employee.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/Employee.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -49,13 +49,13 @@ public class Employee
public boolean equals(Object object) {
Employee emp = ((Employee)object);
if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age))
- {
- return false;
- }
- if(!(emp.birthday.equals(this.birthday)))
- {
- return false;
- }
+ {
+ return false;
+ }
+ if(!(emp.birthday.getTimeInMillis() == (this.birthday.getTimeInMillis())))
+ {
+ return false;
+ }
if((emp.responsibilities == null) && (this.responsibilities != null))
{
return false;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/classlevel/upper/Employee.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/classlevel/upper/Employee.java
index 8c63182..2209ded 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/classlevel/upper/Employee.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/classlevel/upper/Employee.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -54,13 +54,13 @@ public class Employee {
public boolean equals(Object object) {
Employee emp = ((Employee)object);
- if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age)){
- return false;
- }
- if(!(emp.birthday.equals(this.birthday))){
- return false;
- }
- if((emp.responsibilities == null) && (this.responsibilities != null)){
+ if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age)){
+ return false;
+ }
+ if(!(emp.birthday.getTimeInMillis() == this.birthday.getTimeInMillis())){
+ return false;
+ }
+ if((emp.responsibilities == null) && (this.responsibilities != null)){
return false;
}
if((this.responsibilities == null) && (emp.responsibilities != null)){
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/upper/Employee.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/upper/Employee.java
index 122ebe3..146c6df 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/upper/Employee.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnametransformer/upper/Employee.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -51,13 +51,13 @@ public class Employee {
public boolean equals(Object object) {
Employee emp = ((Employee)object);
- if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age)){
- return false;
- }
- if(!(emp.birthday.equals(this.birthday))){
- return false;
- }
- if((emp.responsibilities == null) && (this.responsibilities != null)){
+ if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age)){
+ return false;
+ }
+ if(!(emp.birthday.getTimeInMillis() == this.birthday.getTimeInMillis())){
+ return false;
+ }
+ if((emp.responsibilities == null) && (this.responsibilities != null)){
return false;
}
if((this.responsibilities == null) && (emp.responsibilities != null)){
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/rt_dom/DrivingLicense.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/rt_dom/DrivingLicense.java
index f1cd9a1..24ca414 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/rt_dom/DrivingLicense.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/beanvalidation/rt_dom/DrivingLicense.java
@@ -53,7 +53,9 @@ public class DrivingLicense {
if (id != that.id) {
return false;
}
- if (validThrough != null ? !validThrough.equals(that.validThrough) : that.validThrough != null) {
+ if (validThrough != null && that.validThrough != null && !(validThrough.getTime() == that.validThrough.getTime())) {
+ return false;
+ } else if ((validThrough == null && that.validThrough != null) || (validThrough != null && that.validThrough == null)) {
return false;
}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee.java
index 6936da6..138f284 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -58,13 +58,13 @@ public class Employee
public boolean equals(Object object) {
Employee emp = ((Employee)object);
if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age))
- {
- return false;
- }
- if(!(emp.birthday.equals(this.birthday)))
- {
- return false;
- }
+ {
+ return false;
+ }
+ if(!(emp.birthday.getTimeInMillis() == this.birthday.getTimeInMillis()))
+ {
+ return false;
+ }
if((emp.responsibilities == null) && (this.responsibilities != null))
{
return false;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/EmployeeNoWrapper.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/EmployeeNoWrapper.java
index 3163d0f..a83bf3f 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/EmployeeNoWrapper.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/EmployeeNoWrapper.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -56,13 +56,13 @@ public class EmployeeNoWrapper
public boolean equals(Object object) {
EmployeeNoWrapper emp = ((EmployeeNoWrapper)object);
if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age))
- {
- return false;
- }
- if(!(emp.birthday.equals(this.birthday)))
- {
- return false;
- }
+ {
+ return false;
+ }
+ if(!(emp.birthday.getTimeInMillis() == this.birthday.getTimeInMillis()))
+ {
+ return false;
+ }
if((emp.responsibilities == null) && (this.responsibilities != null))
{
return false;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee_B.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee_B.java
index d0e9994..4d61e20 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee_B.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/employee/Employee_B.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -57,13 +57,13 @@ public class Employee_B
public boolean equals(Object object) {
Employee_B emp = ((Employee_B)object);
if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age))
- {
- return false;
- }
- if(!(emp.birthday.equals(this.birthday)))
- {
- return false;
- }
+ {
+ return false;
+ }
+ if(!(emp.birthday.getTimeInMillis() == this.birthday.getTimeInMillis()))
+ {
+ return false;
+ }
if((emp.responsibilities == null) && (this.responsibilities != null))
{
return false;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnametransformer/Employee.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnametransformer/Employee.java
index df2f6ee..271c9ce 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnametransformer/Employee.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnametransformer/Employee.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -54,13 +54,13 @@ public class Employee {
public boolean equals(Object object) {
Employee emp = ((Employee)object);
- if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age)){
- return false;
- }
- if(!(emp.birthday.equals(this.birthday))){
- return false;
- }
- if((emp.responsibilities == null) && (this.responsibilities != null)){
+ if((emp.id != this.id) ||(!(emp.firstName.equals(this.firstName))) || (!(emp.lastName.equals(this.lastName))) ||(emp.age != this.age)){
+ return false;
+ }
+ if (!(emp.birthday.getTimeInMillis() == this.birthday.getTimeInMillis())) {
+ return false;
+ }
+ if((emp.responsibilities == null) && (this.responsibilities != null)){
return false;
}
if((this.responsibilities == null) && (emp.responsibilities != null)){
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/javadoc/xmlschematype/USPrice.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/javadoc/xmlschematype/USPrice.java
index ec3556a..4c4e017 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/javadoc/xmlschematype/USPrice.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/javadoc/xmlschematype/USPrice.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -24,13 +24,13 @@ public class USPrice {
public Calendar date;
public boolean equals(Object o) {
- if(!(o instanceof USPrice) || o == null) {
- return false;
- } else {
- return ((USPrice)o).date.equals(this.date);
- }
- }
-
+ if(!(o instanceof USPrice) || o == null) {
+ return false;
+ } else {
+ return ((USPrice) o).date.getTimeInMillis() == this.date.getTimeInMillis();
+ }
+ }
+
public String toString() {
return "USPRICE(" + date + ")";
}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/XMLMappingTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/XMLMappingTestCases.java
index 7d86dca..6ce7e2a 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/XMLMappingTestCases.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/XMLMappingTestCases.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -14,12 +14,14 @@ package org.eclipse.persistence.testing.oxm.mappings;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.SAXParser;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.Calendar;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLEventWriter;
@@ -274,13 +276,17 @@ public abstract class XMLMappingTestCases extends OXTestCase {
}
}
- public static void compareXMLRootObjects(XMLRoot controlObj, XMLRoot testObj) {
- assertEquals(controlObj.getLocalName(), testObj.getLocalName());
- assertEquals(controlObj.getNamespaceURI(), testObj.getNamespaceURI());
- assertEquals(controlObj.getObject(), testObj.getObject());
- assertEquals(controlObj.getSchemaType(), testObj.getSchemaType());
- }
-
+ public static void compareXMLRootObjects(XMLRoot controlObj, XMLRoot testObj) {
+ assertEquals(controlObj.getLocalName(), testObj.getLocalName());
+ assertEquals(controlObj.getNamespaceURI(), testObj.getNamespaceURI());
+ if (null != controlObj.getObject() && null != testObj.getObject() && controlObj.getObject() instanceof java.util.Calendar && testObj.getObject() instanceof java.util.Calendar) {
+ assertTrue(((Calendar)controlObj.getObject()).getTimeInMillis() == ((Calendar)testObj.getObject()).getTimeInMillis());
+ } else {
+ assertEquals(controlObj.getObject(), testObj.getObject());
+ }
+ assertEquals(controlObj.getSchemaType(), testObj.getSchemaType());
+ }
+
public void objectToXMLDocumentTest(Document testDocument) throws Exception {
log("**objectToXMLDocumentTest**");
log("Expected:");
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directcollection/Employee.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directcollection/Employee.java
index cb2a2a6..b890179 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directcollection/Employee.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directcollection/Employee.java
@@ -1,20 +1,21 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Oracle - initial API and implementation from Oracle TopLink
- ******************************************************************************/
-package org.eclipse.persistence.testing.oxm.mappings.directcollection;
-
-import java.util.Vector;
-
-public class Employee {
+ ******************************************************************************/
+package org.eclipse.persistence.testing.oxm.mappings.directcollection;
+
+import java.util.Calendar;
+import java.util.Vector;
+
+public class Employee {
private int id;
private Vector responsibilities;
@@ -91,14 +92,34 @@ public class Employee {
{
return false;
}
-
-
- if((this.getID() == employeeObject.getID()) &&
- ((this.getResponsibilities()==null && employeeObject.getResponsibilities()==null) ||(this.getResponsibilities().isEmpty() && employeeObject.getResponsibilities().isEmpty()) || (this.getResponsibilities().containsAll(employeeObject.getResponsibilities()))) &&
- ((this.getOutdoorResponsibilities()==null && employeeObject.getOutdoorResponsibilities()==null) ||(this.getOutdoorResponsibilities().isEmpty() && employeeObject.getOutdoorResponsibilities().isEmpty())|| (this.getOutdoorResponsibilities().containsAll(employeeObject.getOutdoorResponsibilities())))
- )
- return true;
-
- return false;
- }
-}
+
+
+ if((this.getID() == employeeObject.getID()) &&
+ ((this.getResponsibilities()==null && employeeObject.getResponsibilities()==null) ||(this.getResponsibilities().isEmpty() && employeeObject.getResponsibilities().isEmpty()) || (fixCalendar(this.getResponsibilities()).containsAll((fixCalendar(employeeObject.getResponsibilities()))))) &&
+ ((this.getOutdoorResponsibilities()==null && employeeObject.getOutdoorResponsibilities()==null) ||(this.getOutdoorResponsibilities().isEmpty() && employeeObject.getOutdoorResponsibilities().isEmpty())|| (fixCalendar(this.getOutdoorResponsibilities()).containsAll(fixCalendar(employeeObject.getOutdoorResponsibilities()))))
+ )
+ return true;
+
+ return false;
+ }
+
+ private Vector fixCalendar(Vector v) {
+
+ if (null == v) {
+ return null;
+ }
+
+ Vector result = new Vector();
+ for (Object item : v) {
+ if (null != item && item instanceof java.util.Calendar) {
+ Calendar normalizedCalendar = Calendar.getInstance();
+ normalizedCalendar.setTimeInMillis(((Calendar)item).getTimeInMillis());
+ result.add(normalizedCalendar);
+ } else {
+ result.add(item);
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directtofield/leafelement/Employee.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directtofield/leafelement/Employee.java
index e11b92d..c6adb53 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directtofield/leafelement/Employee.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/directtofield/leafelement/Employee.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
-* Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
-* which accompanies this distribution.
+/*******************************************************************************
+* Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -72,13 +72,13 @@ public class Employee {
.getLastName().equals(employee.getLastName()))) {
return false;
}
-
- if((this.getBirthdate()!=null && ((Employee)object).getBirthdate()==null)||
- (this.getBirthdate()==null && ((Employee)object).getBirthdate()!=null)||
- (!(this.getBirthdate().equals(((Employee)object).getBirthdate())))){
- return false;
- }
- return true;
+
+ if((this.getBirthdate()!=null && ((Employee)object).getBirthdate()==null)||
+ (this.getBirthdate()==null && ((Employee)object).getBirthdate()!=null)||
+ (!(this.getBirthdate().getTimeInMillis() == ((Employee)object).getBirthdate().getTimeInMillis()))){
+ return false;
+ }
+ return true;
} catch (ClassCastException e) {
return false;
}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/typeddirect/TestObject.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/typeddirect/TestObject.java
index 324acfc..8a71d8e 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/typeddirect/TestObject.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/mappings/typeddirect/TestObject.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -186,22 +186,22 @@ public class TestObject {
TestObject aTestObject = (TestObject) anObject;
boolean equal = true;
- equal = equal && equalByteArrays(aTestObject.getBase64(), this.getBase64());
- equal = equal && equalByteArrays(aTestObject.getHex(), this.getHex());
-
- equal = equal && (aTestObject.getDate().equals(this.getDate()));
- equal = equal && (aTestObject.getTime().equals(this.getTime()));
- equal = equal && (aTestObject.getDateTime().equals(this.getDateTime()));
-
- equal = equal && equalByteArrayVectors(aTestObject.getBase64Vector(), this.getBase64Vector());
- equal = equal && equalByteArrayVectors(aTestObject.getHexVector(), this.getHexVector());
-
- equal = equal && (aTestObject.getDateVector().equals(this.getDateVector()));
- equal = equal && (aTestObject.getTimeVector().equals(this.getTimeVector()));
- equal = equal && (aTestObject.getDateTimeVector().equals(this.getDateTimeVector()));
-
- equal = equal && (aTestObject.getTypedDate().equals(this.getTypedDate()));
- equal = equal && (aTestObject.getUntypedDate().equals(this.getUntypedDate()));
+ equal = equal && equalByteArrays(aTestObject.getBase64(), this.getBase64());
+ equal = equal && equalByteArrays(aTestObject.getHex(), this.getHex());
+
+ equal = equal && (aTestObject.getDate().getTimeInMillis() == this.getDate().getTimeInMillis());
+ equal = equal && (aTestObject.getTime().getTimeInMillis() == this.getTime().getTimeInMillis());
+ equal = equal && (aTestObject.getDateTime().getTimeInMillis() == this.getDateTime().getTimeInMillis());
+
+ equal = equal && equalByteArrayVectors(aTestObject.getBase64Vector(), this.getBase64Vector());
+ equal = equal && equalByteArrayVectors(aTestObject.getHexVector(), this.getHexVector());
+
+ equal = equal && (fixCalendar(aTestObject.getDateVector()).equals(fixCalendar(this.getDateVector())));
+ equal = equal && (fixCalendar(aTestObject.getTimeVector()).equals(fixCalendar(this.getTimeVector())));
+ equal = equal && (fixCalendar(aTestObject.getDateTimeVector()).equals(fixCalendar(this.getDateTimeVector())));
+
+ equal = equal && (aTestObject.getTypedDate().equals(this.getTypedDate()));
+ equal = equal && (aTestObject.getUntypedDate().equals(this.getUntypedDate()));
equal = equal && (aTestObject.getTypedSqlDate().equals(this.getTypedSqlDate()));
equal = equal && (aTestObject.getUntypedSqlDate().equals(this.getUntypedSqlDate()));
equal = equal && (aTestObject.getTypedTimestamp().equals(this.getTypedTimestamp()));
@@ -236,8 +236,28 @@ public class TestObject {
return false;
}
}
-
- return true;
- }
-
-}
+
+ return true;
+ }
+
+ private Vector fixCalendar(Vector v) {
+
+ if (null == v) {
+ return null;
+ }
+
+ Vector result = new Vector();
+ for (Object item : v) {
+ if (null != item && item instanceof java.util.Calendar) {
+ Calendar normalizedCalendar = Calendar.getInstance();
+ normalizedCalendar.setTimeInMillis(((Calendar)item).getTimeInMillis());
+ result.add(normalizedCalendar);
+ } else {
+ result.add(item);
+ }
+ }
+
+ return result;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DatatypeEmployee.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DatatypeEmployee.java
index 8ddf001..02229f1 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DatatypeEmployee.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DatatypeEmployee.java
@@ -31,13 +31,13 @@ public class DatatypeEmployee {
return false;
}
if (test.deptNumber != this.deptNumber) {
- System.err.println("deptNumber NOT EQUAL");
- return false;
- }
- if (!test.birthDate.equals(this.birthDate)) {
- System.out.println("TEST:");
- System.out.println(test.birthDate);
- System.out.println("\nCTRL:");
+ System.err.println("deptNumber NOT EQUAL");
+ return false;
+ }
+ if (!(test.birthDate.getTimeInMillis() == this.birthDate.getTimeInMillis())) {
+ System.out.println("TEST:");
+ System.out.println(test.birthDate);
+ System.out.println("\nCTRL:");
System.out.println(this.birthDate);
return false;
}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DateAndTimeTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DateAndTimeTestCases.java
index 44ddb7a..390f714 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DateAndTimeTestCases.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/xmlconversionmanager/DateAndTimeTestCases.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -3101,49 +3101,49 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_default_dateTime() {
String string = " \t 1975-02-21T07:47:15 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_0MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_dateTime_0ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_0MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_dateTime_0ms() {
String string = " \t 1975-02-21T07:47:15 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_0MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_dateTime_1ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_0MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_dateTime_1ms() {
String string = " \t 1975-02-21T07:47:15.001 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_1MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_dateTime_10ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_1MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_dateTime_10ms() {
String string = " \t 1975-02-21T07:47:15.01 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_10MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_dateTime_100ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_10MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_dateTime_100ms() {
String string = " \t 1975-02-21T07:47:15.1 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_100MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_date_null() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_100MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_date_null() {
String string = null;
Calendar control = null;
java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
@@ -3153,13 +3153,13 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_default_date() {
String string = " \t 1975-02-21 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_time_null() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_time_null() {
String string = null;
Calendar control = null;
java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
@@ -3169,49 +3169,49 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_default_time() {
String string = " \t 07:47:15 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_0MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_time_0ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_0MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_time_0ms() {
String string = " \t 07:47:15 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_0MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_time_1ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_0MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_time_1ms() {
String string = " \t 07:47:15.001 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_1MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_time_10ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_1MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_time_10ms() {
String string = " \t 07:47:15.01 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_10MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_default_time_100ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_10MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_default_time_100ms() {
String string = " \t 07:47:15.1 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_100MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_date_null() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_100MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_date_null() {
String string = null;
Calendar control = null;
java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_QNAME);
@@ -3221,13 +3221,13 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_date() {
String string = " \t 1975-02-21 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_date_negative1() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_date_negative1() {
try {
String string = "1975-02-21T07:47:15";
xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_QNAME);
@@ -3268,49 +3268,49 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_dateTime() {
String string = " \t 1975-02-21T07:47:15 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_0MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_dateTime_0ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_0MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_dateTime_0ms() {
String string = " \t 1975-02-21T07:47:15 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_0MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_dateTime_1ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_0MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_dateTime_1ms() {
String string = " \t 1975-02-21T07:47:15.001 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_1MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_dateTime_10ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_1MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_dateTime_10ms() {
String string = " \t 1975-02-21T07:47:15.01 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_10MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_dateTime_100ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_10MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_dateTime_100ms() {
String string = " \t 1975-02-21T07:47:15.1 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_DATE_TIME_100MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_dateTime_negative1() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_DATE_TIME_100MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_dateTime_negative1() {
try {
String string = "1975-02-21";
xcm.convertObject(string, java.util.Calendar.class, XMLConstants.DATE_TIME_QNAME);
@@ -3362,49 +3362,49 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_time() {
String string = " \t 07:47:15 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_0MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_time_0ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_0MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_time_0ms() {
String string = " \t 07:47:15 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_0MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_time_1ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_0MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_time_1ms() {
String string = " \t 07:47:15.001 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_1MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_time_10ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_1MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_time_10ms() {
String string = " \t 07:47:15.01 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_10MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_time_100ms() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_10MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_time_100ms() {
String string = " \t 07:47:15.1 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_TIME_100MS);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_time_negative1() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_TIME_100MS);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_time_negative1() {
try {
String string = "1975-02-21";
xcm.convertObject(string, java.util.Calendar.class, XMLConstants.TIME_QNAME);
@@ -3445,13 +3445,13 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_gDay() {
String string = " \t ---21 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_G_DAY);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_DAY_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_gDay_negative1() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_G_DAY);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_DAY_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_gDay_negative1() {
try {
String string = "INVALID";
xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_DAY_QNAME);
@@ -3472,13 +3472,13 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_gMonth() {
String string = " \t --02 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_G_MONTH);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_MONTH_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_gMonth_negative1() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_G_MONTH);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_MONTH_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_gMonth_negative1() {
try {
String string = "INVALID";
xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_MONTH_QNAME);
@@ -3499,13 +3499,13 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_gMonthDay() {
String string = " \t --02-21 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_G_MONTH_DAY);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_MONTH_DAY_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_gMonthDay_negative1() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_G_MONTH_DAY);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_MONTH_DAY_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_gMonthDay_negative1() {
try {
String string = "INVALID";
xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_MONTH_DAY_QNAME);
@@ -3526,13 +3526,13 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_gYear() {
String string = " \t 1975 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_G_YEAR);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_YEAR_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_gYear_negative1() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_G_YEAR);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_YEAR_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_gYear_negative1() {
try {
String string = "INVALID";
xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_YEAR_QNAME);
@@ -3553,13 +3553,13 @@ public class DateAndTimeTestCases extends OXTestCase {
public void testStringToCalendar_gYearMonth() {
String string = " \t 1975-02 \t ";
Calendar control = Calendar.getInstance();
- control.clear();
- control.setTimeInMillis(CONTROL_G_YEAR_MONTH);
- java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_YEAR_MONTH_QNAME);
- this.assertEquals(control, test);
- }
-
- public void testStringToCalendar_gYearMonth_negative1() {
+ control.clear();
+ control.setTimeInMillis(CONTROL_G_YEAR_MONTH);
+ java.util.Calendar test = (java.util.Calendar)xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_YEAR_MONTH_QNAME);
+ this.assertTrue(control.getTimeInMillis() == test.getTimeInMillis());
+ }
+
+ public void testStringToCalendar_gYearMonth_negative1() {
try {
String string = "INVALID";
xcm.convertObject(string, java.util.Calendar.class, XMLConstants.G_YEAR_MONTH_QNAME);