Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

Commit f3e9eae

Browse files
YRutujayaminikb
authored andcommitted
Fixes #21907 : Added JDBC TestSuite to pipeline (#21908)
* Add script for jdbc tests * commented failing tests for jdbc
1 parent 44e297b commit f3e9eae

File tree

2,401 files changed

+85637
-47433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,401 files changed

+85637
-47433
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!--
2+
3+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4+
5+
Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
6+
7+
The contents of this file are subject to the terms of either the GNU
8+
General Public License Version 2 only ("GPL") or the Common Development
9+
and Distribution License("CDDL") (collectively, the "License"). You
10+
may not use this file except in compliance with the License. You can
11+
obtain a copy of the License at
12+
https://oss.oracle.com/licenses/CDDL+GPL-1.1
13+
or LICENSE.txt. See the License for the specific
14+
language governing permissions and limitations under the License.
15+
16+
When distributing the software, include this License Header Notice in each
17+
file and include the License file at LICENSE.txt.
18+
19+
GPL Classpath Exception:
20+
Oracle designates this particular file as subject to the "Classpath"
21+
exception as provided by Oracle in the GPL Version 2 section of the License
22+
file that accompanied this code.
23+
24+
Modifications:
25+
If applicable, add the following below the License Header, with the fields
26+
enclosed by brackets [] replaced by your own identifying information:
27+
"Portions Copyright [year] [name of copyright owner]"
28+
29+
Contributor(s):
30+
If you wish your version of this file to be governed by only the CDDL or
31+
only the GPL Version 2, indicate your decision by adding "[Contributor]
32+
elects to include this software in this distribution under the [CDDL or GPL
33+
Version 2] license." If you don't indicate a single choice of license, a
34+
recipient has the option to distribute your version of this file under
35+
either the CDDL, the GPL Version 2 or to extend the choice of license to
36+
its licensees as provided above. However, if you add GPL Version 2 code
37+
and therefore, elected the GPL Version 2 license, then the option applies
38+
only if the new code is made subject to such option by the copyright
39+
holder.
40+
41+
-->
42+
43+
<property name="oracle.pool.name" value="jdbc-oracle-pool"/>
44+
<property name="oracle.xapool.name" value="jdbc-oracle-xa-pool"/>
45+
<property name="oracle.resource.name" value="jdbc/oracleres"/>
46+
<property name="oracle.xaresource.name" value="jdbc/xa-oracleres"/>
47+
<property name="oracle.datasource.class" value="oracle.jdbc.pool.OracleDataSource"/>
48+
<property name="oracle.xadatasource.class" value="oracle.jdbc.xa.client.OracleXADataSource"/>
49+
<property name="oracle.driver.class" value="oracle.jdbc.driver.OracleDriver"/>
50+
<property name="oracle.driver.name" value="oracle.jdbc.driver.OracleDriver"/>
51+
<property name="oracle.user" value="coretest1"/>
52+
<property name="oracle.password" value="coretest1"/>
53+
<property name="oracle.url" value="jdbc:oracle:thin:@jws-280r-3.red.iplanet.com:1521:ora11g"/>
54+
<property name="oracle.port" value="1521"/>
55+
<property name="oracle.serverName" value="jws-280r-3.red.iplanet.com"/>
56+
<property name="oracle.SID" value="ora11g"/>
57+
<property name="oracle.resource.type" value="javax.sql.DataSource"/>
58+
59+
<!-- MySQL -->
60+
<property name="mysql.pool.name" value="jdbc-mysql-pool"/>
61+
<property name="mysql.xa.pool.name" value="jdbc-mysql-xa-pool"/>
62+
<property name="mysql.resource.name" value="jdbc/mysqlres"/>
63+
<property name="mysql.xa.resource.name" value="jdbc/xa-mysqlres"/>
64+
<property name="mysql.datasource.class" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/>
65+
<property name="mysql.xa.datasource.class" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"/>
66+
<property name="mysql.driver.name" value="com.mysql.jdbc.Driver"/>
67+
<property name="mysql.user" value="root"/>
68+
<property name="mysql.password" value="mysql"/>
69+
<property name="mysql.url" value="jdbc:mysql://localhost:3306/mysql"/>
70+
<property name="mysql.databaseName" value="mysql"/>
71+
<property name="mysql.serverName" value="localhost"/>
72+
<property name="mysql.port" value="3306"/>
73+
74+
<property name="derby.user" value="dbuser"/>
75+
<property name="derby.password" value="dbpassword"/>
76+

appserver/tests/v2-tests/appserv-tests/devtests/jdbc/JdbcCommon.xml renamed to appserver/tests/appserv-tests/devtests/jdbc/JdbcCommon.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,45 @@
11
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<!--
3+
4+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5+
6+
Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
7+
8+
The contents of this file are subject to the terms of either the GNU
9+
General Public License Version 2 only ("GPL") or the Common Development
10+
and Distribution License("CDDL") (collectively, the "License"). You
11+
may not use this file except in compliance with the License. You can
12+
obtain a copy of the License at
13+
https://oss.oracle.com/licenses/CDDL+GPL-1.1
14+
or LICENSE.txt. See the License for the specific
15+
language governing permissions and limitations under the License.
16+
17+
When distributing the software, include this License Header Notice in each
18+
file and include the License file at LICENSE.txt.
19+
20+
GPL Classpath Exception:
21+
Oracle designates this particular file as subject to the "Classpath"
22+
exception as provided by Oracle in the GPL Version 2 section of the License
23+
file that accompanied this code.
24+
25+
Modifications:
26+
If applicable, add the following below the License Header, with the fields
27+
enclosed by brackets [] replaced by your own identifying information:
28+
"Portions Copyright [year] [name of copyright owner]"
29+
30+
Contributor(s):
31+
If you wish your version of this file to be governed by only the CDDL or
32+
only the GPL Version 2, indicate your decision by adding "[Contributor]
33+
elects to include this software in this distribution under the [CDDL or GPL
34+
Version 2] license." If you don't indicate a single choice of license, a
35+
recipient has the option to distribute your version of this file under
36+
either the CDDL, the GPL Version 2 or to extend the choice of license to
37+
its licensees as provided above. However, if you add GPL Version 2 code
38+
and therefore, elected the GPL Version 2 license, then the option applies
39+
only if the new code is made subject to such option by the copyright
40+
holder.
41+
42+
-->
243

344
<!--
445
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<!--
3+
4+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5+
6+
Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
7+
8+
The contents of this file are subject to the terms of either the GNU
9+
General Public License Version 2 only ("GPL") or the Common Development
10+
and Distribution License("CDDL") (collectively, the "License"). You
11+
may not use this file except in compliance with the License. You can
12+
obtain a copy of the License at
13+
https://oss.oracle.com/licenses/CDDL+GPL-1.1
14+
or LICENSE.txt. See the License for the specific
15+
language governing permissions and limitations under the License.
16+
17+
When distributing the software, include this License Header Notice in each
18+
file and include the License file at LICENSE.txt.
19+
20+
GPL Classpath Exception:
21+
Oracle designates this particular file as subject to the "Classpath"
22+
exception as provided by Oracle in the GPL Version 2 section of the License
23+
file that accompanied this code.
24+
25+
Modifications:
26+
If applicable, add the following below the License Header, with the fields
27+
enclosed by brackets [] replaced by your own identifying information:
28+
"Portions Copyright [year] [name of copyright owner]"
29+
30+
Contributor(s):
31+
If you wish your version of this file to be governed by only the CDDL or
32+
only the GPL Version 2, indicate your decision by adding "[Contributor]
33+
elects to include this software in this distribution under the [CDDL or GPL
34+
Version 2] license." If you don't indicate a single choice of license, a
35+
recipient has the option to distribute your version of this file under
36+
either the CDDL, the GPL Version 2 or to extend the choice of license to
37+
its licensees as provided above. However, if you add GPL Version 2 code
38+
and therefore, elected the GPL Version 2 license, then the option applies
39+
only if the new code is made subject to such option by the copyright
40+
holder.
41+
42+
-->
43+
44+
<!DOCTYPE project [
45+
<!ENTITY commonSetup SYSTEM "./../../../config/properties.xml">
46+
<!ENTITY commonBuild SYSTEM "./../../../config/common.xml">
47+
<!ENTITY testproperties SYSTEM "./build.properties">
48+
<!ENTITY run SYSTEM "./../../../config/run.xml">
49+
<!ENTITY jdbcCommon SYSTEM "./../JdbcCommon.xml">
50+
<!ENTITY jdbcProperties SYSTEM "./../JdbcCommon.properties">
51+
]>
52+
53+
<project name="mix" default="usage" basedir=".">
54+
55+
&commonSetup;
56+
&commonBuild;
57+
&run;
58+
&jdbcCommon;
59+
&jdbcProperties;
60+
&testproperties;
61+
62+
<target name="all" depends="build,deploy,run,undeploy"/>
63+
64+
<target name="clean" depends="init-common">
65+
<antcall target="clean-common"/>
66+
</target>
67+
68+
<target name="compile" depends="clean">
69+
<antcall target="compile-common">
70+
<param name="src" value="ejb"/>
71+
</antcall>
72+
<antcall target="compile-common">
73+
<param name="src" value="client"/>
74+
</antcall>
75+
</target>
76+
77+
<target name="build" depends="compile">
78+
<antcall target="build-ear-common">
79+
<param name="ejbjar.classes"
80+
value="**/*.class" />
81+
<param name="appclientjar.classes"
82+
value="**/SimpleBMP.class, **/SimpleBMPHome.class,**/*Client*.class" />
83+
</antcall>
84+
</target>
85+
86+
<target name="deploy" depends="init-common">
87+
<antcall target="execute-sql-common">
88+
<param name="sql.file" value="sql/create_pointbase.sql"/>
89+
</antcall>
90+
<antcall target="deploy-jdbc-common"/>
91+
<!--
92+
<param name="jdbc.conpool.name" value="bmpHandlePool"/>
93+
<param name="jdbc.resource.name" value="jdbc/bmp-handle-mixDB"/>
94+
</antcall>
95+
<antcall target="restart-server-instance-common"/>
96+
-->
97+
<antcall target="deploy-common"/>
98+
</target>
99+
100+
<target name="run" depends="init-common">
101+
<antcall target="setup-derby-for-authentication"/>
102+
<antcall target="execute-sql-common">
103+
<param name="sql.file" value="sql/create_pointbase.sql"/>
104+
</antcall>
105+
<antcall target="runclient-common"/>
106+
<antcall target="reset-derby-for-no-authentication"/>
107+
</target>
108+
109+
<target name="undeploy" depends="init-common">
110+
<antcall target="execute-sql-common">
111+
<param name="sql.file" value="sql/drop_pointbase.sql"/>
112+
</antcall>
113+
114+
<antcall target="undeploy-jdbc-common"/>
115+
<!--
116+
<param name="jdbc.conpool.name" value="bmpHandlePool"/>
117+
<param name="jdbc.resource.name" value="jdbc/bmp-handle-mixDB"/>
118+
</antcall>
119+
-->
120+
<antcall target="undeploy-common"/>
121+
</target>
122+
123+
<target name="usage">
124+
<antcall target="usage-common"/>
125+
</target>
126+
127+
</project>
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
12+
* or LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
41+
package com.sun.s1asdev.jdbc.appauth.client;
42+
43+
import javax.naming.*;
44+
import java.rmi.*;
45+
import java.util.*;
46+
47+
import com.sun.s1asdev.jdbc.appauth.ejb.SimpleBMPHome;
48+
import com.sun.s1asdev.jdbc.appauth.ejb.SimpleBMP;
49+
import com.sun.ejte.ccl.reporter.SimpleReporterAdapter;
50+
51+
public class SimpleBMPClient {
52+
53+
public static void main(String[] args)
54+
throws Exception {
55+
56+
SimpleReporterAdapter stat = new SimpleReporterAdapter();
57+
String testSuite = "AppAuth ";
58+
59+
InitialContext ic = new InitialContext();
60+
Object objRef = ic.lookup("java:comp/env/ejb/SimpleBMPHome");
61+
SimpleBMPHome simpleBMPHome = (SimpleBMPHome)
62+
javax.rmi.PortableRemoteObject.narrow(objRef, SimpleBMPHome.class);
63+
64+
stat.addDescription("JDBC Application Authentication test");
65+
SimpleBMP simpleBMP = simpleBMPHome.create();
66+
67+
System.out.println("test 3 will fail with Derby" );
68+
if ( simpleBMP.test1() ) {
69+
stat.addStatus(testSuite+"test1 : ", stat.PASS);
70+
} else {
71+
stat.addStatus(testSuite+"test1 : ", stat.FAIL);
72+
}
73+
if ( simpleBMP.test2() ) {
74+
stat.addStatus(testSuite+"test2 : ", stat.PASS);
75+
} else {
76+
stat.addStatus(testSuite+"test2 : ", stat.FAIL);
77+
}
78+
79+
if ( simpleBMP.test3() ) {
80+
stat.addStatus(testSuite + "test3 : ", stat.PASS);
81+
} else {
82+
stat.addStatus(testSuite + "test3 : ", stat.FAIL);
83+
}
84+
85+
if ( simpleBMP.test4() ) {
86+
stat.addStatus(testSuite + "test4 : ", stat.PASS);
87+
} else {
88+
stat.addStatus(testSuite + "test4 : ", stat.FAIL);
89+
}
90+
91+
if ( simpleBMP.test5() ) {
92+
stat.addStatus(testSuite + "test5 : ", stat.PASS);
93+
} else {
94+
stat.addStatus(testSuite + "test5 : ", stat.FAIL);
95+
}
96+
97+
System.out.println("jdbc appauth status: ");
98+
stat.printSummary();
99+
}
100+
}

0 commit comments

Comments
 (0)