forked from eclipse-ee4j/eclipselink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[master] Maven build (MOXy) - JMockit dependency removal (eclipse-ee4…
…j#1109) Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
- Loading branch information
Showing
22 changed files
with
669 additions
and
821 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...c/test/java/org/eclipse/persistence/testing/jaxb/annotations/xmlidref/OwnerIntegerId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2021 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 v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, | ||
* or the Eclipse Distribution License v. 1.0 which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
*/ | ||
|
||
// Contributors: | ||
// Oracle - initial API and implementation | ||
package org.eclipse.persistence.testing.jaxb.annotations.xmlidref; | ||
|
||
import jakarta.xml.bind.annotation.XmlIDREF; | ||
import jakarta.xml.bind.annotation.XmlRootElement; | ||
|
||
@XmlRootElement(name = "owner") | ||
public class OwnerIntegerId { | ||
|
||
@XmlIDREF | ||
public ThingIntegerId m_calendar; | ||
|
||
public String m_activityId; | ||
|
||
public boolean equals(Object obj){ | ||
if(obj instanceof OwnerIntegerId){ | ||
OwnerIntegerId ownerObject = (OwnerIntegerId)obj; | ||
if(!this.m_activityId.equals(ownerObject.m_activityId)){ | ||
return false; | ||
} | ||
if(m_calendar == null){ | ||
return ownerObject.m_calendar ==null; | ||
}else{ | ||
return m_calendar.equals(ownerObject.m_calendar); | ||
} | ||
} | ||
return false; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...c/test/java/org/eclipse/persistence/testing/jaxb/annotations/xmlidref/ThingIntegerId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2021 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 v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, | ||
* or the Eclipse Distribution License v. 1.0 which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
*/ | ||
|
||
// Contributors: | ||
// Oracle - initial API and implementation | ||
package org.eclipse.persistence.testing.jaxb.annotations.xmlidref; | ||
|
||
import jakarta.xml.bind.annotation.XmlID; | ||
import jakarta.xml.bind.annotation.XmlRootElement; | ||
|
||
@XmlRootElement | ||
public class ThingIntegerId extends BaseThing { | ||
|
||
@XmlID | ||
public Integer m_calendarId; | ||
|
||
public boolean equals(Object obj) { | ||
if(obj instanceof ThingIntegerId){ | ||
return m_calendarId.equals(((ThingIntegerId)obj).m_calendarId); | ||
} | ||
return false; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
.../persistence/testing/jaxb/annotations/xmlidref/XmlIdSystemPropertyNonDefaultTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2014, 2021 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 v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, | ||
* or the Eclipse Distribution License v. 1.0 which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
*/ | ||
|
||
// Contributors: | ||
// Oracle - initial API and implementation | ||
package org.eclipse.persistence.testing.jaxb.annotations.xmlidref; | ||
|
||
import org.eclipse.persistence.jaxb.MOXySystemProperties; | ||
import org.eclipse.persistence.testing.jaxb.JAXBWithJSONTestCases; | ||
|
||
/** | ||
* Tests verify, that marshalling/unmarshalling works for field with @XmlID annotation if type is different, than String and system property org.eclipse.persistence.moxy.annotation.xml-id-extension is set. | ||
*/ | ||
public class XmlIdSystemPropertyNonDefaultTestCase extends JAXBWithJSONTestCases { | ||
|
||
private static final String XML_RESOURCE="org/eclipse/persistence/testing/jaxb/annotations/xmlidref/missing_id.xml"; | ||
private static final String JSON_RESOURCE="org/eclipse/persistence/testing/jaxb/annotations/xmlidref/missing_id_integer_id.json"; | ||
|
||
static { | ||
System.setProperty(MOXySystemProperties.XML_ID_EXTENSION, "true"); | ||
} | ||
|
||
public XmlIdSystemPropertyNonDefaultTestCase(String name) throws Exception { | ||
super(name); | ||
setClasses(new Class[]{OwnerIntegerId.class, ThingIntegerId.class}); | ||
setControlDocument(XML_RESOURCE); | ||
setControlJSON(JSON_RESOURCE); | ||
} | ||
|
||
@Override | ||
protected Object getControlObject() { | ||
OwnerIntegerId owner = new OwnerIntegerId(); | ||
owner.m_activityId = "1"; | ||
ThingIntegerId theThing = new ThingIntegerId(); | ||
theThing.m_calendarId = 2; | ||
owner.m_calendar = theThing; | ||
return owner; | ||
} | ||
|
||
@Override | ||
public Object getReadControlObject() { | ||
OwnerIntegerId owner = new OwnerIntegerId(); | ||
owner.m_activityId = "1"; | ||
owner.m_calendar = null; | ||
return owner; | ||
} | ||
|
||
//Not applicable | ||
public void testRoundTrip() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.