harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r542776 - in /harmony/enhanced/buildtest/branches/2.0: adaptors/axis2_app/ tests/axis2_app/ tests/axis2_app/resources/ tests/axis2_app/src/
Date Wed, 30 May 2007 08:32:01 GMT
Author: smishura
Date: Wed May 30 01:32:00 2007
New Revision: 542776

URL: http://svn.apache.org/viewvc?view=rev&rev=542776
Log:
Apply patch from HARMONY-3538:
([testing] axis2 client-server scenario to integrate into buildtest)

Added:
    harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/
    harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/adaptor.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/parameters.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/build.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.bat   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.sh   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/lab_stat.wsdl   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/services.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatClient.java   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatServiceSkeleton.java   (with props)
    harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/SimpleAxis2Server.java   (with props)

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/adaptor.xml?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/adaptor.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/adaptor.xml Wed May 30 01:32:00 2007
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+
+<!-- ====================================================================== 
+                        BT Adaptor for Axis2 scenario application
+     ====================================================================== -->
+<project name="axis2_app" default="run" basedir=".">
+
+    <property name="AXIS2_HOME" location="${ext.axis2_111.location}"/>
+
+    <condition property="axis.java.home" value="${java.home}">
+        <equals arg1="true" arg2="${axis2_app.parameters.optional.test.client.only}"/>
+    </condition>
+
+    <condition property="axis.vm.options"
+               value=""
+               else="${axis2_app.parameters.optional.tested.vm.options}">
+        <equals arg1="true" arg2="${axis2_app.parameters.optional.test.client.only}"/>
+    </condition>
+
+    <property name="axis.java.home" value="${tested.runtime}"/>
+
+    <property name="axis.res.dir"   location="${results.dir}/${suite.name}"/>
+    <property name="server.run.log" location="${axis.res.dir}/SimpleAxis2Server.log"/>
+    <property name="client.run.log" location="${axis.res.dir}/client.run.log"/>
+    <property name="axis.summary"   location="${axis.res.dir}/Axis2-message.txt"/>
+
+    <available file="${AXIS2_HOME}/repository/services/LabStatService.aar" 
+               property="app.OK"/>
+
+    <condition property="do.generate.client">
+        <equals arg1="true" arg2="${axis2_app.parameters.optional.generate.client}"/>
+    </condition>
+
+    <!-- setup AXIS2 server -->
+    <target name="setup" unless="app.OK">
+        <log message="AXIS2_HOME: ${AXIS2_HOME}"/>
+        <call-axis2_app target="setup_axis2server"/>
+    </target>
+
+    <!-- do test execution -->
+    <target name="run">
+
+        <antcall target="-generate-client"/>
+
+        <!-- Deleting previous client/server logs -->
+        <delete file="${server.run.log}"/>
+        <delete file="${client.run.log}"/>
+
+        <parallel>
+
+            <sequential>
+                <!-- Start Axis2 server -->
+                <call-axis2_app target="start.server" failureproperty="server.start.failed"/>
+                <axis2-fail message="Axis2 server failed to start" if="server.start.failed"/>
+            </sequential>
+
+            <sequential>
+                <!-- Wait Axis2 server is started -->
+                <waitfor maxwait="${axis2_app.parameters.optional.server.startup.timeout}"
+                         maxwaitunit="second" timeoutproperty="failed.timeout">
+                    <and>
+                        <available file="${server.run.log}"/>
+                        <isfileselected file="${server.run.log}">
+                            <contains text="INFO: [SimpleAxisServer] Started"/>
+                        </isfileselected>
+                    </and>
+                </waitfor>
+                <axis2-fail message="Axis2 server startup timeout exceeded" if="failed.timeout"/>
+
+                <!-- Run client -->
+                <call-axis2_app target="run.client" failureproperty="run.client.failed"/>
+
+                <!-- Stop Axis2 server -->
+                <call-axis2_app target="stop.server" failureproperty="server.stop.failed"/>
+            </sequential>
+        </parallel>
+
+        <axis2-fail message="Axis2 client failed" if="run.client.failed"/>
+        <axis2-fail message="Axis2 server failed to stop" if="server.stop.failed"/>
+
+        <property name="generate.summary" value="true"/>
+        <antcall target="-generate-summary"/>
+
+    </target>
+
+    <target name="clean">
+        <call-axis2_app target="clean"/>
+    </target>
+
+    <target name="-generate-client" if="do.generate.client">
+        <call-axis2_app target="generate.client" failureproperty="generate.client.failed"/>
+        <fail message="Failed to generate client" if="generate.client.failed"/>
+    </target>
+
+    <target name="-generate-summary" if="generate.summary">
+        <echo file="${axis.summary}"
+              message="Axis-2 client log:${line.separator}${line.separator}"/>
+
+        <concat destfile="${axis.summary}" append="true">
+            <filelist dir="${axis.res.dir}" files="client.run.log"/>
+        </concat>
+
+        <echo file="${axis.summary}" append="true"
+              message="${line.separator}***********************************************************${line.separator}"/>
+
+        <echo file="${axis.summary}" append="true"
+              message="Axis-2 server log:${line.separator}${line.separator}"/>
+
+        <concat destfile="${axis.summary}" append="true">
+            <filelist dir="${axis.res.dir}" files="SimpleAxis2Server.log"/>
+        </concat>
+
+        <echo file="${axis.summary}" append="true"
+              message="${line.separator}***********************************************************${line.separator}"/>
+    </target>
+
+    <!-- calls axis2_app's main build file -->
+    <macrodef name="call-axis2_app">
+        <attribute name="target"/>
+        <attribute name="failureproperty" default="fail.property.not.required"/>
+        <sequential>
+            <condition property="do.fail" value="true" else="false">
+                <equals arg1="@{failureproperty}" arg2="fail.property.not.required"/>
+            </condition>
+            <exec-ant dir="${test.sources.dir}/${suite.name}"
+                      targets="@{target}"
+                      failonerror="${do.fail}"
+                      failproperty="@{failureproperty}">
+                <sysproperty key="AXIS2_HOME"        value="${AXIS2_HOME}"/>
+                <sysproperty key="axis.result.dir"   value="${axis.res.dir}"/>
+                <sysproperty key="axis.build.dir"    value="${axis.res.dir}/build"/>
+                <sysproperty key="axis.web.port"     value="${axis2_app.parameters.optional.web.port}"/>
+                <sysproperty key="axis.java.home"    value="${axis.java.home}"/>
+                <sysproperty key="axis.vm.options"   value="${axis.vm.options}"/>
+                <sysproperty key="client.java.home"  value="${tested.runtime}"/>
+                <sysproperty key="client.vm.options" value="${axis2_app.parameters.optional.tested.vm.options}"/>
+            </exec-ant>
+        </sequential>
+    </macrodef>
+
+    <!-- fail task with summary generation before failing -->
+    <macrodef name="axis2-fail">
+        <attribute name="message"/>
+        <attribute name="if"/>
+        <sequential>
+            <condition property="generate.summary">
+                <isset property="@{if}"/>
+            </condition>
+            <antcall target="-generate-summary"/>
+            <fail message="@{message}" if="@{if}"/>
+        </sequential>
+    </macrodef>
+
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/adaptor.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/parameters.xml?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/parameters.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/parameters.xml Wed May 30 01:32:00 2007
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<parameters depends="drlvm">
+
+    <required>
+        <tested.runtime
+            description="Path to Tested Runtime"
+            value="${drlvm.parameters.shared.jre.dir}"/>
+    </required>
+
+    <optional>
+        <tested.vm.options
+            description="JVM options for tested runtime"
+            value=""/>
+        <web.port
+            description="Port for web server"
+            value="6071"/>
+        <server.startup.timeout
+            description="A time to wait for server startup (seconds)."
+            value="300"/>
+        <generate.client
+            description="Set this parameter to 'true' if you need to generate client explicitely"
+            value="false"/>
+        <test.client.only
+            description="Set this parameter to 'true' if you need to test client only"
+            value="false"/>
+    </optional>
+
+    <external>
+        <axis2_111
+            url="http://archive.apache.org/dist/ws/axis2/1_1_1/axis2-1.1.1.zip"
+            md5="478ecbe31a0da6881a2506e3bc0ee5aa"
+            dir="axis2-1.1.1"
+            inc="*/bin/**,*/conf/**,*/lib/**,*/repository/**"
+        />
+    </external>
+
+    <shared/>
+
+    <cc>
+        <summary
+            description="Axis2 client log to insert into CC notification"
+            value="${axis.summary}"/>
+    </cc>
+
+</parameters>

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/axis2_app/parameters.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/build.xml?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/build.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/build.xml Wed May 30 01:32:00 2007
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+ -->
+ 
+<project basedir="." default="generate.service">
+
+    <property environment="env"/>
+    <property name="AXIS2_HOME" value="${env.AXIS2_HOME}"/>
+
+    <property name="axis.build.dir"  value="build"/>
+    <property name="axis.result.dir" value="${axis.build.dir}/result"/>
+
+    <property name="axis.web.port" value="6060"/>
+    <property name="axis.java.home" value="${java.home}"/>
+    <property name="client.java.home" value="${axis.java.home}"/>
+
+<!-- ##### properties below are derived from the ones defined above ##### -->
+
+    <property name="wsdlFilename" 
+              location="${axis.build.dir}/lab_stat.wsdl"/>
+
+    <property name="packageName" value="org.apache.harmony.test.lab_stat_app"/>
+    <property name="namespaceToPackages" 
+             value="http://harmony.apache.org/test/lab_stat_app/xsd=${packageName}.xsd"/>
+
+    <path id="axis2.classpath">
+        <fileset dir="${AXIS2_HOME}/lib">
+            <include name="*.jar"/>
+        </fileset>
+    </path>
+    <path id="client.class.path">
+        <fileset dir="${AXIS2_HOME}/lib">
+            <include name="*.jar" />
+        </fileset>
+        <fileset dir="${axis.build.dir}/client/build/lib" >
+            <include name="*.jar" />
+        </fileset>
+    </path>
+
+<!-- ################## targets definitions ################## -->
+
+    <property name="start.server.script" location="${AXIS2_HOME}/bin/axis2server.R" />
+    <condition property="start.server.cmd" value="${start.server.script}.bat"
+                                            else="${start.server.script}.sh"    >
+        <os family="windows" />
+    </condition>
+
+    <target name="setup_axis2server" depends="generate.all">
+        <javac destdir="${AXIS2_HOME}" 
+               srcdir="${basedir}/src" 
+               includes="SimpleAxis2Server.java"
+               source="1.4" 
+               target="1.4">
+            <classpath refid="axis2.classpath" />
+        </javac>
+        <copy toDir="${AXIS2_HOME}/bin" overwrite="yes" >
+            <fileset dir="${basedir}/resources" includes="axis2server.R.*" />
+        </copy>
+        <chmod file="${start.server.script}.sh" perm="ugo+rx"/>
+        <mkdir dir="${axis.result.dir}"/>
+    </target>
+
+    <condition property="shell.cmd" value="${env.ComSpec}">
+        <os family="windows" />
+    </condition>
+
+    <property name="server.log"     location="${axis.result.dir}/SimpleAxis2Server.log" />
+    <property name="client.run.log" location="${axis.result.dir}/client.run.log" />
+
+    <target name="start.server">
+        <echo file="${server.log}" append="true">
+============== Starting ${start.server.cmd} in the next test run =====
+
+</echo>
+
+        <delete file="${AXIS2_HOME}/stopServer"/>
+        <echo>
+Run ${start.server.cmd}
+Args: ${server.log}
+in ${AXIS2_HOME}
+</echo>
+        <exec executable="${start.server.cmd}" dir="${AXIS2_HOME}">
+            <!--  
+              output="${server.log}" error="${server.log}" append="true">
+
+            <arg line="/C start ${start.server.cmd} >> ${server.log}" /-->
+            <arg line="${server.log}" />
+            <env key="JAVA_HOME"  value="${axis.java.home}"/>
+            <env key="JAVA_OPTS"  value="${axis.vm.options}"/>
+            <env key="AXIS2_HOME" value="${AXIS2_HOME}"/>
+        </exec>
+    </target>
+
+    <target name="stop.server">
+        <touch file="${AXIS2_HOME}/stopServer"/>
+    </target>
+
+    <target name="-init">
+        <mkdir dir="${axis.build.dir}"/>
+        
+        <copy file="${basedir}/resources/lab_stat.wsdl"
+              toDir="${axis.build.dir}"
+              overwrite="yes" />
+        <replace file="${wsdlFilename}"              token="8080" value="${axis.web.port}"/>
+        <replace file="${AXIS2_HOME}/conf/axis2.xml" token="8080" value="${axis.web.port}"/>
+    </target>
+
+    <taskdef name="wsdl2java"
+                 classname="org.apache.axis2.tool.ant.AntCodegenTask"
+                 classpathref="axis2.classpath"/>
+
+    <target name="generate.service" depends="-init">
+
+        <delete dir="${axis.build.dir}/service"/>
+        <wsdl2java wsdlFilename="${wsdlFilename}"
+                   packageName="${packageName}"
+                   namespaceToPackages="${namespaceToPackages}"
+                   language="java"
+                   databindingName="adb"
+                   synconly="true"
+                   output="${axis.build.dir}/service"
+                   serverside="true"
+                   serverSideInterface="true"
+                   generateservicexml="true"/>
+        <copy file="${basedir}/src/LabStatServiceSkeleton.java"
+              toDir="${axis.build.dir}/service/src/org/apache/harmony/test/lab_stat_app/"
+              overwrite="yes" />    
+        <copy file="${basedir}/resources/services.xml"
+              toDir="${axis.build.dir}/service/resources/"
+              overwrite="yes" />
+
+        <ant dir="${axis.build.dir}/service">
+            <property name="axis2.home" value="${AXIS2_HOME}"/>
+        </ant>
+
+        <copy file="${axis.build.dir}/service/build/lib/LabStatService.aar"
+              toDir="${AXIS2_HOME}/repository/services"
+              overwrite="yes" />    
+    </target>
+
+    <target name="generate.client" depends="-init">
+
+        <delete dir="${axis.build.dir}/client"/>
+        <wsdl2java wsdlFilename="${wsdlFilename}"
+                   packageName="${packageName}"
+                   namespaceToPackages="${namespaceToPackages}"
+                   language="java"
+                   databindingName="adb"
+                   synconly="true"
+                   output="${axis.build.dir}/client"/>
+        <copy file="${basedir}/src/LabStatClient.java"
+              toDir="${axis.build.dir}/client/src/org/apache/harmony/test/lab_stat_app/"
+              overwrite="yes"/>
+
+        <ant dir="${axis.build.dir}/client">
+            <property name="axis2.home" value="${AXIS2_HOME}"/>
+        </ant>
+    </target>
+
+    <target name="generate.all" depends="generate.service, generate.client"/>
+
+    <!--target name="run.client" depends="generate.client"-->
+    <target name="run.client">
+        <echo file="${client.run.log}">==== Server Java : ${axis.java.home}
+</echo>
+        <java fork="true" failonerror="true" output="${client.run.log}" append="true"
+            jvm="${axis.java.home}/bin/java"
+            classname="org.apache.harmony.test.lab_stat_app.LabStatClient">
+            <jvmarg value="-version" />
+        </java>
+        <echo file="${client.run.log}" append="true">=========================================================
+==== Client Java : ${client.java.home}
+</echo>
+        <java fork="true" failonerror="true" output="${client.run.log}" append="true"
+            jvm="${client.java.home}/bin/java"
+            classname="org.apache.harmony.test.lab_stat_app.LabStatClient">
+            <jvmarg value="-version" />
+        </java>
+        <echo file="${client.run.log}" append="true">=========================================================
+
+</echo>
+        <run-client step="1" />
+        <run-client step="2" />
+        <run-client step="3" />
+    </target>
+
+    <macrodef name="run-client">
+        <attribute name="step"/>
+        <sequential>
+            <java fork="true" failonerror="true" output="${client.run.log}" append="true"
+                jvm="${client.java.home}/bin/java"
+                classname="org.apache.harmony.test.lab_stat_app.LabStatClient">
+                <jvmarg line="${client.vm.options}"/>
+                <arg value="@{step}" />
+                <classpath refid="client.class.path" />
+            </java>
+        </sequential>
+    </macrodef>
+
+    <target name="clean">
+        <delete dir="${axis.build.dir}"/>
+        <delete file="${AXIS2_HOME}/repository/services/LabStatService.aar" />
+        <delete file="${AXIS2_HOME}/stopServer"/>
+    </target>
+
+</project>

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.bat
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.bat?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.bat (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.bat Wed May 30 01:32:00 2007
@@ -0,0 +1 @@
+@ "%AXIS2_HOME%\bin\axis2server.bat"  >>%1 2>&1

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.bat
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.sh
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.sh?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.sh (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.sh Wed May 30 01:32:00 2007
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+#  Copyright 2001,2004-2006 The Apache Software Foundation
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+# ----------------------------------------------------------------------------
+# SimpleAxis2Server Script
+#
+# Environment Variable Prequisites
+#
+#   AXIS2_HOME   Home of Axis2 installation. If not set I will  try
+#                   to figure it out.
+#
+#   JAVA_HOME       Must point at your Java Development Kit installation.
+#
+#   JAVA_OPTS       (Optional) Java runtime options.
+#
+# -----------------------------------------------------------------------------
+
+# Get the context and from that find the location of setenv.sh
+. `dirname $0`/setenv.sh
+
+echo JAVA_HOME=$JAVA_HOME >>$1
+echo JAVA_OPTS=$JAVA_OPTS >>$1
+echo AXIS2_HOME=$AXIS2_HOME >>$1
+
+$JAVA_HOME/bin/java $JAVA_OPTS -classpath $AXIS2_HOME:$AXIS2_CLASSPATH \
+org.apache.axis2.transport.SimpleAxis2Server \
+-repo $AXIS2_HOME/repository -conf $AXIS2_HOME/conf/axis2.xml >>$1 2>&1

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/axis2server.R.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/lab_stat.wsdl
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/lab_stat.wsdl?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/lab_stat.wsdl (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/lab_stat.wsdl Wed May 30 01:32:00 2007
@@ -0,0 +1,146 @@
+ <!--
+     Licensed to the Apache Software Foundation (ASF) under one or more
+     contributor license agreements.  See the NOTICE file distributed with
+     this work for additional information regarding copyright ownership.
+     The ASF licenses this file to You under the Apache License, Version 2.0
+     (the "License"); you may not use this file except in compliance with
+     the License.  You may obtain a copy of the License at
+      
+          http://www.apache.org/licenses/LICENSE-2.0
+      
+      Unless required by applicable law or agreed to in writing, software
+      distributed under the License is distributed on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+      See the License for the specific language governing permissions and
+      limitations under the License.
+  -->
+
+<wsdl:definitions 
+    xmlns:axis2="http://harmony.apache.org/test/lab_stat_app/" 
+    xmlns:ns="http://harmony.apache.org/test/lab_stat_app/xsd" 
+    targetNamespace="http://harmony.apache.org/test/lab_stat_app/" 
+    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
+    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
+    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+<wsdl:types>
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://harmony.apache.org/test/lab_stat_app/xsd"
+    attributeFormDefault="qualified" elementFormDefault="qualified">
+  <xs:complexType name="statData">
+      <xs:sequence>
+        <xs:element name="CPU_load" nillable="true" type="xs:float" />
+        <xs:element name="RAM_load" nillable="true" type="xs:float" />
+        <xs:element name="active_users" nillable="true" type="xs:int" />
+      </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="statItem">
+      <xs:sequence>
+        <xs:element name="date" nillable="true" type="xs:date" />
+        <xs:element name="stat" type="ns:statData" />
+      </xs:sequence>
+  </xs:complexType>
+
+  <xs:element name="statId">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="server_name" nillable="false" type="xs:string" />
+        <xs:element name="date" nillable="true" type="xs:date" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="statResponse">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="statData" nillable="true" type="ns:statData" />
+      </xs:sequence>
+      <xs:attribute name="empty" type="xs:boolean" use="required"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="serverStat">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="server_name" nillable="false" type="xs:string" />
+        <xs:element name="statItem" type="ns:statItem"
+        		minOccurs="1" maxOccurs="unbounded" />
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
+</wsdl:types>
+
+<wsdl:message name="getStatMessage">
+  <wsdl:part name="part1" element="ns:statId" />
+</wsdl:message>
+<wsdl:message name="getStatResponseMessage">
+  <wsdl:part name="part1" element="ns:statResponse" />
+</wsdl:message>
+<wsdl:message name="updateMessage">
+  <wsdl:part name="part1" element="ns:serverStat" />
+</wsdl:message>
+
+<wsdl:portType name="LabStatServicePortType">
+  <wsdl:operation name="getStat">
+    <wsdl:input message="axis2:getStatMessage" />
+    <wsdl:output message="axis2:getStatResponseMessage" />
+  </wsdl:operation>
+  <wsdl:operation name="update">
+    <wsdl:input message="axis2:updateMessage" />
+  </wsdl:operation>
+</wsdl:portType>
+
+<wsdl:binding name="LabStatServiceSOAP11Binding" type="axis2:LabStatServicePortType">
+  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+  <wsdl:operation name="getStat">
+    <soap:operation soapAction="urn:getStat" style="document" />
+    <wsdl:input>
+      <soap:body use="literal" namespace="http://harmony.apache.org/test/lab_stat_app/" />
+    </wsdl:input>
+    <wsdl:output>
+      <soap:body use="literal" namespace="http://harmony.apache.org/test/lab_stat_app/" />
+    </wsdl:output>
+  </wsdl:operation>
+  <wsdl:operation name="update">
+    <soap:operation soapAction="urn:update" style="document" />
+    <wsdl:input>
+      <soap:body use="literal" namespace="http://harmony.apache.org/test/lab_stat_app/" />
+    </wsdl:input>
+  </wsdl:operation>
+</wsdl:binding>
+
+<wsdl:binding name="LabStatServiceSOAP12Binding" type="axis2:LabStatServicePortType">
+  <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+  <wsdl:operation name="getStat">
+    <soap12:operation soapAction="urn:getStat" style="document" />
+    <wsdl:input>
+      <soap12:body use="literal" 
+             namespace="http://harmony.apache.org/test/lab_stat_app/" />
+    </wsdl:input>
+    <wsdl:output>
+      <soap12:body use="literal" 
+             namespace="http://harmony.apache.org/test/lab_stat_app/" />
+    </wsdl:output>
+  </wsdl:operation>
+  <wsdl:operation name="update">
+    <soap12:operation soapAction="urn:update" style="document" />
+    <wsdl:input>
+      <soap12:body use="literal" namespace="http://harmony.apache.org/test/lab_stat_app/" />
+    </wsdl:input>
+  </wsdl:operation>
+</wsdl:binding>
+
+<wsdl:service name="LabStatService">
+  <wsdl:port name="LabStatServiceSOAP11port" binding="axis2:LabStatServiceSOAP11Binding">
+    <soap:address location="http://localhost:8080/axis2/services/LabStatService" />
+  </wsdl:port>
+  <wsdl:port name="LabStatServiceSOAP12port" binding="axis2:LabStatServiceSOAP12Binding">
+    <soap12:address location="http://localhost:8080/axis2/services/LabStatService" />
+  </wsdl:port>
+</wsdl:service>
+
+</wsdl:definitions>

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/lab_stat.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/services.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/services.xml?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/services.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/services.xml Wed May 30 01:32:00 2007
@@ -0,0 +1,43 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+ -->
+
+<!-- This file was auto-generated from WSDL -->
+<!-- by the Apache Axis2 version: #axisVersion# #today# -->
+<serviceGroup>
+<service name="LabStatService" scope="application">
+
+<messageReceivers>
+  <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" 
+  class="org.apache.harmony.test.lab_stat_app.LabStatServiceMessageReceiverInOut"/>
+  <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" 
+  class="org.apache.harmony.test.lab_stat_app.LabStatServiceMessageReceiverInOnly"/>
+</messageReceivers>
+
+<parameter locked="false" 
+  name="ServiceClass">org.apache.harmony.test.lab_stat_app.LabStatServiceSkeleton</parameter>
+
+<operation name="update" mep="http://www.w3.org/2004/08/wsdl/in-only">
+<actionMapping>urn:update</actionMapping>
+</operation>
+
+<operation name="getStat" mep="http://www.w3.org/2004/08/wsdl/in-out">
+<actionMapping>urn:getStat</actionMapping>
+<outputActionMapping>http://harmony.apache.org/test/lab_stat_app/LabStatServicePortType/getStatResponse</outputActionMapping>
+</operation>
+
+</service>
+</serviceGroup>

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/resources/services.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatClient.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatClient.java?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatClient.java (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatClient.java Wed May 30 01:32:00 2007
@@ -0,0 +1,247 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.harmony.test.lab_stat_app;
+
+import java.util.Calendar;
+import java.util.Date;
+
+public class LabStatClient extends LabStatServiceStub {
+
+    final static int ERROR_CREATE   = 31;
+    final static int ERROR_PREPARE  = 41;
+    final static int ERROR_UPLOAD   = 51;
+    final static int ERROR_GETSTAT  = 61;
+    final static int ERROR_CHECK    = 91;
+
+    final static int MAX_SHIFT    = 3;
+    final static int LAST_PDAY    = 5;
+
+    Calendar base_date = Calendar.getInstance();
+    boolean verbose = false;
+    int step; // in the range 1..MAX_SHIFT
+//--------------------------------------------------------------
+    
+    public LabStatClient() throws org.apache.axis2.AxisFault {
+		super();
+    }
+
+    public static void main(String[] args) {
+        LabStatClient client = null;
+        try {
+            
+            client = new LabStatClient();
+
+        } catch(Exception e) {
+            e.printStackTrace();
+            System.err.println("\n\n");
+            System.exit(ERROR_CREATE);
+        }
+
+        client.step = Integer.parseInt(args[0]);
+        if (System.getenv("AXIS2_APP_VERBOSE") != null) {
+			client.verbose = true;
+		}
+
+        client.upLoad(1);
+        client.upLoad(2);
+        client.check(2);
+
+        client.upLoad(MAX_SHIFT);
+        client.check(MAX_SHIFT);
+    }
+//--------------------------------------------------------------
+
+    public Date genDate(int day) {
+        base_date.clear();
+        base_date.set(2007, Calendar.MARCH, 10+day);
+        return base_date.getTime();
+	}
+
+    public int firstDay(int step, int shift) {
+		return (step-1)*5+shift;
+    }
+
+    public String serverName(int step, int shift) {
+        return "nst-"+ (step*10 + shift);
+	}
+
+    public String serverName(int shift) {
+        return serverName(step, shift);
+	}
+//--------------------------------------------------------------
+
+    public void upLoad(int shift) {
+        ServerStat sst = new ServerStat();
+        StatItem[] sia = new StatItem[6];
+
+        try {
+            for (int d=LAST_PDAY; d>=0; d--) {
+                StatData s_data = new StatData();
+                int m = shift*10 + d;
+                
+                s_data.setCPU_load(m + step/100f);
+                s_data.setRAM_load(step + m/100f);
+                s_data.setActive_users(step*100 + m);
+
+                StatItem s_item = new StatItem();
+                s_item.setDate(genDate( firstDay(step, shift)+d ));
+                s_item.setStat(s_data);
+
+                sia[d] = s_item; 
+		    } 
+
+            sst.setServer_name(serverName(shift));
+            sst.setStatItem(sia);
+        } catch(Exception e) {
+            e.printStackTrace();
+            System.err.println("\n\n");
+            System.exit(ERROR_PREPARE);
+        }
+
+        try {
+            update(sst);
+            //System.err.println("done");
+        } catch(Exception e) {
+            e.printStackTrace();
+            System.err.println("\n\n");
+            System.exit(ERROR_UPLOAD);
+        }
+    }
+//--------------------------------------------------------------
+
+    public void check(int shift) {
+        StatResponse resp = null;
+        StatId req = new StatId();
+        int last_day = firstDay(step, shift)+LAST_PDAY;
+
+		System.out.println("\n========= Check step "+ step +", shift "+ shift);
+        for (int day=1; day<=last_day; day++) {
+			VerboseLines v = new VerboseLines();
+			int bound = MAX_SHIFT;
+			String sname = null;
+
+			for (int s=1; s<=step; s++) {
+			    if (s == step) 
+			        bound = shift;
+			    for (int b=1; b<=bound; b++) { //====================
+                    try {
+                        sname = serverName(s, b);
+                        req.setDate(genDate(day));
+                        req.setServer_name(sname);
+
+                        resp = getStat(req); // call in synchro mode
+
+                    } catch(Exception e) {
+                        e.printStackTrace();
+                        System.err.println("\n\n");
+                        System.exit(ERROR_GETSTAT);
+                    }
+                    try {
+                        if (resp.getEmpty()) {
+                            v.addEmpty(sname);
+                            if (! isEmpty(s, b, day))
+                                throw new Exception("Got empty stat for "+ sname +
+                                                                   " on "+ genDate(day));
+                        } else {
+                            StatData s_data = resp.getStatData();
+                            v.add(sname, s_data);
+
+                            checkNonEmpty(s_data, s, b, day); 
+						}
+                    } catch(Exception e) {
+                        e.printStackTrace();
+                        System.err.println("\n\n");
+                        System.exit(ERROR_CHECK);
+                    }
+				} // b<=bound ==========================================
+			}
+			v.print(day);
+		}
+    }
+//--------------------------------------------------------------
+
+    public boolean isEmpty(int step, int shift, int day) {
+		int r_day = day - firstDay(step, shift);
+		return (r_day < 0) || (r_day > LAST_PDAY);
+    }
+
+    public void checkNonEmpty(StatData s_data, int step, int shift, int day)
+                                                                     throws Exception {
+        if (isEmpty(step, shift, day))
+            throw new Exception("Got non-empty stat for "+ serverName(step, shift) +
+                                                   " on "+ genDate(day) +
+                                                   "\n- "+ toString(s_data));
+
+        int m = shift*10 + (day - firstDay(step, shift));
+                
+//                s_data.setCPU_load(m + step/100f);
+//                s_data.setRAM_load(step + m/100f);
+//                s_data.setActive_users(step*100 + m);
+
+		String wrong = "";
+		if (Math.abs(s_data.getCPU_load() - (m + step/100f)) > Float.MIN_VALUE*8)
+		    wrong += "CPU";
+		if (Math.abs(s_data.getRAM_load() - (step + m/100f)) > Float.MIN_VALUE*8)
+		    wrong += " RAM";
+		if (         s_data.getActive_users() != (step*100 + m)                 )
+		    wrong += " Users";
+		if (wrong.length() > 0)
+		    throw new Exception("Got wrong "+ wrong +" for "+ serverName(step, shift) +
+                                                   " on "+ genDate(day) +
+                                                   "\n- "+ toString(s_data));
+    }
+
+    public String toString(StatData s_data) {
+		return "CPU: "+ s_data.getCPU_load() +
+              " RAM: "+ s_data.getRAM_load() +
+              " Users: "+ s_data.getActive_users();
+    }
+//--------------------------------------------------------------
+//--------------------------------------------------------------
+
+    class VerboseLines {
+		String names = "Server";
+		String CPU   = "CPU";
+		String RAM   = "RAM";
+		String users = "Users";
+
+		void addEmpty(String sname) {
+            names += "\t"+ sname;
+            CPU   += "\t -";
+            RAM   += "\t -";
+            users += "\t -";
+		}
+
+		void add(String sname, StatData s_data) {
+            names += "\t"+ sname;
+            CPU   += "\t"+ s_data.getCPU_load();
+            RAM   += "\t"+ s_data.getRAM_load();
+            users += "\t"+ s_data.getActive_users();
+		}
+
+		void print(int day) {
+			if (! verbose)
+			    return;
+			System.out.println("===== Date "+ genDate(day));
+			System.out.println(names);
+			System.out.println(CPU);
+			System.out.println(RAM);
+			System.out.println(users);
+		}
+	}
+}

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatServiceSkeleton.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatServiceSkeleton.java?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatServiceSkeleton.java (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatServiceSkeleton.java Wed May 30 01:32:00 2007
@@ -0,0 +1,99 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * LabStatServiceSkeleton.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis2 version: 1.1.1 Jan 09, 2007 (06:20:51 LKT)
+ */
+
+package org.apache.harmony.test.lab_stat_app;
+
+import org.apache.harmony.test.lab_stat_app.xsd.ServerStat;
+import org.apache.harmony.test.lab_stat_app.xsd.StatResponse;
+import org.apache.harmony.test.lab_stat_app.xsd.StatId;
+import org.apache.harmony.test.lab_stat_app.xsd.StatData;
+import org.apache.harmony.test.lab_stat_app.xsd.StatItem;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.TreeMap;
+
+/**
+ *  LabStatServiceSkeleton java skeleton for the axisService
+ */
+public class LabStatServiceSkeleton implements LabStatServiceSkeletonInterface{
+
+    private TreeMap storageServers = new TreeMap();
+    private TreeMap storageDates   = new TreeMap();
+
+    void put(TreeMap storage, Object prim_key, Object sec_key, Object data) {
+        HashMap hm = (HashMap)storage.get(prim_key);
+        boolean newHM = hm == null;
+        if (newHM)
+			hm = new HashMap();
+		hm.put(sec_key, data);
+		
+        if (newHM)
+			storage.put(prim_key, hm);
+	}
+
+    public void update (ServerStat stat) {
+        String server = stat.getServer_name();
+        StatItem[] si_list = stat.getStatItem();
+        //Date curDate = Date();
+        
+        for(int i=0; i<si_list.length; i++) {
+			StatItem si = si_list[i];
+			Date date   = si.getDate();
+
+			put(storageServers, server, date, si.getStat());
+			put(storageDates,   date, server, si.getStat());
+		}
+    }
+ 
+    public StatResponse getStat(StatId serverDate) {
+		StatResponse res = new StatResponse();
+		res.setEmpty(true);
+
+		String server = serverDate.getServer_name();
+		HashMap hm = (HashMap)storageServers.get(server);
+		if (hm == null)
+			return res;
+
+		Date date = serverDate.getDate();
+		StatData sd = (StatData)hm.get(date);
+		if (sd != null)
+			res.setEmpty(false);
+
+		res.setStatData(sd);
+		return res;
+    }
+ 
+}
+/*
+class serverData {
+    String server;
+    StatData data;
+
+    serverData(String server, StatData data) {
+        this.server = server;
+        this.data = data;
+	}
+}
+*/
\ No newline at end of file

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/LabStatServiceSkeleton.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/SimpleAxis2Server.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/SimpleAxis2Server.java?view=auto&rev=542776
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/SimpleAxis2Server.java (added)
+++ harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/SimpleAxis2Server.java Wed May 30 01:32:00 2007
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *  This code is a bit modified source file taken from the AXIS2 repository.
+ *  Origin can be found at 
+ *   http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/SimpleAxis2Server.java?revision=490434&view=markup
+ */
+
+package org.apache.axis2.transport;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.engine.ListenerManager;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.axis2.util.CommandLineOption;
+import org.apache.axis2.util.CommandLineOptionParser;
+import org.apache.axis2.util.OptionsValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class SimpleAxis2Server {
+
+    private static final Log log = LogFactory.getLog(SimpleHTTPServer.class);
+
+    int port = -1;
+
+    public static int DEFAULT_PORT = 8080;
+    
+
+    /**
+     * @param args
+     * @throws Exception
+     */
+    public static void main(String[] args) throws Exception {
+		String repoLocation = null;
+		String confLocation = null;
+
+		CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
+		List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
+			public boolean isInvalid(CommandLineOption option) {
+				String optionType = option.getOptionType();
+				return !("repo".equalsIgnoreCase(optionType) || "conf"
+						.equalsIgnoreCase(optionType));
+			}
+		});
+		
+		if ((invalidOptionsList.size()>0)||(args.length>4))
+		{
+			printUsage();
+			return;
+		}
+		
+		Map optionsMap = optionsParser.getAllOptions();
+
+		CommandLineOption repoOption = (CommandLineOption) optionsMap
+				.get("repo");
+		CommandLineOption confOption = (CommandLineOption) optionsMap
+				.get("conf");
+
+		log.info("[SimpleAxisServer] Starting");
+		if (repoOption != null) {
+			repoLocation = repoOption.getOptionValue();
+			log.info("[SimpleAxisServer] Using the Axis2 Repository"
+					+ new File(repoLocation).getAbsolutePath());
+		}
+		if (confOption != null) {
+			confLocation = confOption.getOptionValue();
+			System.out
+					.println("[SimpleAxisServer] Using the Axis2 Configuration File"
+							+ new File(confLocation).getAbsolutePath());
+		}
+
+		ListenerManager listenerManager = null;
+		try {
+			ConfigurationContext configctx = ConfigurationContextFactory
+					.createConfigurationContextFromFileSystem(repoLocation,
+							confLocation);
+			listenerManager =  new ListenerManager();
+			listenerManager.init(configctx);
+			listenerManager.start();
+			Thread.sleep(2000);
+		} catch (Throwable t) {
+            log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
+            System.exit(10);
+        }
+		log.info("[SimpleAxisServer] Started");
+
+		boolean run = true;
+		while (run) {
+			Thread.sleep(2000);
+			//final String sep = File.separator; confLocation +sep+ ".." +sep+ 
+			File stop = new File("stopServer");
+			if (stop.exists()) {
+				log.info("[SimpleAxisServer] Shutting down...");
+				listenerManager.stop();
+				run = false;
+			}
+		}
+    }
+    
+    public static void printUsage() {
+        System.out.println("Usage: SimpleAxisServer -repo <repository>  -conf <axis2 configuration file>");
+        System.out.println();
+        System.exit(1);
+    }
+}

Propchange: harmony/enhanced/buildtest/branches/2.0/tests/axis2_app/src/SimpleAxis2Server.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message