Search in sources :

Example 76 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project failsafe by jhalterman.

the class AsyncFailsafeTest method beforeMethod.

@BeforeMethod
protected void beforeMethod() {
    reset(service);
    waiter = new Waiter();
    counter = new AtomicInteger();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Waiter(net.jodah.concurrentunit.Waiter) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 77 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project failsafe by jhalterman.

the class SyncFailsafeTest method beforeMethod.

@BeforeMethod
protected void beforeMethod() {
    reset(service);
    counter = new AtomicInteger();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 78 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project failsafe by jhalterman.

the class Issue36 method beforeMethod.

@BeforeMethod
protected void beforeMethod() {
    calls = new AtomicInteger();
    failedAttempts = new AtomicInteger();
    retries = new AtomicInteger();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 79 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project che by eclipse.

the class JsonRpcResponseTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    response = new JsonObject();
    JsonObject error = new JsonObject();
    JsonObject result = new JsonObject();
    error.addProperty("code", 0);
    error.addProperty("message", "error message");
    response.addProperty("jsonrpc", "2.0");
    response.addProperty("id", "0");
    response.add("error", error);
    response.add("result", result);
    when(this.result.toJsonElement()).thenReturn(result);
    when(this.error.toJsonObject()).thenReturn(error);
}
Also used : JsonObject(com.google.gson.JsonObject) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 80 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project che by eclipse.

the class ZipUtilsTest method setUp.

@BeforeMethod
public void setUp() throws IOException {
    zipFile = File.createTempFile("test", "zip");
    zipFile.deleteOnExit();
    byte[] testData = new byte[2048];
    Random random = new Random();
    random.nextBytes(testData);
    try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) {
        ZipEntry entry = new ZipEntry("test");
        entry.setSize(testData.length);
        zos.putNextEntry(entry);
        zos.write(testData);
        zos.closeEntry();
        zos.close();
    }
}
Also used : Random(java.util.Random) ZipOutputStream(java.util.zip.ZipOutputStream) FileOutputStream(java.io.FileOutputStream) ZipEntry(java.util.zip.ZipEntry) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

BeforeMethod (org.testng.annotations.BeforeMethod)1078 File (java.io.File)60 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)52 IOException (java.io.IOException)49 DateTime (org.joda.time.DateTime)46 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)42 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)41 LoanTestHelper (org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)38 Enumeration (java.util.Enumeration)37 Project (com.google.refine.model.Project)33 StringWriter (java.io.StringWriter)26 Properties (java.util.Properties)26 EntityType (org.molgenis.data.meta.model.EntityType)25 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)23 ServletConfig (jakarta.servlet.ServletConfig)22 ServletContext (jakarta.servlet.ServletContext)22 HttpServletRequest (javax.servlet.http.HttpServletRequest)22 AppLauncher (org.mifos.test.acceptance.framework.AppLauncher)22 Subject (javax.security.auth.Subject)21 Attribute (org.molgenis.data.meta.model.Attribute)21