Search in sources :

Example 1 with BeforeClass

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

the class RangeMergeOptimizerTest method setup.

@BeforeClass
public void setup() {
    _compiler = new Pql2Compiler();
    _optimizer = new RangeMergeOptimizer();
    _builder = new FilterQueryOptimizerRequest.FilterQueryOptimizerRequestBuilder();
}
Also used : Pql2Compiler(com.linkedin.pinot.pql.parsers.Pql2Compiler) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with BeforeClass

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

the class SchemaTest method setUp.

@BeforeClass
public void setUp() throws IOException {
    URL resourceUrl = getClass().getClassLoader().getResource("schemaTest.schema");
    Preconditions.checkNotNull(resourceUrl);
    schema = Schema.fromFile(new File(resourceUrl.getFile()));
}
Also used : File(java.io.File) URL(java.net.URL) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with BeforeClass

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

the class PinotTableRestletResourceTest method setUp.

@BeforeClass
public void setUp() {
    startZk();
    ControllerConf config = ControllerTestUtils.getDefaultControllerConfiguration();
    config.setTableMinReplicas(TABLE_MIN_REPLICATION);
    startController(config);
}
Also used : ControllerConf(com.linkedin.pinot.controller.ControllerConf) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with BeforeClass

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

the class TableSizeReaderTest method setUp.

@BeforeClass
public void setUp() throws IOException {
    helix = mock(PinotHelixResourceManager.class);
    when(helix.hasOfflineTable(anyString())).thenAnswer(new Answer() {

        @Override
        public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
            String table = (String) invocationOnMock.getArguments()[0];
            return table.indexOf("offline") >= 0;
        }
    });
    when(helix.hasRealtimeTable(anyString())).thenAnswer(new Answer() {

        @Override
        public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
            String table = (String) invocationOnMock.getArguments()[0];
            return table.indexOf("realtime") >= 0;
        }
    });
    int counter = 0;
    // server0
    FakeSizeServer s = new FakeSizeServer(Arrays.asList("s1", "s2", "s3"), serverPortStart + counter);
    s.start(URI_PATH, createHandler(200, s.sizes, 0));
    serverMap.put(serverName(counter), s);
    ++counter;
    // server1
    s = new FakeSizeServer(Arrays.asList("s2", "s5"), serverPortStart + counter);
    s.start(URI_PATH, createHandler(200, s.sizes, 0));
    serverMap.put(serverName(counter), s);
    ++counter;
    // server2
    s = new FakeSizeServer(Arrays.asList("s3", "s6"), serverPortStart + counter);
    s.start(URI_PATH, createHandler(404, s.sizes, 0));
    serverMap.put(serverName(counter), s);
    ++counter;
    // server3
    s = new FakeSizeServer(Arrays.asList("r1", "r2"), serverPortStart + counter);
    s.start(URI_PATH, createHandler(200, s.sizes, 0));
    serverMap.put(serverName(counter), s);
    ++counter;
    // server4
    s = new FakeSizeServer(Arrays.asList("r2"), serverPortStart + counter);
    s.start(URI_PATH, createHandler(200, s.sizes, 0));
    serverMap.put(serverName(counter), s);
    ++counter;
    // server5 ... timing out server
    s = new FakeSizeServer(Arrays.asList("s3", "s5"), serverPortStart + counter);
    s.start(URI_PATH, createHandler(200, s.sizes, timeoutMsec * 100));
    serverMap.put(serverName(counter), s);
    ++counter;
}
Also used : Answer(org.mockito.stubbing.Answer) PinotHelixResourceManager(com.linkedin.pinot.controller.helix.core.PinotHelixResourceManager) InvocationOnMock(org.mockito.invocation.InvocationOnMock) Matchers.anyString(org.mockito.Matchers.anyString) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with BeforeClass

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

the class ControllerSentinelTestV2 method setup.

@BeforeClass
public void setup() throws Exception {
    startZk();
    _zkClient = new ZkClient(ZkStarter.DEFAULT_ZK_STR);
    startController();
    _pinotResourceManager = _controllerStarter.getHelixResourceManager();
    ControllerRequestBuilderUtil.addFakeBrokerInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZkStarter.DEFAULT_ZK_STR, 20, true);
    ControllerRequestBuilderUtil.addFakeDataInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZkStarter.DEFAULT_ZK_STR, 20, true);
}
Also used : ZkClient(org.apache.helix.manager.zk.ZkClient) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

BeforeClass (org.testng.annotations.BeforeClass)1182 Series (com.axibase.tsd.api.model.series.Series)178 File (java.io.File)154 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)24 ServerConnector (org.eclipse.jetty.server.ServerConnector)24 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)23 IOException (java.io.IOException)23 Path (java.nio.file.Path)23