#!/bin/sh
#
# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#

#
# @(#)cts	1.38 02/01/12
#
# This script is the main one used to run the Javatest GUI.

if [ -z "${CTS_HOME}" ]
then
    echo "Please set CTS_HOME"
    echo "Exiting $0"
    exit 1
fi 

. ${CTS_HOME}/bin/cts_env

if [ -z "${HARNESS_DEBUG}" ]
then
        SET_HARNESS_DEBUG=
else
        SET_HARNESS_DEBUG=-Dcts.harness.debug=true
fi

# The values for the 10 variables below  are set in the cts_env file.
#	-DJ2EE_HOME		J2EE home for Vendor Implementation
#	-DLOCAL_CLASSES 	Additional classes for Vendor Implementation
#	-DORB_HOST 		Host name for Vendor Naming Service
#	-DORB_PORT 		Port number for Vendor Naming Service
#
#	-DJ2EE_HOME_RI		J2EE home for Sun Implementation
#	-DLOCAL_CLASSES_RI 	Additional classes for Sun Implementation
#	-DORB_HOST_RI 		Host name for Sun Naming Service
#	-DORB_PORT_RI 		Port number for Sun Naming Service
#
#	-DJAVA_HOME		JAVA home for JDK being used to run tests
#	-DTZ			This specifies your local timezone
#
# The values for the 2 variables below  are set as env variables in the shell.
#	-DCTS_HOME		This specifies the CTS home directory
#	-DJAVA_OPTIONS 		JAVA options for JDK being used to run tests
#
# 	-Djava.security.policy  Sets the security policy used to run JavaTest
#

CLASSPATH=${CTS_CLASSPATH}
export CLASSPATH
${JAVA_CMD} \
	-DCTS_HOME=${CTS_HOME} \
	-DJAVA_HOME=${JAVA_HOME} \
	-DJ2EE_HOME=${J2EE_HOME} \
	-DJAVA_OPTIONS=${JAVA_OPTIONS} \
	-DLOCAL_CLASSES=${LOCAL_CLASSES} \
	-DJ2EE_HOME_RI=${J2EE_HOME_RI} \
	-DLOCAL_CLASSES_RI=${LOCAL_CLASSES_RI} \
	-Djava.security.policy=${CTS_HOME}/bin/harness.policy \
	-Dorg.omg.CORBA.ORBInitialHost=${ORB_HOST} \
	-Dorg.omg.CORBA.ORBInitialPort=${ORB_PORT} \
	-DORB_HOST=${ORB_HOST} \
	-DORB_PORT=${ORB_PORT} \
	-DORB_HOST_RI=${ORB_HOST_RI} \
	-DORB_PORT_RI=${ORB_PORT_RI} \
	-DRMIIIOP_HTTP_SERVER_HOST=${RMIIIOP_HTTP_SERVER_HOST} \
	-DRMIIIOP_HTTP_SERVER_PORT=${RMIIIOP_HTTP_SERVER_PORT} \
	-DTZ=${TZ} \
	-Djavatest.security.allowPropertiesAccess=true \
	${SET_HARNESS_DEBUG} \
	-Xmx128m \
	javasoft.sqe.javatest.tool.Main  -observer com.sun.cts.harness.CTSGUIHarnessObserver $1
