Skip to content

Commit

Permalink
apply new language features
Browse files Browse the repository at this point in the history
* pattern matching
* text blocks

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Jan 25, 2024
1 parent 08247e5 commit 551c812
Show file tree
Hide file tree
Showing 888 changed files with 6,476 additions and 7,542 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,50 +128,52 @@ public class OracleObjecttypeTestSuite {
static final String DATABASE_URL_KEY = "db.url";
static final String DATABASE_DRIVER_KEY = "db.driver";
static final String OBJECTTYPE_SCHEMA =
"<?xml version='1.0' encoding='UTF-8'?>\n" +
"<xsd:schema\n" +
" targetNamespace=\"urn:oracleobjecttype\" xmlns=\"urn:oracleobjecttype\" elementFormDefault=\"qualified\"\n" +
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
" >\n" +
" <xsd:complexType name=\"addressType\">\n" +
" <xsd:sequence>\n" +
" <xsd:element name=\"street\" type=\"xsd:string\" />\n" +
" <xsd:element name=\"city\" type=\"xsd:string\" />\n" +
" <xsd:element name=\"province\" type=\"xsd:string\" />\n" +
" </xsd:sequence>\n" +
" </xsd:complexType>\n" +
" <xsd:complexType name=\"employeeType\">\n" +
" <xsd:sequence>\n" +
" <xsd:element name=\"id\" type=\"xsd:int\" />\n" +
" <xsd:element name=\"first-name\" type=\"xsd:string\" />\n" +
" <xsd:element name=\"last-name\" type=\"xsd:string\" />\n" +
" <xsd:element name=\"address\" type=\"addressType\" />\n" +
" </xsd:sequence>\n" +
" </xsd:complexType>\n" +
"</xsd:schema>";
"""
<?xml version='1.0' encoding='UTF-8'?>
<xsd:schema
targetNamespace="urn:oracleobjecttype" xmlns="urn:oracleobjecttype" elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<xsd:complexType name="addressType">
<xsd:sequence>
<xsd:element name="street" type="xsd:string" />
<xsd:element name="city" type="xsd:string" />
<xsd:element name="province" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="employeeType">
<xsd:sequence>
<xsd:element name="id" type="xsd:int" />
<xsd:element name="first-name" type="xsd:string" />
<xsd:element name="last-name" type="xsd:string" />
<xsd:element name="address" type="addressType" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>""";
static final String OBJECTTYPE_XRMODEL =
"<?xml version='1.0' encoding='UTF-8'?>\n" +
"<dbws\n" +
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xmlns:ns1=\"urn:oracleobjecttype\"\n" +
" >\n" +
" <name>oracleobjecttype</name>\n" +
" <query>\n" +
" <name>getEmployeesByProv</name>\n" +
" <parameter>\n" +
" <name>X</name>\n" +
" <type>ns1:addressType</type>\n" +
" </parameter>\n" +
" <result isCollection=\"true\">\n" +
" <type>ns1:employeeType</type>\n" +
" </result>\n" +
" <named-query>\n" +
" <name>getEmployeesByProv</name>\n" +
" <descriptor>employee</descriptor>\n" +
" </named-query>\n" +
" </query>\n" +
"</dbws>";
"""
<?xml version='1.0' encoding='UTF-8'?>
<dbws
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="urn:oracleobjecttype"
>
<name>oracleobjecttype</name>
<query>
<name>getEmployeesByProv</name>
<parameter>
<name>X</name>
<type>ns1:addressType</type>
</parameter>
<result isCollection="true">
<type>ns1:employeeType</type>
</result>
<named-query>
<name>getEmployeesByProv</name>
<descriptor>employee</descriptor>
</named-query>
</query>
</dbws>""";
static final String OBJECTTYPE_OR_PROJECT =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<object-persistence version=\"" + CONSTANT_PROJECT_BUILD_VERSION + "\" xmlns=\"http://www.eclipse.org/eclipselink/xsds/persistence\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:eclipselink=\"http://www.eclipse.org/eclipselink/xsds/persistence\">" +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -128,80 +128,82 @@ public class VeearrayTestSuite {
static final String DATABASE_URL_KEY = "db.url";
static final String DATABASE_DRIVER_KEY = "db.driver";
static final String VEEARRAY_SCHEMA =
"<?xml version='1.0' encoding='UTF-8'?>" +
"<xsd:schema\n" +
" targetNamespace=\"urn:veearray\" xmlns=\"urn:veearray\" elementFormDefault=\"qualified\"\n" +
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
" >\n" +
" <xsd:complexType name=\"phoneType\">\n" +
" <xsd:sequence>\n" +
" <xsd:element name=\"areaCode\" type=\"xsd:string\" />\n" +
" <xsd:element name=\"phoneNumber\" type=\"xsd:string\" />\n" +
" <xsd:element name=\"type\" type=\"xsd:string\" />\n" +
" </xsd:sequence>\n" +
" </xsd:complexType>\n" +
" <xsd:complexType name=\"employeeType\">\n" +
" <xsd:sequence>\n" +
" <xsd:element name=\"id\" type=\"xsd:int\" />\n" +
" <xsd:element name=\"first-name\" type=\"xsd:string\" />\n" +
" <xsd:element name=\"last-name\" type=\"xsd:string\" />\n" +
" <xsd:sequence>\n" +
" <xsd:element name=\"phones\" type=\"phoneType\" minOccurs=\"0\" />\n" +
" </xsd:sequence>\n" +
" </xsd:sequence>\n" +
" </xsd:complexType>\n" +
"</xsd:schema>";
"""
<?xml version='1.0' encoding='UTF-8'?><xsd:schema
targetNamespace="urn:veearray" xmlns="urn:veearray" elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<xsd:complexType name="phoneType">
<xsd:sequence>
<xsd:element name="areaCode" type="xsd:string" />
<xsd:element name="phoneNumber" type="xsd:string" />
<xsd:element name="type" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="employeeType">
<xsd:sequence>
<xsd:element name="id" type="xsd:int" />
<xsd:element name="first-name" type="xsd:string" />
<xsd:element name="last-name" type="xsd:string" />
<xsd:sequence>
<xsd:element name="phones" type="phoneType" minOccurs="0" />
</xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>""";
static final String VEEARRAY_XRMODEL =
"<?xml version='1.0' encoding='UTF-8'?>\n" +
"<dbws\n" +
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xmlns:ns1=\"urn:veearray\"\n" +
" >\n" +
" <name>veearray</name>\n" +
" <query>\n" +
" <name>getVeeArrayEmployees</name>\n" +
" <result isCollection=\"true\">\n" +
" <type>ns1:employeeType</type>\n" +
" </result>\n" +
" <named-query>\n" +
" <name>getVeeArrayEmployees</name>\n" +
" <descriptor>employee</descriptor>\n" +
" </named-query>\n" +
" </query>\n" +
" <query>\n" +
" <name>getVeeArrayEmployee</name>\n" +
" <parameter>\n" +
" <name>X</name>\n" +
" <type>xsd:int</type>\n" +
" </parameter>\n" +
" <result isCollection=\"true\">\n" +
" <type>ns1:employeeType</type>\n" +
" </result>\n" +
" <named-query>\n" +
" <name>getVeeArrayEmployee</name>\n" +
" <descriptor>employee</descriptor>\n" +
" </named-query>\n" +
" </query>\n" +
" <query>\n" +
" <name>updateVeeArrayPhones</name>\n" +
" <parameter>\n" +
" <name>X</name>\n" +
" <type>xsd:int</type>\n" +
" </parameter>\n" +
" <parameter>\n" +
" <name>Y</name>\n" +
" <type>ns1:phoneType</type>\n" +
" </parameter>\n" +
" <result>\n" +
" <type>xsd:int</type>\n" +
" </result>\n" +
" <named-query>\n" +
" <name>updateVeeArrayPhones</name>\n" +
" <descriptor>employee</descriptor>\n" +
" </named-query>\n" +
" </query>\n" +
"</dbws>\n";
"""
<?xml version='1.0' encoding='UTF-8'?>
<dbws
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="urn:veearray"
>
<name>veearray</name>
<query>
<name>getVeeArrayEmployees</name>
<result isCollection="true">
<type>ns1:employeeType</type>
</result>
<named-query>
<name>getVeeArrayEmployees</name>
<descriptor>employee</descriptor>
</named-query>
</query>
<query>
<name>getVeeArrayEmployee</name>
<parameter>
<name>X</name>
<type>xsd:int</type>
</parameter>
<result isCollection="true">
<type>ns1:employeeType</type>
</result>
<named-query>
<name>getVeeArrayEmployee</name>
<descriptor>employee</descriptor>
</named-query>
</query>
<query>
<name>updateVeeArrayPhones</name>
<parameter>
<name>X</name>
<type>xsd:int</type>
</parameter>
<parameter>
<name>Y</name>
<type>ns1:phoneType</type>
</parameter>
<result>
<type>xsd:int</type>
</result>
<named-query>
<name>updateVeeArrayPhones</name>
<descriptor>employee</descriptor>
</named-query>
</query>
</dbws>
""";

// test fixtures
public static XMLComparer comparer = new XMLComparer();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -115,64 +115,66 @@ public class KeyMappingsTestSuite {
"DROP TABLE XR_KEYMAP_ADDRESS|" ;

static final String KEYMAPPINGS_SCHEMA =
"<?xml version='1.0' encoding='UTF-8'?>" +
"<xsd:schema targetNamespace=\"urn:keymappings\" xmlns=\"urn:keymappings\" elementFormDefault=\"qualified\"\n" +
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
">\n" +
"<xsd:complexType name=\"phone\">\n" +
"<xsd:sequence>\n" +
"<xsd:element name=\"area-code\" type=\"xsd:string\" />\n" +
"<xsd:element name=\"phone-number\" type=\"xsd:string\" />\n" +
"<xsd:element name=\"type\" type=\"xsd:string\" />\n" +
"</xsd:sequence>\n" +
"<xsd:attribute name=\"phone-id\" type=\"xsd:int\" use=\"required\" />\n" +
"<xsd:attribute name=\"owner-ref-id\" type=\"xsd:int\" use=\"required\" />\n" +
"</xsd:complexType>\n" +
"<xsd:complexType name=\"address\">\n" +
"<xsd:sequence>\n" +
"<xsd:element name=\"street\" type=\"xsd:string\" />\n" +
"<xsd:element name=\"city\" type=\"xsd:string\" />\n" +
"<xsd:element name=\"province\" type=\"xsd:string\" />\n" +
"</xsd:sequence>\n" +
"<xsd:attribute name=\"address-id\" type=\"xsd:int\" use=\"required\" />\n" +
"</xsd:complexType>\n" +
"<xsd:complexType name=\"employee\">\n" +
"<xsd:sequence>\n" +
"<xsd:element name=\"first-name\" type=\"xsd:string\" />\n" +
"<xsd:element name=\"last-name\" type=\"xsd:string\" />\n" +
"<xsd:element name=\"address\" type=\"address\" minOccurs=\"0\" />\n" +
"<xsd:element name=\"phones\">\n" +
"<xsd:complexType>\n" +
"<xsd:sequence>\n" +
"<xsd:element maxOccurs=\"unbounded\" name=\"phone-ref\">\n" +
"<xsd:complexType>\n" +
"<xsd:attribute name=\"phone-id\" type=\"xsd:int\" use=\"required\" />\n" +
"</xsd:complexType>\n" +
"</xsd:element>\n" +
"</xsd:sequence>\n" +
"</xsd:complexType>\n" +
"</xsd:element>\n" +
"</xsd:sequence>\n" +
"<xsd:attribute name=\"employee-id\" type=\"xsd:int\" use=\"required\" />\n" +
"<xsd:attribute name=\"address-ref-id\" type=\"xsd:int\" use=\"required\" />\n" +
"</xsd:complexType>\n" +
"</xsd:schema>";
"""
<?xml version='1.0' encoding='UTF-8'?><xsd:schema targetNamespace="urn:keymappings" xmlns="urn:keymappings" elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<xsd:complexType name="phone">
<xsd:sequence>
<xsd:element name="area-code" type="xsd:string" />
<xsd:element name="phone-number" type="xsd:string" />
<xsd:element name="type" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="phone-id" type="xsd:int" use="required" />
<xsd:attribute name="owner-ref-id" type="xsd:int" use="required" />
</xsd:complexType>
<xsd:complexType name="address">
<xsd:sequence>
<xsd:element name="street" type="xsd:string" />
<xsd:element name="city" type="xsd:string" />
<xsd:element name="province" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="address-id" type="xsd:int" use="required" />
</xsd:complexType>
<xsd:complexType name="employee">
<xsd:sequence>
<xsd:element name="first-name" type="xsd:string" />
<xsd:element name="last-name" type="xsd:string" />
<xsd:element name="address" type="address" minOccurs="0" />
<xsd:element name="phones">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="phone-ref">
<xsd:complexType>
<xsd:attribute name="phone-id" type="xsd:int" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="employee-id" type="xsd:int" use="required" />
<xsd:attribute name="address-ref-id" type="xsd:int" use="required" />
</xsd:complexType>
</xsd:schema>""";
static final String KEYMAPPINGS_DBWS =
"<?xml version='1.0' encoding='UTF-8'?>\n" +
"<dbws\n" +
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
"xmlns:ns1=\"urn:keymappings\"\n" +
">\n" +
"<name>keymappings</name>\n" +
"<query>\n" +
"<name>getAllEmployees</name>\n" +
"<result isCollection=\"true\">\n" +
"<type>ns1:employee</type>\n" +
"</result>\n" +
"<sql><![CDATA[select * from XR_KEYMAP_EMPLOYEE]]></sql>\n" +
"</query>\n" +
"</dbws>\n";
"""
<?xml version='1.0' encoding='UTF-8'?>
<dbws
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="urn:keymappings"
>
<name>keymappings</name>
<query>
<name>getAllEmployees</name>
<result isCollection="true">
<type>ns1:employee</type>
</result>
<sql><![CDATA[select * from XR_KEYMAP_EMPLOYEE]]></sql>
</query>
</dbws>
""";
static final String KEYMAPPINGS_OR_PROJECT =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<object-persistence version=\"" + CONSTANT_PROJECT_BUILD_VERSION + "\"\n" +
Expand Down

0 comments on commit 551c812

Please sign in to comment.