Ejemplo n.º 1
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());
    }
  }
Ejemplo n.º 2
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);
    }
  }