Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZCS-5350 Convert eas test from BeanShell to Java. #20

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ This contains zimbra jmeter load tests.

### Assumptions

1. Java Developer Kit (JDK) 7 or higher installed.
1. Java Developer Kit (JDK) 8 or higher installed.
2. Ant 1.9 or higher installed.
3. [jmeter 3.0](https://archive.apache.org/dist/jmeter/binaries/) installed at /opt/apache-jmeter-3.0 if not modify build.xml jmeter.home appropriately.
3. [jmeter 4.0](https://archive.apache.org/dist/jmeter/binaries/) installed at /opt/apache-jmeter-4.0 if not modify build.xml jmeter.home appropriately.
4. config/env.prop is configured for the Zimbra environment to be tested.
5. admin account exists and has password of test123 in the Zimbra environment (modify config/users.csv if other account(s) desired).
6. See src [README.md](src/README.md) for addtional requirements to generate Zimbra JMeter Java Library.
Expand Down Expand Up @@ -89,8 +89,8 @@ $ sh reportGen/scripts/loadtest.sh -t <test name> -w < workspace path>

### Assumptions

1. Java Developer Kit (JDK) 7 or higher installed.
2. [jmeter 3.0](https://archive.apache.org/dist/jmeter/binaries/) installed.
1. Java Developer Kit (JDK) 8 or higher installed.
2. [jmeter 4.0](https://archive.apache.org/dist/jmeter/binaries/) installed.

### Execution

Expand Down
23 changes: 16 additions & 7 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ant build

requires: java 7, ant 1.9, junit, and hamcrest
requires: java 8, jmeter 4.0, ant 1.9, junit, and hamcrest

centos: yum install java ant ant-contrib ant-junit

Expand All @@ -10,10 +10,18 @@ $ ant

all generated items are in build directory.

* jar = zjmeter jar file
* doc = zjmeter documentation
* classes = zjmeter classes
* test = zjmeter test classes
* jar = jar files
* doc = documentation
* classes = classes
* test = test classes

For eas testing the zimbraext.jar file must be installed to the jmeter lib/ext directory. This build assumes jmeter is available at /opt/apache-jemeter-4.0 if not then set jmeter.home to the proper location. If you have write access tot he jmeter location you can use:

```
$ ant install
```

To copy the zimbraext.jar to the jmeter lib/ext directory.

```
$ ant clean
Expand All @@ -26,7 +34,7 @@ will remove build directory.

```
shopt -s globstar
javac -cp java java/**/*.java
javac -cp java:/opt/apache-jmeter-4.0/lib/*:/opt/apache-jmeter-4.0/lib/ext/* java/**/*.java
```

## command line testing
Expand All @@ -39,7 +47,8 @@ java -cp java com.zimbra.jmeter.test command SOAP properties/test.prop
## jar

```
cd java; jar -cf ../zjmeter.jar .
cd java; jar -cf ../zjmeter.jar com/zimbra/jmeter/*.class
cd java; jar -cf ../zimbraext.jar com/zimbra/jmeter/ext/*.class
```

## jar command line testing
Expand Down
57 changes: 53 additions & 4 deletions src/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<property name="test" location="${build}/test"/>
<property name="jar" location="${build}/jar"/>
<property name="doc" location="${build}/doc"/>
<property name="ext" value="zimbraext.jar"/>
<property name="jmeter.home" value="/opt/apache-jmeter-3.0"/>
<path id="test.path">
<pathelement location="${jar}/zjmeter.jar"/>
</path>
Expand All @@ -15,14 +17,59 @@
<antcall target="test"/>
<antcall target="doc"/>
</target>
<path id="jmeter-classpath">
<fileset dir="${jmeter.home}/lib/ext">
<include name="ApacheJMeter_core.jar"/>
<include name="ApacheJMeter_java.jar"/>
</fileset>
<fileset dir="${jmeter.home}/lib">
<!-- jmeter logging -->
<include name="slf4j-api-*.jar"/>
<!-- EAS http -->
<include name="httpclient-*.jar"/>
<include name="httpcore-*.jar"/>
<!-- EAS base64 -->
<include name="commons-codec-*.jar"/>
</fileset>
<fileset dir="build/jar">
<!-- EAS wbxml -->
<include name="zm-sync-common.jar"/>
</fileset>
</path>
<target name="zm-sync-common-test">
<available file="build/jar/zm-sync-common.jar"
property="zm-sync-common-jar.present"/>
</target>
<target name="build">
<mkdir dir="${classes}"/>
<javac srcdir="${src}" destdir="${classes}" fork="yes"
<javac srcdir="${src}/com" destdir="${classes}" fork="yes"
includeAntRuntime="false"/>
<antcall target="extbuild"/>
</target>
<target name="extbuild" depends="zm-sync-common-test"
if="zm-sync-common-jar.present">
<javac srcdir="${src}/ext" destdir="${classes}" fork="yes"
includeAntRuntime="false">
<classpath refid="jmeter-classpath"/>
</javac>
</target>
<target name="jar" depends="build">
<target name="install">
<copy todir="${jmeter.home}/lib/ext">
<fileset dir="${jar}">
<include name="${ext}"/>
</fileset>
</copy>
</target>
<target name="jar" depends="build,zm-sync-common-test">
<jar destfile="${jar}/zjmeter.jar" basedir="${classes}">
<include name="com/zimbra/jmeter/*"/>
<include name="com/zimbra/jmeter/*.class"/>
</jar>
<antcall target="extjar"/>
</target>
<target name="extjar" depends="zm-sync-common-test"
if="zm-sync-common-jar.present">
<jar destfile="${jar}/${ext}" basedir="${classes}">
<include name="com/zimbra/jmeter/ext/*"/>
</jar>
</target>
<target name="Loganalyzer.jar" depends="build">
Expand All @@ -41,7 +88,9 @@
</junit>
</target>
<target name="doc">
<javadoc sourcepath="${src}" destdir="${doc}"/>
<javadoc sourcepath="${src}" destdir="${doc}">
<classpath refid="jmeter-classpath"/>
</javadoc>
</target>
<target name="clean">
<delete dir="${build}"/>
Expand Down
Loading