Search in sources :

Example 36 with BeforeTest

use of org.testng.annotations.BeforeTest in project athenz by yahoo.

the class PrincipalTokenTest method loadKeys.

@BeforeTest
private void loadKeys() throws IOException {
    Path path = Paths.get("./src/test/resources/fantasy_public_k0.key");
    servicePublicKeyStringK0 = new String(Files.readAllBytes(path));
    path = Paths.get("./src/test/resources/fantasy_private_k0.key");
    servicePrivateKeyStringK0 = new String(Files.readAllBytes(path));
    path = Paths.get("./src/test/resources/fantasy_public_k1.key");
    servicePublicKeyStringK1 = new String(Files.readAllBytes(path));
    path = Paths.get("./src/test/resources/fantasy_private_k1.key");
    servicePrivateKeyStringK1 = new String(Files.readAllBytes(path));
}
Also used : Path(java.nio.file.Path) BeforeTest(org.testng.annotations.BeforeTest)

Example 37 with BeforeTest

use of org.testng.annotations.BeforeTest in project athenz by yahoo.

the class RoleTokenTest method loadKeys.

@BeforeTest
private void loadKeys() throws IOException {
    Path path = Paths.get("./src/test/resources/zts_public_k0.key");
    ztsPublicKeyStringK0 = new String(Files.readAllBytes(path));
    path = Paths.get("./src/test/resources/zts_public_k1.key");
    ztsPublicKeyStringK1 = new String(Files.readAllBytes(path));
    path = Paths.get("./src/test/resources/zts_private_k0.key");
    ztsPrivateKeyStringK0 = new String(Files.readAllBytes(path));
    path = Paths.get("./src/test/resources/zts_private_k1.key");
    ztsPrivateKeyStringK1 = new String(Files.readAllBytes(path));
}
Also used : Path(java.nio.file.Path) BeforeTest(org.testng.annotations.BeforeTest)

Example 38 with BeforeTest

use of org.testng.annotations.BeforeTest in project athenz by yahoo.

the class TokenTest method loadKeys.

@BeforeTest
private void loadKeys() throws IOException {
    Path path = Paths.get("./src/test/resources/fantasy_private_k0.key");
    servicePrivateKeyStringK0 = new String(Files.readAllBytes(path));
    path = Paths.get("./src/test/resources/fantasy_public_k0.key");
    servicePublicKeyStringK0 = new String(Files.readAllBytes(path));
    path = Paths.get("./src/test/resources/fantasy_private_k1.key");
    servicePrivateKeyStringK1 = new String(Files.readAllBytes(path));
}
Also used : Path(java.nio.file.Path) BeforeTest(org.testng.annotations.BeforeTest)

Example 39 with BeforeTest

use of org.testng.annotations.BeforeTest in project rest.li by linkedin.

the class TestD2ConfigWithSingleZKFailover method setup.

@BeforeTest
public void setup() throws IOException, Exception {
    // zkServer
    _zkServer = ZKTestUtil.startZKServer();
    _zkPort = _zkServer.getPort();
    _zkHosts = ZK_HOST + ":" + _zkPort;
    _zkUriString = "zk://" + _zkHosts;
    // Register clusters/services  (two services per cluster)
    LoadBalancerClientCli.runDiscovery(_zkHosts, "/d2", D2_CONFIG_DATA);
    // Get LoadBalancer Client
    _cli = new LoadBalancerClientCli(_zkHosts, "/d2");
    // Echo servers startup
    startAllEchoServers();
    assertAllEchoServersRunning(_echoServers);
    _client = _cli.createClient(_cli.getZKClient(), _zkUriString, "/d2", "service-1_1");
    _log.info(LoadBalancerClientCli.printStores(_cli.getZKClient(), _zkUriString, "/d2"));
    assertAllEchoServersRegistered(_cli.getZKClient(), _zkUriString, _echoServers);
}
Also used : LoadBalancerClientCli(com.linkedin.d2.balancer.util.LoadBalancerClientCli) BeforeTest(org.testng.annotations.BeforeTest)

Example 40 with BeforeTest

use of org.testng.annotations.BeforeTest in project pinot by linkedin.

the class RetentionManagerTest method setup.

@BeforeTest
public void setup() throws Exception {
    _zookeeperInstance = ZkStarter.startLocalZkServer();
    _zkClient = new ZkClient(ZK_STR);
    _pinotHelixResourceManager = new PinotHelixResourceManager(ZK_STR, HELIX_CLUSTER_NAME, CONTROLLER_INSTANCE_NAME, null, 10000L, true, /*isUpdateStateModel=*/
    false);
    _pinotHelixResourceManager.start();
    ControllerRequestBuilderUtil.addFakeDataInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZK_STR, 2, true);
    ControllerRequestBuilderUtil.addFakeBrokerInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZK_STR, 2, true);
    _helixAdmin = _pinotHelixResourceManager.getHelixAdmin();
    _helixZkManager = _pinotHelixResourceManager.getHelixZkManager();
    String OfflineTableConfigJson = ControllerRequestBuilderUtil.buildCreateOfflineTableJSON(_testTableName, null, null, 2).toString();
    AbstractTableConfig offlineTableConfig = AbstractTableConfig.init(OfflineTableConfigJson);
    _pinotHelixResourceManager.addTable(offlineTableConfig);
    _propertyStore = ZkUtils.getZkPropertyStore(_helixZkManager, HELIX_CLUSTER_NAME);
}
Also used : ZkClient(org.apache.helix.manager.zk.ZkClient) PinotHelixResourceManager(com.linkedin.pinot.controller.helix.core.PinotHelixResourceManager) AbstractTableConfig(com.linkedin.pinot.common.config.AbstractTableConfig) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

BeforeTest (org.testng.annotations.BeforeTest)80 HashMap (java.util.HashMap)8 CommandManager (com.sun.identity.cli.CommandManager)6 Path (java.nio.file.Path)6 File (java.io.File)5 Injector (com.google.inject.Injector)4 PinotHelixResourceManager (com.linkedin.pinot.controller.helix.core.PinotHelixResourceManager)4 Series (com.axibase.tsd.api.model.series.Series)3 AbstractTableConfig (com.linkedin.pinot.common.config.AbstractTableConfig)3 ArrayList (java.util.ArrayList)3 Parameters (org.testng.annotations.Parameters)3 SSOException (com.iplanet.sso.SSOException)2 Schema (com.linkedin.pinot.common.data.Schema)2 SegmentGeneratorConfig (com.linkedin.pinot.core.indexsegment.generator.SegmentGeneratorConfig)2 SegmentIndexCreationDriver (com.linkedin.pinot.core.segment.creator.SegmentIndexCreationDriver)2 SegmentIndexCreationDriverImpl (com.linkedin.pinot.core.segment.creator.impl.SegmentIndexCreationDriverImpl)2 ThirdEyeConfigProperties (com.linkedin.thirdeye.hadoop.config.ThirdEyeConfigProperties)2 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)2 OrganizationConfigManager (com.sun.identity.sm.OrganizationConfigManager)2 SMSException (com.sun.identity.sm.SMSException)2