|
Line 0
Link Here
|
|
|
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved. |
| 3 |
* This program and the accompanying materials are made available under the |
| 4 |
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 |
| 5 |
* which accompanies this distribution. |
| 6 |
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| 7 |
* and the Eclipse Distribution License is available at |
| 8 |
* http://www.eclipse.org/org/documents/edl-v10.php. |
| 9 |
* |
| 10 |
* Contributors: |
| 11 |
* Matt MacIvor - 2.4 - initial implementation |
| 12 |
******************************************************************************/ |
| 13 |
package org.eclipse.persistence.testing.jaxb.annotations.xmlinversereference; |
| 14 |
|
| 15 |
import java.util.ArrayList; |
| 16 |
|
| 17 |
import org.eclipse.persistence.testing.jaxb.JAXBWithJSONTestCases; |
| 18 |
|
| 19 |
public class InverseReferenceWithRefTestCases extends JAXBWithJSONTestCases { |
| 20 |
private static final String XML_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlinversereference/parent.xml"; |
| 21 |
private static final String JSON_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlinversereference/parent.json"; |
| 22 |
|
| 23 |
public InverseReferenceWithRefTestCases(String name) throws Exception { |
| 24 |
super(name); |
| 25 |
setClasses(new Class[]{ Parent.class, Child.class, ChildSubclass.class }); |
| 26 |
setControlDocument(XML_RESOURCE); |
| 27 |
setControlJSON(JSON_RESOURCE); |
| 28 |
} |
| 29 |
|
| 30 |
public Object getControlObject() { |
| 31 |
Parent parent = new Parent(); |
| 32 |
parent.children = new ArrayList<Child>(); |
| 33 |
|
| 34 |
Child child = new Child(); |
| 35 |
child.parent = parent; |
| 36 |
parent.children.add(child); |
| 37 |
|
| 38 |
child = new ChildSubclass(); |
| 39 |
child.parent = parent; |
| 40 |
parent.children.add(child); |
| 41 |
|
| 42 |
return parent; |
| 43 |
|
| 44 |
} |
| 45 |
} |