Skip to content
Browse files

Merge pull request #1 from Yutongs/master

Remove redundant files in test
  • Loading branch information...
2 parents 89684ad + 0778b2b commit 0a45e9731a9fb7590489b07f2bbcd228970b7b7b @MicrosoftHPC committed Dec 29, 2011
View
55 test/TestData.xml
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<Config>
-
-<Global>
-<Scheduler>shpc-0042</Scheduler>
-<UserName>fareast\wsdcta</UserName>
-<Password>Pa55word&amp;&amp;7</Password>
-<ServiceName>AITestServiceLib</ServiceName>
-<NbOfCalls>10</NbOfCalls>
-<NbOfSessions>3</NbOfSessions>
-<NbOfClients>2</NbOfClients>
- <UserName2>fareast\wsdcta2</UserName2>
- <Password2>Pa55word&amp;&amp;7</Password2>
- <NbOfBatches>2</NbOfBatches></Global>
-
-<Group name="BVT">
-<NbOfCalls>12</NbOfCalls>
-<BVTName1>BVTValue1</BVTName1>
-</Group>
-
-
-<Group name="GenericService">
-<ServiceName>SoaGenericTestService</ServiceName>
-
-</Group>
- <Group name="DurableSessionTest">
- <ServiceName>aitestservicelib</ServiceName></Group>
- <Group name="SessionBaseTest">
- <ServiceName>aitestservicelib</ServiceName></Group>
- <Group name="CommonDataTest">
- <DefaultDataServer>\\shpc-0050\CommonData2</DefaultDataServer>
- <DataSizeToCheck>1024,32768,1048576,4194304,16777216,67108864,104857600</DataSizeToCheck>
- <PreConfiguredDataServer1>\\Mingqing-box\TestConfig-1</PreConfiguredDataServer1>
- </Group>
-
-<Group name="SessionStartInfoTest">
-<ServiceName>Microsoft.Hpc.Excel.XllContainer64</ServiceName>
-</Group>
-
-<Group name="Stress">
-<MinCalls>10</MinCalls>
-<MaxCalls>50</MaxCalls>
-<MinClients>2</MinClients>
-<MaxClients>5</MaxClients>
-<MinBatches>2</MinBatches>
-<MaxBatches>5</MaxBatches>
-<MinDataKb>5</MinDataKb>
-<MaxDataKb>15</MaxDataKb>
-<MinTimeMs>5</MinTimeMs>
-<MaxTimeMs>15</MaxTimeMs>
-
-</Group>
-
-
-</Config>
View
286 test/build.xml
@@ -1,286 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- WARNING: Eclipse auto-generated file.
- Any modifications will be overwritten.
- To include a user specific buildfile here, simply create one in the same
- directory with the processing instruction <?eclipse.ant.import?>
- as the first entry and export the buildfile again. -->
-<project basedir="." default="build" name="SOAtest">
- <property environment="env"/>
- <property name="ECLIPSE_HOME" value="D:\Java\eclipse"/>
- <property name="CXF_HOME" value="D:\Java\apache-cxf-2.4.0" />
- <property name="SD_PATH" value="D:\HPCv3sp1" />
- <property name="junit.output.dir" value="junit"/>
- <property name="SOA.location" value="../SOA"/>
- <property name="debuglevel" value="source,lines,vars"/>
- <property name="target" value="1.6"/>
- <property name="source" value="1.6"/>
- <property name="src.dir" value="${basedir}/test" />
- <!-- output directory used for EMMA coverage reports: -->
- <property name="coverage.dir" value="${basedir}/coverage" />
- <!-- directory that contains emma.jar and emma_ant.jar: -->
- <property name="emma.dir" value="D:\Java\emma-2.0.5312\lib" />
- <!-- path element used by EMMA taskdef below: -->
- <path id="emma.lib" >
- <pathelement location="${emma.dir}/emma.jar" />
- <pathelement location="${emma.dir}/emma_ant.jar" />
- </path>
- <!-- this loads <emma> and <emmajava> custom tasks: -->
- <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
-
-
- <path id="CXF.userclasspath">
- <pathelement location="${CXF_HOME}/lib/antlr-2.7.7.jar"/>
- <pathelement location="${CXF_HOME}/lib/aopalliance-1.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/asm-3.3.jar"/>
- <pathelement location="${CXF_HOME}/lib/commons-collections-3.2.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/commons-lang-2.6.jar"/>
- <pathelement location="${CXF_HOME}/lib/commons-logging-1.1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/commons-pool-1.5.5.jar"/>
- <pathelement location="${CXF_HOME}/lib/cxf-2.4.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/cxf-manifest.jar"/>
- <pathelement location="${CXF_HOME}/lib/cxf-xjc-boolean-2.3.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/cxf-xjc-bug671-2.3.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/cxf-xjc-dv-2.3.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/cxf-xjc-ts-2.3.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/FastInfoset-1.2.9.jar"/>
- <pathelement location="${CXF_HOME}/lib/geronimo-activation_1.1_spec-1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/geronimo-annotation_1.0_spec-1.1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/geronimo-javamail_1.4_spec-1.7.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/geronimo-jaxws_2.2_spec-1.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/geronimo-jms_1.1_spec-1.1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/geronimo-servlet_3.0_spec-1.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/geronimo-ws-metadata_2.0_spec-1.1.3.jar"/>
- <pathelement location="${CXF_HOME}/lib/isorelax-20030108.jar"/>
- <pathelement location="${CXF_HOME}/lib/jaxb-api-2.2.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/jaxb-impl-2.2.1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/jaxb-xjc-2.2.1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/jettison-1.3.jar"/>
- <pathelement location="${CXF_HOME}/lib/jetty-continuation-7.3.1.v20110307.jar"/>
- <pathelement location="${CXF_HOME}/lib/jetty-http-7.3.1.v20110307.jar"/>
- <pathelement location="${CXF_HOME}/lib/jetty-io-7.3.1.v20110307.jar"/>
- <pathelement location="${CXF_HOME}/lib/jetty-security-7.3.1.v20110307.jar"/>
- <pathelement location="${CXF_HOME}/lib/jetty-server-7.3.1.v20110307.jar"/>
- <pathelement location="${CXF_HOME}/lib/jetty-util-7.3.1.v20110307.jar"/>
- <pathelement location="${CXF_HOME}/lib/joda-time-1.6.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/jra-1.0-alpha-4.jar"/>
- <pathelement location="${CXF_HOME}/lib/js-1.7R2.jar"/>
- <pathelement location="${CXF_HOME}/lib/jsr311-api-1.1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/msv-core-2010.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/neethi-3.0.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/opensaml-2.4.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/openws-1.4.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/oro-2.0.8.jar"/>
- <pathelement location="${CXF_HOME}/lib/relaxngDatatype-20020414.jar"/>
- <pathelement location="${CXF_HOME}/lib/saaj-api-1.3.jar"/>
- <pathelement location="${CXF_HOME}/lib/saaj-impl-1.3.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/serializer-2.7.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/slf4j-api-1.6.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/slf4j-jdk14-1.6.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-aop-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-asm-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-beans-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-context-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-core-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-expression-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-jms-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-tx-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/spring-web-3.0.5.RELEASE.jar"/>
- <pathelement location="${CXF_HOME}/lib/stax2-api-3.1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/velocity-1.6.4.jar"/>
- <pathelement location="${CXF_HOME}/lib/woodstox-core-asl-4.1.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/wsdl4j-1.6.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/wss4j-1.6.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/xalan-2.7.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/xmlbeans-2.4.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/xml-resolver-1.2.jar"/>
- <pathelement location="${CXF_HOME}/lib/xmlschema-core-2.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/xmlsec-1.4.4.jar"/>
- <pathelement location="${CXF_HOME}/lib/xmltooling-1.3.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/xsdlib-2010.1.jar"/>
- <pathelement location="${CXF_HOME}/lib/endorsed/geronimo-jaxws_2.2_spec-1.0.jar"/>
- <pathelement location="${CXF_HOME}/lib/endorsed/jaxb-api-2.2.1.jar"/>
- </path>
- <path id="JUnit 4.libraryclasspath">
- <pathelement location="${ECLIPSE_HOME}/plugins/org.junit_4.8.1.v4_8_1_v20100427-1100/junit.jar"/>
- <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar"/>
- </path>
- <path id="TestServices.userclasspath">
- <pathelement location="${SD_PATH}/private/tests/AITest/E2ETest/JavaSampleCode/TestServiceClient/AITestLibService.jar"/>
- </path>
- <path id="SOA.classpath">
- <pathelement location="${SOA.location}/bin"/>
- <path refid="CXF.userclasspath"/>
- <path refid="JUnit 4.libraryclasspath"/>
- <pathelement location="${SD_PATH}/private/tests/AITest/E2ETest/JavaSampleCode/TestServiceClient/AITestLibService.jar"/>
- </path>
- <path id="SOAtest.classpath">
- <pathelement location="bin"/>
- <pathelement location="${SOA.location}/outinstr" />
- <path refid="CXF.userclasspath"/>
- <path refid="JUnit 4.libraryclasspath"/>
- <path refid="TestServices.userclasspath"/>
- <path refid="SOA.classpath"/>
- <path refid="emma.lib" />
-
- </path>
-
- <target name="emma" description="turns on EMMA's instrumentation/reporting" >
- <property name="emma.enabled" value="true" />
- <property name="out.instr.dir" value="${basedir}/outinstr" />
- <mkdir dir="${out.instr.dir}" />
- <property name="emma.filter" value="" />
- </target>
-
-
- <target name="init" depends="clean">
- <mkdir dir="bin"/>
- <copy includeemptydirs="false" todir="bin">
- <fileset dir="${src.dir}">
- <exclude name="**/*.launch"/>
- <exclude name="**/*.java"/>
- </fileset>
- </copy>
- </target>
- <target name="clean">
- <delete dir="bin"/>
- <delete dir="${basedir}/outinstr" />
- <delete dir="${basedir}/coverage" />
- </target>
- <target depends="clean" name="cleanall">
- <ant antfile="build.xml" dir="${SOA.location}" inheritAll="false" target="clean"/>
- </target>
- <target depends="build-subprojects,build-project" name="build"/>
- <target name="build-subprojects">
- <ant antfile="build.xml" dir="${SOA.location}" inheritAll="false">
- <propertyset>
- <propertyref name="build.compiler"/>
- </propertyset>
- <target name="emma" />
- <target name="build"/>
-
- </ant>
- </target>
-
-
- <target depends="init" name="build-project">
- <echo message="${ant.project.name}: ${ant.file}"/>
- <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
- <src path="${src.dir}/functiontest"/>
- <classpath refid="SOAtest.classpath"/>
- </javac>
- <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
- <src path="${src.dir}/fullpass"/>
- <classpath refid="SOAtest.classpath"/>
- </javac>
- <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
- <src path="${src.dir}/stresstest"/>
- <classpath refid="SOAtest.classpath"/>
- </javac>
- </target>
- <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
-
- <target name="BVT">
- <mkdir dir="${junit.output.dir}"/>
- <junit fork="yes" printsummary="withOutAndErr">
- <formatter type="xml"/>
- <test name="functiontest.BVT" todir="${junit.output.dir}"/>
- <classpath refid="SOAtest.classpath"/>
- <jvmarg value="-Demma.coverage.out.file=${SOA.location}/coverage/coverage.emma" />
- <jvmarg value="-Demma.coverage.out.merge=false" />
- </junit>
-
- </target>
- <target name="BVT.test_BVT_CreateDurableSession">
- <mkdir dir="${junit.output.dir}"/>
- <junit fork="yes" printsummary="withOutAndErr">
- <formatter type="xml"/>
- <test name="functiontest.BVT_one" todir="${junit.output.dir}"/>
- <classpath refid="SOAtest.classpath"/>
- <jvmarg value="-Demma.coverage.out.file=${SOA.location}/coverage/coverage.emma" />
- <jvmarg value="-Demma.coverage.out.merge=false" />
- </junit>
-
- </target>
-
- <target name="CommonDataTestInteractive.DataClient_BrokerClient_E2E_1">
- <mkdir dir="${junit.output.dir}"/>
- <junit fork="yes" printsummary="withOutAndErr">
- <formatter type="xml"/>
- <test name="functiontest.CommonDataTestInteractive" todir="${junit.output.dir}"/>
- <classpath refid="SOAtest.classpath"/>
- </junit>
- </target>
- <target name="Full">
- <mkdir dir="${junit.output.dir}"/>
- <junit fork="yes" printsummary="withOutAndErr">
- <formatter type="xml"/>
- <test name="fullpass.Full" todir="${junit.output.dir}"/>
- <classpath refid="SOAtest.classpath"/>
- </junit>
- </target>
- <target name="functiontest">
- <mkdir dir="${junit.output.dir}"/>
- <junit fork="yes" printsummary="withOutAndErr">
- <formatter type="xml"/>
- <test name="functiontest.BVT" todir="${junit.output.dir}"/>
- <test name="functiontest.BrokerClientTest" todir="${junit.output.dir}"/>
- <test name="functiontest.BrokerResponseTest" todir="${junit.output.dir}"/>
- <test name="functiontest.CommonDataTestDurable" todir="${junit.output.dir}"/>
- <test name="functiontest.CommonDataTestInteractive" todir="${junit.output.dir}"/>
- <test name="functiontest.DataClientTest" todir="${junit.output.dir}"/>
- <test name="functiontest.DurableSessionTest" todir="${junit.output.dir}"/>
- <test name="functiontest.GenericServiceTest" todir="${junit.output.dir}"/>
- <test name="functiontest.SessionAttachInfoTest" todir="${junit.output.dir}"/>
- <test name="functiontest.SessionBaseTest" todir="${junit.output.dir}"/>
- <test name="functiontest.SessionPool" todir="${junit.output.dir}"/>
- <test name="functiontest.SessionStartInfoTest" todir="${junit.output.dir}"/>
- <test name="functiontest.SessionTest" todir="${junit.output.dir}"/>
- <classpath refid="SOAtest.classpath"/>
- </junit>
- </target>
- <target name="Stress">
- <mkdir dir="${junit.output.dir}"/>
- <junit fork="yes" printsummary="withOutAndErr">
- <formatter type="xml"/>
- <test name="stresstest.Stress" todir="${junit.output.dir}"/>
- <classpath refid="SOAtest.classpath"/>
- </junit>
- </target>
-
- <target name="emmareport">
- <emma enabled="${emma.enabled}" >
- <report sourcepath="${SOA.location}/src"
- sort="+block,+name,+method,+class"
- metrics="method:70,block:80,line:80,class:100"
- >
-
- <fileset dir="${SOA.location}/coverage" >
- <include name="*.emma" />
- </fileset>
-
-
- <txt outfile="${SOA.location}/coverage/coverage.txt"
- depth="package"
- columns="class,method,block,line,name"
- />
- <xml outfile="${SOA.location}/coverage/coverage.xml"
- depth="package"
- />
- <html outfile="${SOA.location}/coverage/coverage.html"
- depth="method"
- columns="name,class,method,block,line"
- />
- </report>
- </emma>
- </target>
-
- <target name="junitreport">
- <junitreport todir="${junit.output.dir}">
- <fileset dir="${junit.output.dir}">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames" todir="${junit.output.dir}"/>
- </junitreport>
- </target>
-</project>
View
13 test/buildtests.cmd
@@ -1,13 +0,0 @@
- @echo off
- set JAVAC="%JAVA_HOME%\bin\javac.exe"
- set JAR="%JAVA_HOME%\bin\jar.exe"
- set CLASSPATH=.;%CXF_HOME%\lib\cxf-manifest.jar;junit.jar;org.hamcrest.core_1.1.0.v20090501071000.jar;AITestLibService.jar;..\..\SOA\src
-
- rd /s /q bin
- md bin
- echo Compiling
- %javac% -sourcepath functiontest\*.java -d bin
- %javac% fullpass\Full.java -d bin
- echo Done
-
-
View
13 test/buildtests.sh
@@ -1,13 +0,0 @@
-#!bin/sh
-export CXF_HOME=/usr/java/apache-cxf-2.4.0
-export CLASSPATH=.:$CXF_HOME/lib/cxf-manifest.jar:./junit.jar:./org.hamcrest.core_1.1.0.v20090501071000.jar:./AITestLibService.jar:../../SOA/src
-
-rm -rf bin
-mkdir bin
-
-echo Compiling
-find ./functiontest -name *.java -print | xargs javac -d ./bin -Djava.endorsed.dirs="$CXF_HOME/lib/endorsed"
-
-find ./fullpass -name *.java -print | xargs javac -d ./bin -Djava.endorsed.dirs="$CXF_HOME/lib/endorsed"
-echo Done
-
View
77 test/org/tempuri/CcpEchoSvc.java
@@ -1,77 +0,0 @@
-
-/*
- *
- */
-
-package org.tempuri;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import javax.xml.namespace.QName;
-import javax.xml.ws.WebEndpoint;
-import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.Service;
-
-/**
- * This class was generated by Apache CXF 2.3.1
- * Tue Dec 28 11:00:17 GMT+08:00 2010
- * Generated source version: 2.3.1
- *
- */
-
-
-@WebServiceClient(name = "CcpEchoSvc",
- wsdlLocation = "file:tempuri.org.wsdl",
- targetNamespace = "http://tempuri.org/")
-public class CcpEchoSvc extends Service {
-
- public final static URL WSDL_LOCATION;
- public final static QName SERVICE = new QName("http://tempuri.org/", "CcpEchoSvc");
- public final static QName DefaultBindingIEchoSvc = new QName("http://tempuri.org/", "DefaultBinding_IEchoSvc");
- static {
- URL url = null;
- try {
- url = new URL("file:tempuri.org.wsdl");
- } catch (MalformedURLException e) {
- System.err.println("Can not initialize the default wsdl from file:tempuri.org.wsdl");
- // e.printStackTrace();
- }
- WSDL_LOCATION = url;
- }
-
- public CcpEchoSvc(URL wsdlLocation) {
- super(wsdlLocation, SERVICE);
- }
-
- public CcpEchoSvc(URL wsdlLocation, QName serviceName) {
- super(wsdlLocation, serviceName);
- }
-
- public CcpEchoSvc() {
- super(WSDL_LOCATION, SERVICE);
- }
-
- /**
- *
- * @return
- * returns IEchoSvc
- */
- @WebEndpoint(name = "DefaultBinding_IEchoSvc")
- public IEchoSvc getDefaultBindingIEchoSvc() {
- return super.getPort(DefaultBindingIEchoSvc, IEchoSvc.class);
- }
-
- /**
- *
- * @param features
- * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
- * @return
- * returns IEchoSvc
- */
- @WebEndpoint(name = "DefaultBinding_IEchoSvc")
- public IEchoSvc getDefaultBindingIEchoSvc(WebServiceFeature... features) {
- return super.getPort(DefaultBindingIEchoSvc, IEchoSvc.class, features);
- }
-
-}
View
65 test/org/tempuri/Echo.java
@@ -1,65 +0,0 @@
-
-package org.tempuri;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="input" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "input"
-})
-@XmlRootElement(name = "Echo")
-public class Echo {
-
- @XmlElementRef(name = "input", namespace = "http://tempuri.org/", type = JAXBElement.class, required = false)
- protected JAXBElement<String> input;
-
- /**
- * Gets the value of the input property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public JAXBElement<String> getInput() {
- return input;
- }
-
- /**
- * Sets the value of the input property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public void setInput(JAXBElement<String> value) {
- this.input = ((JAXBElement<String> ) value);
- }
-
-}
View
65 test/org/tempuri/EchoResponse.java
@@ -1,65 +0,0 @@
-
-package org.tempuri;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="EchoResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "echoResult"
-})
-@XmlRootElement(name = "EchoResponse")
-public class EchoResponse {
-
- @XmlElementRef(name = "EchoResult", namespace = "http://tempuri.org/", type = JAXBElement.class, required = false)
- protected JAXBElement<String> echoResult;
-
- /**
- * Gets the value of the echoResult property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public JAXBElement<String> getEchoResult() {
- return echoResult;
- }
-
- /**
- * Sets the value of the echoResult property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public void setEchoResult(JAXBElement<String> value) {
- this.echoResult = ((JAXBElement<String> ) value);
- }
-
-}
View
120 test/org/tempuri/GenerateLoad.java
@@ -1,120 +0,0 @@
-
-package org.tempuri;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="runMilliSeconds" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
- * &lt;element name="dummyData" type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
- * &lt;element name="fileData" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "runMilliSeconds",
- "dummyData",
- "fileData"
-})
-@XmlRootElement(name = "GenerateLoad")
-public class GenerateLoad {
-
- protected Double runMilliSeconds;
- @XmlElementRef(name = "dummyData", namespace = "http://tempuri.org/", type = JAXBElement.class, required = false)
- protected JAXBElement<byte[]> dummyData;
- @XmlElementRef(name = "fileData", namespace = "http://tempuri.org/", type = JAXBElement.class, required = false)
- protected JAXBElement<String> fileData;
-
- /**
- * Gets the value of the runMilliSeconds property.
- *
- * @return
- * possible object is
- * {@link Double }
- *
- */
- public Double getRunMilliSeconds() {
- return runMilliSeconds;
- }
-
- /**
- * Sets the value of the runMilliSeconds property.
- *
- * @param value
- * allowed object is
- * {@link Double }
- *
- */
- public void setRunMilliSeconds(Double value) {
- this.runMilliSeconds = value;
- }
-
- /**
- * Gets the value of the dummyData property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link byte[]}{@code >}
- *
- */
- public JAXBElement<byte[]> getDummyData() {
- return dummyData;
- }
-
- /**
- * Sets the value of the dummyData property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link byte[]}{@code >}
- *
- */
- public void setDummyData(JAXBElement<byte[]> value) {
- this.dummyData = ((JAXBElement<byte[]> ) value);
- }
-
- /**
- * Gets the value of the fileData property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public JAXBElement<String> getFileData() {
- return fileData;
- }
-
- /**
- * Sets the value of the fileData property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link String }{@code >}
- *
- */
- public void setFileData(JAXBElement<String> value) {
- this.fileData = ((JAXBElement<String> ) value);
- }
-
-}
View
65 test/org/tempuri/GenerateLoadResponse.java
@@ -1,65 +0,0 @@
-
-package org.tempuri;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="GenerateLoadResult" type="{http://schemas.datacontract.org/2004/07/EchoSvcLib}StatisticInfo" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "generateLoadResult"
-})
-@XmlRootElement(name = "GenerateLoadResponse")
-public class GenerateLoadResponse {
-
- @XmlElementRef(name = "GenerateLoadResult", namespace = "http://tempuri.org/", type = JAXBElement.class, required = false)
- protected JAXBElement<StatisticInfo> generateLoadResult;
-
- /**
- * Gets the value of the generateLoadResult property.
- *
- * @return
- * possible object is
- * {@link JAXBElement }{@code <}{@link StatisticInfo }{@code >}
- *
- */
- public JAXBElement<StatisticInfo> getGenerateLoadResult() {
- return generateLoadResult;
- }
-
- /**
- * Sets the value of the generateLoadResult property.
- *
- * @param value
- * allowed object is
- * {@link JAXBElement }{@code <}{@link StatisticInfo }{@code >}
- *
- */
- public void setGenerateLoadResult(JAXBElement<StatisticInfo> value) {
- this.generateLoadResult = ((JAXBElement<StatisticInfo> ) value);
- }
-
-}
View
45 test/org/tempuri/IEchoSvc.java
@@ -1,45 +0,0 @@
-package org.tempuri;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.ws.Action;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-
-/**
- * This class was generated by Apache CXF 2.3.1
- * Tue Dec 28 11:00:17 GMT+08:00 2010
- * Generated source version: 2.3.1
- *
- */
-
-@WebService(targetNamespace = "http://tempuri.org/", name = "IEchoSvc")
-public interface IEchoSvc {
-
- @WebResult(name = "GenerateLoadResult", targetNamespace = "http://tempuri.org/")
- @Action(input = "http://tempuri.org/IEchoSvc/GenerateLoad", output = "http://tempuri.org/IEchoSvc/GenerateLoadResponse")
- @RequestWrapper(localName = "GenerateLoad", targetNamespace = "http://tempuri.org/", className = "org.tempuri.GenerateLoad")
- @WebMethod(operationName = "GenerateLoad", action = "http://tempuri.org/IEchoSvc/GenerateLoad")
- @ResponseWrapper(localName = "GenerateLoadResponse", targetNamespace = "http://tempuri.org/", className = "org.tempuri.GenerateLoadResponse")
- public StatisticInfo generateLoad(
- @WebParam(name = "runMilliSeconds", targetNamespace = "http://tempuri.org/")
- java.lang.Double runMilliSeconds,
- @WebParam(name = "dummyData", targetNamespace = "http://tempuri.org/")
- byte[] dummyData,
- @WebParam(name = "fileData", targetNamespace = "http://tempuri.org/")
- java.lang.String fileData
- );
-
- @WebResult(name = "EchoResult", targetNamespace = "http://tempuri.org/")
- @Action(input = "http://tempuri.org/IEchoSvc/Echo", output = "http://tempuri.org/IEchoSvc/EchoResponse")
- @RequestWrapper(localName = "Echo", targetNamespace = "http://tempuri.org/", className = "org.tempuri.Echo")
- @WebMethod(operationName = "Echo", action = "http://tempuri.org/IEchoSvc/Echo")
- @ResponseWrapper(localName = "EchoResponse", targetNamespace = "http://tempuri.org/", className = "org.tempuri.EchoResponse")
- public java.lang.String echo(
- @WebParam(name = "input", targetNamespace = "http://tempuri.org/")
- java.lang.String input
- );
-}
View
117 test/org/tempuri/ObjectFactory.java
@@ -1,117 +0,0 @@
-
-package org.tempuri;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the org.tempuri package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _EchoResponseEchoResult_QNAME = new QName("http://tempuri.org/", "EchoResult");
- private final static QName _EchoInput_QNAME = new QName("http://tempuri.org/", "input");
- private final static QName _GenerateLoadDummyData_QNAME = new QName("http://tempuri.org/", "dummyData");
- private final static QName _GenerateLoadFileData_QNAME = new QName("http://tempuri.org/", "fileData");
- private final static QName _GenerateLoadResponseGenerateLoadResult_QNAME = new QName("http://tempuri.org/", "GenerateLoadResult");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.tempuri
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link Echo }
- *
- */
- public Echo createEcho() {
- return new Echo();
- }
-
- /**
- * Create an instance of {@link GenerateLoadResponse }
- *
- */
- public GenerateLoadResponse createGenerateLoadResponse() {
- return new GenerateLoadResponse();
- }
-
- /**
- * Create an instance of {@link GenerateLoad }
- *
- */
- public GenerateLoad createGenerateLoad() {
- return new GenerateLoad();
- }
-
- /**
- * Create an instance of {@link EchoResponse }
- *
- */
- public EchoResponse createEchoResponse() {
- return new EchoResponse();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://tempuri.org/", name = "EchoResult", scope = EchoResponse.class)
- public JAXBElement<String> createEchoResponseEchoResult(String value) {
- return new JAXBElement<String>(_EchoResponseEchoResult_QNAME, String.class, EchoResponse.class, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://tempuri.org/", name = "input", scope = Echo.class)
- public JAXBElement<String> createEchoInput(String value) {
- return new JAXBElement<String>(_EchoInput_QNAME, String.class, Echo.class, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://tempuri.org/", name = "dummyData", scope = GenerateLoad.class)
- public JAXBElement<byte[]> createGenerateLoadDummyData(byte[] value) {
- return new JAXBElement<byte[]>(_GenerateLoadDummyData_QNAME, byte[].class, GenerateLoad.class, ((byte[]) value));
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://tempuri.org/", name = "fileData", scope = GenerateLoad.class)
- public JAXBElement<String> createGenerateLoadFileData(String value) {
- return new JAXBElement<String>(_GenerateLoadFileData_QNAME, String.class, GenerateLoad.class, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link StatisticInfo }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://tempuri.org/", name = "GenerateLoadResult", scope = GenerateLoadResponse.class)
- public JAXBElement<StatisticInfo> createGenerateLoadResponseGenerateLoadResult(StatisticInfo value) {
- return new JAXBElement<StatisticInfo>(_GenerateLoadResponseGenerateLoadResult_QNAME, StatisticInfo.class, GenerateLoadResponse.class, value);
- }
-
-}
View
121 test/org/tempuri/StatisticInfo.java
@@ -1,121 +0,0 @@
-/**
- *
- */
-package org.tempuri;
-
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-
-/**
- * <p>Java class for StatisticInfo complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="StatisticInfo">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element name="endTime" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
- * &lt;element name="startTime" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
- * &lt;element name="taskId" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "StatisticInfo", propOrder = {
- "endTime",
- "startTime",
- "taskId"
-})
-public class StatisticInfo {
-
- @XmlSchemaType(name = "dateTime")
- protected XMLGregorianCalendar endTime;
- @XmlSchemaType(name = "dateTime")
- protected XMLGregorianCalendar startTime;
- protected Integer taskId;
-
- /**
- * Gets the value of the endTime property.
- *
- * @return
- * possible object is
- * {@link XMLGregorianCalendar }
- *
- */
- public XMLGregorianCalendar getEndTime() {
- return endTime;
- }
-
- /**
- * Sets the value of the endTime property.
- *
- * @param value
- * allowed object is
- * {@link XMLGregorianCalendar }
- *
- */
- public void setEndTime(XMLGregorianCalendar value) {
- this.endTime = value;
- }
-
- /**
- * Gets the value of the startTime property.
- *
- * @return
- * possible object is
- * {@link XMLGregorianCalendar }
- *
- */
- public XMLGregorianCalendar getStartTime() {
- return startTime;
- }
-
- /**
- * Sets the value of the startTime property.
- *
- * @param value
- * allowed object is
- * {@link XMLGregorianCalendar }
- *
- */
- public void setStartTime(XMLGregorianCalendar value) {
- this.startTime = value;
- }
-
- /**
- * Gets the value of the taskId property.
- *
- * @return
- * possible object is
- * {@link Integer }
- *
- */
- public Integer getTaskId() {
- return taskId;
- }
-
- /**
- * Sets the value of the taskId property.
- *
- * @param value
- * allowed object is
- * {@link Integer }
- *
- */
- public void setTaskId(Integer value) {
- this.taskId = value;
- }
-
-}
View
3 test/org/tempuri/package-info.java
@@ -1,3 +0,0 @@
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://tempuri.org/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.tempuri;
-
View
71 test/readme.txt
@@ -1,71 +0,0 @@
-Introduction
-============
-This readme.txt shows the steps to run HPC Java Session API test cases
-
-
-Prerequisites
-============
-1) JDK 1.6.0_23
-2) CXF 2.4.0
-3) JUNIT 4.8.1
-
-
-On Windows Server 2008 R2:
-
-
-1. Download and compile the HPC Java Session API source code
-
-a) Download HPC Java Session API source code to %basedir%\SOA\src
-b) Build the HPC Java Session API source code by makejar.cmd, remember
- to set up %JAVA_HOME% and %CXF_HOME% before run the script.
-
-
-2. Download and compile the HPC Java Session API test cases
-
-a) Download HPC Java Session API test code to %basedir%\SOAtest\test
-b) Download and copy AITestLibService.jar, junit.jar and org.hamcrest.core_1.1.0.v20090501071000.jar to %basedir%\SOAtest\test
-c) Build the HPC Java Session API test code by buildtests.cmd, remember
- to set up %JAVA_HOME% and %CXF_HOME% before running the script.
-
-3. Run the HPC Java Session API test cases
-
-a) Modify the TestData.xml with the correct headnode name, username and password, and copy it to the bin folder
-b) Under %basedir%\SOAtest\test run cmd to launch the BVT test
- java -Xmx1024m -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext";%CXF_HOME%\lib;%CXF_HOME%\lib\endorsed org.junit.runner.JUnitCore functionest.BVT
-c) To run the full pass, under %basedir%\SOAtest\test run
- java -Xmx1024m -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext";%CXF_HOME%\lib;%CXF_HOME%\lib\endorsed org.junit.runner.JUnitCore fullpass.Full
-
-
-
-On RHEL5.5:
-
-1. Download and compile the HPC Java Session API source code
-
-a) Download HPC Java Session API source code to $basedir/SOA/src
-b) Build the HPC Java Session API source code by makejar.sh, remember
- to export CXF_HOME and make sure $JAVA_HOME and $JAVA_BIN are set before run the script.
-
-
-2. Download and compile the HPC Java Session API test cases
-
-a) Download HPC Java Session API test code to $basedir/SOAtest/test
-b) Download and copy AITestLibService.jar, junit.jar and org.hamcrest.core_1.1.0.v20090501071000.jar to $basedir/SOAtest/test
-
-
-d) Build the HPC Java Session API test code by buildtests.sh, remember
- to export $JAVA_HOME and $CXF_HOME before running the script.
-
-3. Run the HPC Java Session API test cases
-
-a) Modify the TestData.xml with the correct headnode name, username and password, and copy it to the bin folder
-b) Make sure the CLASSPATH is set correctly, e.g.
- export CLASSPATH=.:$CXF_HOME/lib/cxf-manifest.jar:./junit.jar:./org.hamcrest.core_1.1.0.v20090501071000.jar:./AITestLibService.jar:../../SOA/src:./bin
-c) To run CommonData test cases, the command data share folder should be mounted by
- mount -t cifs -o username=[domain]/\[username],password='[password]' //[headnode]/runtime$ /mnt/winshare/
-d) Under $basedir/SOAtest/test run cmd to launch the BVT test
- java -Xmx1024m -Djava.ext.dirs=/usr/java/jdk1.6.0_23/jre/lib/ext:/usr/java/apache-cxf-2.4.0/lib:/usr/java/apache-cxf-2.4.0/lib/endorsed org.junit.runner.JUnitCore functiontest.BVT
-e) To run the full pass, under %basedir%\SOAtest\test run
- java -Xmx1024m -Djava.ext.dirs=/usr/java/jdk1.6.0_23/jre/lib/ext:/usr/java/apache-cxf-2.4.0/lib:/usr/java/apache-cxf-2.4.0/lib/endorsed org.junit.runner.JUnitCore fullpass.Full
-
-
-
View
335 test/stresstest/Stress.java
@@ -1,335 +0,0 @@
-/**
- *
- */
-package stresstest;
-
-import java.net.SocketTimeoutException;
-import java.util.Random;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import javax.xml.soap.SOAPException;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import org.datacontract.schemas._2004._07.services.ComputerInfo;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.tempuri.AITestLibService;
-import org.tempuri.Echo;
-import org.tempuri.EchoResponse;
-import com.microsoft.hpc.scheduler.session.BrokerClient;
-import com.microsoft.hpc.scheduler.session.BrokerResponse;
-import com.microsoft.hpc.scheduler.session.DurableSession;
-import com.microsoft.hpc.scheduler.session.HpcJava;
-import com.microsoft.hpc.scheduler.session.ResponseListener;
-import com.microsoft.hpc.scheduler.session.Session;
-import com.microsoft.hpc.scheduler.session.SessionAttachInfo;
-import com.microsoft.hpc.scheduler.session.SessionBase;
-import com.microsoft.hpc.scheduler.session.SessionException;
-import com.microsoft.hpc.scheduler.session.SessionStartInfo;
-import functiontest.Logger;
-import functiontest.Config;
-import functiontest.Util;
-
-/**
- * @author yutongs
- *
- */
-public class Stress {
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- config = new Config("Stress");
- logger = new Logger(true, true, "Stress");
-
- HpcJava.setUsername(config.UserName);
- HpcJava.setPassword(config.Password);
-
- //read config params
- minCalls = Integer.parseInt(config.getValue("MinCalls"));
- maxCalls = Integer.parseInt(config.getValue("MaxCalls"));
- minClients = Integer.parseInt(config.getValue("MinClients"));
- maxClients = Integer.parseInt(config.getValue("MaxClients"));
- minBatches = Integer.parseInt(config.getValue("MinBatches"));
- maxBatches = Integer.parseInt(config.getValue("MaxBatches"));
-
- /*int minDataKb = Integer.parseInt(config.getValue("MinDataKb"));
- int maxDataKb = Integer.parseInt(config.getValue("MaxDataKb"));
- int minTimeMs = Integer.parseInt(config.getValue("MinTimeMs"));
- int maxTimeMs = Integer.parseInt(config.getValue("MaxTimeMs"));
- */
- rand = new Random();
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- logger.close();
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- // todo: check if the target cluster is in ready state
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
- public void tearDown() throws Exception {
- // todo: cleanup work for each case
- }
-
- /**
- * durable concurrent multiple batches, n * m batches
- */
- @Test
- public void test_Stress_DurableConcurrentMultipleBatches() {
- logger.Start("test_BVT_DurableConcurrentMultipleBatches");
-
-
- int NbOfCalls = minCalls+ rand.nextInt(maxCalls -minCalls);
- int NbOfClients = minClients + rand.nextInt(maxClients - minClients);
- int NbOfBatches = minBatches + rand.nextInt(maxBatches - minBatches);
-
-
- SessionStartInfo info = new SessionStartInfo(config.Scheduler,
- config.ServiceName, config.UserName, config.Password);
- logger.Info("Creating a %s durable session.", config.ServiceName);
-
- DurableSession session = null;
- try {
- session = DurableSession.createSession(info);
- logger.Info("Session %d is created.", session.getId());
-
- CountDownLatch L = new CountDownLatch(NbOfClients);
-
- Thread[] workers = new Thread[NbOfClients];
- for (int m = 0; m < NbOfClients; m++) {
- workers[m] = new Thread(new ConcurrentClient(m, NbOfBatches, NbOfCalls, L, session, 0));
- }
- for (int m = 0; m < NbOfClients; m++) {
- workers[m].start();
- }
-
- L.await(10, TimeUnit.MINUTES);
-
- CountDownLatch L2 = new CountDownLatch(NbOfClients);
-
- for (int m = 0; m < NbOfClients; m++) {
- workers[m] = new Thread(new ConcurrentClient(m,NbOfBatches, NbOfCalls, L2, session, 1));
- }
- for (int m = 0; m < NbOfClients; m++) {
- workers[m].start();
- }
-
- L2.await(10, TimeUnit.MINUTES);
-
- } catch (Throwable e) {
- logger.Error("Exception is thrown %s", e.toString());
- e.printStackTrace();
- }
-
- try {
- session.close();
- } catch (Throwable e) {
- logger.Error("Exception is thrown %s", e.toString());
- e.printStackTrace();
- }
-
- logger.End("test_BVT_DurableConcurrentMultipleBatches");
- }
-
- /**
- * interactive concurrent multiple batches, n * m batches
- */
- @Test
- public void test_Stress_InteractiveConcurrentMultipleBatches() {
- logger.Start("test_BVT_InteractiveConcurrentMultipleBatches");
-
-
- int NbOfCalls = minCalls+ rand.nextInt(maxCalls -minCalls);
- int NbOfClients = minClients + rand.nextInt(maxClients - minClients);
- int NbOfBatches = minBatches + rand.nextInt(maxBatches - minBatches);
-
-
- SessionStartInfo info = new SessionStartInfo(config.Scheduler,
- config.ServiceName, config.UserName, config.Password);
- logger.Info("Creating a %s durable session.", config.ServiceName);
-
- Session session = null;
- try {
- session = Session.createSession(info);
- logger.Info("Session %d is created.", session.getId());
-
- CountDownLatch L = new CountDownLatch(NbOfClients);
-
- Thread[] workers = new Thread[NbOfClients];
- for (int m = 0; m < NbOfClients; m++) {
- workers[m] = new Thread(new ConcurrentClient(m, NbOfBatches, NbOfCalls, L, session, 0));
- }
- for (int m = 0; m < NbOfClients; m++) {
- workers[m].start();
- }
-
- L.await(10, TimeUnit.MINUTES);
-
- CountDownLatch L2 = new CountDownLatch(NbOfClients);
-
- for (int m = 0; m < NbOfClients; m++) {
- workers[m] = new Thread(new ConcurrentClient(m,NbOfBatches, NbOfCalls, L2, session, 1));
- }
- for (int m = 0; m < NbOfClients; m++) {
- workers[m].start();
- }
-
- L2.await(10, TimeUnit.MINUTES);
-
- } catch (Throwable e) {
- logger.Error("Exception is thrown %s", e.toString());
- e.printStackTrace();
- }
-
- try {
- session.close();
- } catch (Throwable e) {
- logger.Error("Exception is thrown %s", e.toString());
- e.printStackTrace();
- }
-
- logger.End("test_BVT_InteractiveConcurrentMultipleBatches");
- }
-
- class ConcurrentClient implements Runnable {
- public ConcurrentClient(int m, int NbOfBatches, int NbOfCalls, CountDownLatch l, SessionBase session,
- int sendget) {
- this.m = m;
- this.l = l;
- this.NbOfBatches = NbOfBatches;
- this.NbOfCalls = NbOfCalls;
- this.session = session;
- this.sendget = sendget;
-
- }
-
- @Override
- public void run() {
- if (sendget == 0) {
- for (int k = 0; k < NbOfBatches; k++) {
- BrokerClient<AITestLibService> client = new BrokerClient<AITestLibService>(
- "Client" + m + "_" + k, session,
- AITestLibService.class);
-
- logger.Info("Client %s sending %d requests...",
- m + "_" + k, NbOfCalls);
-
- for (int i = 0; i < NbOfCalls; i++) {
- Echo request = Util.generateEchoRequest(m * k);
- try {
- client.sendRequest(request, i);
- } catch (SessionException e) {
- logger.Error("SessionException: %s", e.toString());
- e.printStackTrace();
- } catch (SocketTimeoutException e) {
- logger.Error("SessionException: %s", e.toString());
- e.printStackTrace();
- }
- }
- logger.Info("Client %s calling endRequests()...", m + "_"
- + k);
- try {
- client.endRequests();
- } catch (SocketTimeoutException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SessionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- l.countDown();
- } else if (sendget == 1) {
- for (int k = 0; k < NbOfBatches; k++) {
- BrokerClient<AITestLibService> client = new BrokerClient<AITestLibService>(
- "Client" + m + "_" + k, session,
- AITestLibService.class);
- logger.Info("Client%s retrieving responses...", m + "_" + k);
- try {
- int count =0;
- for (BrokerResponse<EchoResponse> response : client
- .getResponses(EchoResponse.class)) {
- try {
- ComputerInfo reply = response.getResult()
- .getEchoResult().getValue();
- count++;
-
- } catch (Throwable ex) {
- logger.Error("Error in process request %s",
- ex.toString());
-
- }
-
- }
- logger.assertEqual("response count should equal", count, NbOfCalls);
-
- } catch (SessionException e) {
- logger.Error("SessionException: %s", e.toString());
- e.printStackTrace();
- }
- logger.Info("Done retrieving %d responses",
- NbOfCalls);
- try {
- client.close();
- } catch (SocketTimeoutException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SessionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- l.countDown();
- }
-
- }
-
- private int m = 0;
- private int NbOfBatches = 0;
- private int NbOfCalls = 0;
- private CountDownLatch l = null;
- private SessionBase session = null;
- private int sendget = 0;
-
- }
-
-
- //read config params
- private static int minCalls = 0;
- private static int maxCalls = 0;
- private static int minClients = 0;
- private static int maxClients = 0;
- private static int minBatches = 0;
- private static int maxBatches = 0;
-
- private static Random rand = null;
-
-
- private static Config config;
- private static Logger logger;
-
-
-
-}
View
268 test/unittest/DataClientTest.java
@@ -1,268 +0,0 @@
-package unittest;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-
-import com.microsoft.hpc.scheduler.session.DataClient;
-import com.microsoft.hpc.scheduler.session.DataLifeCycle;
-import com.microsoft.hpc.exceptions.DataException;
-import com.microsoft.hpc.scheduler.session.SessionException;
-
-public class DataClientTest
-{
- static String serverName = "vincent-hpc";
- static String userName = "fareast\\wsdcta";
- static String password = "Pa55word$$4";
-
- @Test
- public void testBasic() {
- byte[] data = { 1, 2, 3, 4, 5, 6, 7 };
- try {
- DataClient c = DataClient.create("Test", serverName, userName,
- password);
- c.writeRawBytesAll(data);
- c.close();
-
- DataClient d = DataClient.open("Test", serverName, userName,
- password);
- byte[] result = d.readRawBytesAll();
-
- int i = 0;
- for (byte b : result) {
- Assert.assertEquals(data[i], b);
- i++;
- }
- d.close();
-
- DataClient.delete("Test", serverName, userName, password);
- } catch (DataException e) {
- // TODO Auto-generated catch block
- Assert.fail(e.getMessage());
- } catch (Exception ex) {
- ex.printStackTrace();
- Assert.fail(ex.getMessage());
- }
- }
-
- @Test
- public void testBasic2() {
- byte[] data = { 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5,
- 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71,
- 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3,
- 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5,
- 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71,
- 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3,
- 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5,
- 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71,
- 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3,
- 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5,
- 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71,
- 2, 3, 4, 5, 6, 7 };
- try {
- DataClient c = DataClient.create("Test", serverName, userName,
- password);
- c.writeRawBytesAll(data);
- c.close();
-
- DataClient d = DataClient.open("Test", serverName, userName,
- password);
- byte[] result = d.readRawBytesAll();
-
- int i = 0;
- for (byte b : result) {
- Assert.assertEquals(data[i], b);
- i++;
- }
- d.close();
- DataClient.delete("Test", serverName, userName, password);
- } catch (DataException e) {
- // TODO Auto-generated catch block
- Assert.fail(e.getMessage());
- } catch (Exception ex) {
- ex.printStackTrace();
- Assert.fail(ex.getMessage());
- }
- }
-
- @Test
- public void testCompress() {
- byte[] data = { 1, 2, 3, 4, 5, 6, 7 };
- try {
- DataClient.delete("Test2", serverName, userName, password);
- DataClient c = DataClient.create("Test2", serverName, userName,
- password);
- c.writeRawBytesAll(data, true);
- c.close();
-
- DataClient d = DataClient.open("Test2", serverName, userName,
- password);
- byte[] result = d.readRawBytesAll();
-
- int i = 0;
- for (byte b : result) {
- Assert.assertEquals(data[i], b);
- i++;
- }
- d.close();
- DataClient.delete("Test2", serverName, userName, password);
- } catch (DataException e) {
- // TODO Auto-generated catch block
- Assert.fail(e.getMessage());
- }
- }
-
- @Test
- public void testLifecycle() {
- byte[] data = { 1, 2, 3, 4, 5, 6, 7 };
- try {
- DataClient.delete("Test2", serverName, userName, password);
- DataClient c = DataClient.create("Test2", serverName, userName,
- password);
- c.setDataLifeCycle(new DataLifeCycle(10));
- c.writeRawBytesAll(data, true);
- c.close();
-
- DataClient d = DataClient.open("Test2", serverName, userName,
- password);
- byte[] result = d.readRawBytesAll();
-
- int i = 0;
- for (byte b : result) {
- Assert.assertEquals(data[i], b);
- i++;
- }
- d.close();
-
- DataClient.delete("Test2", serverName, userName, password);
- } catch (DataException e) {
- // TODO Auto-generated catch block
- Assert.fail(e.getMessage());
- }
- }
-
- @Test
- public void testCompress2() {
- byte[] data = { 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5,
- 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71,
- 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3,
- 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5,
- 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71,
- 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3,
- 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5,
- 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71,
- 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3,
- 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5,
- 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 71,
- 2, 3, 4, 5, 6, 71, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 71, 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ataClient.delete("Test2", serverName, userName, password);
- DataClient c = DataClient.create("Test2", serverName, userName,
- password);
- c.writeRawBytesAll(data, true);
- c.close();
-
- DataClient d = DataClient.open("Test2", serverName, userName,
- password);
- byte[] result = d.readRawBytesAll();
-
- int i = 0;
- for (byte b : result) {
- Assert.assertEquals(data[i], b);
- i++;
- }
- d.close();
- DataClient.delete("Test2", serverName, userName, password);
- } catch (DataException e) {
- // TODO Auto-generated catch block
- Assert.fail(e.getMessage());
- }
- }
-
- String ConvertPath(String original, String runtimeShare)
- {
- int firstSlash = original.indexOf('\\', 3);
- int secondSlash = original.indexOf('\\', firstSlash + 1);
-
- if (secondSlash == -1)
- {
- return null;
- }
-
- String result = runtimeShare + original.substring(secondSlash);
- return result.replace('\\', '/');
- }
-
- @Test
- public void testConvertPath() {
- String data = "\\\\junsuwin\\runtime$\\soa\\data\\14\\1.dat";
-
- Assert.assertEquals("/mnt/smb/soa/data/14/1.dat",ConvertPath(data, "/mnt/smb"));
- }
-}
View
90 test/unittest/SessionInfoTest.java
@@ -1,90 +0,0 @@
-/**
- *
- */
-package unittest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.HashMap;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.microsoft.hpc.scheduler.session.HpcJava;
-import com.microsoft.hpc.scheduler.session.SessionUnitType;
-import com.microsoft.hpc.scheduler.session.SessionStartInfo;
-import com.microsoft.hpc.scheduler.session.Version;
-
-/**
- * @author junsu
- *
- */
-public class SessionInfoTest
-{
- static String serverName = "junsuwin";
- static String userName = "fareast\\wsdcta";
- static String password = "Pa55word##3";
-
- @BeforeClass
- public static void before() {
- HpcJava.setPassword(password);
- HpcJava.setUsername(userName);
- }
-
- @Test
- public void TestBasicProperty() {
- SessionStartInfo info = new SessionStartInfo("A", "B");
- assertEquals("headnode is not match", info.getHeadnode(), "A");
- assertEquals("service name is not match", info.getServiceName(), "B");
-
- assertEquals("default security is not true", true, info.isSecure());
- assertEquals("default sharesession is not false", false,
- info.isShareSession());
- }
-
- @Test
- public void TestUnittype() {
- SessionStartInfo info = new SessionStartInfo("A", "V");
- info.setResourceUnitType(SessionUnitType.Socket);
- assertEquals("Resource Unit Type is not matched",
- SessionUnitType.Socket, info.getResourceUnitType());
-
- info.setClientIdleTimeout(3000);
- assertEquals("clientIdleTimeout", info.clientIdleTimeout(), 3000);
- }
-
- @Test
- public void TestEnv() {
- SessionStartInfo info = new SessionStartInfo("A", "V");
- info.addEnvironment("A", "B");
- info.addEnvironment("C", "D");
-
- HashMap<String, String> k = info.getEnvironments();
- assertEquals("env is wrong", "B", k.get("A"));
- assertEquals("env is wrong", "D", k.get("C"));
- }
-
- @Test
- public void TestVersion() {
- Version Version10 = new Version(1, 0);
- Version Version12 = new Version(1, 2);
-
- Version Version1000 = new Version(1, 0, 0, 0);
- Version Version1020 = new Version(1, 0, 2, 0);
-
- assertTrue(Version12.compareTo(Version10) > 0);
- assertTrue(Version1020.compareTo(Version10) > 0);
- assertTrue(Version10 == Version10);
- }
-
- @Test
- public void TestCrash() {
- SessionStartInfo info = new SessionStartInfo("A", "V");
- assertEquals("getResourceUnitType", info.getResourceUnitType(),
- SessionUnitType.Core);
- assertEquals("nodeGroupsStr", info.getNodeGroups(), null);
- assertEquals("serviceJobName", info.getServiceJobName(), null);
- assertEquals("isCanPreempt", info.isPreemptive(), false);
- }
-}
View
180 test/unittest/SessionPoolTest.java
@@ -1,180 +0,0 @@
-package unittest;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.microsoft.hpc.scheduler.session.DurableSession;
-import com.microsoft.hpc.scheduler.session.HpcJava;
-import com.microsoft.hpc.scheduler.session.Session;
-import com.microsoft.hpc.scheduler.session.SessionStartInfo;
-import com.microsoft.hpc.scheduler.session.SessionUnitType;
-
-public class SessionPoolTest
-{
- static String schedulerName = "qingzhi-2008r2";
- static String userName = "fareast\\wsdcta";
- static String password = "Pa55word$$4";
-
- @BeforeClass
- public static void before()
- {
- HpcJava.setPassword(password);
- HpcJava.setUsername(userName);
- }
-
- @Test
- public void CheckInvalidParameter()
- {
- try
- {
- SessionStartInfo info = new SessionStartInfo(schedulerName, "CcpEchoSvc");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setShareSession(false);
- info.setUseSessionPool(true);
-
- DurableSession session1 = DurableSession.createSession(info);
- session1.close();
- }
- catch(IllegalArgumentException e) {
- System.out.println(e.getMessage());
- assertTrue(e.getMessage().compareTo("Session pool is not supported by unshared session.") == 0);
- }
- catch (Exception e) {
- e.printStackTrace();
- fail("unexpected exception");
- }
- }
-
- @Test
- public void UseDurableSessionPoolForSameService()
- {
- try
- {
- SessionStartInfo info = new SessionStartInfo(schedulerName, "CcpEchoSvc");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setShareSession(true);
- info.setUseSessionPool(true);
-
- DurableSession session1 = DurableSession.createSession(info);
- session1.close(false);
-
- info = new SessionStartInfo(schedulerName, "CcpEchoSvc");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setShareSession(true);
- info.setUseSessionPool(true);
- DurableSession session2 = DurableSession.createSession(info);
- session2.close();
-
- assertTrue(session1.getId() == session2.getId());
- }
- catch (Exception e) {
- e.printStackTrace();
- fail("unexpected exception");
- }
- }
-
- @Test
- public void UseInteractiveSessionPoolForSameService()
- {
- try
- {
- SessionStartInfo info = new SessionStartInfo(schedulerName, "CcpEchoSvc");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setShareSession(true);
- info.setUseSessionPool(true);
-
- Session session1 = Session.createSession(info);
- session1.close(false);
-
- info = new SessionStartInfo(schedulerName, "CcpEchoSvc");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setShareSession(true);
- info.setUseSessionPool(true);
- Session session2 = Session.createSession(info);
- session2.close();
-
- assertTrue(session1.getId() == session2.getId());
- }
- catch (Exception e) {
- e.printStackTrace();
- fail("unexpected exception");
- }
- }
-
- @Test
- public void NotUseSessionPoolForSameService()
- {
- try
- {
- SessionStartInfo info = new SessionStartInfo(schedulerName, "CcpEchoSvc");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setShareSession(true);
- info.setUseSessionPool(false);
-
- DurableSession session1 = DurableSession.createSession(info);
- session1.close(false);
-
- info = new SessionStartInfo(schedulerName, "CcpEchoSvc");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setShareSession(true);
- info.setUseSessionPool(false);
- DurableSession session2 = DurableSession.createSession(info);
- session2.close();
-
- assertTrue(session1.getId() != session2.getId());
- }
- catch (Exception e) {
- e.printStackTrace();
- fail("unexpected exception");
- }
- }
-
- @Test
- public void NotUseSessionPoolForDiffService()
- {
- try
- {
- SessionStartInfo info = new SessionStartInfo(schedulerName, "aitestservicelib");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setUseSessionPool(true);
- info.setShareSession(true);
- DurableSession session1 = DurableSession.createSession(info);
- session1.close(false);
-
- info = new SessionStartInfo(schedulerName, "CcpEchoSvc");
- info.setResourceUnitType(SessionUnitType.Core);
- info.setMaxUnits(1);
- info.setMinUnits(1);
- info.setUseSessionPool(true);
- info.setShareSession(true);
- DurableSession session2 = DurableSession.createSession(info);
- session2.close();
-
- assertTrue(session2.getId() != session1.getId());
- session1.close();
- }
- catch (Exception e) {
- e.printStackTrace();
- fail("unexpected exception");
- }
- }
-}
View
645 test/unittest/SessionTest.java
@@ -1,645 +0,0 @@
-package unittest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Method;
-import java.net.SocketTimeoutException;
-import java.util.Date;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPException;
-import javax.xml.ws.Service;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import junit.framework.Assert;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.tempuri.CcpEchoSvc;
-import org.tempuri.Echo;
-import org.tempuri.EchoResponse;
-import org.tempuri.GenerateLoad;
-import org.tempuri.GenerateLoadResponse;
-import org.tempuri.IEchoSvc;
-import org.tempuri.StatisticInfo;
-
-import com.microsoft.hpc.genericservice.GenericOperation;
-import com.microsoft.hpc.genericservice.GenericService;
-import com.microsoft.hpc.scheduler.session.BrokerClient;
-import com.microsoft.hpc.scheduler.session.BrokerResponse;
-import com.microsoft.hpc.scheduler.session.DurableSession;
-import com.microsoft.hpc.scheduler.session.HpcJava;
-import com.microsoft.hpc.scheduler.session.ResponseListener;
-import com.microsoft.hpc.scheduler.session.Session;
-import com.microsoft.hpc.scheduler.session.SessionBase;
-import com.microsoft.hpc.scheduler.session.SessionException;
-import com.microsoft.hpc.scheduler.session.SessionStartInfo;
-import com.microsoft.hpc.scheduler.session.Version;
-
-public class SessionTest
-{
-
- static String serverName = "junsuwin";
- static String userName = "fareast\\wsdcta";
- static String password = "Pa55word$$4";
-
- @BeforeClass
- public static void before() {
- HpcJava.setPassword(password);
- HpcJava.setUsername(userName);
- }
-
- /**
- * Creates a request class using the specified objects as input
- *
- * The order of input should be the order they appear in the
- * <code>TRequest<code> class.
- * The function works by iterating through all <code>set[requestClass]</code>
- * methods and call the corresponding ObjectFactory, if necessary, to create
- * the input.
- *
- * @param <TRequest>
- * return type
- * @param requestClass
- * instance to create
- * @param args
- * input objects
- * @return A request to be sent to the broker using SendRequest
- * @see BrokerClient#sendRequest(Object)
- */
- public static <TRequest> TRequest createRequest(
- Class<TRequest> requestClass, Object... args) {
- return createRequest(requestClass, null, args, false);
- }
-
- /**
- * Creates a request class using the specified objects as input
- *
- * The order of input should be the order they appear in the
- * <code>TRequest<code> class
- * The function works by iterate through all <code>set[requestClass]</code>
- * methods and call the corresponding ObjectFactory, if necessary, to create
- * the input.
- *
- * @param <TRequest>
- * return type
- * @param requestClass
- * instance to create
- * @param classNames
- * class names to check each argument against
- * @param args
- * input objects
- * @return A request to be sent to the broker using SendRequest
- * @see BrokerClient#sendRequest(Object)
- */
- public static <TRequest> TRequest createRequest(
- Class<TRequest> requestClass, Class<?> classNames[], Object args[]) {
- return createRequest(requestClass, classNames, args, true);
- }
-
- /**
- * Creates a request class using the specified objects as input
- *
- * @param <TRequest>
- * return type
- * @param requestClass
- * instance to create
- * @param classNames
- * class names to check against
- * @param args
- * input objects
- * @return A request to be sent to the broker using SendRequest
- * @see BrokerClient#sendRequest(Object)
- */
- private static <TRequest> TRequest createRequest(
- Class<TRequest> requestClass, Class<?> classNames[], Object args[],
- boolean checkClassArgs) {
- TRequest request;
- try {
-