Codebase list wss4j / upstream/1.5.8+svntag build.xml
upstream/1.5.8+svntag

Tree @upstream/1.5.8+svntag (Download .tar.gz)

build.xml @upstream/1.5.8+svntagraw · history · blame

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
<?xml version="1.0"?>

<project name="Web Services Security (WSS4J)" default="usage" basedir=".">
    <!-- ================================================================== -->
    <description>
   Build file for WSS4J

   This file is intended for ANT, a Java based build tool.
   ANT is available from http://jakarta.apache.org/ant/index.html

Prerequisites:
    See the README file

Build Instructions:
   To build, run

     ant "target"

   on the directory where this file is located with the target you want.

    </description>

    <target name="init">
        <property name='product.Name' value='Apache-WS-Security-J'/>
        <property name='product.name' value='wss4j'/>
        <property name='product.shortname' value='wss4j'/>

        <property name='product.version.major' value='1'/>
        <property name='product.version.minor' value='5'/>
        <property name='product.version.level' value='8'/>
        <property name='product.version.qualifier' value=''/>
        <property name='product.version' value='${product.version.major}.${product.version.minor}.${product.version.level}${product.version.qualifier}'/>
        <property name="year" value="2008"/>
        <property name="copyright" value="Copyright &#169; ${year} Apache WSS4J Project. All Rights Reserved."/>

        <!-- Give user a chance to override without editing this file
             (and without typing -D each time it compiles it) -->
        <property file="./build.properties"/>
        <property file="${user.home}/build.properties"/>

        <!-- Place Holder for proxy settings -->
        <property name="http.proxyHost" value=""/>
        <property name="http.proxyPort" value=""/>
        <property name="http.nonProxyHosts" value="localhost"/>
        <property name="http.proxyUser" value=""/>
        <property name="http.proxyPassword" value=""/>

        <property name="dir.doc" value="./doc"/>
        <property name="dir.dist" value="./dist"/>
        <property name="dir.libs" value="./lib"/>
        <property name="dir.endorsed.libs" value="./endorsed"/>
        <property name="dir.src" value="./src"/>
        <property name="dir.samples" value="./samples"/>
        <property name="dir.test" value="./test"/>
        <property name="dir.keys" value="./keys"/>
        <property name="dir.specs" value="./specs"/>
        <property name="dir.interop" value="./interop"/>
        <property name="dir.webapp" location="./webapps/axis" />

        <property name="build.dir" value="./build"/>
        <property name="build.classes" value="${build.dir}/classes"/>
        <property name="build.work" value="${build.dir}/work"/>
        <property name="build.webapp" location="${build.dir}/webapps/axis"/>

        <property name="jar.library" value="${product.shortname}-${product.version}.jar"/>

        <property name="build.doc" value="${build.dir}/doc"/>
        <property name="build.doc.xml" value="${build.doc}/xml"/>
        <property name="build.doc.html" value="${build.doc}/html"/>
        <property name="build.javadoc" value="${build.doc.html}/api"/>
        <property name="build.junit.xml" value="${build.doc.xml}/junit"/>
        <property name="build.junit.html" value="${build.doc.html}/junit"/>


        <condition property="jdk13.present">
          <equals arg1="${ant.java.version}" arg2="1.3"/>
        </condition>

        <condition property="jdk14.present">
          <equals arg1="${ant.java.version}" arg2="1.4"/>
        </condition>

        <condition property="jdk15.present">
          <equals arg1="${ant.java.version}" arg2="1.5"/>
        </condition>

        <condition property="merlin.ok">
            <or>
                <equals arg1="${ant.java.version}" arg2="1.4"/>
                <equals arg1="${ant.java.version}" arg2="1.5"/>
            </or>
        </condition>

        <!-- 

         for the time being following path id uses the libs in the wss4j
         lib directory only This is done to test if we really don't need
         any axis libs. After this is done we can include the
         java.class.path and leave the wss4j/lib empty. This requires that
         the CLASSPATH includes all required packages (see above

         -->
        
        
        <path id="classpath.libraries" description="3rd party libs">
            <fileset dir="${dir.libs}">
                <include name="**/*.jar"/>
                <exclude name="**/bcprov-jdk15-*.jar" unless="jdk15.present"/>
                <exclude name="**/bcprov-jdk13-*.jar" if="jdk15.present" />
                <!-- <pathelement path="${java.class.path}"/> -->
            </fileset>
            <fileset dir="${dir.endorsed.libs}">
                <include name="**/*.jar"/>
                <!-- <pathelement path="${java.class.path}"/> -->
            </fileset>
        </path>

        <path id="classpath.wss4j" description="wss4j classes; first try pure class files, then jars">
            <pathelement path="${build.classes}"/>
            <pathelement path="${build.dir}/${jar.library}"/>
        </path>

        <path id="classpath.library">
            <path refid="classpath.wss4j"/>
            <path refid="classpath.libraries"/>
        </path>

        <taskdef resource="axis-tasks.properties" classpathref=
              "classpath.library"/>
        <taskdef name="runaxisfunctionaltests" classname=
              "org.apache.axis.tools.ant.axis.RunAxisFunctionalTestsTask"
            loaderref="axis">
            <classpath refid="classpath.library"/>
        </taskdef>
      
        <!-- this shall include Axis jars because the tests use the
         Axis implementation of javax.xml.soap, etc. Therefore the
         CLASSPATH is included.
         -->
        <path id="classpath.test">
            <!-- classpath for test is librarypath plus junit -->
            <path refid="classpath.library"/>
<!--            <pathelement path="${java.class.path}"/> -->
        </path>

        <path id="classpath.test.jar">
            <!-- classpath for test is librarypath plus junit -->
            <path refid="classpath.library"/>
            <pathelement path="${build.dir}/${jar.library}"/>
            <pathelement path="${build.dir}/${jar.tests}"/>
        </path>

        <patternset id="distFiles">
            <include name="build.xml"/>
            <include name="LICENSE.txt"/>
        </patternset>

        <patternset id="srcFiles">
         <!-- for some strange reasons, I can't use ${src} but must use src -->
            <include name="src/**/*"/>
        </patternset>

        <patternset id="srcSamplesFiles">
            <include name="samples/**/*"/>
        </patternset>

        <patternset id="srcUnitTestsFiles">
            <include name="test/**/*"/>
        </patternset>

        <patternset id="srcInteropFiles">
            <include name="interop/**/*"/>
        </patternset>

        <property name="javadoc.packages"
            value="
org.apache.ws.security,
org.apache.ws.security.components,
org.apache.ws.security.components.crypto,
org.apache.ws.security.message,
org.apache.ws.security.message.token,
org.apache.ws.security.util,
org.apache.ws.axis,
org.apache.ws.axis.security,
org.apache.ws.axis.security.util
"/>

      <echo level="debug">
        -------------------------------------------------------------------
        ${product.Name} v${product.version} [${year}] 
        -------------------------------------------------------------------
        Building with ${ant.version}
        using build file ${ant.file}
        Java ${java.version} located at ${java.home} 
        -------------------------------------------------------------------
        --- Property values ---
        sun.boot.class.path=${sun.boot.class.path}
      </echo>
      <pathconvert targetos="windows" property="classpath.test.as.string" 
          refid="classpath.test"/>
      <echo level="debug">
        classpath.test: ${classpath.test.as.string}
      </echo>
    </target>

    <target name="usage" depends="init">
      <echo>
         Build instructions                                                
        -------------------------------------------------------------------
                                                                           
         available targets are:                                            
                                                                           
           compile         --> compiles everything                         
           compile.library --> compiles the source code                    
           compile.samples --> compiles the samples source code            
           compile.tests   --> compiles the tests source code              
           compile.interops--> compiles the interop source code            
                                                                           
           javadoc         --> generates the API documentation             
                               (needs Java > 1.2)                          
                                                                           
           test            --> runs the defined JUnit tests                
           report          --> generates html report of test results       
                                                                           
           clean           --> cleans up all generated files and           
                               directories                                 
           jar             --> creates the JAR file                        
           gump            --> includes javadoc, compile jar and test      
                                                                           
           usage           --> provides help on using the build tool       
                               (default)                                   
                                                                           
           changelog       --> generates changelog.html                    
                                                                           
         See comments inside the build.xml file for more details.          
        -------------------------------------------------------------------
      </echo>
    </target>

    <target name="clean" depends="init"
        description="Clean up all temporary build files">
        <delete dir="${build.dir}"/>
        <delete>
            <fileset dir="." includes="before*.xml"/>
            <fileset dir="." includes="after*.xml"/>
            <fileset dir="." includes="signed*.xml"/>
            <fileset dir="." includes="server*.wsdd"/>
            <fileset dir="." includes="client*.wsdd"/>
        </delete>
        <delete dir="${dir.dist}"/>
    </target>

    <target name="prepare" depends="init"
        description="This target generates a first build directory and checks for some libraries">
        <tstamp/>
        <mkdir dir="${build.dir}"/>
        <!--<delete dir="${build.dir}/test-reports"/> -->
        <mkdir dir="${build.dir}/test-reports"/>

        <available property="junit.present" 
                classname="junit.framework.TestCase">
            <!-- check whether JUnit is available -->
            <classpath refid="classpath.test"/>
        </available>

        <available property="bc.present" classname="org.bouncycastle.jce.provider.BouncyCastleProvider">
            <!-- check whether BouncyCastle is available -->
            <classpath refid="classpath.test"/>
        </available>

        <echo level="debug">
        --- Flags (Note: If the {property name} is displayed,
                   then the component is not present)
        jdk13.present=${jdk13.present}
        jdk14.present=${jdk14.present}
        jdk15.present=${jdk15.present}
        bc.present=${bc.present}
        </echo>

    </target>

    <!-- ################################################################## -->
    <!-- ################################################################## -->
    <!-- ################################################################## -->
    <!-- ################################################################## -->
    <!-- ################################################################## -->

    <target name="prepare-src" depends="prepare" 
        description="This target copies the Java sources and brands the version information">
        <!-- create directories -->
        <mkdir dir="${build.classes}"/>
        <copy todir="${build.classes}">
            <fileset dir="${dir.src}">
                <include name="META-INF/*"/>
            </fileset>
        </copy>
    </target>

    <target name="javadoc"
        depends="prepare-src"
        description="Generates javadoc from all .java files; this is done on the 'branded' files">
        <mkdir dir="${build.doc}"/>
        <mkdir dir="${build.doc.html}"/>
        <mkdir dir="${build.javadoc}"/>

        <javadoc destdir="${build.javadoc}"
            packagenames="${javadoc.packages}"
            classpathref="classpath.test">
            <!-- additionalparam="-breakiterator"-->
            <sourcepath>
                <pathelement location="${dir.src}"/>
                <pathelement location="${dir.test}"/>
                <pathelement location="${dir.samples}"/>
                <pathelement location="${dir.interop}"/>
            </sourcepath>
        </javadoc>
    </target>

    <!-- ################################################################## -->

    <!-- Aliases -->
    <target name="javadocs" depends="javadoc"/>
    <target name="jars" depends="jar"/>

    <!-- Collections -->
    <target name="gump" 
            depends="clean,javadoc,compile,test" 
            description="Target for the gump run"/>

    <target name="compile" 
       depends="compile.library,compile.samples, compile.tests, 
                compile.interops, fix.properties"
            description="compile everything"/>

    <target name="test"
            depends="unitTests, systemTests"
            description="tests everything"/>        

    <!-- ################################################################## -->

    <target name="fix.properties" if="jdk13.present">
        <replace dir="${build.dir}" value="org.apache.ws.security.components.crypto.BouncyCastle">
            <include name="**/*.properties"/>
            <replacetoken>org.apache.ws.security.components.crypto.Merlin</replacetoken>
        </replace>
    </target>

    <target name="compile.library" depends="prepare-src">
        <!-- Compile the java code from ${dir.src} into ${build.classes} -->
        <javac srcdir="${dir.src}" destdir="${build.classes}" debug="on" source="1.3" target="1.3">
            <classpath refid="classpath.library"/>
            <exclude name="**/Merlin.java" unless="merlin.ok"/>
            <exclude name="**/sandbox/**/*.java" if="jdk13.present" />
        </javac>
        <!-- Copy Property files -->
        <copy todir="${build.classes}">
            <fileset dir="${dir.src}">
                <include name="**/*.properties"/>
                <exclude name="**/axis/**/*.properties"/>
            </fileset>
        </copy>
    </target>

    <target name="compile.tests"
        depends="compile.interops"
        if="junit.present">

        <javac srcdir="${dir.test}" destdir="${build.classes}" debug="on" source="1.3" target="1.3">
            <classpath refid="classpath.test"/>
<!--            <exclude name="**/secconv/**/*.java"/> -->
        </javac>

        <mkdir dir="${build.work}"/>

        <javac srcdir="${build.work}" destdir="${build.classes}" debug="on" source="1.3" target="1.3">
            <classpath refid="classpath.test"/>
        </javac>

        <!-- Copy Property files -->
        <copy todir="${build.classes}">
            <fileset dir="${dir.test}" includes="**/*.properties"/>
            <fileset dir="${dir.interop}">
                <include name="**/*.properties"/>
            </fileset>
        </copy>
    </target>

    <target name="compile.samples"
        depends="compile.library">
        <!-- Compile the java code from ${dir.src} into ${build.classes} -->
        <javac srcdir="${dir.samples}"
            debug="on"
            source="1.4"
            destdir="${build.classes}" target="1.4">
            <classpath refid="classpath.library"/>
        </javac>
        <copy todir="${build.classes}">
            <fileset dir="${dir.src}" includes="**/axis/**/*.properties"/>
        </copy>
    </target>

    <target name="compile.interops"
        depends="compile.library">
        <ant dir="${dir.interop}"
            antfile="build.xml"
            target="compile"
            inheritAll="false">
        </ant>
    </target>

    <target name="systemTests" unless="skip.tests" depends="compile"
        if="junit.present"
        description="Runs all JUnit tests">
        <runaxisfunctionaltests
            url="http://localhost:8088"
            httpServerTarget="start-functional-test-http-server"
            testTarget="allTests"
            httpStopTarget="stop-functional-test-http-server"/>
    </target>

    <target name="start-functional-test-http-server" if="junit.present">
        <echo message="Starting http server."/>
        <java classname="org.apache.axis.transport.http.SimpleAxisServer" 
          fork="yes" dir="${build.dir}">
            <jvmarg value="-Djava.endorsed.dirs=${basedir}/endorsed"/>
            <classpath refid="classpath.library"/>
        </java>
    </target>

    <target name="stop-functional-test-http-server" if="junit.present">
        <echo message="Stopping http server."/>
        <java classname="org.apache.axis.client.AdminClient" fork="yes">
            <classpath refid="classpath.library"/>
            <arg line="quit"/>
        </java>
    </target>

    <target name="allTests" depends="interopTests">
    </target>

    <target name="interopTests" depends="init">
        <echo message="Running system tests - BEGIN..."/>

        <path id="undeploy_xml_files">
            <fileset dir="${build.work}">
                <include name="**/undeploy.wsdd"/>
            </fileset>
        </path>
        <property name="undeploy_xml_property" refid="undeploy_xml_files"/>

        <antcall target="deployWSDD" />
        <junit printsummary="yes"
            haltonfailure="yes"
            fork="yes"
            dir="${basedir}">
            <jvmarg value="-Djava.endorsed.dirs=${basedir}/endorsed"/>
            <jvmarg value="-Dhttp.proxyHost=${http.proxyHost}"/>
            <jvmarg value="-Dhttp.proxyPort=${http.proxyPort}"/>
            <jvmarg value="-Dhttp.nonProxyHosts=${http.nonProxyHosts}"/>
            <jvmarg value="-Dhttp.proxyUser=${http.proxyUser}"/>
            <jvmarg value="-Dhttp.proxyPassword=${http.proxyPassword}"/>
            <classpath refid="classpath.test"/>
            <formatter type="xml"/>
            <batchtest todir="${build.dir}/test-reports">
                <fileset dir="${build.classes}">
                    <include name="**/interop/PackageTests.class"/>
                </fileset>
            </batchtest>
        </junit>

        <java classname="org.apache.axis.utils.Admin" fork="true">
            <classpath refid="classpath.library"/>
            <arg value="client"/>
            <arg file=
               "${build.work}/org/apache/ws/axis/oasis/ping/undeploy.wsdd"/>
        </java>

        <junit printsummary="yes"
            haltonfailure="yes"
            fork="yes"
            dir="${basedir}">
            <jvmarg value="-Djava.endorsed.dirs=${basedir}/endorsed"/>
            <jvmarg value="-Dhttp.proxyHost=${http.proxyHost}"/>
            <jvmarg value="-Dhttp.proxyPort=${http.proxyPort}"/>
            <jvmarg value="-Dhttp.nonProxyHosts=${http.nonProxyHosts}"/>
            <jvmarg value="-Dhttp.proxyUser=${http.proxyUser}"/>
            <jvmarg value="-Dhttp.proxyPassword=${http.proxyPassword}"/>
            <classpath refid="classpath.test"/>
            <formatter type="xml"/>
            <batchtest todir="${build.dir}/test-reports">
                <fileset dir="${build.classes}">
                    <include name="**/interop/TestJAXRPCHandler.class"/>
                </fileset>
            </batchtest>
        </junit>

        <java classname="org.apache.axis.client.AdminClient" fork="yes">
            <classpath refid="classpath.library"/>
            <arg line="${undeploy_xml_property}"/>
        </java>
        
        <echo message="Running system tests - END..."/>
    </target>

    <target name="unitTests" unless="skip.tests" depends="compile">
        <junit printsummary="yes"
            haltonfailure="yes"
            fork="yes"
            dir="${basedir}">
            <!-- See if this helps with Gump test failures -->
            <sysproperty key="build.clonevm" value="true"/>

            <jvmarg value="-Djava.endorsed.dirs=${basedir}/endorsed"/>
            <jvmarg value="-Dhttp.proxyHost=${http.proxyHost}"/>
            <jvmarg value="-Dhttp.proxyPort=${http.proxyPort}"/>
            <jvmarg value="-Dhttp.nonProxyHosts=${http.nonProxyHosts}"/>
            <jvmarg value="-Dhttp.proxyUser=${http.proxyUser}"/>
            <jvmarg value="-Dhttp.proxyPassword=${http.proxyPassword}"/>
            <classpath refid="classpath.test"/>
            <formatter type="xml"/>
            <batchtest todir="${build.dir}/test-reports">
                <fileset dir="${build.classes}">
                    <include name="**/wssec/PackageTests.class"/>
                    <include name="**/components/PackageTests.class"/>
             <!--<include name="**/secconv/components/PackageTests.class"/> -->
                </fileset>
            </batchtest>
        </junit>
    </target>

    <target name="sandboxTests" depends="compile">
        <java classname="org.apache.axis.client.AdminClient" fork="yes">
            <classpath refid="classpath.library"/>
            <arg line="${dir.samples}/org/apache/ws/sandbox/security/trust2/samples/deploy.wsdd"/>
        </java>

        <junit printsummary="yes"
            haltonfailure="yes"
            fork="yes"
            dir="${basedir}">
            <!-- See if this helps with Gump test failures -->
            <sysproperty key="build.clonevm" value="true"/>

            <jvmarg value="-Djava.endorsed.dirs=${basedir}/endorsed"/>
            <jvmarg value="-Dhttp.proxyHost=${http.proxyHost}"/>
            <jvmarg value="-Dhttp.proxyPort=${http.proxyPort}"/>
            <jvmarg value="-Dhttp.nonProxyHosts=${http.nonProxyHosts}"/>
            <jvmarg value="-Dhttp.proxyUser=${http.proxyUser}"/>
            <jvmarg value="-Dhttp.proxyPassword=${http.proxyPassword}"/>
            <classpath refid="classpath.test"/>
            <formatter type="xml"/>
            <batchtest todir="${build.dir}/test-reports">
                <fileset dir="${build.classes}">
                    <include name="**/sandbox/PackageTests.class"/>
                </fileset>
            </batchtest>
        </junit>

        <java classname="org.apache.axis.client.AdminClient" fork="yes">
            <classpath refid="classpath.library"/>
            <arg line="${dir.samples}/org/apache/ws/sandbox/security/trust2/samples/undeploy.wsdd"/>
        </java>
    </target>
    
    <target name="tcpmon" depends="init" description=
                "Start standalone tcp monitor application (provided by axis)">
        <java dir="${basedir}" fork="yes" failOnError="true" 
                 className="org.apache.axis.utils.tcpmon">
            <classpath refid="classpath.library" />
             <arg value="9080" />
             <arg value="localhost" />
             <arg value="8080" />
         </java>
    </target>

    <!--
    This runs the selected scenario with SimpleAxisServer locally.
    Before you start this target be sure you have started tcpmon too 
        in a separate
    "ant tcpmon" call.
    To run different scenarios use: "ant -DNumber=x scenarioTest" 
        to run scenario x
    -->
    <target name="scenarioTest" depends="compile"
        if="junit.present"
        description="Runs all JUnit tests">
        <runaxisfunctionaltests
            url="http://localhost:8088"
            httpServerTarget="start-functional-test-http-server"
            testTarget="scenario"
            httpStopTarget="stop-functional-test-http-server"/>
    </target>

    <target name="scenario" if="junit.present">
        <echo message=
          "Running interop test scenario ${Number} on SimpleAxisServer"/>

        <antcall target="deployWSDD" />
        
        <java classname="interop.TestScenario${Number}" fork="yes" 
                 dir="${basedir}">
            <jvmarg value="-Djava.endorsed.dirs=${basedir}/endorsed"/>
            <classpath refid="classpath.library"/>
        </java>

        <antcall target="undeployWSDD" />

    </target>
    
    <!--
    This runs the selected scenario with SimpleAxisServer locally 
        with perfomance
    timing switched on.
    You may also emable the **.TIME entry in log4j.properties to get 
        the internal
    timing.
    To run different scenarios use: "ant -DNumber=x scenarioTest" 
        to run scenario x
    -->
    <target name="performanceTest" depends="compile"
        if="junit.present"
        description="Runs all JUnit tests">
        <runaxisfunctionaltests
            url="http://localhost:8088"
            httpServerTarget="start-functional-test-http-server"
            testTarget="performance"
            httpStopTarget="stop-functional-test-http-server"/>
    </target>

    <target name="performance" if="junit.present">
        <echo message=
           "Running performance test scenario ${Number} on SimpleAxisServer"/>

        <antcall target="deployWSDD" />
        <java classname="interop.TestScenario${Number}" fork="yes" 
            dir="${basedir}">
            <jvmarg value="-Djava.endorsed.dirs=${basedir}/endorsed"/>
       <arg value="-lhttp://localhost:8080/axis/services/Ping${Number}" />
            <arg value="-t" />
            <classpath refid="classpath.library"/>
        </java>
        <antcall target="undeployWSDD" />
    </target>
    
    <target name="deployWSDD">
      <path id="deploy_xml_files">
      <fileset dir="${build.work}">
        <include name="**/deploy.wsdd"/>
      </fileset>
      </path>

      <copy todir="${build.dir}/keys">
        <fileset dir="${dir.keys}" includes="**"/>
      </copy>
      <copy todir="${build.dir}/interop">
        <fileset dir="${dir.interop}" includes="*.jks"/>
      </copy>

      <property name="deploy_xml_property" refid="deploy_xml_files"/>
 
      <java classname="org.apache.axis.utils.Admin" fork="true">
        <classpath refid="classpath.library"/>
        <arg value="client"/>
        <arg file="${build.work}/org/apache/ws/axis/oasis/Client_deploy.wsdd"/>
      </java>
        
      <java classname="org.apache.axis.client.AdminClient" fork="yes">
        <classpath refid="classpath.library"/>
        <arg line="${deploy_xml_property}"/>
      </java>
    </target>
    
    <target name="undeployWSDD">
      <path id="undeploy_xml_files">
        <fileset dir="${build.work}">
          <include name="**/undeploy.wsdd"/>
        </fileset>
      </path>

      <property name="undeploy_xml_property" refid="undeploy_xml_files"/>

      <java classname="org.apache.axis.utils.Admin" fork="true">
            <classpath refid="classpath.library"/>
            <arg value="client"/>
            <arg file=
                 "${build.work}/org/apache/ws/axis/oasis/ping/undeploy.wsdd"/>
      </java>

      <java classname="org.apache.axis.client.AdminClient" fork="yes">
        <classpath refid="classpath.library"/>
        <arg line="${undeploy_xml_property}"/>
      </java>
    </target>
        
    <!-- generate a report from all the tests. 
           requires Xalan or other XSLT engine in ant\lib-->

   <target name="report" depends="init">
        <junitreport todir="${build.dir}/test-reports">
            <fileset dir="${build.dir}/test-reports">
                <include name="TEST-*.xml"/>
            </fileset>
            <report format="frames" todir="${build.dir}/test-reports/html"/>
        </junitreport>
        <echo message=
            "point your browser to ${build.dir}/test-reports/html/index.html"/>
    </target>

    <target name="jar"
        depends="compile, test"
        description="Creates the ${jar.library}">

        <jar jarfile="${build.dir}/${jar.library}"
            basedir="${build.classes}"
            includes="**/*, *.txt"
            excludes="components/**, *.properties, **/sandbox/**, wssec/**, **/interop/**, **/oasis/**, **/samples/**" 
            />
    </target>

    <target name="dist" depends="bindist, otherdist, srcdist"/>

   <target name="bindist" depends="gump" 
      description="Build zip file for distro">
     <delete dir="${dir.dist}"/>
     <mkdir dir="${dir.dist}"/>
     <jar jarfile="${dir.dist}/${jar.library}"
       basedir="${build.classes}"
       includes="**/apache/**/security/**, META-INF/**"  />
     <zip destfile=
        "${dir.dist}/${product.shortname}-bin-${product.version}.zip">
        <zipfileset prefix="wss4j" dir="."
            includes="keys/**, interop/**, interop2/**, test/**, samples/**,
                ChangeLog.txt, LICENSE.txt, README.txt, NOTICE, legal/**, webapps/**"/>
        <zipfileset prefix="wss4j/classes" dir="${build.classes}"
            includes=
                "*.properties, interop/**, wssec/**, org/**/oasis/**, org/**/samples/**"/>
        <zipfileset prefix="wss4j/doc/api" dir="${build.javadoc}"/>
        <zipfileset fullpath="wss4j/${jar.library}" dir="${dir.dist}" 
            includes="${jar.library}"/>
      </zip>
    </target>

    <target name="otherdist" depends="init" 
             description="Build zip for required jars">
         <mkdir dir="${dir.dist}"/>
         <zip destfile=
           "${dir.dist}/${product.shortname}-otherjars-${product.version}.zip">
             <zipfileset prefix="wss4j" dir="."
                 includes="lib/*.jar, endorsed/*.jar legal/**"/>
         </zip>
     </target>  
    
    <target name="srcdist" depends="init" description=
               "Build source zip file for distro">
        <mkdir dir="${dir.dist}"/>
        <zip destfile=
                 "${dir.dist}/${product.shortname}-src-${product.version}.zip">
            <zipfileset prefix="wss4j" dir="."
                includes="src/** ChangeLog.txt LICENSE.txt README.txt NOTICE legal/** build.xml "/>
        </zip>
    </target>

    <target name="fixcrlf"
        description="Fixes CRLF">
        <fixcrlf srcdir="."
            eol="crlf"
            includes="**/*.java"
            />
        <fixcrlf srcdir="."
            eol="crlf"
            includes="**/*.properties"
            />
    </target>

    <target name="changelog"
        depends="prepare"
        description="Generate the changelog for WSS4J project">
        <cvschangelog dir="."
            destfile="${build.dir}/changelog.xml"
            />
        <style in="${build.dir}/changelog.xml"
            out="${build.dir}/changelog.html"
            style="./tools/changelog.xsl">
            <param name="title" expression="WSS4J ChangeLog"/>
            <param name="module" expression="ws-wss4j"/>
            <param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/>
        </style>
    </target>

  <!-- =================================================================== -->
  <!-- Creates a war file for interop testing                              -->
  <!-- =================================================================== -->
  <target name="interop-war" depends="test"
      description="Create the web application" >
    <mkdir dir="${build.webapp}"/>
    <copy todir="${build.webapp}">
      <fileset dir="${dir.webapp}"/>
    </copy>
    <copy todir="${build.webapp}/WEB-INF/lib">
      <fileset dir="${dir.libs}">
        <include name="*.jar"/>
      </fileset>
      <fileset dir="${basedir}/endorsed">
        <include name="*.jar"/>
      </fileset>
    </copy>
    <copy todir="${build.webapp}/WEB-INF">
      <fileset dir="${build.dir}">
        <include name="*.wsdd"/>
      </fileset>
    </copy>
    <copy todir="${build.webapp}/WEB-INF/classes/">
      <fileset dir="${build.classes}"/>
    </copy>
    <copy todir="${build.webapp}/WEB-INF/classes/">
      <fileset dir=".">
          <include name="client-config.wsdd"/>
      </fileset>
    </copy>
    <copy todir="${build.webapp}/WEB-INF/classes/interop">
        <fileset dir="${dir.interop}">
            <include name="**/interop2.jks"/>
        </fileset>
    </copy>

    <delete>
      <fileset dir="${build.webapp}" includes="**/CVS"/>
    </delete>
    <path id="deploy_xml_files">
        <fileset dir="${build.work}">
            <include name="**/deploy.wsdd"/>
        </fileset>
    </path>
    <property name="deploy_xml_property" refid="deploy_xml_files"/>
    <java classname="org.apache.axis.utils.Admin" fork="true"
        dir="${build.webapp}/WEB-INF/classes">
      <classpath refid="classpath.library"/>
      <arg value="client"/>
      <arg file="${build.work}/org/apache/ws/axis/oasis/Client_deploy.wsdd"/>
    </java>
    <java classname="org.apache.axis.utils.Admin" fork="yes" 
        dir="${build.webapp}/WEB-INF">
        <classpath refid="classpath.library"/>
        <arg line="server"/>
        <arg line="${deploy_xml_property}"/>
    </java>

    <jar jarfile="${build.dir}/wss4j.war" basedir="${build.webapp}"/>
  </target>

</project>