Exemplo n.º 1
0
  @Test(enabled = true)
  public void sendToDifiTest() throws URISyntaxException {

    OperationalMode modeOfOperation = globalConfiguration.getModeOfOperation();
    assertEquals(modeOfOperation, OperationalMode.TEST, "This test may only be run in TEST mode");

    URL resource = MainIT.class.getClassLoader().getResource("BII04_T10_EHF-v2.0_invoice.xml");
    URI uri = resource.toURI();
    File testFile = new File(uri);
    assertTrue(testFile.canRead(), "Can not locate " + testFile);

    String[] args = {
      "-f", testFile.toString(),
      "-r", WellKnownParticipant.DIFI_TEST.toString(),
      "-s", WellKnownParticipant.U4_TEST.toString(),
      "-t", "true",
      "-e", "/tmp" // current directory
    };

    // Executes the outbound message sender
    try {
      Main.main(args);
    } catch (Exception e) {
      fail("Failed " + e.getMessage(), e);
    }
  }
Exemplo n.º 2
0
  @Test(enabled = false)
  public void sendToEspapTest() throws URISyntaxException {

    OperationalMode modeOfOperation = globalConfiguration.getModeOfOperation();
    assertEquals(modeOfOperation, OperationalMode.TEST, "This test may only be run in TEST mode");

    URL resource = MainIT.class.getClassLoader().getResource("BII04_T10_EHF-v2.0_invoice.xml");
    URI uri = resource.toURI();
    File testFile = new File(uri);
    assertTrue(testFile.canRead(), "Can not locate " + testFile);

    String[] args = {
      "-f", testFile.toString(),
      "-r", "9946:ESPAP",
      "-s", WellKnownParticipant.DIFI_TEST.toString(),
      "-t", "true",
      "-u", "https://ap1.espap.pt/oxalis/as2",
      "-m", "AS2",
      "-i", "APP_1000000222"
    };

    // Executes the outbound message sender
    try {
      Main.main(args);
    } catch (Exception e) {
      fail("Failed " + e.getMessage());
    }
  }
  @Test
  public void testMain() throws Exception {
    String inputDir = testFilesFolder + fileSep + "trityper";
    String inputExprs = testFilesFolder + fileSep + "Geuvadis_CEU_YRI_Expr.txt.gz";
    String inputExprsAnnot = testFilesFolder + fileSep + "Geuvadis_CEU_YRI_Annot.txt";
    String inputGte = testFilesFolder + fileSep + "Geuvadis_CEU_gte.txt";

    System.out.println(inputDir);

    Main.main(
        "--mode",
        "metaqtl",
        "--in",
        inputDir,
        "--out",
        tmpOutputFolder.getAbsolutePath(),
        "--cis",
        "--perm",
        "10",
        "--inexp",
        inputExprs,
        "--inexpannot",
        inputExprsAnnot,
        "--inexpplatform",
        "Ensembl_v.71",
        "--gte",
        inputGte,
        "--skipqqplot",
        "--skipdotplot",
        "--rseed",
        "0");

    QTLTextFile eExp =
        new QTLTextFile(
            testFilesFolder + fileSep + "TestOutput" + fileSep + "Cis-CEU-eQTLsFDR0.05.txt",
            QTLTextFile.R);

    QTLFileSorter r = new QTLFileSorter();
    r.run(
        tmpOutputFolder.getAbsolutePath() + fileSep + "eQTLsFDR0.05.txt",
        tmpOutputFolder.getAbsolutePath() + fileSep + "eQTLsFDR0.05_S.txt");

    QTLTextFile eActual =
        new QTLTextFile(
            tmpOutputFolder.getAbsolutePath() + fileSep + "eQTLsFDR0.05_S.txt", QTLTextFile.R);
    Iterator<EQTL> eExpIterator = eExp.getEQtlIterator();
    Iterator<EQTL> eActualIterator = eActual.getEQtlIterator();

    while (eExpIterator.hasNext() && eActualIterator.hasNext()) {
      assertTrue(eActualIterator.next().sameQTL(eExpIterator.next()), "eQTL not identical");
    }

    assertFalse(eExpIterator.hasNext(), "not all expected eQTL are found");
    assertFalse(eActualIterator.hasNext(), "found more eQTL than expected");
  }