Search in sources :

Example 81 with BeforeClass

use of org.testng.annotations.BeforeClass in project smscgateway by RestComm.

the class SipTest method setup.

@BeforeClass
public void setup() throws Exception {
    SipFactory sipFactory = SipFactory.getInstance();
    addressFactory = sipFactory.createAddressFactory();
}
Also used : SipFactory(javax.sip.SipFactory) BeforeClass(org.testng.annotations.BeforeClass)

Example 82 with BeforeClass

use of org.testng.annotations.BeforeClass in project incubator-gobblin by apache.

the class GobblinClusterManagerTest method setUp.

@BeforeClass
public void setUp() throws Exception {
    // Use a random ZK port
    this.testingZKServer = new TestingServer(-1);
    LOG.info("Testing ZK Server listening on: " + testingZKServer.getConnectString());
    URL url = GobblinClusterManagerTest.class.getClassLoader().getResource(GobblinClusterManager.class.getSimpleName() + ".conf");
    Assert.assertNotNull(url, "Could not find resource " + url);
    Config config = ConfigFactory.parseURL(url).withValue("gobblin.cluster.zk.connection.string", ConfigValueFactory.fromAnyRef(testingZKServer.getConnectString())).resolve();
    String zkConnectionString = config.getString(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING_KEY);
    HelixUtils.createGobblinHelixCluster(zkConnectionString, config.getString(GobblinClusterConfigurationKeys.HELIX_CLUSTER_NAME_KEY));
    this.helixManager = HelixManagerFactory.getZKHelixManager(config.getString(GobblinClusterConfigurationKeys.HELIX_CLUSTER_NAME_KEY), TestHelper.TEST_HELIX_INSTANCE_NAME, InstanceType.PARTICIPANT, zkConnectionString);
    this.helixManager.connect();
    this.helixManager.getMessagingService().registerMessageHandlerFactory(GobblinHelixConstants.SHUTDOWN_MESSAGE_TYPE, new TestShutdownMessageHandlerFactory(this));
    this.gobblinClusterManager = new GobblinClusterManager(TestHelper.TEST_APPLICATION_NAME, TestHelper.TEST_APPLICATION_ID, config, Optional.<Path>absent());
    this.gobblinClusterManager.getEventBus().register(this.gobblinClusterManager);
    this.gobblinClusterManager.connectHelixManager();
}
Also used : TestingServer(org.apache.curator.test.TestingServer) Path(org.apache.hadoop.fs.Path) Config(com.typesafe.config.Config) URL(java.net.URL) BeforeClass(org.testng.annotations.BeforeClass)

Example 83 with BeforeClass

use of org.testng.annotations.BeforeClass in project incubator-gobblin by apache.

the class GobblinHelixTaskTest method setUp.

@BeforeClass
public void setUp() throws IOException {
    Configuration configuration = new Configuration();
    configuration.setInt(ConfigurationKeys.TASK_EXECUTOR_THREADPOOL_SIZE_KEY, 1);
    this.taskExecutor = new TaskExecutor(configuration);
    this.helixManager = Mockito.mock(HelixManager.class);
    Mockito.when(this.helixManager.getInstanceName()).thenReturn(GobblinHelixTaskTest.class.getSimpleName());
    this.taskStateTracker = new GobblinHelixTaskStateTracker(new Properties());
    this.localFs = FileSystem.getLocal(configuration);
    this.appWorkDir = new Path(GobblinHelixTaskTest.class.getSimpleName());
    this.taskOutputDir = new Path(this.appWorkDir, "output");
}
Also used : Path(org.apache.hadoop.fs.Path) TaskExecutor(org.apache.gobblin.runtime.TaskExecutor) HelixManager(org.apache.helix.HelixManager) Configuration(org.apache.hadoop.conf.Configuration) Properties(java.util.Properties) BeforeClass(org.testng.annotations.BeforeClass)

Example 84 with BeforeClass

use of org.testng.annotations.BeforeClass in project incubator-gobblin by apache.

the class GobblinTaskRunnerTest method setUp.

@BeforeClass
public void setUp() throws Exception {
    this.testingZKServer = new TestingServer(-1);
    LOG.info("Testing ZK Server listening on: " + testingZKServer.getConnectString());
    URL url = GobblinTaskRunnerTest.class.getClassLoader().getResource(GobblinTaskRunnerTest.class.getSimpleName() + ".conf");
    Assert.assertNotNull(url, "Could not find resource " + url);
    Config config = ConfigFactory.parseURL(url).withValue("gobblin.cluster.zk.connection.string", ConfigValueFactory.fromAnyRef(testingZKServer.getConnectString())).resolve();
    String zkConnectionString = config.getString(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING_KEY);
    HelixUtils.createGobblinHelixCluster(zkConnectionString, config.getString(GobblinClusterConfigurationKeys.HELIX_CLUSTER_NAME_KEY));
    // Participant
    this.gobblinTaskRunner = new GobblinTaskRunner(TestHelper.TEST_APPLICATION_NAME, TestHelper.TEST_HELIX_INSTANCE_NAME, TestHelper.TEST_APPLICATION_ID, TestHelper.TEST_TASK_RUNNER_ID, config, Optional.<Path>absent());
    this.gobblinTaskRunner.connectHelixManager();
    // Controller
    this.gobblinClusterManager = new GobblinClusterManager(TestHelper.TEST_APPLICATION_NAME, TestHelper.TEST_APPLICATION_ID, config, Optional.<Path>absent());
    this.gobblinClusterManager.connectHelixManager();
}
Also used : TestingServer(org.apache.curator.test.TestingServer) Path(org.apache.hadoop.fs.Path) Config(com.typesafe.config.Config) URL(java.net.URL) BeforeClass(org.testng.annotations.BeforeClass)

Example 85 with BeforeClass

use of org.testng.annotations.BeforeClass in project incubator-gobblin by apache.

the class HelixUtilsTest method setUp.

@BeforeClass
public void setUp() throws IOException {
    this.configuration = new Configuration();
    this.fileSystem = FileSystem.getLocal(this.configuration);
    this.tokenFilePath = new Path(HelixUtilsTest.class.getSimpleName(), "token");
    this.token = new Token<>();
    this.token.setKind(new Text("test"));
    this.token.setService(new Text("test"));
}
Also used : Path(org.apache.hadoop.fs.Path) Configuration(org.apache.hadoop.conf.Configuration) Text(org.apache.hadoop.io.Text) BeforeClass(org.testng.annotations.BeforeClass)

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