Skip to content

Commit 74f7020

Browse files
NicoPeters.NPNicoPeters.NP
NicoPeters.NP
authored and
NicoPeters.NP
committed
prepared oryx for JUnit tests and Cactus servlet tests.
there are test.xml ant scripts available to run the tests and there are test folders in each subproject for adding junit tests. the cactus tests are not working right now. git-svn-id: http://oryx-editor.googlecode.com/svn/trunk@1695 d672c736-503d-0410-a38a-9366997c882b
1 parent 198ff31 commit 74f7020

38 files changed

+2197
-90
lines changed

.classpath

+56-41
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,7 @@
66
<classpathentry kind="src" path="poem-jvm/src/java"/>
77
<classpathentry kind="src" path="buildApps/src"/>
88
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
9-
<classpathentry kind="lib" path="editor/lib/batik-anim.jar"/>
10-
<classpathentry kind="lib" path="editor/lib/batik-awt-util.jar"/>
11-
<classpathentry kind="lib" path="editor/lib/batik-bridge.jar"/>
12-
<classpathentry kind="lib" path="editor/lib/batik-codec.jar"/>
13-
<classpathentry kind="lib" path="editor/lib/batik-css.jar"/>
14-
<classpathentry kind="lib" path="editor/lib/batik-dom.jar"/>
15-
<classpathentry kind="lib" path="editor/lib/batik-ext.jar"/>
16-
<classpathentry kind="lib" path="editor/lib/batik-extension.jar"/>
17-
<classpathentry kind="lib" path="editor/lib/batik-gui-util.jar"/>
18-
<classpathentry kind="lib" path="editor/lib/batik-gvt.jar"/>
19-
<classpathentry kind="lib" path="editor/lib/batik-parser.jar"/>
20-
<classpathentry kind="lib" path="editor/lib/batik-script.jar"/>
21-
<classpathentry kind="lib" path="editor/lib/batik-svg-dom.jar"/>
22-
<classpathentry kind="lib" path="editor/lib/batik-svggen.jar"/>
23-
<classpathentry kind="lib" path="editor/lib/batik-swing.jar"/>
24-
<classpathentry kind="lib" path="editor/lib/batik-transcoder.jar"/>
25-
<classpathentry kind="lib" path="editor/lib/batik-util.jar"/>
26-
<classpathentry kind="lib" path="editor/lib/batik-xml.jar"/>
27-
<classpathentry kind="lib" path="editor/lib/commons-codec-1.3.jar"/>
28-
<classpathentry kind="lib" path="editor/lib/commons-collections-3.2.jar"/>
29-
<classpathentry kind="lib" path="editor/lib/commons-configuration-1.5.jar"/>
30-
<classpathentry kind="lib" path="editor/lib/commons-fileupload-1.2.jar"/>
31-
<classpathentry kind="lib" path="editor/lib/commons-httpclient-3.0.1.jar"/>
32-
<classpathentry kind="lib" path="editor/lib/commons-io-1.4.jar"/>
33-
<classpathentry kind="lib" path="editor/lib/commons-lang-2.3.jar"/>
34-
<classpathentry kind="lib" path="editor/lib/commons-logging-1.1.1.jar"/>
35-
<classpathentry kind="lib" path="editor/lib/custom_rhino.jar"/>
36-
<classpathentry kind="lib" path="editor/lib/dom3-xml-apis.jar"/>
37-
<classpathentry kind="lib" path="editor/lib/fop.jar"/>
38-
<classpathentry kind="lib" path="editor/lib/js.jar"/>
39-
<classpathentry kind="lib" path="editor/lib/openid4java.jar"/>
40-
<classpathentry kind="lib" path="editor/lib/oryxAtlas.jar"/>
41-
<classpathentry kind="lib" path="editor/lib/pdf-transcoder.jar"/>
42-
<classpathentry kind="lib" path="editor/lib/servlet-api.jar"/>
43-
<classpathentry kind="lib" path="editor/lib/xml-apis-ext.jar"/>
44-
<classpathentry kind="lib" path="editor/lib/xmlgraphics-commons-1.1.jar"/>
45-
<classpathentry kind="lib" path="editor/lib/org.json.jar"/>
9+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
4610
<classpathentry kind="lib" path="poem-jvm/lib/antlr-2.7.6.jar"/>
4711
<classpathentry kind="lib" path="poem-jvm/lib/aopalliance-1.0.jar"/>
4812
<classpathentry kind="lib" path="poem-jvm/lib/asm-1.5.3.jar"/>
@@ -88,6 +52,7 @@
8852
<classpathentry kind="lib" path="poem-jvm/lib/jsr107cache-1.0.jar"/>
8953
<classpathentry kind="lib" path="poem-jvm/lib/jta-1_0_1B-classes.jar"/>
9054
<classpathentry kind="lib" path="poem-jvm/lib/jta-1.0.1B.jar"/>
55+
<classpathentry kind="lib" path="poem-jvm/lib/junit-4.5.jar"/>
9156
<classpathentry kind="lib" path="poem-jvm/lib/log4j-1.2.12.jar"/>
9257
<classpathentry kind="lib" path="poem-jvm/lib/log4j-1.2.14.jar"/>
9358
<classpathentry kind="lib" path="poem-jvm/lib/logkit-1.0.1.jar"/>
@@ -99,8 +64,6 @@
9964
<classpathentry kind="lib" path="poem-jvm/lib/org.json.jar"/>
10065
<classpathentry kind="lib" path="poem-jvm/lib/persistence-api-1.0.jar"/>
10166
<classpathentry kind="lib" path="poem-jvm/lib/postgresql-8.3-603.jdbc3.jar"/>
102-
<classpathentry kind="lib" path="poem-jvm/lib/servlet-api-2.4.jar"/>
103-
<classpathentry kind="lib" path="poem-jvm/lib/servlet-api-2.5.jar"/>
10467
<classpathentry kind="lib" path="poem-jvm/lib/spring-beans-2.0.6.jar"/>
10568
<classpathentry kind="lib" path="poem-jvm/lib/spring-context-2.0.6.jar"/>
10669
<classpathentry kind="lib" path="poem-jvm/lib/spring-core-2.0.6.jar"/>
@@ -113,9 +76,61 @@
11376
<classpathentry kind="lib" path="poem-jvm/lib/xml-apis-2.0.2.jar"/>
11477
<classpathentry kind="lib" path="poem-jvm/lib/xmlgraphics-commons-1.3.jar"/>
11578
<classpathentry kind="lib" path="poem-jvm/lib/xmlsec-1.3.0.jar"/>
79+
<classpathentry kind="lib" path="buildApps/lib/commons-codec-1.3.jar"/>
11680
<classpathentry kind="lib" path="buildApps/lib/org.json.jar"/>
117-
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
81+
<classpathentry kind="lib" path="editor/lib/batik-anim.jar"/>
82+
<classpathentry kind="lib" path="editor/lib/batik-awt-util.jar"/>
83+
<classpathentry kind="lib" path="editor/lib/batik-bridge.jar"/>
84+
<classpathentry kind="lib" path="editor/lib/batik-codec.jar"/>
85+
<classpathentry kind="lib" path="editor/lib/batik-css.jar"/>
86+
<classpathentry kind="lib" path="editor/lib/batik-dom.jar"/>
87+
<classpathentry kind="lib" path="editor/lib/batik-ext.jar"/>
88+
<classpathentry kind="lib" path="editor/lib/batik-extension.jar"/>
89+
<classpathentry kind="lib" path="editor/lib/batik-gui-util.jar"/>
90+
<classpathentry kind="lib" path="editor/lib/batik-gvt.jar"/>
91+
<classpathentry kind="lib" path="editor/lib/batik-parser.jar"/>
92+
<classpathentry kind="lib" path="editor/lib/batik-script.jar"/>
93+
<classpathentry kind="lib" path="editor/lib/batik-svg-dom.jar"/>
94+
<classpathentry kind="lib" path="editor/lib/batik-svggen.jar"/>
95+
<classpathentry kind="lib" path="editor/lib/batik-swing.jar"/>
96+
<classpathentry kind="lib" path="editor/lib/batik-transcoder.jar"/>
97+
<classpathentry kind="lib" path="editor/lib/batik-util.jar"/>
98+
<classpathentry kind="lib" path="editor/lib/batik-xml.jar"/>
99+
<classpathentry kind="lib" path="editor/lib/commons-codec-1.3.jar"/>
100+
<classpathentry kind="lib" path="editor/lib/commons-collections-3.2.jar"/>
101+
<classpathentry kind="lib" path="editor/lib/commons-configuration-1.5.jar"/>
102+
<classpathentry kind="lib" path="editor/lib/commons-fileupload-1.2.jar"/>
103+
<classpathentry kind="lib" path="editor/lib/commons-httpclient-3.0.1.jar"/>
104+
<classpathentry kind="lib" path="editor/lib/commons-io-1.4.jar"/>
105+
<classpathentry kind="lib" path="editor/lib/commons-lang-2.3.jar"/>
106+
<classpathentry kind="lib" path="editor/lib/commons-logging-1.1.1.jar"/>
107+
<classpathentry kind="lib" path="editor/lib/custom_rhino.jar"/>
108+
<classpathentry kind="lib" path="editor/lib/dom3-xml-apis.jar"/>
109+
<classpathentry kind="lib" path="editor/lib/fop.jar"/>
118110
<classpathentry kind="lib" path="editor/lib/jbpt.jar"/>
119-
<classpathentry kind="lib" path="poem-jvm/lib/junit-4.5.jar"/>
111+
<classpathentry kind="lib" path="editor/lib/js.jar"/>
112+
<classpathentry kind="lib" path="editor/lib/openid4java.jar"/>
113+
<classpathentry kind="lib" path="editor/lib/org.json.jar"/>
114+
<classpathentry kind="lib" path="editor/lib/oryxAtlas.jar"/>
115+
<classpathentry kind="lib" path="editor/lib/pdf-transcoder.jar"/>
116+
<classpathentry kind="lib" path="editor/lib/xml-apis-ext.jar"/>
117+
<classpathentry kind="lib" path="editor/lib/xmlgraphics-commons-1.1.jar"/>
118+
<classpathentry kind="lib" path="lib/aspectjrt-1.5.3.jar"/>
119+
<classpathentry kind="lib" path="lib/cactus.core.framework.uberjar.javaEE.14-1.8.0.jar"/>
120+
<classpathentry kind="lib" path="lib/cactus.integration.ant-1.8.0.jar"/>
121+
<classpathentry kind="lib" path="lib/cactus.integration.shared.api-1.8.0.jar"/>
122+
<classpathentry kind="lib" path="lib/cargo-ant-0.9.jar"/>
123+
<classpathentry kind="lib" path="lib/cargo-core-uberjar-0.9.jar"/>
124+
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
125+
<classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
126+
<classpathentry kind="lib" path="lib/httpunit-1.6.jar"/>
127+
<classpathentry kind="lib" path="lib/jasper-compiler-5.5.9.jar"/>
128+
<classpathentry kind="lib" path="lib/jasper-runtime-5.5.9.jar"/>
129+
<classpathentry kind="lib" path="lib/junit-3.8.2.jar"/>
130+
<classpathentry kind="lib" path="lib/junit-4.5.jar"/>
131+
<classpathentry kind="lib" path="lib/nekohtml-1.9.6.jar"/>
132+
<classpathentry kind="lib" path="lib/org.mortbay.jetty-5.1.9.jar"/>
133+
<classpathentry kind="lib" path="lib/servlet-api-2.4.jar"/>
134+
<classpathentry kind="lib" path="lib/xercesImpl-2.8.1.jar"/>
120135
<classpathentry kind="output" path="bin"/>
121136
</classpath>

build.xml

+43-40
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<project name="Oryx Main Build Script">
3-
<!-- Load additional properties -->
4-
<property file="build.properties" />
5-
6-
<!-- Import ANT build scripts of sub projects -->
7-
<import file="editor/build.xml" />
8-
<import file="poem-jvm/build.xml" />
9-
<import file="stick/build.xml" />
10-
11-
3+
<!-- Load additional properties -->
4+
<property file="build.properties"/>
5+
6+
<!-- Import ANT build scripts of sub projects -->
7+
<import file="editor/build.xml"/>
8+
<import file="poem-jvm/build.xml"/>
9+
<import file="stick/build.xml"/>
10+
11+
1212
<!-- (RE)BUILD EDITOR AND BACKEND -->
13-
<target name="build-all" depends="build-editor, build-backend" />
14-
15-
<target name="rebuild-all" depends="clean-editor, build-editor, clean-backend, build-backend" />
16-
17-
18-
<!-- CLEAN EDITOR AND BACKEND -->
19-
<target name="clean-all" depends="clean-editor, clean-backend" />
20-
21-
22-
<!-- DEPLOYMENT TARGETS (NO BUILD OF PROJECTS!) -->
23-
24-
<!-- (UN)DEPLOY EDITOR AND BACKEND -->
25-
<target name="deploy-all" depends="deploy-editor, deploy-backend" />
26-
27-
<target name="undeploy-all" depends="undeploy-editor, undeploy-backend" />
28-
29-
30-
<!-- (UN)DEPLOY EDITOR -->
31-
<target name="deploy-editor">
32-
<copy file="${target-dir}/oryx.war" todir="${deploymentdir}" />
13+
<target name="build-all" depends="build-editor, build-backend"/>
14+
15+
<target name="rebuild-all" depends="clean-editor, build-editor, clean-backend, build-backend"/>
16+
17+
18+
<!-- CLEAN EDITOR AND BACKEND -->
19+
<target name="clean-all">
20+
<delete dir="build"/>
21+
<delete dir="dist"/>
22+
</target>
23+
24+
25+
<!-- DEPLOYMENT TARGETS (NO BUILD OF PROJECTS!) -->
26+
27+
<!-- (UN)DEPLOY EDITOR AND BACKEND -->
28+
<target name="deploy-all" depends="deploy-editor, deploy-backend"/>
29+
30+
<target name="undeploy-all" depends="undeploy-editor, undeploy-backend"/>
31+
32+
33+
<!-- (UN)DEPLOY EDITOR -->
34+
<target name="deploy-editor">
35+
<copy file="${target-dir}/oryx.war" todir="${deploymentdir}"/>
3336
</target>
34-
35-
<target name="undeploy-editor">
36-
<delete file="${deploymentdir}/oryx.war" />
37+
38+
<target name="undeploy-editor">
39+
<delete file="${deploymentdir}/oryx.war"/>
3740
</target>
38-
41+
3942
<target name="deploy-stencilsets">
4043
<copy todir='${deploymentdir}/oryx/stencilsets'>
4144
<fileset dir="${editor-src-root}/data/stencilsets"/>
@@ -44,15 +47,15 @@
4447
Copied stencilsets into deployment destination
4548
</echo>
4649
</target>
47-
4850

49-
<!-- (UN)DEPLOY REPOSITORY -->
50-
<target name="deploy-backend">
51-
<copy file="${target-dir}/backend.war" tofile="${deploymentdir}/backend.war" />
51+
52+
<!-- (UN)DEPLOY REPOSITORY -->
53+
<target name="deploy-backend">
54+
<copy file="${target-dir}/backend.war" tofile="${deploymentdir}/backend.war"/>
5255
</target>
53-
56+
5457
<target name="undeploy-backend">
55-
<delete file="${deploymentdir}/backend.war" />
58+
<delete file="${deploymentdir}/backend.war"/>
5659
</target>
57-
60+
5861
</project>

editor/build.xml

+3
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
<include name="*.jar"/>
120120
<exclude name="deprecated/**" />
121121
</fileset>
122+
<fileset dir="lib">
123+
<include name="*.jar" />
124+
</fileset>
122125
</classpath>
123126
</javac>
124127
</target>

editor/lib/servlet-api.jar

-86.5 KB
Binary file not shown.

editor/test.xml

+104-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,117 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<project name="Oryx Editor Test">
2+
<project name="Oryx Editor Tests">
3+
<!-- Load additional properties -->
4+
<property file="../test.properties"/>
35

46
<property name="url" value="${localWorkingDirectoryUrl}/editor/test/jsunit/testRunner.html?testPage=${localWorkingDirectoryUrl}/editor/test/client/TestSuite.html"/>
57
<property name="resourceBase" value="editor/test/jsunit"/>
68

9+
<import file="build.xml" />
10+
711
<!-- Import ANT build script of jsUnit -->
812
<import file="test/jsunit/build.xml" />
913

1014
<target name="test.editor.client" depends="standalone_test" />
1115

1216
<!-- <target name="test.editor.client.distributed" depends="distributed_test" /> -->
1317

18+
19+
<!-- SERVER TESTS -->
20+
<path id="test.editor.server.classpath">
21+
<fileset dir="${editor-src-root}/lib">
22+
<include name="*.jar"/>
23+
<exclude name="deprecated/**"/>
24+
</fileset>
25+
<fileset dir="lib">
26+
<include name="*.jar"/>
27+
</fileset>
28+
</path>
29+
30+
<taskdef resource="cactus.tasks"
31+
classpathref="test.editor.server.classpath"/>
32+
33+
<!-- Compiles the test sources for the editor-->
34+
<target name="test.editor.server.prepare.compile" depends="build-editor">
35+
<mkdir dir="build/editor/test/server"/>
36+
<javac destdir="build/editor/test/server"
37+
debug="on" optimize="off"
38+
deprecation="off">
39+
<src path="editor/test/server"/>
40+
<classpath>
41+
<fileset dir="${editor-src-root}/lib">
42+
<include name="*.jar"/>
43+
<exclude name="deprecated/**"/>
44+
</fileset>
45+
<fileset dir="lib">
46+
<include name="*.jar"/>
47+
</fileset>
48+
<pathelement location="build/editor/test/server"/>
49+
<pathelement location="build/editor/classes"/>
50+
</classpath>
51+
</javac>
52+
</target>
53+
54+
<!-- Copy libraries to ant lib folder -->
55+
<target name="test.prepare.cactus.ant">
56+
<copy file="lib/xercesImpl-2.8.1.jar" todir="${ant.home}/lib"/>
57+
</target>
58+
59+
60+
<!-- Prepare editor server test cases -->
61+
62+
<!-- Cactify the web-app archive. ATTENTION! oryx.war will be overwritten!-->
63+
<target name="test.editor.server.prepare.cactifywar" depends="test.prepare.cactus.ant, test.editor.server.prepare.compile">
64+
65+
<cactifywar srcfile="${target-dir}/oryx.war"
66+
destfile="${target-dir}/oryxcactified.war">
67+
<classes dir="build/editor/test/server"/>
68+
<lib file="lib/httpunit-1.6.jar"/>
69+
</cactifywar>
70+
71+
<delete file="${target-dir}/oryx.war"/>
72+
<move file="${target-dir}/oryxcactified.war" tofile="${target-dir}/oryx.war"/>
73+
</target>
74+
75+
<!-- Run editor server tests -->
76+
<target name="test.editor.server.cactus.run" depends="test.editor.server.prepare.cactifywar">
77+
<cactus warfile="${target-dir}/oryx.war"
78+
printsummary="withOutAndErr">
79+
<classpath>
80+
<path refid="test.editor.server.classpath"/>
81+
<pathelement location="build/editor/test/server"/>
82+
<pathelement location="build/editor/classes"/>
83+
</classpath>
84+
<containerset>
85+
<tomcat5x dir="${tomcat.home}" port="8080"/>
86+
</containerset>
87+
<formatter type="xml"/>
88+
<batchtest>
89+
<fileset dir="build/editor/test/server">
90+
<include name="**/Test*.class"/>
91+
</fileset>
92+
</batchtest>
93+
</cactus>
94+
</target>
95+
96+
<target name="test.editor.server.junit.run" depends="test.editor.server.prepare.compile">
97+
<junit printsummary="withOutAndErr" haltonfailure="no">
98+
<classpath>
99+
<path refid="test.editor.server.classpath"/>
100+
<pathelement location="build/editor/test/server"/>
101+
<pathelement location="build/editor/classes"/>
102+
</classpath>
103+
104+
<formatter type="xml"/>
105+
106+
<batchtest>
107+
<fileset dir="build/editor/test/server">
108+
<include name="**/Test*.class"/>
109+
</fileset>
110+
</batchtest>
111+
</junit>
112+
113+
</target>
114+
115+
<target name="test.editor.server.run.all" depends="test.editor.server.junit.run"/>
116+
14117
</project>

0 commit comments

Comments
 (0)