View | Details | Raw Unified | Return to bug 268592 | Differences between
and this patch

Collapse All | Expand All

(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/ChangeSummary.xsd (+18 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdo="commonj.sdo"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="ChangeSummaryA">
12
        <xsd:sequence>
13
            <xsd:element name="property1" type="xsd:string"/>
14
            <xsd:element name="changes" type="sdo:ChangeSummaryType" minOccurs="0"/>
15
        </xsd:sequence>
16
    </xsd:complexType>
17
18
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataType.xsd (+30 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="NonDataTypeC">
12
        <xsd:sequence>
13
            <xsd:element name="property" type="xsd:string"/>
14
        </xsd:sequence>
15
    </xsd:complexType>
16
17
    <xsd:complexType name="NonDataTypeA">
18
        <xsd:sequence>
19
            <xsd:element name="b" type="NonDataTypeB"/>
20
            <xsd:element name="c" type="NonDataTypeC"/>
21
        </xsd:sequence>
22
    </xsd:complexType>
23
24
    <xsd:complexType name="NonDataTypeB">
25
        <xsd:sequence>
26
            <xsd:element name="property" type="xsd:string"/>
27
        </xsd:sequence>
28
    </xsd:complexType>
29
30
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/Inheritance.xsd (+37 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.com" xmlns:sdox="commonj.sdo/xml" xmlns:sdoj="commonj.sdo/java" sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
2
3
        <xsd:import namespace="commonj.sdo/java" schemaLocation="sdoJava.xsd"/>
4
5
        <xsd:complexType name="InheritanceD">
6
                <xsd:complexContent>
7
                        <xsd:extension base="InheritanceC">
8
                                <xsd:sequence>
9
                                        <xsd:element name="propertyD" type="xsd:string"/>
10
                                </xsd:sequence>
11
                        </xsd:extension>
12
                </xsd:complexContent>
13
        </xsd:complexType>
14
15
        <xsd:complexType name="InheritanceA">
16
                <xsd:sequence>
17
                        <xsd:element name="propertyA" type="xsd:string"/>
18
                </xsd:sequence>
19
        </xsd:complexType>
20
21
        <xsd:complexType name="InheritanceB">
22
                <xsd:complexContent>
23
                        <xsd:extension base="InheritanceA">
24
                                <xsd:sequence>
25
                                        <xsd:element name="propertyB" type="xsd:string"/>
26
                                </xsd:sequence>
27
                        </xsd:extension>
28
                </xsd:complexContent>
29
        </xsd:complexType>
30
31
        <xsd:complexType name="InheritanceC">
32
                <xsd:complexContent>
33
                        <xsd:extension base="InheritanceB"/>
34
                </xsd:complexContent>
35
        </xsd:complexType>
36
37
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/OneElement.xsd (+17 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="OneElement">
12
        <xsd:sequence>
13
            <xsd:element name="property1" type="xsd:string"/>
14
        </xsd:sequence>
15
    </xsd:complexType>
16
17
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeMany.xsd (+30 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="NonDataTypeManyC">
12
        <xsd:sequence>
13
            <xsd:element name="property" type="xsd:string"/>
14
        </xsd:sequence>
15
    </xsd:complexType>
16
17
    <xsd:complexType name="NonDataTypeManyA">
18
        <xsd:sequence>
19
            <xsd:element name="b" type="NonDataTypeManyB" maxOccurs="unbounded"/>
20
            <xsd:element name="c" type="NonDataTypeManyC" maxOccurs="unbounded"/>
21
        </xsd:sequence>
22
    </xsd:complexType>
23
24
    <xsd:complexType name="NonDataTypeManyB">
25
        <xsd:sequence>
26
            <xsd:element name="property" type="xsd:string"/>
27
        </xsd:sequence>
28
    </xsd:complexType>
29
30
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypes.xsd (+61 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="DataTypes">
12
        <xsd:sequence>
13
            <xsd:element name="anySimpleType-property" type="xsd:anySimpleType"/>
14
            <xsd:element name="anyType-property" type="xsd:anyType"/>
15
            <xsd:element name="anyURI-property" type="xsd:anyURI"/>
16
            <xsd:element name="base64Binary-property" type="xsd:base64Binary"/>
17
            <xsd:element name="boolean-property" type="xsd:boolean"/>
18
            <xsd:element name="byte-property" type="xsd:byte"/>
19
            <xsd:element name="date-property" type="xsd:date"/>
20
            <xsd:element name="dateTime-property" type="xsd:dateTime"/>
21
            <xsd:element name="decimal-property" type="xsd:decimal"/>
22
           <xsd:element name="double-property" type="xsd:double"/>
23
            <xsd:element name="duration-property" type="xsd:duration"/>
24
            <xsd:element name="ENTITIES-property" type="xsd:ENTITIES"/>
25
            <xsd:element name="ENTITY-property" type="xsd:ENTITY"/>
26
            <xsd:element name="float-property" type="xsd:float"/>
27
            <xsd:element name="gDay-property" type="xsd:gDay"/>
28
            <xsd:element name="gMonth-property" type="xsd:gMonth"/>
29
            <xsd:element name="gMonthDay-property" type="xsd:gMonthDay"/>
30
            <xsd:element name="gYear-property" type="xsd:gYear"/>
31
            <xsd:element name="gYearMonth-property" type="xsd:gYearMonth"/>
32
            <xsd:element name="hexBinary-property" type="xsd:hexBinary"/>
33
            <xsd:element name="ID-property" type="xsd:ID"/>
34
            <xsd:element name="IDREF-property" type="xsd:IDREF"/>
35
            <xsd:element name="int-property" type="xsd:int"/>
36
            <xsd:element name="integer-property" type="xsd:integer"/>
37
            <xsd:element name="language-property" type="xsd:language"/>
38
            <xsd:element name="long-property" type="xsd:long"/>
39
            <xsd:element name="Name-property" type="xsd:Name"/>
40
            <xsd:element name="NCName-property" type="xsd:NCName"/>
41
            <xsd:element name="negativeInteger-property" type="xsd:negativeInteger"/>
42
            <xsd:element name="NMTOKEN-property" type="xsd:NMTOKEN"/>
43
            <xsd:element name="NMTOKENS-property" type="xsd:NMTOKENS"/>
44
            <xsd:element name="nonNegativeInteger-property" type="xsd:nonNegativeInteger"/>
45
            <xsd:element name="nonPositiveInteger-property" type="xsd:nonPositiveInteger"/>
46
            <xsd:element name="normalizedString-property" type="xsd:normalizedString"/>
47
            <xsd:element name="NOTATION" type="xsd:NOTATION"/>
48
            <xsd:element name="positiveInteger-property" type="xsd:positiveInteger"/>
49
            <xsd:element name="QName" type="xsd:QName"/>
50
            <xsd:element name="short" type="xsd:short"/>
51
            <xsd:element name="string" type="xsd:string"/>
52
            <xsd:element name="time" type="xsd:time"/>
53
            <xsd:element name="token" type="xsd:token"/>
54
            <xsd:element name="unsignedByte" type="xsd:unsignedByte"/>
55
            <xsd:element name="unsignedInt" type="xsd:unsignedInt"/>
56
            <xsd:element name="unsignedLong" type="xsd:unsignedLong"/>
57
            <xsd:element name="unsignedShort" type="xsd:unsignedShort"/>
58
        </xsd:sequence>
59
    </xsd:complexType>
60
61
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypeMany.xsd (+17 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="DataTypeMany">
12
        <xsd:sequence>
13
            <xsd:element name="property1" type="xsd:string" maxOccurs="unbounded"/>
14
        </xsd:sequence>
15
    </xsd:complexType>
16
17
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/ChangeSummary.xsd (+18 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdo="commonj.sdo"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="ChangeSummaryA">
12
        <xsd:sequence>
13
            <xsd:element name="property1" type="xsd:string"/>
14
            <xsd:element name="changes" type="sdo:ChangeSummaryType" minOccurs="0"/>
15
        </xsd:sequence>
16
    </xsd:complexType>
17
18
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypeMany.xsd (+17 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="DataTypeMany">
12
        <xsd:sequence>
13
            <xsd:element name="property1" type="xsd:string" maxOccurs="unbounded"/>
14
        </xsd:sequence>
15
    </xsd:complexType>
16
17
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypes.xsd (+61 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="DataTypes">
12
        <xsd:sequence>
13
            <xsd:element name="anySimpleType-property" type="xsd:anySimpleType"/>
14
            <xsd:element name="anyType-property" type="xsd:anyType"/>
15
            <xsd:element name="anyURI-property" type="xsd:anyURI"/>
16
            <xsd:element name="base64Binary-property" type="xsd:base64Binary"/>
17
            <xsd:element name="boolean-property" type="xsd:boolean"/>
18
            <xsd:element name="byte-property" type="xsd:byte"/>
19
            <xsd:element name="date-property" type="xsd:date"/>
20
            <xsd:element name="dateTime-property" type="xsd:dateTime"/>
21
            <xsd:element name="decimal-property" type="xsd:decimal"/>
22
           <xsd:element name="double-property" type="xsd:double"/>
23
            <xsd:element name="duration-property" type="xsd:duration"/>
24
            <xsd:element name="ENTITIES-property" type="xsd:ENTITIES"/>
25
            <xsd:element name="ENTITY-property" type="xsd:ENTITY"/>
26
            <xsd:element name="float-property" type="xsd:float"/>
27
            <xsd:element name="gDay-property" type="xsd:gDay"/>
28
            <xsd:element name="gMonth-property" type="xsd:gMonth"/>
29
            <xsd:element name="gMonthDay-property" type="xsd:gMonthDay"/>
30
            <xsd:element name="gYear-property" type="xsd:gYear"/>
31
            <xsd:element name="gYearMonth-property" type="xsd:gYearMonth"/>
32
            <xsd:element name="hexBinary-property" type="xsd:hexBinary"/>
33
            <xsd:element name="ID-property" type="xsd:ID"/>
34
            <xsd:element name="IDREF-property" type="xsd:IDREF"/>
35
            <xsd:element name="int-property" type="xsd:int"/>
36
            <xsd:element name="integer-property" type="xsd:integer"/>
37
            <xsd:element name="language-property" type="xsd:language"/>
38
            <xsd:element name="long-property" type="xsd:long"/>
39
            <xsd:element name="Name-property" type="xsd:Name"/>
40
            <xsd:element name="NCName-property" type="xsd:NCName"/>
41
            <xsd:element name="negativeInteger-property" type="xsd:negativeInteger"/>
42
            <xsd:element name="NMTOKEN-property" type="xsd:NMTOKEN"/>
43
            <xsd:element name="NMTOKENS-property" type="xsd:NMTOKENS"/>
44
            <xsd:element name="nonNegativeInteger-property" type="xsd:nonNegativeInteger"/>
45
            <xsd:element name="nonPositiveInteger-property" type="xsd:nonPositiveInteger"/>
46
            <xsd:element name="normalizedString-property" type="xsd:normalizedString"/>
47
            <xsd:element name="NOTATION" type="xsd:NOTATION"/>
48
            <xsd:element name="positiveInteger-property" type="xsd:positiveInteger"/>
49
            <xsd:element name="QName" type="xsd:QName"/>
50
            <xsd:element name="short" type="xsd:short"/>
51
            <xsd:element name="string" type="xsd:string"/>
52
            <xsd:element name="time" type="xsd:time"/>
53
            <xsd:element name="token" type="xsd:token"/>
54
            <xsd:element name="unsignedByte" type="xsd:unsignedByte"/>
55
            <xsd:element name="unsignedInt" type="xsd:unsignedInt"/>
56
            <xsd:element name="unsignedLong" type="xsd:unsignedLong"/>
57
            <xsd:element name="unsignedShort" type="xsd:unsignedShort"/>
58
        </xsd:sequence>
59
    </xsd:complexType>
60
61
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/Inheritance.xsd (+37 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.com" xmlns:sdox="commonj.sdo/xml" xmlns:sdoj="commonj.sdo/java" sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
2
3
        <xsd:import namespace="commonj.sdo/java" schemaLocation="sdoJava.xsd"/>
4
5
        <xsd:complexType name="InheritanceD">
6
                <xsd:complexContent>
7
                        <xsd:extension base="InheritanceC">
8
                                <xsd:sequence>
9
                                        <xsd:element name="propertyD" type="xsd:string"/>
10
                                </xsd:sequence>
11
                        </xsd:extension>
12
                </xsd:complexContent>
13
        </xsd:complexType>
14
15
        <xsd:complexType name="InheritanceA">
16
                <xsd:sequence>
17
                        <xsd:element name="propertyA" type="xsd:string"/>
18
                </xsd:sequence>
19
        </xsd:complexType>
20
21
        <xsd:complexType name="InheritanceB">
22
                <xsd:complexContent>
23
                        <xsd:extension base="InheritanceA">
24
                                <xsd:sequence>
25
                                        <xsd:element name="propertyB" type="xsd:string"/>
26
                                </xsd:sequence>
27
                        </xsd:extension>
28
                </xsd:complexContent>
29
        </xsd:complexType>
30
31
        <xsd:complexType name="InheritanceC">
32
                <xsd:complexContent>
33
                        <xsd:extension base="InheritanceB"/>
34
                </xsd:complexContent>
35
        </xsd:complexType>
36
37
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataType.xsd (+30 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="NonDataTypeC">
12
        <xsd:sequence>
13
            <xsd:element name="property" type="xsd:string"/>
14
        </xsd:sequence>
15
    </xsd:complexType>
16
17
    <xsd:complexType name="NonDataTypeA">
18
        <xsd:sequence>
19
            <xsd:element name="b" type="NonDataTypeB"/>
20
            <xsd:element name="c" type="NonDataTypeC"/>
21
        </xsd:sequence>
22
    </xsd:complexType>
23
24
    <xsd:complexType name="NonDataTypeB">
25
        <xsd:sequence>
26
            <xsd:element name="property" type="xsd:string"/>
27
        </xsd:sequence>
28
    </xsd:complexType>
29
30
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeMany.xsd (+30 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="NonDataTypeManyC">
12
        <xsd:sequence>
13
            <xsd:element name="property" type="xsd:string"/>
14
        </xsd:sequence>
15
    </xsd:complexType>
16
17
    <xsd:complexType name="NonDataTypeManyA">
18
        <xsd:sequence>
19
            <xsd:element name="b" type="NonDataTypeManyB" maxOccurs="unbounded"/>
20
            <xsd:element name="c" type="NonDataTypeManyC" maxOccurs="unbounded"/>
21
        </xsd:sequence>
22
    </xsd:complexType>
23
24
    <xsd:complexType name="NonDataTypeManyB">
25
        <xsd:sequence>
26
            <xsd:element name="property" type="xsd:string"/>
27
        </xsd:sequence>
28
    </xsd:complexType>
29
30
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/OneElement.xsd (+17 lines)
Line 0 Link Here
1
<xsd:schema targetNamespace="http://www.example.com"
2
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
    xmlns="http://www.example.com"
4
    xmlns:sdox="commonj.sdo/xml"
5
    xmlns:sdoj="commonj.sdo/java"
6
    sdoj:package="org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl">
7
8
    <xsd:import namespace="commonj.sdo/java"
9
        schemaLocation="sdoJava.xsd" />
10
11
    <xsd:complexType name="OneElement">
12
        <xsd:sequence>
13
            <xsd:element name="property1" type="xsd:string"/>
14
        </xsd:sequence>
15
    </xsd:complexType>
16
17
</xsd:schema>
(-)resource/org/eclipse/persistence/testing/sdo/helper/classgen/schematypes/org/example/MyTestTypeImpl.java (-2 / +2 lines)
Lines 67-73 Link Here
67
   }
67
   }
68
68
69
   public byte[] getMyBase64BinaryTest() {
69
   public byte[] getMyBase64BinaryTest() {
70
      return (byte[])get(START_PROPERTY_INDEX + 7);
70
      return getBytes(START_PROPERTY_INDEX + 7);
71
   }
71
   }
72
72
73
   public void setMyBase64BinaryTest(byte[] value) {
73
   public void setMyBase64BinaryTest(byte[] value) {
Lines 195-201 Link Here
195
   }
195
   }
196
196
197
   public byte[] getMyHexBinaryTest() {
197
   public byte[] getMyHexBinaryTest() {
198
      return (byte[])get(START_PROPERTY_INDEX + 23);
198
      return getBytes(START_PROPERTY_INDEX + 23);
199
   }
199
   }
200
200
201
   public void setMyHexBinaryTest(byte[] value) {
201
   public void setMyHexBinaryTest(byte[] value) {
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypeMany.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface DataTypeMany {
16
17
   public java.util.List getProperty1();
18
19
   public void setProperty1(java.util.List value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/ChangeSummaryA.java (+25 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface ChangeSummaryA {
16
17
   public java.lang.String getProperty1();
18
19
   public void setProperty1(java.lang.String value);
20
21
   public commonj.sdo.ChangeSummary getChanges();
22
23
24
}
25
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeTestCases.java (+52 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class NonDataTypeTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataType.xsd";
25
    private static String CONTROL_STRING = "control";
26
27
    public NonDataTypeTestCases(String name) {
28
        super(name);
29
    }
30
31
    public void setUp() {
32
        super.setUp();
33
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
34
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
35
    }
36
37
    public void testCreateObject() {
38
        DataObject nonDataTypeADO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeA");
39
        NonDataTypeA nonDataTypeA = (NonDataTypeA) nonDataTypeADO;
40
41
        DataObject nonDataTypeBDO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeB");
42
        NonDataTypeB nonDataTypeB = (NonDataTypeB) nonDataTypeBDO;
43
        nonDataTypeA.setB(nonDataTypeB);
44
        assertEquals(nonDataTypeB, nonDataTypeA.getB());
45
46
        DataObject nonDataTypeCDO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeC");
47
        NonDataTypeC nonDataTypeC = (NonDataTypeC) nonDataTypeCDO;
48
        nonDataTypeA.setC(nonDataTypeC);
49
        assertEquals(nonDataTypeC, nonDataTypeA.getC());
50
    }
51
52
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceTestCases.java (+81 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class InheritanceTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/Inheritance.xsd";
25
    private static String CONTROL_STRING = "control";
26
27
    public InheritanceTestCases(String name) {
28
        super(name);
29
    }
30
31
    public void setUp() {
32
        super.setUp();
33
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
34
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
35
    }
36
37
    public void testCreateRoot() {
38
        DataObject inheritanceADO = aHelperContext.getDataFactory().create("http://www.example.com", "InheritanceA");
39
        InheritanceA inheritanceA = (InheritanceA) inheritanceADO;
40
41
        inheritanceA.setPropertyA(CONTROL_STRING);
42
        assertEquals(CONTROL_STRING, inheritanceA.getPropertyA());
43
    }
44
45
    public void testCreateTrunk() {
46
        DataObject inheritanceBDO = aHelperContext.getDataFactory().create("http://www.example.com", "InheritanceB");
47
        InheritanceB inheritanceB = (InheritanceB) inheritanceBDO;
48
49
        inheritanceB.setPropertyA(CONTROL_STRING);
50
        assertEquals(CONTROL_STRING, inheritanceB.getPropertyA());
51
52
        inheritanceB.setPropertyB(CONTROL_STRING);
53
        assertEquals(CONTROL_STRING, inheritanceB.getPropertyB());
54
    }
55
56
    public void testCreateTrunkEmpty() {
57
        DataObject inheritanceCDO = aHelperContext.getDataFactory().create("http://www.example.com", "InheritanceC");
58
        InheritanceC inheritanceC = (InheritanceC) inheritanceCDO;
59
60
        inheritanceC.setPropertyA(CONTROL_STRING);
61
        assertEquals(CONTROL_STRING, inheritanceC.getPropertyA());
62
63
        inheritanceC.setPropertyB(CONTROL_STRING);
64
        assertEquals(CONTROL_STRING, inheritanceC.getPropertyB());
65
    }
66
67
    public void testCreateLeaf() {
68
        DataObject inheritanceDDO = aHelperContext.getDataFactory().create("http://www.example.com", "InheritanceD");
69
        InheritanceD inheritanceD = (InheritanceD) inheritanceDDO;
70
71
        inheritanceD.setPropertyA(CONTROL_STRING);
72
        assertEquals(CONTROL_STRING, inheritanceD.getPropertyA());
73
74
        inheritanceD.setPropertyB(CONTROL_STRING);
75
        assertEquals(CONTROL_STRING, inheritanceD.getPropertyB());
76
77
        inheritanceD.setPropertyD(CONTROL_STRING);
78
        assertEquals(CONTROL_STRING, inheritanceD.getPropertyD());
79
    }
80
81
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/OneElementTestCases.java (+47 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class OneElementTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/OneElement.xsd";
25
    private static String CONTROL_STRING = "control";
26
27
    public OneElementTestCases(String name) {
28
        super(name);
29
    }
30
31
    public void setUp() {
32
        super.setUp();
33
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
34
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
35
    }
36
37
    public void testCreateObject() {
38
        DataObject oneElementDO = aHelperContext.getDataFactory().create("http://www.example.com", "OneElement");
39
        OneElement oneElement = (OneElement) oneElementDO;
40
41
        oneElement.setProperty1(CONTROL_STRING);
42
        assertNotNull(oneElement.getProperty1());
43
        assertTrue(oneElementDO.isSet("property1"));
44
        assertNotNull(oneElementDO.get("property1"));
45
    }
46
47
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeManyA.java (+27 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeManyA {
16
17
   public java.util.List getB();
18
19
   public void setB(java.util.List value);
20
21
   public java.util.List getC();
22
23
   public void setC(java.util.List value);
24
25
26
}
27
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeManyB.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeManyB {
16
17
   public java.lang.String getProperty();
18
19
   public void setProperty(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypesTestCases.java (+194 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
import java.math.BigDecimal;
17
import java.math.BigInteger;
18
import java.util.ArrayList;
19
import java.util.List;
20
21
import org.eclipse.persistence.testing.sdo.SDOTestCase;
22
23
import commonj.sdo.DataObject;
24
import commonj.sdo.Type;
25
26
public class DataTypesTestCases extends SDOTestCase {
27
28
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypes.xsd";
29
30
    private static Object CONTROL_OBJECT = "control";
31
    private static String CONTROL_STRING = "control";
32
    private static List CONTROL_STRINGS = new ArrayList();
33
    private static boolean CONTROL_BOOLEAN = true;
34
    private static byte CONTROL_BYTE = 1;
35
    private static byte[] CONTROL_BYTES = new byte[0];
36
    private static BigDecimal CONTROL_BIG_DECIMAL = BigDecimal.ONE;
37
    private static double CONTROL_DOUBLE = 1;
38
    private static float CONTROL_FLOAT = 1;
39
    private static int CONTROL_INT = 1;
40
    private static BigInteger CONTROL_BIG_INTEGER = BigInteger.ONE;
41
    private static long CONTROL_LONG = 1;
42
    private static short CONTROL_SHORT = 1;
43
44
    public DataTypesTestCases(String name) {
45
        super(name);
46
    }
47
48
    public void setUp() {
49
        super.setUp();
50
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
51
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
52
    }
53
54
    public void testCreateObject() {
55
        DataObject dataTypesDO = aHelperContext.getDataFactory().create("http://www.example.com", "DataTypes");
56
        DataTypes dataTypes = (DataTypes) dataTypesDO;
57
58
        dataTypes.setAnySimpleTypeProperty(CONTROL_OBJECT);
59
        assertEquals(CONTROL_OBJECT, dataTypes.getAnySimpleTypeProperty());
60
61
        dataTypes.setAnyTypeProperty(dataTypesDO);
62
        assertEquals(dataTypesDO, dataTypes.getAnyTypeProperty());
63
64
        dataTypes.setAnyURIProperty(CONTROL_STRING);
65
        assertEquals(CONTROL_STRING, dataTypes.getAnyURIProperty());
66
/*
67
        dataTypes.setBase64BinaryProperty(CONTROL_BYTES);
68
        assertEquals(CONTROL_BYTES, dataTypes.getBase64BinaryProperty());
69
*/
70
        dataTypes.setBooleanProperty(CONTROL_BOOLEAN);
71
        assertEquals(CONTROL_BOOLEAN, dataTypes.isBooleanProperty());
72
73
        dataTypes.setByteProperty(CONTROL_BYTE);
74
        assertEquals(CONTROL_BYTE, dataTypes.getByteProperty());
75
76
        dataTypes.setDateProperty(CONTROL_STRING);
77
        assertEquals(CONTROL_STRING, dataTypes.getDateProperty());
78
79
        dataTypes.setDateTimeProperty(CONTROL_STRING);
80
        assertEquals(CONTROL_STRING, dataTypes.getDateTimeProperty());
81
82
        dataTypes.setDecimalProperty(CONTROL_BIG_DECIMAL);
83
        assertEquals(CONTROL_BIG_DECIMAL, dataTypes.getDecimalProperty());
84
85
        dataTypes.setDoubleProperty(CONTROL_DOUBLE);
86
        assertEquals(CONTROL_DOUBLE, dataTypes.getDoubleProperty());
87
88
        dataTypes.setDurationProperty(CONTROL_STRING);
89
        assertEquals(CONTROL_STRING, dataTypes.getDurationProperty());
90
91
        dataTypes.setENTITIESProperty(CONTROL_STRINGS);
92
        assertEquals(CONTROL_STRINGS, dataTypes.getENTITIESProperty());
93
94
        dataTypes.setENTITYProperty(CONTROL_STRING);
95
        assertEquals(CONTROL_STRING, dataTypes.getENTITYProperty());
96
97
        dataTypes.setFloatProperty(CONTROL_FLOAT);
98
        assertEquals(CONTROL_FLOAT, dataTypes.getFloatProperty());
99
100
        dataTypes.setGDayProperty(CONTROL_STRING);
101
        assertEquals(CONTROL_STRING, dataTypes.getGDayProperty());
102
103
        dataTypes.setGMonthProperty(CONTROL_STRING);
104
        assertEquals(CONTROL_STRING, dataTypes.getGMonthProperty());
105
106
        dataTypes.setGMonthDayProperty(CONTROL_STRING);
107
        assertEquals(CONTROL_STRING, dataTypes.getGMonthDayProperty());
108
109
        dataTypes.setGYearProperty(CONTROL_STRING);
110
        assertEquals(CONTROL_STRING, dataTypes.getGYearProperty());
111
112
        dataTypes.setGYearMonthProperty(CONTROL_STRING);
113
        assertEquals(CONTROL_STRING, dataTypes.getGYearMonthProperty());
114
115
        dataTypes.setHexBinaryProperty(CONTROL_BYTES);
116
        assertEquals(CONTROL_BYTES, dataTypes.getHexBinaryProperty());
117
118
        dataTypes.setIDProperty(CONTROL_STRING);
119
        assertEquals(CONTROL_STRING, dataTypes.getIDProperty());
120
121
        dataTypes.setIDREFProperty(CONTROL_STRING);
122
        assertEquals(CONTROL_STRING, dataTypes.getIDREFProperty());
123
124
        dataTypes.setIntProperty(CONTROL_INT);
125
        assertEquals(CONTROL_INT, dataTypes.getIntProperty());
126
127
        dataTypes.setIntegerProperty(CONTROL_BIG_INTEGER);
128
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getIntegerProperty());
129
130
        dataTypes.setLanguageProperty(CONTROL_STRING);
131
        assertEquals(CONTROL_STRING, dataTypes.getLanguageProperty());
132
133
        dataTypes.setLongProperty(CONTROL_LONG);
134
        assertEquals(CONTROL_LONG, dataTypes.getLongProperty());
135
136
        dataTypes.setNameProperty(CONTROL_STRING);
137
        assertEquals(CONTROL_STRING, dataTypes.getNameProperty());
138
139
        dataTypes.setNCNameProperty(CONTROL_STRING);
140
        assertEquals(CONTROL_STRING, dataTypes.getNCNameProperty());
141
142
        dataTypes.setNegativeIntegerProperty(CONTROL_BIG_INTEGER);
143
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getNegativeIntegerProperty());
144
145
        dataTypes.setNMTOKENProperty(CONTROL_STRING);
146
        assertEquals(CONTROL_STRING, dataTypes.getNMTOKENProperty());
147
148
        dataTypes.setNMTOKENSProperty(CONTROL_STRINGS);
149
        assertEquals(CONTROL_STRINGS, dataTypes.getNMTOKENSProperty());
150
151
        dataTypes.setNonNegativeIntegerProperty(CONTROL_BIG_INTEGER);
152
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getNonNegativeIntegerProperty());
153
154
        dataTypes.setNonPositiveIntegerProperty(CONTROL_BIG_INTEGER);
155
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getNonPositiveIntegerProperty());
156
157
        dataTypes.setNormalizedStringProperty(CONTROL_STRING);
158
        assertEquals(CONTROL_STRING, dataTypes.getNormalizedStringProperty());
159
160
        dataTypes.setNOTATION(CONTROL_STRING);
161
        assertEquals(CONTROL_STRING, dataTypes.getNOTATION());
162
163
        dataTypes.setPositiveIntegerProperty(CONTROL_BIG_INTEGER);
164
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getPositiveIntegerProperty());
165
166
        dataTypes.setQName(CONTROL_STRING);
167
        assertEquals(CONTROL_STRING, dataTypes.getQName());
168
169
        dataTypes.setShort(CONTROL_SHORT);
170
        assertEquals(CONTROL_SHORT, dataTypes.getShort());
171
172
        dataTypes.setString(CONTROL_STRING);
173
        assertEquals(CONTROL_STRING, dataTypes.getString());
174
175
        dataTypes.setTime(CONTROL_STRING);
176
        assertEquals(CONTROL_STRING, dataTypes.getTime());
177
178
        dataTypes.setToken(CONTROL_STRING);
179
        assertEquals(CONTROL_STRING, dataTypes.getToken());
180
181
        dataTypes.setUnsignedByte(CONTROL_SHORT);
182
        assertEquals(CONTROL_SHORT, dataTypes.getUnsignedByte());
183
184
        dataTypes.setUnsignedInt(CONTROL_LONG);
185
        assertEquals(CONTROL_LONG, dataTypes.getUnsignedInt());
186
187
        dataTypes.setUnsignedLong(CONTROL_BIG_INTEGER);
188
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getUnsignedLong());
189
190
        dataTypes.setUnsignedShort(CONTROL_INT);
191
        assertEquals(CONTROL_INT, dataTypes.getUnsignedInt());
192
    }
193
194
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeManyC.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeManyC {
16
17
   public java.lang.String getProperty();
18
19
   public void setProperty(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypeManyTestCases.java (+50 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
import java.util.ArrayList;
17
import java.util.List;
18
19
import org.eclipse.persistence.testing.sdo.SDOTestCase;
20
21
import commonj.sdo.DataObject;
22
import commonj.sdo.Type;
23
24
public class DataTypeManyTestCases extends SDOTestCase {
25
26
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypeMany.xsd";
27
    private static String CONTROL_STRING = "control";
28
29
    public DataTypeManyTestCases(String name) {
30
        super(name);
31
    }
32
33
    public void setUp() {
34
        super.setUp();
35
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
36
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
37
    }
38
39
    public void testCreateObject() {
40
        DataObject dataTypeManyDO = aHelperContext.getDataFactory().create("http://www.example.com", "DataTypeMany");
41
        DataTypeMany dataTypeMany = (DataTypeMany) dataTypeManyDO;
42
43
        List strings = new ArrayList();
44
        strings.add("FOO");
45
        strings.add("BAR");
46
        dataTypeMany.setProperty1(strings);
47
        assertEquals(2, dataTypeMany.getProperty1().size());
48
    }
49
50
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DynamicImplTestSuite.java (+37 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/ 
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import junit.framework.Test;
16
import junit.framework.TestSuite;
17
18
public class DynamicImplTestSuite {
19
    public DynamicImplTestSuite() {
20
    }
21
22
    public static void main(String[] args) {
23
        junit.textui.TestRunner.run(suite());
24
    }
25
26
    public static Test suite() {
27
        TestSuite suite = new TestSuite("Dynamic Impl Tests");
28
        suite.addTestSuite(OneElementTestCases.class);
29
        suite.addTestSuite(DataTypesTestCases.class);
30
        suite.addTestSuite(InheritanceTestCases.class);
31
        suite.addTestSuite(DataTypeManyTestCases.class);
32
        suite.addTestSuite(NonDataTypeTestCases.class);
33
        suite.addTestSuite(NonDataTypeManyTestCases.class);
34
        suite.addTestSuite(ChangeSummaryTestCases.class);
35
        return suite;
36
    }
37
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/ChangeSummaryTestCases.java (+45 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class ChangeSummaryTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/ChangeSummary.xsd";
25
26
    public ChangeSummaryTestCases(String name) {
27
        super(name);
28
    }
29
30
    public void setUp() {
31
        super.setUp();
32
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
33
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
34
    }
35
36
    public void testCreateObject() {
37
        DataObject changeSummaryADO = aHelperContext.getDataFactory().create("http://www.example.com", "ChangeSummaryA");
38
        ChangeSummaryA changeSummaryA = (ChangeSummaryA) changeSummaryADO;
39
40
        assertNotNull(changeSummaryADO.getChangeSummary());
41
        assertNotNull(changeSummaryA.getChanges());
42
        assertEquals(changeSummaryADO.getChangeSummary(), changeSummaryA.getChanges());
43
    }
44
45
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeA.java (+27 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeA {
16
17
   public org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.NonDataTypeB getB();
18
19
   public void setB(org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.NonDataTypeB value);
20
21
   public org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.NonDataTypeC getC();
22
23
   public void setC(org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.NonDataTypeC value);
24
25
26
}
27
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeB.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeB {
16
17
   public java.lang.String getProperty();
18
19
   public void setProperty(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeC.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeC {
16
17
   public java.lang.String getProperty();
18
19
   public void setProperty(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeManyTestCases.java (+52 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class NonDataTypeManyTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeMany.xsd";
25
    private static String CONTROL_STRING = "control";
26
27
    public NonDataTypeManyTestCases(String name) {
28
        super(name);
29
    }
30
31
    public void setUp() {
32
        super.setUp();
33
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
34
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
35
    }
36
37
    public void testCreateObject() {
38
        DataObject nonDataTypeManyADO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeManyA");
39
        NonDataTypeManyA nonDataTypeManyA = (NonDataTypeManyA) nonDataTypeManyADO;
40
        
41
        DataObject nonDataTypeManyBDO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeManyB");
42
        NonDataTypeManyB nonDataTypeManyB = (NonDataTypeManyB) nonDataTypeManyBDO;
43
        nonDataTypeManyA.getB().add(nonDataTypeManyB);
44
        assertEquals(nonDataTypeManyB, nonDataTypeManyA.getB().get(0));
45
        
46
        DataObject nonDataTypeManyCDO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeManyC");
47
        NonDataTypeManyC nonDataTypeManyC = (NonDataTypeManyC) nonDataTypeManyCDO;
48
        nonDataTypeManyA.getC().add(nonDataTypeManyC);
49
        assertEquals(nonDataTypeManyC, nonDataTypeManyA.getC().get(0));
50
    }
51
52
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceA.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface InheritanceA {
16
17
   public java.lang.String getPropertyA();
18
19
   public void setPropertyA(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceB.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface InheritanceB extends org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.InheritanceA {
16
17
   public java.lang.String getPropertyB();
18
19
   public void setPropertyB(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/OneElement.java (+21 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface OneElement {
16
17
   public java.lang.String getProperty1();
18
19
   public void setProperty1(java.lang.String value);
20
21
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceC.java (+19 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface InheritanceC extends org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.InheritanceB {
16
17
18
}
19
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceD.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface InheritanceD extends org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.InheritanceC {
16
17
   public java.lang.String getPropertyD();
18
19
   public void setPropertyD(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypes.java (+198 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface DataTypes {
16
17
   public java.lang.Object getAnySimpleTypeProperty();
18
19
   public void setAnySimpleTypeProperty(java.lang.Object value);
20
21
   public commonj.sdo.DataObject getAnyTypeProperty();
22
23
   public void setAnyTypeProperty(commonj.sdo.DataObject value);
24
25
   public java.lang.String getAnyURIProperty();
26
27
   public void setAnyURIProperty(java.lang.String value);
28
29
   public byte[] getBase64BinaryProperty();
30
31
   public void setBase64BinaryProperty(byte[] value);
32
33
   public boolean isBooleanProperty();
34
35
   public void setBooleanProperty(boolean value);
36
37
   public byte getByteProperty();
38
39
   public void setByteProperty(byte value);
40
41
   public java.lang.String getDateProperty();
42
43
   public void setDateProperty(java.lang.String value);
44
45
   public java.lang.String getDateTimeProperty();
46
47
   public void setDateTimeProperty(java.lang.String value);
48
49
   public java.math.BigDecimal getDecimalProperty();
50
51
   public void setDecimalProperty(java.math.BigDecimal value);
52
53
   public double getDoubleProperty();
54
55
   public void setDoubleProperty(double value);
56
57
   public java.lang.String getDurationProperty();
58
59
   public void setDurationProperty(java.lang.String value);
60
61
   public java.util.List getENTITIESProperty();
62
63
   public void setENTITIESProperty(java.util.List value);
64
65
   public java.lang.String getENTITYProperty();
66
67
   public void setENTITYProperty(java.lang.String value);
68
69
   public float getFloatProperty();
70
71
   public void setFloatProperty(float value);
72
73
   public java.lang.String getGDayProperty();
74
75
   public void setGDayProperty(java.lang.String value);
76
77
   public java.lang.String getGMonthProperty();
78
79
   public void setGMonthProperty(java.lang.String value);
80
81
   public java.lang.String getGMonthDayProperty();
82
83
   public void setGMonthDayProperty(java.lang.String value);
84
85
   public java.lang.String getGYearProperty();
86
87
   public void setGYearProperty(java.lang.String value);
88
89
   public java.lang.String getGYearMonthProperty();
90
91
   public void setGYearMonthProperty(java.lang.String value);
92
93
   public byte[] getHexBinaryProperty();
94
95
   public void setHexBinaryProperty(byte[] value);
96
97
   public java.lang.String getIDProperty();
98
99
   public void setIDProperty(java.lang.String value);
100
101
   public java.lang.String getIDREFProperty();
102
103
   public void setIDREFProperty(java.lang.String value);
104
105
   public int getIntProperty();
106
107
   public void setIntProperty(int value);
108
109
   public java.math.BigInteger getIntegerProperty();
110
111
   public void setIntegerProperty(java.math.BigInteger value);
112
113
   public java.lang.String getLanguageProperty();
114
115
   public void setLanguageProperty(java.lang.String value);
116
117
   public long getLongProperty();
118
119
   public void setLongProperty(long value);
120
121
   public java.lang.String getNameProperty();
122
123
   public void setNameProperty(java.lang.String value);
124
125
   public java.lang.String getNCNameProperty();
126
127
   public void setNCNameProperty(java.lang.String value);
128
129
   public java.math.BigInteger getNegativeIntegerProperty();
130
131
   public void setNegativeIntegerProperty(java.math.BigInteger value);
132
133
   public java.lang.String getNMTOKENProperty();
134
135
   public void setNMTOKENProperty(java.lang.String value);
136
137
   public java.util.List getNMTOKENSProperty();
138
139
   public void setNMTOKENSProperty(java.util.List value);
140
141
   public java.math.BigInteger getNonNegativeIntegerProperty();
142
143
   public void setNonNegativeIntegerProperty(java.math.BigInteger value);
144
145
   public java.math.BigInteger getNonPositiveIntegerProperty();
146
147
   public void setNonPositiveIntegerProperty(java.math.BigInteger value);
148
149
   public java.lang.String getNormalizedStringProperty();
150
151
   public void setNormalizedStringProperty(java.lang.String value);
152
153
   public java.lang.String getNOTATION();
154
155
   public void setNOTATION(java.lang.String value);
156
157
   public java.math.BigInteger getPositiveIntegerProperty();
158
159
   public void setPositiveIntegerProperty(java.math.BigInteger value);
160
161
   public java.lang.String getQName();
162
163
   public void setQName(java.lang.String value);
164
165
   public short getShort();
166
167
   public void setShort(short value);
168
169
   public java.lang.String getString();
170
171
   public void setString(java.lang.String value);
172
173
   public java.lang.String getTime();
174
175
   public void setTime(java.lang.String value);
176
177
   public java.lang.String getToken();
178
179
   public void setToken(java.lang.String value);
180
181
   public short getUnsignedByte();
182
183
   public void setUnsignedByte(short value);
184
185
   public long getUnsignedInt();
186
187
   public void setUnsignedInt(long value);
188
189
   public java.math.BigInteger getUnsignedLong();
190
191
   public void setUnsignedLong(java.math.BigInteger value);
192
193
   public int getUnsignedShort();
194
195
   public void setUnsignedShort(int value);
196
197
198
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/ChangeSummaryA.java (+25 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface ChangeSummaryA {
16
17
   public java.lang.String getProperty1();
18
19
   public void setProperty1(java.lang.String value);
20
21
   public commonj.sdo.ChangeSummary getChanges();
22
23
24
}
25
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/ChangeSummaryTestCases.java (+45 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class ChangeSummaryTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/ChangeSummary.xsd";
25
26
    public ChangeSummaryTestCases(String name) {
27
        super(name);
28
    }
29
30
    public void setUp() {
31
        super.setUp();
32
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
33
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
34
    }
35
36
    public void testCreateObject() {
37
        DataObject changeSummaryADO = aHelperContext.getDataFactory().create("http://www.example.com", "ChangeSummaryA");
38
        ChangeSummaryA changeSummaryA = (ChangeSummaryA) changeSummaryADO;
39
40
        assertNotNull(changeSummaryADO.getChangeSummary());
41
        assertNotNull(changeSummaryA.getChanges());
42
        assertEquals(changeSummaryADO.getChangeSummary(), changeSummaryA.getChanges());
43
    }
44
45
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypeMany.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface DataTypeMany {
16
17
   public java.util.List getProperty1();
18
19
   public void setProperty1(java.util.List value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypeManyTestCases.java (+50 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
import java.util.ArrayList;
17
import java.util.List;
18
19
import org.eclipse.persistence.testing.sdo.SDOTestCase;
20
21
import commonj.sdo.DataObject;
22
import commonj.sdo.Type;
23
24
public class DataTypeManyTestCases extends SDOTestCase {
25
26
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypeMany.xsd";
27
    private static String CONTROL_STRING = "control";
28
29
    public DataTypeManyTestCases(String name) {
30
        super(name);
31
    }
32
33
    public void setUp() {
34
        super.setUp();
35
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
36
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
37
    }
38
39
    public void testCreateObject() {
40
        DataObject dataTypeManyDO = aHelperContext.getDataFactory().create("http://www.example.com", "DataTypeMany");
41
        DataTypeMany dataTypeMany = (DataTypeMany) dataTypeManyDO;
42
43
        List strings = new ArrayList();
44
        strings.add("FOO");
45
        strings.add("BAR");
46
        dataTypeMany.setProperty1(strings);
47
        assertEquals(2, dataTypeMany.getProperty1().size());
48
    }
49
50
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypes.java (+198 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface DataTypes {
16
17
   public java.lang.Object getAnySimpleTypeProperty();
18
19
   public void setAnySimpleTypeProperty(java.lang.Object value);
20
21
   public commonj.sdo.DataObject getAnyTypeProperty();
22
23
   public void setAnyTypeProperty(commonj.sdo.DataObject value);
24
25
   public java.lang.String getAnyURIProperty();
26
27
   public void setAnyURIProperty(java.lang.String value);
28
29
   public byte[] getBase64BinaryProperty();
30
31
   public void setBase64BinaryProperty(byte[] value);
32
33
   public boolean isBooleanProperty();
34
35
   public void setBooleanProperty(boolean value);
36
37
   public byte getByteProperty();
38
39
   public void setByteProperty(byte value);
40
41
   public java.lang.String getDateProperty();
42
43
   public void setDateProperty(java.lang.String value);
44
45
   public java.lang.String getDateTimeProperty();
46
47
   public void setDateTimeProperty(java.lang.String value);
48
49
   public java.math.BigDecimal getDecimalProperty();
50
51
   public void setDecimalProperty(java.math.BigDecimal value);
52
53
   public double getDoubleProperty();
54
55
   public void setDoubleProperty(double value);
56
57
   public java.lang.String getDurationProperty();
58
59
   public void setDurationProperty(java.lang.String value);
60
61
   public java.util.List getENTITIESProperty();
62
63
   public void setENTITIESProperty(java.util.List value);
64
65
   public java.lang.String getENTITYProperty();
66
67
   public void setENTITYProperty(java.lang.String value);
68
69
   public float getFloatProperty();
70
71
   public void setFloatProperty(float value);
72
73
   public java.lang.String getGDayProperty();
74
75
   public void setGDayProperty(java.lang.String value);
76
77
   public java.lang.String getGMonthProperty();
78
79
   public void setGMonthProperty(java.lang.String value);
80
81
   public java.lang.String getGMonthDayProperty();
82
83
   public void setGMonthDayProperty(java.lang.String value);
84
85
   public java.lang.String getGYearProperty();
86
87
   public void setGYearProperty(java.lang.String value);
88
89
   public java.lang.String getGYearMonthProperty();
90
91
   public void setGYearMonthProperty(java.lang.String value);
92
93
   public byte[] getHexBinaryProperty();
94
95
   public void setHexBinaryProperty(byte[] value);
96
97
   public java.lang.String getIDProperty();
98
99
   public void setIDProperty(java.lang.String value);
100
101
   public java.lang.String getIDREFProperty();
102
103
   public void setIDREFProperty(java.lang.String value);
104
105
   public int getIntProperty();
106
107
   public void setIntProperty(int value);
108
109
   public java.math.BigInteger getIntegerProperty();
110
111
   public void setIntegerProperty(java.math.BigInteger value);
112
113
   public java.lang.String getLanguageProperty();
114
115
   public void setLanguageProperty(java.lang.String value);
116
117
   public long getLongProperty();
118
119
   public void setLongProperty(long value);
120
121
   public java.lang.String getNameProperty();
122
123
   public void setNameProperty(java.lang.String value);
124
125
   public java.lang.String getNCNameProperty();
126
127
   public void setNCNameProperty(java.lang.String value);
128
129
   public java.math.BigInteger getNegativeIntegerProperty();
130
131
   public void setNegativeIntegerProperty(java.math.BigInteger value);
132
133
   public java.lang.String getNMTOKENProperty();
134
135
   public void setNMTOKENProperty(java.lang.String value);
136
137
   public java.util.List getNMTOKENSProperty();
138
139
   public void setNMTOKENSProperty(java.util.List value);
140
141
   public java.math.BigInteger getNonNegativeIntegerProperty();
142
143
   public void setNonNegativeIntegerProperty(java.math.BigInteger value);
144
145
   public java.math.BigInteger getNonPositiveIntegerProperty();
146
147
   public void setNonPositiveIntegerProperty(java.math.BigInteger value);
148
149
   public java.lang.String getNormalizedStringProperty();
150
151
   public void setNormalizedStringProperty(java.lang.String value);
152
153
   public java.lang.String getNOTATION();
154
155
   public void setNOTATION(java.lang.String value);
156
157
   public java.math.BigInteger getPositiveIntegerProperty();
158
159
   public void setPositiveIntegerProperty(java.math.BigInteger value);
160
161
   public java.lang.String getQName();
162
163
   public void setQName(java.lang.String value);
164
165
   public short getShort();
166
167
   public void setShort(short value);
168
169
   public java.lang.String getString();
170
171
   public void setString(java.lang.String value);
172
173
   public java.lang.String getTime();
174
175
   public void setTime(java.lang.String value);
176
177
   public java.lang.String getToken();
178
179
   public void setToken(java.lang.String value);
180
181
   public short getUnsignedByte();
182
183
   public void setUnsignedByte(short value);
184
185
   public long getUnsignedInt();
186
187
   public void setUnsignedInt(long value);
188
189
   public java.math.BigInteger getUnsignedLong();
190
191
   public void setUnsignedLong(java.math.BigInteger value);
192
193
   public int getUnsignedShort();
194
195
   public void setUnsignedShort(int value);
196
197
198
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypesTestCases.java (+194 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
import java.math.BigDecimal;
17
import java.math.BigInteger;
18
import java.util.ArrayList;
19
import java.util.List;
20
21
import org.eclipse.persistence.testing.sdo.SDOTestCase;
22
23
import commonj.sdo.DataObject;
24
import commonj.sdo.Type;
25
26
public class DataTypesTestCases extends SDOTestCase {
27
28
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DataTypes.xsd";
29
30
    private static Object CONTROL_OBJECT = "control";
31
    private static String CONTROL_STRING = "control";
32
    private static List CONTROL_STRINGS = new ArrayList();
33
    private static boolean CONTROL_BOOLEAN = true;
34
    private static byte CONTROL_BYTE = 1;
35
    private static byte[] CONTROL_BYTES = new byte[0];
36
    private static BigDecimal CONTROL_BIG_DECIMAL = BigDecimal.ONE;
37
    private static double CONTROL_DOUBLE = 1;
38
    private static float CONTROL_FLOAT = 1;
39
    private static int CONTROL_INT = 1;
40
    private static BigInteger CONTROL_BIG_INTEGER = BigInteger.ONE;
41
    private static long CONTROL_LONG = 1;
42
    private static short CONTROL_SHORT = 1;
43
44
    public DataTypesTestCases(String name) {
45
        super(name);
46
    }
47
48
    public void setUp() {
49
        super.setUp();
50
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
51
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
52
    }
53
54
    public void testCreateObject() {
55
        DataObject dataTypesDO = aHelperContext.getDataFactory().create("http://www.example.com", "DataTypes");
56
        DataTypes dataTypes = (DataTypes) dataTypesDO;
57
58
        dataTypes.setAnySimpleTypeProperty(CONTROL_OBJECT);
59
        assertEquals(CONTROL_OBJECT, dataTypes.getAnySimpleTypeProperty());
60
61
        dataTypes.setAnyTypeProperty(dataTypesDO);
62
        assertEquals(dataTypesDO, dataTypes.getAnyTypeProperty());
63
64
        dataTypes.setAnyURIProperty(CONTROL_STRING);
65
        assertEquals(CONTROL_STRING, dataTypes.getAnyURIProperty());
66
/*
67
        dataTypes.setBase64BinaryProperty(CONTROL_BYTES);
68
        assertEquals(CONTROL_BYTES, dataTypes.getBase64BinaryProperty());
69
*/
70
        dataTypes.setBooleanProperty(CONTROL_BOOLEAN);
71
        assertEquals(CONTROL_BOOLEAN, dataTypes.isBooleanProperty());
72
73
        dataTypes.setByteProperty(CONTROL_BYTE);
74
        assertEquals(CONTROL_BYTE, dataTypes.getByteProperty());
75
76
        dataTypes.setDateProperty(CONTROL_STRING);
77
        assertEquals(CONTROL_STRING, dataTypes.getDateProperty());
78
79
        dataTypes.setDateTimeProperty(CONTROL_STRING);
80
        assertEquals(CONTROL_STRING, dataTypes.getDateTimeProperty());
81
82
        dataTypes.setDecimalProperty(CONTROL_BIG_DECIMAL);
83
        assertEquals(CONTROL_BIG_DECIMAL, dataTypes.getDecimalProperty());
84
85
        dataTypes.setDoubleProperty(CONTROL_DOUBLE);
86
        assertEquals(CONTROL_DOUBLE, dataTypes.getDoubleProperty());
87
88
        dataTypes.setDurationProperty(CONTROL_STRING);
89
        assertEquals(CONTROL_STRING, dataTypes.getDurationProperty());
90
91
        dataTypes.setENTITIESProperty(CONTROL_STRINGS);
92
        assertEquals(CONTROL_STRINGS, dataTypes.getENTITIESProperty());
93
94
        dataTypes.setENTITYProperty(CONTROL_STRING);
95
        assertEquals(CONTROL_STRING, dataTypes.getENTITYProperty());
96
97
        dataTypes.setFloatProperty(CONTROL_FLOAT);
98
        assertEquals(CONTROL_FLOAT, dataTypes.getFloatProperty());
99
100
        dataTypes.setGDayProperty(CONTROL_STRING);
101
        assertEquals(CONTROL_STRING, dataTypes.getGDayProperty());
102
103
        dataTypes.setGMonthProperty(CONTROL_STRING);
104
        assertEquals(CONTROL_STRING, dataTypes.getGMonthProperty());
105
106
        dataTypes.setGMonthDayProperty(CONTROL_STRING);
107
        assertEquals(CONTROL_STRING, dataTypes.getGMonthDayProperty());
108
109
        dataTypes.setGYearProperty(CONTROL_STRING);
110
        assertEquals(CONTROL_STRING, dataTypes.getGYearProperty());
111
112
        dataTypes.setGYearMonthProperty(CONTROL_STRING);
113
        assertEquals(CONTROL_STRING, dataTypes.getGYearMonthProperty());
114
115
        dataTypes.setHexBinaryProperty(CONTROL_BYTES);
116
        assertEquals(CONTROL_BYTES, dataTypes.getHexBinaryProperty());
117
118
        dataTypes.setIDProperty(CONTROL_STRING);
119
        assertEquals(CONTROL_STRING, dataTypes.getIDProperty());
120
121
        dataTypes.setIDREFProperty(CONTROL_STRING);
122
        assertEquals(CONTROL_STRING, dataTypes.getIDREFProperty());
123
124
        dataTypes.setIntProperty(CONTROL_INT);
125
        assertEquals(CONTROL_INT, dataTypes.getIntProperty());
126
127
        dataTypes.setIntegerProperty(CONTROL_BIG_INTEGER);
128
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getIntegerProperty());
129
130
        dataTypes.setLanguageProperty(CONTROL_STRING);
131
        assertEquals(CONTROL_STRING, dataTypes.getLanguageProperty());
132
133
        dataTypes.setLongProperty(CONTROL_LONG);
134
        assertEquals(CONTROL_LONG, dataTypes.getLongProperty());
135
136
        dataTypes.setNameProperty(CONTROL_STRING);
137
        assertEquals(CONTROL_STRING, dataTypes.getNameProperty());
138
139
        dataTypes.setNCNameProperty(CONTROL_STRING);
140
        assertEquals(CONTROL_STRING, dataTypes.getNCNameProperty());
141
142
        dataTypes.setNegativeIntegerProperty(CONTROL_BIG_INTEGER);
143
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getNegativeIntegerProperty());
144
145
        dataTypes.setNMTOKENProperty(CONTROL_STRING);
146
        assertEquals(CONTROL_STRING, dataTypes.getNMTOKENProperty());
147
148
        dataTypes.setNMTOKENSProperty(CONTROL_STRINGS);
149
        assertEquals(CONTROL_STRINGS, dataTypes.getNMTOKENSProperty());
150
151
        dataTypes.setNonNegativeIntegerProperty(CONTROL_BIG_INTEGER);
152
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getNonNegativeIntegerProperty());
153
154
        dataTypes.setNonPositiveIntegerProperty(CONTROL_BIG_INTEGER);
155
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getNonPositiveIntegerProperty());
156
157
        dataTypes.setNormalizedStringProperty(CONTROL_STRING);
158
        assertEquals(CONTROL_STRING, dataTypes.getNormalizedStringProperty());
159
160
        dataTypes.setNOTATION(CONTROL_STRING);
161
        assertEquals(CONTROL_STRING, dataTypes.getNOTATION());
162
163
        dataTypes.setPositiveIntegerProperty(CONTROL_BIG_INTEGER);
164
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getPositiveIntegerProperty());
165
166
        dataTypes.setQName(CONTROL_STRING);
167
        assertEquals(CONTROL_STRING, dataTypes.getQName());
168
169
        dataTypes.setShort(CONTROL_SHORT);
170
        assertEquals(CONTROL_SHORT, dataTypes.getShort());
171
172
        dataTypes.setString(CONTROL_STRING);
173
        assertEquals(CONTROL_STRING, dataTypes.getString());
174
175
        dataTypes.setTime(CONTROL_STRING);
176
        assertEquals(CONTROL_STRING, dataTypes.getTime());
177
178
        dataTypes.setToken(CONTROL_STRING);
179
        assertEquals(CONTROL_STRING, dataTypes.getToken());
180
181
        dataTypes.setUnsignedByte(CONTROL_SHORT);
182
        assertEquals(CONTROL_SHORT, dataTypes.getUnsignedByte());
183
184
        dataTypes.setUnsignedInt(CONTROL_LONG);
185
        assertEquals(CONTROL_LONG, dataTypes.getUnsignedInt());
186
187
        dataTypes.setUnsignedLong(CONTROL_BIG_INTEGER);
188
        assertEquals(CONTROL_BIG_INTEGER, dataTypes.getUnsignedLong());
189
190
        dataTypes.setUnsignedShort(CONTROL_INT);
191
        assertEquals(CONTROL_INT, dataTypes.getUnsignedInt());
192
    }
193
194
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/DynamicImplTestSuite.java (+37 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/ 
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import junit.framework.Test;
16
import junit.framework.TestSuite;
17
18
public class DynamicImplTestSuite {
19
    public DynamicImplTestSuite() {
20
    }
21
22
    public static void main(String[] args) {
23
        junit.textui.TestRunner.run(suite());
24
    }
25
26
    public static Test suite() {
27
        TestSuite suite = new TestSuite("Dynamic Impl Tests");
28
        suite.addTestSuite(OneElementTestCases.class);
29
        suite.addTestSuite(DataTypesTestCases.class);
30
        suite.addTestSuite(InheritanceTestCases.class);
31
        suite.addTestSuite(DataTypeManyTestCases.class);
32
        suite.addTestSuite(NonDataTypeTestCases.class);
33
        suite.addTestSuite(NonDataTypeManyTestCases.class);
34
        suite.addTestSuite(ChangeSummaryTestCases.class);
35
        return suite;
36
    }
37
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceA.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface InheritanceA {
16
17
   public java.lang.String getPropertyA();
18
19
   public void setPropertyA(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceB.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface InheritanceB extends org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.InheritanceA {
16
17
   public java.lang.String getPropertyB();
18
19
   public void setPropertyB(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceC.java (+19 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface InheritanceC extends org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.InheritanceB {
16
17
18
}
19
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceD.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface InheritanceD extends org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.InheritanceC {
16
17
   public java.lang.String getPropertyD();
18
19
   public void setPropertyD(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/InheritanceTestCases.java (+81 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class InheritanceTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/Inheritance.xsd";
25
    private static String CONTROL_STRING = "control";
26
27
    public InheritanceTestCases(String name) {
28
        super(name);
29
    }
30
31
    public void setUp() {
32
        super.setUp();
33
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
34
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
35
    }
36
37
    public void testCreateRoot() {
38
        DataObject inheritanceADO = aHelperContext.getDataFactory().create("http://www.example.com", "InheritanceA");
39
        InheritanceA inheritanceA = (InheritanceA) inheritanceADO;
40
41
        inheritanceA.setPropertyA(CONTROL_STRING);
42
        assertEquals(CONTROL_STRING, inheritanceA.getPropertyA());
43
    }
44
45
    public void testCreateTrunk() {
46
        DataObject inheritanceBDO = aHelperContext.getDataFactory().create("http://www.example.com", "InheritanceB");
47
        InheritanceB inheritanceB = (InheritanceB) inheritanceBDO;
48
49
        inheritanceB.setPropertyA(CONTROL_STRING);
50
        assertEquals(CONTROL_STRING, inheritanceB.getPropertyA());
51
52
        inheritanceB.setPropertyB(CONTROL_STRING);
53
        assertEquals(CONTROL_STRING, inheritanceB.getPropertyB());
54
    }
55
56
    public void testCreateTrunkEmpty() {
57
        DataObject inheritanceCDO = aHelperContext.getDataFactory().create("http://www.example.com", "InheritanceC");
58
        InheritanceC inheritanceC = (InheritanceC) inheritanceCDO;
59
60
        inheritanceC.setPropertyA(CONTROL_STRING);
61
        assertEquals(CONTROL_STRING, inheritanceC.getPropertyA());
62
63
        inheritanceC.setPropertyB(CONTROL_STRING);
64
        assertEquals(CONTROL_STRING, inheritanceC.getPropertyB());
65
    }
66
67
    public void testCreateLeaf() {
68
        DataObject inheritanceDDO = aHelperContext.getDataFactory().create("http://www.example.com", "InheritanceD");
69
        InheritanceD inheritanceD = (InheritanceD) inheritanceDDO;
70
71
        inheritanceD.setPropertyA(CONTROL_STRING);
72
        assertEquals(CONTROL_STRING, inheritanceD.getPropertyA());
73
74
        inheritanceD.setPropertyB(CONTROL_STRING);
75
        assertEquals(CONTROL_STRING, inheritanceD.getPropertyB());
76
77
        inheritanceD.setPropertyD(CONTROL_STRING);
78
        assertEquals(CONTROL_STRING, inheritanceD.getPropertyD());
79
    }
80
81
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeA.java (+27 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeA {
16
17
   public org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.NonDataTypeB getB();
18
19
   public void setB(org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.NonDataTypeB value);
20
21
   public org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.NonDataTypeC getC();
22
23
   public void setC(org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl.NonDataTypeC value);
24
25
26
}
27
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeB.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeB {
16
17
   public java.lang.String getProperty();
18
19
   public void setProperty(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeC.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeC {
16
17
   public java.lang.String getProperty();
18
19
   public void setProperty(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeManyA.java (+27 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeManyA {
16
17
   public java.util.List getB();
18
19
   public void setB(java.util.List value);
20
21
   public java.util.List getC();
22
23
   public void setC(java.util.List value);
24
25
26
}
27
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeManyB.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeManyB {
16
17
   public java.lang.String getProperty();
18
19
   public void setProperty(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeManyC.java (+23 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface NonDataTypeManyC {
16
17
   public java.lang.String getProperty();
18
19
   public void setProperty(java.lang.String value);
20
21
22
}
23
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeManyTestCases.java (+52 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class NonDataTypeManyTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeMany.xsd";
25
    private static String CONTROL_STRING = "control";
26
27
    public NonDataTypeManyTestCases(String name) {
28
        super(name);
29
    }
30
31
    public void setUp() {
32
        super.setUp();
33
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
34
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
35
    }
36
37
    public void testCreateObject() {
38
        DataObject nonDataTypeManyADO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeManyA");
39
        NonDataTypeManyA nonDataTypeManyA = (NonDataTypeManyA) nonDataTypeManyADO;
40
        
41
        DataObject nonDataTypeManyBDO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeManyB");
42
        NonDataTypeManyB nonDataTypeManyB = (NonDataTypeManyB) nonDataTypeManyBDO;
43
        nonDataTypeManyA.getB().add(nonDataTypeManyB);
44
        assertEquals(nonDataTypeManyB, nonDataTypeManyA.getB().get(0));
45
        
46
        DataObject nonDataTypeManyCDO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeManyC");
47
        NonDataTypeManyC nonDataTypeManyC = (NonDataTypeManyC) nonDataTypeManyCDO;
48
        nonDataTypeManyA.getC().add(nonDataTypeManyC);
49
        assertEquals(nonDataTypeManyC, nonDataTypeManyA.getC().get(0));
50
    }
51
52
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataTypeTestCases.java (+52 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 18/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class NonDataTypeTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/NonDataType.xsd";
25
    private static String CONTROL_STRING = "control";
26
27
    public NonDataTypeTestCases(String name) {
28
        super(name);
29
    }
30
31
    public void setUp() {
32
        super.setUp();
33
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
34
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
35
    }
36
37
    public void testCreateObject() {
38
        DataObject nonDataTypeADO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeA");
39
        NonDataTypeA nonDataTypeA = (NonDataTypeA) nonDataTypeADO;
40
41
        DataObject nonDataTypeBDO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeB");
42
        NonDataTypeB nonDataTypeB = (NonDataTypeB) nonDataTypeBDO;
43
        nonDataTypeA.setB(nonDataTypeB);
44
        assertEquals(nonDataTypeB, nonDataTypeA.getB());
45
46
        DataObject nonDataTypeCDO = aHelperContext.getDataFactory().create("http://www.example.com", "NonDataTypeC");
47
        NonDataTypeC nonDataTypeC = (NonDataTypeC) nonDataTypeCDO;
48
        nonDataTypeA.setC(nonDataTypeC);
49
        assertEquals(nonDataTypeC, nonDataTypeA.getC());
50
    }
51
52
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/OneElement.java (+21 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
public interface OneElement {
16
17
   public java.lang.String getProperty1();
18
19
   public void setProperty1(java.lang.String value);
20
21
}
(-)src/org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/OneElementTestCases.java (+47 lines)
Line 0 Link Here
1
/*******************************************************************************
2
* Copyright (c) 1998, 2008 Oracle. 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
*     bdoughan - Mar 17/2009 - 2.0 - Initial implementation
12
******************************************************************************/
13
package org.eclipse.persistence.testing.sdo.helper.classgen.dynamicimpl;
14
15
import java.io.InputStream;
16
17
import org.eclipse.persistence.testing.sdo.SDOTestCase;
18
19
import commonj.sdo.DataObject;
20
import commonj.sdo.Type;
21
22
public class OneElementTestCases extends SDOTestCase {
23
24
    private static String XSD = "org/eclipse/persistence/testing/sdo/helper/classgen/dynamicimpl/OneElement.xsd";
25
    private static String CONTROL_STRING = "control";
26
27
    public OneElementTestCases(String name) {
28
        super(name);
29
    }
30
31
    public void setUp() {
32
        super.setUp();
33
        InputStream xsdInputStream = Thread.currentThread().getContextClassLoader().getSystemResourceAsStream(XSD);
34
        this.aHelperContext.getXSDHelper().define(xsdInputStream, null);
35
    }
36
37
    public void testCreateObject() {
38
        DataObject oneElementDO = aHelperContext.getDataFactory().create("http://www.example.com", "OneElement");
39
        OneElement oneElement = (OneElement) oneElementDO;
40
41
        oneElement.setProperty1(CONTROL_STRING);
42
        assertNotNull(oneElement.getProperty1());
43
        assertTrue(oneElementDO.isSet("property1"));
44
        assertNotNull(oneElementDO.get("property1"));
45
    }
46
47
}
(-)src/org/eclipse/persistence/testing/sdo/helper/datafactory/SDODataFactoryCreateSimpleTestCases.java (-8 lines)
Lines 43-56 Link Here
43
        assertEquals(simpleType, dataObject.getType());
43
        assertEquals(simpleType, dataObject.getType());
44
    }
44
    }
45
45
46
    public void testCreateByImplClass() {
47
        Class oldClass = simpleType.getInstanceClass();
48
        simpleType.setInstanceClass(USAddressImpl.class);
49
        DataObject dataObject = dataFactory.create(simpleType);
50
        assertEquals(simpleType, dataObject.getType());
51
        simpleType.setInstanceClass(oldClass);
52
    }
53
54
    public void testCreateByInvalidClass() {
46
    public void testCreateByInvalidClass() {
55
        Class oldClass = simpleType.getInstanceClass();
47
        Class oldClass = simpleType.getInstanceClass();
56
        simpleType.setInstanceClass(String.class);
48
        simpleType.setInstanceClass(String.class);

Return to bug 268592