Search in sources :

Example 46 with BeforeClass

use of org.testng.annotations.BeforeClass in project async-http-client by AsyncHttpClient.

the class AbstractBasicTest method setUpGlobal.

@BeforeClass(alwaysRun = true)
public void setUpGlobal() throws Exception {
    server = new Server();
    ServerConnector connector = addHttpConnector(server);
    server.setHandler(getWebSocketHandler());
    server.start();
    port1 = connector.getLocalPort();
    logger.info("Local HTTP server started successfully");
}
Also used : ServerConnector(org.eclipse.jetty.server.ServerConnector) Server(org.eclipse.jetty.server.Server) BeforeClass(org.testng.annotations.BeforeClass)

Example 47 with BeforeClass

use of org.testng.annotations.BeforeClass in project pulsar by yahoo.

the class CallbackMutexTest method setup.

@BeforeClass
public void setup() {
    Logger log = Logger.getLogger(CallbackMutex.class);
    log.setLevel(Level.DEBUG);
}
Also used : Logger(org.apache.log4j.Logger) BeforeClass(org.testng.annotations.BeforeClass)

Example 48 with BeforeClass

use of org.testng.annotations.BeforeClass in project jdk8u_jdk by JetBrains.

the class StreamTest method setupTestFolder.

@BeforeClass
void setupTestFolder() throws IOException {
    testFolder = TestUtil.createTemporaryDirectory();
    supportsLinks = TestUtil.supportsLinks(testFolder);
    TreeSet<Path> set = new TreeSet<>();
    // Level 1
    Path empty = testFolder.resolve("empty");
    Path file = testFolder.resolve("file");
    Path dir = testFolder.resolve("dir");
    Path dir2 = testFolder.resolve("dir2");
    Files.createDirectory(empty);
    Files.createFile(file);
    Files.createDirectory(dir);
    Files.createDirectory(dir2);
    set.add(empty);
    set.add(file);
    set.add(dir);
    set.add(dir2);
    if (supportsLinks) {
        Path tmp = testFolder.resolve("linkDir");
        Files.createSymbolicLink(tmp, dir);
        set.add(tmp);
        tmp = testFolder.resolve("linkFile");
        Files.createSymbolicLink(tmp, file);
        set.add(tmp);
    }
    level1 = set.toArray(new Path[0]);
    // Level 2
    Path tmp = dir.resolve("d1");
    Files.createDirectory(tmp);
    set.add(tmp);
    tmp = dir.resolve("f1");
    Files.createFile(tmp);
    set.add(tmp);
    if (supportsLinks) {
        tmp = dir.resolve("lnDir2");
        Files.createSymbolicLink(tmp, dir2);
        set.add(tmp);
    }
    // walk include starting folder
    set.add(testFolder);
    all = set.toArray(new Path[0]);
    // Follow links
    if (supportsLinks) {
        tmp = testFolder.resolve("linkDir");
        set.add(tmp.resolve("d1"));
        set.add(tmp.resolve("f1"));
        tmp = tmp.resolve("lnDir2");
        set.add(tmp);
    }
    all_folowLinks = set.toArray(new Path[0]);
}
Also used : Path(java.nio.file.Path) TreeSet(java.util.TreeSet) BeforeClass(org.testng.annotations.BeforeClass)

Example 49 with BeforeClass

use of org.testng.annotations.BeforeClass in project oxAuth by GluuFederation.

the class UmaMultithreadTest method before.

@BeforeClass
public void before() {
    ClientConnectionManager connectoinManager = new PoolingClientConnectionManager();
    final DefaultHttpClient defaultHttpClient = new DefaultHttpClient(connectoinManager);
    final ApacheHttpClient4Executor clientExecutor = new ApacheHttpClient4Executor(defaultHttpClient);
    String url = serverUri + "/oxauth/seam/resource/restv1/oxauth/uma-configuration";
    service = UmaClientFactory.instance().createMetaDataConfigurationService(url, clientExecutor);
}
Also used : PoolingClientConnectionManager(org.apache.http.impl.conn.PoolingClientConnectionManager) ApacheHttpClient4Executor(org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor) ClientConnectionManager(org.apache.http.conn.ClientConnectionManager) PoolingClientConnectionManager(org.apache.http.impl.conn.PoolingClientConnectionManager) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 50 with BeforeClass

use of org.testng.annotations.BeforeClass in project oxAuth by GluuFederation.

the class BenchmarkRequestAccessToken method registerClient.

@Parameters({ "userId", "userSecret", "redirectUris", "sectorIdentifierUri" })
@BeforeClass
public void registerClient(final String userId, final String userSecret, String redirectUris, String sectorIdentifierUri) throws Exception {
    Reporter.log("Register client", true);
    List<ResponseType> responseTypes = new ArrayList<ResponseType>();
    RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth benchmark test app", StringUtils.spaceSeparatedToList(redirectUris));
    registerRequest.setResponseTypes(responseTypes);
    registerRequest.setSectorIdentifierUri(sectorIdentifierUri);
    RegisterClient registerClient = new RegisterClient(registrationEndpoint);
    registerClient.setRequest(registerRequest);
    RegisterResponse registerResponse = registerClient.exec();
    assertEquals(registerResponse.getStatus(), 200, "Unexpected response code: " + registerResponse.getEntity());
    assertNotNull(registerResponse.getClientId());
    assertNotNull(registerResponse.getClientSecret());
    assertNotNull(registerResponse.getRegistrationAccessToken());
    assertNotNull(registerResponse.getClientIdIssuedAt());
    assertNotNull(registerResponse.getClientSecretExpiresAt());
    this.clientId = registerResponse.getClientId();
    this.clientSecret = registerResponse.getClientSecret();
}
Also used : RegisterRequest(org.xdi.oxauth.client.RegisterRequest) RegisterResponse(org.xdi.oxauth.client.RegisterResponse) RegisterClient(org.xdi.oxauth.client.RegisterClient) ArrayList(java.util.ArrayList) ResponseType(org.xdi.oxauth.model.common.ResponseType) BeforeClass(org.testng.annotations.BeforeClass) Parameters(org.testng.annotations.Parameters)

Aggregations

BeforeClass (org.testng.annotations.BeforeClass)1186 Series (com.axibase.tsd.api.model.series.Series)178 File (java.io.File)157 ArrayList (java.util.ArrayList)78 HashMap (java.util.HashMap)43 ClusterControllerManager (org.apache.helix.integration.manager.ClusterControllerManager)37 Injector (com.google.inject.Injector)36 Properties (java.util.Properties)35 Path (org.apache.hadoop.fs.Path)33 ClusterSetup (org.apache.helix.tools.ClusterSetup)33 Configuration (org.apache.hadoop.conf.Configuration)31 BigDecimal (java.math.BigDecimal)29 URL (java.net.URL)28 MockParticipantManager (org.apache.helix.integration.manager.MockParticipantManager)27 Date (java.util.Date)26 Server (org.eclipse.jetty.server.Server)25 ServerConnector (org.eclipse.jetty.server.ServerConnector)25 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)23 IOException (java.io.IOException)23 Path (java.nio.file.Path)23