rineholt    2002/07/01 05:20:52

  Modified:    java/samples/attachments EchoAttachment.java
               java/test/functional TestAttachmentsSample.java
  Log:
  Have functional test also send DIME attachments.
  
  Revision  Changes    Path
  1.17      +5 -5      xml-axis/java/samples/attachments/EchoAttachment.java
  
  Index: EchoAttachment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/attachments/EchoAttachment.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- EchoAttachment.java       1 Jul 2002 02:46:27 -0000       1.16
  +++ EchoAttachment.java       1 Jul 2002 12:20:52 -0000       1.17
  @@ -91,7 +91,6 @@
   
       Options opts = null;
   
  -    static boolean doTheDIME= false;
   
       public EchoAttachment( Options opts) {
           this.opts = opts;
  @@ -104,7 +103,7 @@
        *  @param The filename that is the source to send.
        *  @return True if sent and compared.
        */
  -    public boolean echo(String filename) throws Exception {
  +    public boolean echo(final boolean doTheDIME, String filename) throws Exception {
   
           //javax.activation.MimetypesFileTypeMap map= 
(javax.activation.MimetypesFileTypeMap)javax.activation.MimetypesFileTypeMap.getDefaultFileTypeMap();
           //map.addMimeTypes("application/x-org-apache-axis-wsdd wsdd");
  @@ -196,7 +195,7 @@
        *  @param The directory that is the source to send.
        *  @return True if sent and compared.
        */
  -    public boolean echoDir(String filename) throws Exception {
  +    public boolean echoDir(final boolean doTheDIME, String filename) throws 
Exception {
           boolean rc = true;
   
   
  @@ -319,6 +318,7 @@
                   System.exit(8);
               }
   
  +            boolean doTheDIME= false;
               if( args[0].trim().equalsIgnoreCase("+FDR")){
                 doTheDIME= true;
                 ++argpos;
  @@ -339,7 +339,7 @@
               }
   
               if (source.isFile()) {
  -                if (echoattachment.echo(argFile)) {
  +                if (echoattachment.echo(doTheDIME, argFile)) {
                       System.out.println("Attachment sent and received ok!");
                       System.exit(0);
                   }
  @@ -349,7 +349,7 @@
                   }
               }
               else { //a directory?
  -                if (echoattachment.echoDir(argFile)) {
  +                if (echoattachment.echoDir(doTheDIME, argFile)) {
                       System.out.println("Attachments sent and received ok!");
                       System.exit(0);
                   }
  
  
  
  1.4       +18 -2     xml-axis/java/test/functional/TestAttachmentsSample.java
  
  Index: TestAttachmentsSample.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/functional/TestAttachmentsSample.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestAttachmentsSample.java        19 Jun 2002 19:11:50 -0000      1.3
  +++ TestAttachmentsSample.java        1 Jul 2002 12:20:52 -0000       1.4
  @@ -80,13 +80,25 @@
       
       public void doTestAttachments1() throws Exception {
           Options opts = new Options( new String[]{});
  -        boolean res = new EchoAttachment(opts).echo("samples/attachments/README");
  +        boolean res = new EchoAttachment(opts).echo(false, 
"samples/attachments/README");
  +       assertEquals("Didn't process attachment correctly", res, true) ;
  +    }
  +
  +    public void doTestAttachmentsD1() throws Exception {
  +        Options opts = new Options( new String[]{});
  +        boolean res = new EchoAttachment(opts).echo(true, 
"samples/attachments/README");
          assertEquals("Didn't process attachment correctly", res, true) ;
       }
       
       public void doTestAttachments2() throws Exception {
           Options opts = new Options( new String[]{});
  -        boolean res = new EchoAttachment(opts).echoDir("samples/attachments");
  +        boolean res = new EchoAttachment(opts).echoDir(false, 
"samples/attachments");
  +        assertEquals("Didn't process attachments correctly", res, true);
  +    }
  +
  +    public void doTestAttachmentsD2() throws Exception {
  +        Options opts = new Options( new String[]{});
  +        boolean res = new EchoAttachment(opts).echoDir(true, "samples/attachments");
           assertEquals("Didn't process attachments correctly", res, true);
       }
       
  @@ -108,6 +120,10 @@
               doTestAttachments1();
               log.info("Testing multiple file attachments...");
               doTestAttachments2();
  +            log.info("Testing single file DIME attachment...");
  +            doTestAttachmentsD1();
  +            log.info("Testing multiple file DIME attachments...");
  +            doTestAttachmentsD2();
               log.info("Testing undeployment...");
               doTestUndeploy();
               log.info("Test complete.");
  
  
  


Reply via email to