@Before
 public void setUp() throws Exception {
   MDC.clear();
   ServerSetup serverSetup = new ServerSetup(port, "localhost", ServerSetup.PROTOCOL_SMTP);
   greenMailServer = new GreenMail(serverSetup);
   greenMailServer.start();
   // give the server a head start
   if (EnvUtilForTests.isRunningOnSlowJenkins()) {
     Thread.sleep(2000);
   } else {
     Thread.sleep(50);
   }
 }
  @Before
  public void setUp() throws Exception {

    OnConsoleStatusListener.addNewInstanceToContext(loggerContext);
    MDC.clear();
    ServerSetup serverSetup = new ServerSetup(port, "localhost", ServerSetup.PROTOCOL_SMTP);
    greenMailServer = new GreenMail(serverSetup);
    greenMailServer.start();
    // give the server a head start
    if (EnvUtilForTests.isRunningOnSlowJenkins()) {
      Thread.sleep(2000);
    } else {
      Thread.sleep(50);
    }
  }
Esempio n. 3
0
  @Test
  public void failed_rename() throws IOException {
    if (!EnvUtilForTests.isWindows()) return;

    FileOutputStream fos = null;
    try {
      String fileName = testId2FileName("failed_rename");
      File file = new File(fileName);
      file.getParentFile().mkdirs();

      fos = new FileOutputStream(fileName);

      String testId = "failed_rename";
      rolloverChecker = new ZRolloverChecker(testId);
      genericTest(testId, "failed_rename", "", FILE_OPTION_SET, NO_RESTART);

    } finally {
      StatusPrinter.print(context);
      if (fos != null) fos.close();
    }
  }