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();
}
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();
}
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");
}
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();
}
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"));
}
Aggregations