Initial Contribution

Signed-off-by: Vinay Vishal <vinay.vishal@oracle.com>
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/alltables_oracle.sql b/appserver/tests/appserv-tests/devtests/cdi/config/alltables_oracle.sql
new file mode 100644
index 0000000..82a61d0
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/alltables_oracle.sql
@@ -0,0 +1,3 @@
+-- droping all tables from the current user db
+-- delete from user_tables;
+select 'drop table', table_name,'cascade constraints;' from user_tables;
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/das-config.properties b/appserver/tests/appserv-tests/devtests/cdi/config/das-config.properties
new file mode 100644
index 0000000..e0f75f7
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/das-config.properties
@@ -0,0 +1,53 @@
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+execution.mode=pe
+admin.port=4849
+admin.user=admin
+admin.host=localhost
+admin.domain=domain1
+admin.domain.dir=${env.S1AS_HOME}/domains
+activeconsumer.maxnum=1
+mail.host="ha21sca.sfbay.sun.com"
+http.port=8080
+http.host=localhost
+https.host=localhost
+https.port=8181
+orb.port=3700
+admin.password=admin123
+master.password=admin123
+appserver.instance.name=server
+appserver.config.name=server-config
+directory.server.host=localhost
+directory.server.port=389
+directory.server.basedn=dc=sfbay,dc=sun,dc=com
+directory.manager.dn=cn=Directory Manager
+directory.manager.pwd=directorymanager
+server.dir=home/results/s1aspe80
+log.server.location=sardinia.sfbay.sun.com
+win.map.drive=Q:
+results.mailer=abc@sun.com
+results.mailee=xyz@sun.com
+interop.admin.port=5858
+interop.admin.host=localhost
+interop.admin.domain=domain2
+interop.http.port=9090
+interop.http.host=localhost
+interop.https.port=2043
+interop.orb.port=4700
+isInteropDomain=true
+resources.dottedname.prefix=server.resources
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/database.xml b/appserver/tests/appserv-tests/devtests/cdi/config/database.xml
new file mode 100644
index 0000000..d4d1fb0
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/database.xml
@@ -0,0 +1,123 @@
+<!--
+
+    Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Public License v. 2.0, which is available at
+    http://www.eclipse.org/legal/epl-2.0.
+
+    This Source Code may also be made available under the following Secondary
+    Licenses when the conditions for such availability set forth in the
+    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+    version 2 with the GNU Classpath Exception, which is available at
+    https://www.gnu.org/software/classpath/license.html.
+
+    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+-->
+
+<!--
+<!DOCTYPE project [
+  <!ENTITY common SYSTEM "file:../../../config/common.xml">
+  <!ENTITY testcommon SYSTEM "file:../../../config/properties.xml">
+]>
+-->
+<!-- ============================ -->
+<!-- ORACLE SETUP FOR CONPOOL     -->
+<!-- ============================ -->
+<!--
+<project name="oracle-db-settings" default="create-jdbc-conpool-connector" basedir=".">
+
+&common; 
+&testcommon;
+-->
+
+<target name="create-jdbc-conpool-connector" depends="default-jdbc-conpool, oracle-jdbc-conpool"/>
+
+<target name="default-jdbc-conpool" depends="init-common" unless="oracle">
+	<antcall target="create-jdbc-connpool-common"/>
+</target>
+	   
+<target name="oracle-jdbc-conpool" depends="init-common" if="oracle">
+<echo message="creating jdbc connection pool ${jdbc.conpool.name}"
+    level="verbose"/>
+    <exec executable="${ASADMIN}" failonerror="false">
+        <arg line="create-jdbc-connection-pool"/>
+        <arg line="--datasourceclassname ${db.class}"/>
+        <arg line="--restype ${jdbc.resource.type}"/>
+        <arg line="--target ${appserver.instance.name}"/>
+        <arg line="${as.props}"/>
+        <arg line="${jdbc.conpool.name}"/>
+    </exec>
+    <antcall target="set-oracle-props">
+	<param name="pool.type" value="jdbc"/>
+	<param name="conpool.name" value="${jdbc.conpool.name}"/>
+    </antcall>
+</target>
+
+<target name="set-oracle-props" depends="init-common" if="oracle"> 
+  <property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/>
+  <antcall target="asadmin-common-ignore-fail">
+    <param name="admin.command" value="set" />
+    <param name="operand.props"
+      value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.ServerName=${oracleForConnector.host}"/>
+  </antcall>
+  <antcall target="asadmin-common-ignore-fail">
+    <param name="admin.command" value="set" />
+    <param name="operand.props"
+      value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.PortNumber=${oracleForConnector.port}" />
+  </antcall>
+  <antcall target="asadmin-common-ignore-fail">
+    <param name="admin.command" value="set" />
+    <param name="operand.props"
+      value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.DatabaseName='jdbc:sun:oracle://${oracleForConnector.host}:${oracleForConnector.port};SID=${oracleForConnector.sid}' " />
+  </antcall>
+  <antcall target="asadmin-common-ignore-fail">
+    <param name="admin.command" value="set" />
+    <param name="operand.props"
+      value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.ClassName=${oracleForConnector.dbclass}" />
+  </antcall>
+  <antcall target="asadmin-common-ignore-fail">
+    <param name="admin.command" value="set" />
+    <param name="operand.props"
+      value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.SID=${oracleForConnector.sid}" />
+  </antcall>
+  <antcall target="asadmin-common-ignore-fail">
+    <param name="admin.command" value="set" />
+    <param name="operand.props"
+      value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.User=${oracleForConnector.user}" />
+  </antcall>
+  <antcall target="asadmin-common-ignore-fail">
+    <param name="admin.command" value="set" />
+    <param name="operand.props"
+      value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.Password=${oracleForConnector.pwd}" />
+  </antcall>
+</target>
+
+
+<target name="execute-sql-connector" depends="init-common, default-sql, sql-oracle"/>
+
+<target name="default-sql" depends="init-common" unless="oracle" > 
+	<antcall target="execute-sql-common"/>
+</target>
+
+<target name="sql-oracle" depends="init-common" if="oracle">
+	<property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/>
+	<property name="domain.lib.ext" value="${env.S1AS_HOME}/domains/domain1/lib/ext"/>
+	<property name="oracle.driver.path" value="${domain.lib.ext}/smoracle.jar:${domain.lib.ext}/smbase.jar:${domain.lib.ext}/smresource.jar:${domain.lib.ext}/smutil.jar:${domain.lib.ext}/smspy.jar:${domain.lib.ext}/Oranxo.jar"/>
+	<echo message="${oracleForConnector.driver}"/>
+<echo message="Executing sql statement at ${basedir} from ${sql.file}"
+    level="verbose"/>
+  <sql
+    driver="${oracleForConnector.driver}"
+    url="${oracleForConnector.url}"
+    userid="${oracleForConnector.user}"
+    password="${oracleForConnector.pwd}"
+    src="${sql.file}"
+    onerror="continue"
+    print="yes"
+    classpath="${oracle.driver.path}"/>
+</target>
+<!--
+</project>
+-->
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/ee-config.properties b/appserver/tests/appserv-tests/devtests/cdi/config/ee-config.properties
new file mode 100644
index 0000000..461bee1
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/ee-config.properties
@@ -0,0 +1,57 @@
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+execution.mode=ee
+admin.port=4849
+admin.user=admin
+admin.password=admin123
+master.password=admin123
+admin.host=localhost
+admin.domain=sqe-domain
+admin.domain.dir=${env.S1AS_HOME}/domains
+imq.dir=${env.S1AS_HOME}/imq
+activeconsumer.maxnum=-1
+http.port=38080
+http.host=localhost
+https.host=localhost
+https.port=33820
+orb.port=33700
+nodeagent.name=sqe-agent
+appserver.config.name=server-config
+cluster.name=sqe-cluster
+clustered.instance.name=clustered_server
+server.instance.name=sqe-cluster
+appserver.instance.name=sqe-cluster
+config.dottedname.prefix=server
+resources.dottedname.prefix=domain.resources
+directory.server.host=localhost
+directory.server.port=389
+directory.server.basedn=dc=sfbay,dc=sun,dc=com
+directory.manager.dn=cn=Directory Manager
+directory.manager.pwd=directorymanager
+interop.admin.port=5858
+interop.admin.host=localhost
+interop.admin.domain=domain2
+interop.http.port=9090
+interop.http.host=localhost
+interop.https.port=2043
+interop.orb.port=4700
+isInteropDomain=true
+results.mailer=abc@sun.com
+results.mailee=xyz@sun.com
+mail.host="ha21sca.sfbay.sun.com"
+install.type=cluster
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/eesetup b/appserver/tests/appserv-tests/devtests/cdi/config/eesetup
new file mode 100644
index 0000000..ef24e53
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/eesetup
@@ -0,0 +1,226 @@
+#!/bin/sh
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+# This script creates and starts a domain called "sqe-domain"
+# with a single server instance named "sqe-server".
+
+#--- Extract environment properties --- "sed" doesn't work with iastools.zip used in windows
+
+PASSWORD_FILE=${APS_HOME}/devtests/connector/config/password.txt
+
+for x in `cat $APS_HOME/devtests/connector/config/ee-config.properties`
+do
+    varval=`echo $x |cut -d'=' -f1`
+
+    if [ $varval = "admin.user" ];
+    then
+        AS_ADMIN_USER=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "admin.port" ];
+    then
+        AS_ADMIN_PORT=`echo $x |cut -d'=' -f2`
+    fi
+    
+    if [ $varval = "admin.host" ];
+    then
+        AS_ADMIN_HOST=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "orb.port" ];
+    then
+        ORB_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "http.port" ];
+    then
+        HTTP_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "https.port" ];
+    then
+        SSL_PORT=`echo $x |cut -d'=' -f2`
+    fi
+    
+    if [ $varval = "admin.password" ];
+    then
+        echo "AS_ADMIN_PASSWORD=`echo $x |cut -d'=' -f2`" > ${PASSWORD_FILE} 
+        echo "AS_ADMIN_ADMINPASSWORD=`echo $x |cut -d'=' -f2`" >> ${PASSWORD_FILE} 
+    fi
+
+    if [ $varval = "master.password" ];
+    then
+        echo "AS_ADMIN_MASTERPASSWORD=`echo $x |cut -d'=' -f2`" >> ${PASSWORD_FILE}
+    fi
+
+    if [ $varval = "admin.domain" ];
+    then
+        AS_ADMIN_DOMAIN=`echo $x |cut -d'=' -f2`
+    fi
+    if [ $varval = "nodeagent.name" ];
+    then
+        AS_ADMIN_NODEAGENT=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "server.instance.name" ];
+    then
+        AS_ADMIN_SERVER=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "cluster.name" ];
+    then
+        CLUSTER_NAME=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "clustered.instance.name" ];
+    then
+        CLUSTERED_INSTANCE_NAME=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "install.type" ];
+    then
+        INSTALL_TYPE=`echo $x |cut -d'=' -f2`
+    fi
+
+done
+
+ASADMIN=${S1AS_HOME}/bin/asadmin
+HTTP_LISTENER_2_PORT="1042"
+SSL_MUTUALAUTH_PORT="1058"
+JMX_SYSTEM_CONNECTOR_PORT="8687"
+
+export AS_ADMIN_USER
+#export AS_ADMIN_PASSWORD ## do not set AS_ADMIN_PASSWORD in env. -password option is deprecated. 
+export AS_ADMIN_PORT
+export AS_ADMIN_HOST
+export AS_ADMIN_DOMAIN
+export AS_ADMIN_NODEAGENT
+export AS_ADMIN_SERVER
+export CLUSTER_NAME
+export CLUSTERED_INSTANCE_NAME
+
+##----- End Variable Defintions --------------
+
+
+
+#Create domain: sqe-domain----
+echo "               EESETUP: creating domain ${AS_ADMIN_DOMAIN}..."
+${ASADMIN} create-domain --adminport ${AS_ADMIN_PORT} --adminuser ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_DOMAIN}
+
+# Start domain: sqe-domain----
+echo "               EESETUP: starting domain ${AS_ADMIN_DOMAIN}..."
+${ASADMIN} start-domain --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_DOMAIN}
+
+# Create node agent (sqe-agent) referencing sqe-domain.----
+echo "               EESETUP: creating node agent: ${AS_ADMIN_NODEAGENT}..."
+${ASADMIN} create-node-agent --host ${AS_ADMIN_HOST} --port ${AS_ADMIN_PORT} --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_NODEAGENT}
+
+#----Start the sqe-agent. ----
+echo "               EESETUP: starting node agent: ${AS_ADMIN_NODEAGENT}..."
+${ASADMIN} start-node-agent --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_NODEAGENT}
+
+echo "               EESETUP: INSTALL TYPE is set to :${INSTALL_TYPE}"
+#echo "               EESETUP: install.type value in config.properties needs to be one of [standalone | cluster]"
+
+if [ ${INSTALL_TYPE} = "standalone" ]; then
+#  ----------------
+    # Create server instance: sqe-server----
+    echo "               EESETUP: creating sever instance:${AS_ADMIN_SERVER}..."
+    ${ASADMIN} create-instance \
+        --user ${AS_ADMIN_USER} \
+        --passwordfile ${PASSWORD_FILE} \
+        --nodeagent ${AS_ADMIN_NODEAGENT} \
+        ${AS_ADMIN_SERVER}
+
+    ${ASADMIN} start-instance \
+        --user ${AS_ADMIN_USER} \
+        --passwordfile ${PASSWORD_FILE} \
+        ${AS_ADMIN_SERVER}
+fi
+
+if [ ${INSTALL_TYPE} = "cluster" ]; then
+#  ----------------
+    # Create cluster: sqe-cluster----
+    echo "               EESETUP: creating cluster:${CLUSTER_NAME}..."
+    ${ASADMIN} create-cluster --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} --host ${AS_ADMIN_HOST} --port ${AS_ADMIN_PORT} ${CLUSTER_NAME}
+
+    # Set ports for first instance 
+    echo "               EESETUP: using default ports in ee-config.properties for first instance..."
+        HTTP_LISTENER_1_PORT=`expr ${HTTP_LISTENER_1_PORT} `
+        HTTP_LISTENER_2_PORT=`expr ${HTTP_LISTENER_2_PORT} `
+        ORB_LISTENER_1_PORT=`expr ${ORB_LISTENER_1_PORT} `
+        SSL_PORT=`expr ${SSL_PORT} `
+        SSL_MUTUALAUTH_PORT=`expr ${SSL_MUTUALAUTH_PORT} `
+        JMX_SYSTEM_CONNECTOR_PORT=`expr ${JMX_SYSTEM_CONNECTOR_PORT} `
+
+    # Create clustered instance: clustered-server----
+    echo "               EESETUP: creating server instance:${CLUSTERED_INSTANCE_NAME}_1..."
+    ${ASADMIN} create-instance \
+        --nodeagent ${AS_ADMIN_NODEAGENT} \
+        --cluster ${CLUSTER_NAME} \
+        --systemproperties "HTTP_LISTENER_PORT=${HTTP_LISTENER_1_PORT}:HTTP_SSL_LISTENER_PORT=${HTTP_LISTENER_2_PORT}:IIOP_LISTENER_PORT=${ORB_LISTENER_1_PORT}:IIOP_SSL_LISTENER_PORT=${SSL_PORT}:IIOP_SSL_MUTUALAUTH_PORT=${SSL_MUTUALAUTH_PORT}:JMX_SYSTEM_CONNECTOR_PORT=${JMX_SYSTEM_CONNECTOR_PORT}" \
+        --user ${AS_ADMIN_USER} \
+	--passwordfile ${PASSWORD_FILE} \
+    ${CLUSTERED_INSTANCE_NAME}_1
+
+    # Roll over ports ----------------
+    echo "               EESETUP: Rolling over default port values by 4."
+        HTTP_LISTENER_1_PORT=`expr ${HTTP_LISTENER_1_PORT} + 4`
+        HTTP_LISTENER_2_PORT=`expr ${HTTP_LISTENER_2_PORT} + 4`
+        ORB_LISTENER_1_PORT=`expr ${ORB_LISTENER_1_PORT} + 4`
+        SSL_PORT=`expr ${SSL_PORT} + 4`
+        SSL_MUTUALAUTH_PORT=`expr ${SSL_MUTUALAUTH_PORT} + 4`
+        JMX_SYSTEM_CONNECTOR_PORT=`expr ${JMX_SYSTEM_CONNECTOR_PORT} + 4`
+
+    # Create clustered instance: clustered-server----
+    echo "               EESETUP: creating server instance:${CLUSTERED_INSTANCE_NAME}_2..."
+    ${ASADMIN} create-instance \
+        --nodeagent ${AS_ADMIN_NODEAGENT} \
+        --cluster ${CLUSTER_NAME} \
+        --systemproperties "HTTP_LISTENER_PORT=${HTTP_LISTENER_1_PORT}:HTTP_SSL_LISTENER_PORT=${HTTP_LISTENER_2_PORT}:IIOP_LISTENER_PORT=${ORB_LISTENER_1_PORT}:IIOP_SSL_LISTENER_PORT=${SSL_PORT}:IIOP_SSL_MUTUALAUTH_PORT=${SSL_MUTUALAUTH_PORT}:JMX_SYSTEM_CONNECTOR_PORT=${JMX_SYSTEM_CONNECTOR_PORT}" \
+        --user ${AS_ADMIN_USER} \
+	--passwordfile ${PASSWORD_FILE} \
+    ${CLUSTERED_INSTANCE_NAME}_2
+    #-- END Cluster Setup--------------------------
+
+    # Start cluster: sqe-cluster----
+    echo "               EESETUP: Starting cluster:${CLUSTER_NAME}..."
+    ${ASADMIN} start-cluster --user ${AS_ADMIN_USER} --passwordfile ${PASSWORD_FILE} --host ${AS_ADMIN_HOST} --port ${AS_ADMIN_PORT} ${CLUSTER_NAME}
+
+fi
+
+rm -f $PASSWORD_FILE
+echo "               EESETUP: EE setup complete!"
+
+# ---------  Notes. ------------
+
+#NOTE: There is an unstated jmx port 8686 which is 
+# currently not configurable. This port will need to be specified 
+# when creating the node agent.
+
+#NOTE: The domain should be up an running when the node agent is started. 
+
+#NOTE: The stop-nodeagent command currently does
+# not function due to a bug so should you ever need to stop the node
+# agent you must kill its process. In reality you should never need 
+# to stop the node agent once it is started.
+
+#NOTE: The ports by default will not conflict with those of the DAS. 
+#The http-listener port will default to 8079. 
+
+
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/eeunsetup b/appserver/tests/appserv-tests/devtests/cdi/config/eeunsetup
new file mode 100644
index 0000000..b5a1038
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/eeunsetup
@@ -0,0 +1,173 @@
+#!/bin/sh
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+#--- Extract environment properties --- "sed" doesn't work with iastools.zip used in windows
+PASSWORD_FILE=${APS_HOME}/devtests/connector/config/password.txt
+for x in `cat $APS_HOME/devtests/connector/config/ee-config.properties`
+do
+    varval=`echo $x |cut -d'=' -f1`
+                                                                                                                                                             
+    if [ $varval = "admin.user" ];
+    then
+        AS_ADMIN_USER=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "admin.port" ];
+    then
+        AS_ADMIN_PORT=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "admin.host" ];
+    then
+        AS_ADMIN_HOST=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "orb.port" ];
+    then
+        ORB_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "http.port" ];
+    then
+        HTTP_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "https.port" ];
+    then
+        SSL_PORT=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "admin.password" ];
+    then
+        echo "AS_ADMIN_PASSWORD=`echo $x |cut -d'=' -f2`" > ${PASSWORD_FILE}
+        echo "AS_ADMIN_ADMINPASSWORD=`echo $x |cut -d'=' -f2`" >> ${PASSWORD_FILE}
+    fi
+    
+    if [ $varval = "master.password" ];
+    then
+        echo "AS_ADMIN_MASTERPASSWORD=`echo $x |cut -d'=' -f2`" >> ${PASSWORD_FILE}
+    fi
+                                                                                                                                                             
+    if [ $varval = "admin.domain" ];
+    then
+        AS_ADMIN_DOMAIN=`echo $x |cut -d'=' -f2`
+    fi
+    if [ $varval = "nodeagent.name" ];
+    then
+        AS_ADMIN_NODEAGENT=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "server.instance.name" ];
+    then
+        AS_ADMIN_SERVER=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "cluster.name" ];
+    then
+        CLUSTER_NAME=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "clustered.instance.name" ];
+    then
+        CLUSTERED_INSTANCE_NAME=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+    if [ $varval = "install.type" ];
+    then
+        INSTALL_TYPE=`echo $x |cut -d'=' -f2`
+    fi
+                                                                                                                                                             
+done
+                                                                                                                                                             
+ASADMIN=${S1AS_HOME}/bin/asadmin
+HTTP_LISTENER_2_PORT="1042"
+SSL_MUTUALAUTH_PORT="1058"
+JMX_SYSTEM_CONNECTOR_PORT="8687"
+                                                                                                                                                             
+export AS_ADMIN_USER
+#export AS_ADMIN_PASSWORD ## do not set AS_ADMIN_PASSWORD in env. -password option is deprecated.
+export AS_ADMIN_PORT
+export AS_ADMIN_HOST
+export AS_ADMIN_DOMAIN
+export AS_ADMIN_NODEAGENT
+export AS_ADMIN_SERVER
+export CLUSTER_NAME
+export CLUSTERED_INSTANCE_NAME
+                                                                                                                                                             
+
+LOG_DIR=$APS_HOME/devtests/jdbc/logs
+
+if [ ${INSTALL_TYPE} = "standalone" ]; then
+#  ----------------
+    # Stop server instance: sqe-server----
+    echo "              EEUNSETUP: stopping sever instance:${AS_ADMIN_SERVER}..."
+    ${ASADMIN} stop-instance \
+        --user ${AS_ADMIN_USER} \
+        --passwordfile ${PASSWORD_FILE} \
+        ${AS_ADMIN_SERVER}
+
+    ${ASADMIN} delete-instance \
+        --user ${AS_ADMIN_USER} \
+        --passwordfile ${PASSWORD_FILE} \
+        ${AS_ADMIN_SERVER}
+fi
+
+if [ ${INSTALL_TYPE} = "cluster" ]; then
+#  ----------------
+    # Create server instance: sqe-server----
+    echo "              EEUNSETUP: stopping cluster ${CLUSTER_NAME}"
+    ${ASADMIN} stop-cluster \
+        --user ${AS_ADMIN_USER} \
+        --passwordfile ${PASSWORD_FILE} \
+        ${CLUSTER_NAME}
+
+   ${ASADMIN} delete-instance \
+        --user ${AS_ADMIN_USER} \
+        --passwordfile ${PASSWORD_FILE} \
+        ${CLUSTERED_INSTANCE_NAME}_1
+
+   ${ASADMIN} delete-instance \
+        --user ${AS_ADMIN_USER} \
+        --passwordfile ${PASSWORD_FILE} \
+        ${CLUSTERED_INSTANCE_NAME}_2
+
+   ${ASADMIN} delete-cluster \
+        --user ${AS_ADMIN_USER} \
+        --passwordfile ${PASSWORD_FILE} \
+        ${CLUSTER_NAME}
+fi
+
+
+echo "              EEUNSETUP: stopping nodeagent....."
+${ASADMIN} stop-node-agent $AS_ADMIN_NODEAGENT
+
+echo "              EEUNSETUP: Deleting nodeagent....."
+${ASADMIN} delete-node-agent ${AS_ADMIN_NODEAGENT}
+
+echo "              EEUNSETUP: Deleting nodeagent config....."
+${ASADMIN} delete-node-agent-config --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_NODEAGENT}
+
+echo "              EEUNSETUP: stopping domain...."
+${ASADMIN} stop-domain ${AS_ADMIN_DOMAIN}
+
+${ASADMIN} delete-domain ${AS_ADMIN_DOMAIN}
+echo "              EEUNSETUP: EE domain,server instance and nodeagent has been deleted"
+
+rm -f $PASSWORD_FILE
+echo "		    EEUNSETUP: Unsetup complete.... "
+
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/oracle.properties b/appserver/tests/appserv-tests/devtests/cdi/config/oracle.properties
new file mode 100644
index 0000000..7109dfb
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/oracle.properties
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+oracleForConnector.port=1527
+oracleForConnector.host=localhost
+oracleForConnector.sid=testdb
+oracleForConnector.user=dbuser
+oracleForConnector.pwd=dbpassword
+oracleForConnector.driver=org.apache.derby.jdbc.ClientDriver
+oracleForConnector.dbclass=org.apache.derby.jdbc.ClientXADataSource
+oracleForConnector.url=jdbc:derby://${oracleForConnector.host}:${oracleForConnector.port}/${oracleForConnector.sid};create=true;
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/oracle_datadirect.properties b/appserver/tests/appserv-tests/devtests/cdi/config/oracle_datadirect.properties
new file mode 100644
index 0000000..3b7fe95
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/oracle_datadirect.properties
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+db.port=1521
+db.host=natraj.sfbay.sun.com
+db.sid=dbsmpl1
+db.type=oracle
+db.name=dbsmpl1
+db.user=dbuser
+db.pwd=dbpassword
+db.driver=com.sun.sql.jdbc.oracle.OracleDriver
+db.class=com.sun.sql.jdbcx.oracle.OracleDataSource
+db.xaclass=com.sun.sql.jdbcx.oracle.OracleDataSource
+db.url=jdbc:sun:oracle://${db.host}:${db.port};SID=${db.sid}
+connector.url=jdbc\\:sun\\:oracle\\://natraj.sfbay.sun.com\\:1521\\;SID\\=dbsmpl1
+db.unixdriverpath=lib/drivers/oracle/smoracle.jar
+db.windriverpath=lib/drivers/oracle/smoracle.jar
+cpds.class=com.sun.sql.jdbcx.oracle.OracleDataSource
+isDBOracle=true
+datadirect=true
+
+#properties used by global transaction tests.
+txdb.port=1521
+txdb.host=natraj.sfbay.sun.com
+txdb.name=dbsmpl2
+txdb.user=pbpublic
+txdb.pwd=pbpublic
+txdb.url=jdbc:sun:oracle://natraj.sfbay.sun.com:1521;SID=dbsmpl2
+
+#Properties used by admincli
+adminclidb.user=admincli
+adminclidb.pwd=admincli
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/pe-config.properties b/appserver/tests/appserv-tests/devtests/cdi/config/pe-config.properties
new file mode 100644
index 0000000..4e1e6fc
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/pe-config.properties
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+execution.mode=pe
+admin.port=4848
+admin.user=admin
+admin.host=localhost
+admin.domain=domain1
+admin.domain.dir=${env.S1AS_HOME}/domains
+activeconsumer.maxnum=1
+mail.host="ha21sca.sfbay.sun.com"
+http.port=8080
+http.host=localhost
+https.host=localhost
+https.port=8181
+orb.port=3700
+admin.password=adminadmin
+master.password=changeit
+appserver.instance.name=server
+appserver.config.name=server-config
+directory.server.host=localhost
+directory.server.port=389
+directory.server.basedn=dc=sfbay,dc=sun,dc=com
+directory.manager.dn=cn=Directory Manager
+directory.manager.pwd=directorymanager
+server.dir=home/results/s1aspe80
+log.server.location=sardinia.sfbay.sun.com
+win.map.drive=Q:
+results.mailer=abc@sun.com
+results.mailee=xyz@sun.com
+interop.admin.port=5858
+interop.admin.host=localhost
+interop.admin.domain=domain2
+interop.http.port=9090
+interop.http.host=localhost
+interop.https.port=2043
+interop.orb.port=4700
+isInteropDomain=true
+resources.dottedname.prefix=domain.resources
+admin.password.file=${env.APS_HOME}/devtests/connector/config/password.txt
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/pointbase.properties b/appserver/tests/appserv-tests/devtests/cdi/config/pointbase.properties
new file mode 100644
index 0000000..27f6c75
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/pointbase.properties
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+db.port=9092
+db.host=localhost
+db.type=pointbase
+db.user=dbuser
+db.pwd=dbpassword
+db.name=sqe-samples
+db.class=com.pointbase.jdbc.jdbcDataSource
+db.xaclass=com.pointbase.xa.xaDataSource
+db.driver=com.pointbase.jdbc.jdbcUniversalDriver
+db.url=jdbc:pointbase:server://${db.host}:${db.port}/${db.name},new
+#db.unixdriverpath=lib/drivers/pointbase/pbclient.jar
+db.unixdriverpath=pointbase/lib/pbclient.jar
+db.windriverpath=lib/\drivers/\pointbase\/\pbclient.jar
+connector.url=jdbc\\:pointbase\\:server\\://${db.host}\\:${db.port}/${db.name},new
+cpds.class=com.pointbase.jdbc.jdbcDataSource
+isDBPointbase=true
+
+#properties used by global transaction tests.
+txdb.port=9095
+txdb.host=localhost
+txdb.name=txsample
+txdb.user=dbuser
+txdb.pwd=dbpassword
+txdb.url=jdbc:pointbase:server://localhost:9095/txsample,new
+
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/startee b/appserver/tests/appserv-tests/devtests/cdi/config/startee
new file mode 100644
index 0000000..aad2af1
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/startee
@@ -0,0 +1,142 @@
+#!/bin/sh
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+#--- Extract environment properties --- "sed" doesn't work with iastools.zip used in windows
+
+for x in `cat $APS_HOME/devtests/jdbc/config/ee-config.properties`
+do
+    varval=`echo $x |cut -d'=' -f1`
+
+    if [ $varval = "admin.user" ];
+    then
+        AS_ADMIN_USER=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "admin.port" ];
+    then
+        AS_ADMIN_PORT=`echo $x |cut -d'=' -f2`
+    fi
+    
+    if [ $varval = "admin.host" ];
+    then
+        AS_ADMIN_HOST=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "orb.port" ];
+    then
+        ORB_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "http.port" ];
+    then
+        HTTP_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "https.port" ];
+    then
+        SSL_PORT=`echo $x |cut -d'=' -f2`
+    fi
+    
+    if [ $varval = "admin.password" ];
+    then
+        AS_ADMIN_PASSWORD=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "admin.domain" ];
+    then
+        AS_ADMIN_DOMAIN=`echo $x |cut -d'=' -f2`
+    fi
+    if [ $varval = "nodeagent.name" ];
+    then
+        AS_ADMIN_NODEAGENT=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "server.instance.name" ];
+    then
+        AS_ADMIN_SERVER=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "cluster.name" ];
+    then
+        CLUSTER_NAME="sqe-cluster"
+    fi
+
+    if [ $varval = "clustered.instance.name" ];
+    then
+        CLUSTERED_INSTANCE_NAME="clustered_server"
+    fi
+
+    if [ $varval = "install.type" ];
+    then
+        INSTALL_TYPE=`echo $x |cut -d'=' -f2`
+    fi
+
+done
+
+
+ASADMIN=${ASADMIN}/bin/asadmin
+HTTP_LISTENER_2_PORT="1042"
+SSL_MUTUALAUTH_PORT="1058"
+JMX_SYSTEM_CONNECTOR_PORT="8687"
+
+export AS_ADMIN_USER
+export AS_ADMIN_PASSWORD
+export AS_ADMIN_PORT
+export AS_ADMIN_HOST
+export AS_ADMIN_DOMAIN
+export AS_ADMIN_NODEAGENT
+export AS_ADMIN_SERVER
+export CLUSTER_NAME
+export CLUSTERED_INSTANCE_NAME
+
+##---  End Variables Definitions --------
+
+# Start domain: sqe-domain----
+echo "starting domain ${AS_ADMIN_DOMAIN}..."
+${S1AS_HOME}/bin/asadmin start-domain --user ${AS_ADMIN_USER} --password ${AS_ADMIN_PASSWORD} ${AS_ADMIN_DOMAIN}
+
+
+# Create node agent (sqe-agent) referencing sqe-domain.----
+echo "starting node agent: ${AS_ADMIN_NODEAGENT}..."
+${S1AS_HOME}/bin/asadmin start-node-agent --user ${AS_ADMIN_USER} --password ${AS_ADMIN_PASSWORD} ${AS_ADMIN_NODEAGENT}
+
+
+if [ ${INSTALL_TYPE} = "standalone" -o ${INSTALL_TYPE} = "all" ]; then
+
+    echo "Doing nothing,starting nodeagent would have started server instance"
+#  ----------------
+   #echo "Starting server instance ${AS_ADMIN_SERVER}"
+   # ${S1AS_HOME}/bin/asadmin start-instance \
+   #     -u ${AS_ADMIN_USER} \
+   #     -w ${AS_ADMIN_PASSWORD} \
+   #     ${AS_ADMIN_SERVER}
+
+fi
+
+if [ ${INSTALL_TYPE} = "cluster" -o ${INSTALL_TYPE} = "all" ]; then
+#  ----------------
+    # Start cluster: sqe-cluster----
+    echo "Starting cluster:${CLUSTER_NAME}..."
+    ${S1AS_HOME}/bin/asadmin start-cluster -u ${AS_ADMIN_USER} -w ${AS_ADMIN_PASSWORD} ${CLUSTER_NAME}
+
+
+fi
+
+
+echo "***All server process started***"
+
diff --git a/appserver/tests/appserv-tests/devtests/cdi/config/stopee b/appserver/tests/appserv-tests/devtests/cdi/config/stopee
new file mode 100644
index 0000000..6ee0ba9
--- /dev/null
+++ b/appserver/tests/appserv-tests/devtests/cdi/config/stopee
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v. 2.0, which is available at
+# http://www.eclipse.org/legal/epl-2.0.
+#
+# This Source Code may also be made available under the following Secondary
+# Licenses when the conditions for such availability set forth in the
+# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+# version 2 with the GNU Classpath Exception, which is available at
+# https://www.gnu.org/software/classpath/license.html.
+#
+# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+#
+
+
+for x in `cat $APS_HOME/devtests/jdbc/config/ee-config.properties`
+do
+    varval=`echo $x |cut -d'=' -f1`
+
+    if [ $varval = "admin.user" ];
+    then
+        AS_ADMIN_USER=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "admin.port" ];
+    then
+        AS_ADMIN_PORT=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "admin.password" ];
+    then
+        AS_ADMIN_PASSWORD=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "admin.domain" ];
+    then
+        AS_ADMIN_DOMAIN=`echo $x |cut -d'=' -f2`
+    fi
+    if [ $varval = "nodeagent.name" ];
+    then
+        AS_ADMIN_NODEAGENT=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "server.instance.name" ];
+    then
+        AS_ADMIN_SERVER=`echo $x |cut -d'=' -f2`
+    fi
+
+    if [ $varval = "cluster.name" ];
+    then
+        CLUSTER_NAME="sqe-cluster"
+    fi
+
+    if [ $varval = "clustered.instance.name" ];
+    then
+        CLUSTERED_INSTANCE_NAME="clustered_server"
+    fi
+
+done
+
+
+export AS_ADMIN_USER
+export AS_ADMIN_PASSWORD
+export AS_ADMIN_PORT
+export AS_ADMIN_DOMAIN
+export AS_ADMIN_NODEAGENT
+export AS_ADMIN_SERVER
+export CLUSTER_NAME
+export CLUSTERED_INSTANCE_NAME
+
+##---  End Variables Definitions --------
+
+# stop standalone server instance ----
+
+# stop nodeagent ----
+echo "stopping nodeagent:${AS_ADMIN_NODEAGENT}..."
+${S1AS_HOME}/bin/asadmin stop-node-agent ${AS_ADMIN_NODEAGENT}
+
+# sleep ----
+echo "sleeping for 15 seconds..."
+sleep 15
+
+# stop domain ----
+echo "stopping domain ${AS_ADMIN_DOMAIN}..."
+${S1AS_HOME}/bin/asadmin stop-domain ${AS_ADMIN_DOMAIN}
+
+echo "***All Server Processes Stopped!"