Example #1
0
 @Test
 public void testExportMageTab_2Ex() throws Exception {
   logForSilverCompatibility(TEST_NAME, "testStreamMageTab_2Ex");
   String type = gov.nih.nci.caarray.external.v1_0.experiment.Experiment.class.getName();
   String eid = "URN:LSID:" + type + ":2";
   CaArrayEntityReference ref = new CaArrayEntityReference(eid);
   MageTabFileSet df = service.exportMageTab(ref);
   assertEquals(0, df.getDataFiles().size());
   assertEquals("admin-00002.idf", df.getIdf().getMetadata().getName());
   assertEquals("admin-00002.sdrf", df.getSdrf().getMetadata().getName());
 }
Example #2
0
  @Test
  public void testExportMageTab_1Ex() throws Exception {
    logForSilverCompatibility(TEST_NAME, "testExportMageTab_1Ex");
    String type = gov.nih.nci.caarray.external.v1_0.experiment.Experiment.class.getName();
    String eid = "URN:LSID:" + type + ":1";
    CaArrayEntityReference ref = new CaArrayEntityReference(eid);
    MageTabFileSet df = service.exportMageTab(ref);
    logForSilverCompatibility(
        TEST_OUTPUT, "exteriment has " + df.getDataFiles().size() + " data files");
    assertEquals(19, df.getDataFiles().size());
    assertEquals("admin-00001.idf", df.getIdf().getMetadata().getName());
    assertEquals("admin-00001.sdrf", df.getSdrf().getMetadata().getName());

    Map<String, String> expected = new HashMap<String, String>();
    expected.put("8kNew111_14v1p4m12.gpr", "84823097c0db8d62028cfaa896a14ff9");
    expected.put("8kNew111_14_4601_m84.gpr", "a563783e47fe4ef352f82ac1731f848b");
    expected.put("8kNew111_17m12701m36.gpr", "3aaeb9ef790bf2867750913070008f7a");
    expected.put("8kNew111_17_4601_m82.gpr", "9879a28ea8d11698d7c7ed27b9ef7f73");
    expected.put("8kNewPr111_14v1p4m11.gpr", "97df92ef864ff3edb04fffb418ea842b");
    expected.put("8kNewPr111_14v1p4m13.gpr", "2b2bb27b31c19d7a60c809148f807bb5");
    expected.put("8kNewPr111_14v1p4m14.gpr", "15b6a2d3dbb0bb01e3d3c7fc50a7e331");
    expected.put("8kNewPr111_1712701m37.gpr", "b081876b46410e6bdd9749fa9bd82bbe");
    expected.put("8kPr111_17M62103100p1090600.gpr", "cb481dadbcf00e73ab6ed9566e8a95fb");
    expected.put("8KReverNewC2_111_4601_m86.gpr", "5a38e79b403e3d0dad8053e9eda7c19c");
    expected.put("8kReversNew17_111_4601_m83.gpr", "111722aa71d45af97810f82b5715c745");
    expected.put("G_New8k111C131501m73.gpr", "eedecb1b0ea2cdfe7e6fa9a3dcf335d1");
    expected.put("New8kPr111_C221601m29.gpr", "738385806286014ae5081eb0267b70fd");
    expected.put("New8kPr111_C221601m30.gpr", "85176edd715c326005c0a2721261550c");
    expected.put("New8kPr111_C221601m31.gpr", "8954bf4a8b6dee62eab34b6eb5262ebf");
    expected.put("VG_1New8k111_C14401m78.gpr", "a2532abf56b767231492224c1ff0616f");
    expected.put("VG_8k1New111_C14401m79.gpr", "56c72116692e5888f3737991b5b41bef");
    expected.put("VG_8k3New111_C14401m80.gpr", "cedff2aa6707bc8518578d0b177cd0a5");
    expected.put("VG_8k4New111_C14401m81.gpr", "f528f00fc219062a641cff653d08456");

    for (File f : df.getDataFiles()) {
      String exHash = expected.get(f.getMetadata().getName());
      assertNotNull(exHash);
      FileStreamableContents fsContents = service.streamFileContents(f.getReference(), true);
      InputStream is = RemoteInputStreamClient.wrap(fsContents.getContentStream());
      GZIPInputStream zin = new GZIPInputStream(is);
      byte[] b = md5(zin);
      String hash = toHex(b);
      assertEquals(exHash, hash);
    }
  }