Changeset 3939


Ignore:
Timestamp:
Nov 8, 2007, 12:08:00 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #492: Web services

  • Try to delete temp files generated by BioAssaySetExporter? instead of waiting until the JVM exits
  • Changed order of webservices tests to make it quicker in case no webservices has been setup
Location:
trunk/src
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/test/TestWebservices.java

    r3876 r3939  
    7272    write("++Testing webservices");
    7373   
     74    //Tests
     75    SessionClient client = test_SessionClient();
     76    if (client == null) return ok;
     77   
    7478    //Create items to use in the tests
    7579   
     
    107111   
    108112    //Tests
    109     SessionClient client = test_SessionClient();
    110     if (client != null)
    111     {
    112       test_ProjectClient(client, projectId);
    113       test_getRawDataInExperiment(client, experimentId1, rawBioAssayId1);
    114       test_getRawDataInExperiment(client, experimentId2, rawBioAssayId3);   
    115       test_getArrayDesign(client, rawBioAssayId1, arrayDesignId1);
    116       test_getArrayDesign(client, rawBioAssayId3, arrayDesignId2);   
    117       test_BioAssaySetClient(client, experimentId1, rootBioAssaySetId1);       
    118       test_Logout(client);
    119     }
     113    test_ProjectClient(client, projectId);
     114    test_getRawDataInExperiment(client, experimentId1, rawBioAssayId1);
     115    test_getRawDataInExperiment(client, experimentId2, rawBioAssayId3);   
     116    test_getArrayDesign(client, rawBioAssayId1, arrayDesignId1);
     117    test_getArrayDesign(client, rawBioAssayId3, arrayDesignId2);   
     118    test_BioAssaySetClient(client, experimentId1, rootBioAssaySetId1);       
     119    test_Logout(client);
    120120   
    121121    //Standard test:Delete/cleanup
     
    429429      write("--Create/login session FAILED");
    430430      write("--Skipping webservices test.");
     431      t.printStackTrace();
    431432      return null;
    432433    }
  • trunk/src/webservices/server/net/sf/basedb/ws/server/BioAssaySetService.java

    r3919 r3939  
    3737import java.util.List;
    3838
    39 import javax.activation.FileDataSource;
     39import javax.activation.DataSource;
    4040
    4141import org.apache.axiom.om.OMElement;
     
    9797  public OMElement downloadBioAssaySet(String ID, int bioAssaySetId, String format, String[] reporterFieldArray,
    9898      String[] spotFieldArray, Boolean mergeReporters)
     99    throws Exception
    99100  {
    100101    if (format == null) return null;
     
    140141      }
    141142      fos.close();
    142       FileDataSource source = new FileDataSource(exportFile);
     143      DataSource source = new TempFileDataSource(exportFile, "text/plain");
    143144      elementWithAttachment = attachFile(source, elementName);
    144     }
    145     catch(Throwable th)
    146     {
    147       th.printStackTrace();
    148       return null;
    149145    }
    150146    finally
    151147    {   
    152148      if (dc != null) dc.close();
    153       if (exportFile != null) exportFile.deleteOnExit();
    154149    }
    155150   
Note: See TracChangeset for help on using the changeset viewer.