Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
*
* Annotation to denote that the test needs to run its own
* mini cluster that is separate from the clusters used by
* tests annotated as {@link HBaseManagedTimeTest} or
* {@link ClientManagedTimeTest}.
* tests annotated as {@link ParallelStatsDisabledTest} or
* {@link ParallelStatsEnabledTest}.
*
* As much as possible, tests should be able to run in one of the
* mini clusters used by {@link HBaseManagedTimeTest} or
* {@link ClientManagedTimeTest}. In the *rare* case it can't
* mini clusters used by {@link ParallelStatsDisabledTest} or
* {@link ParallelStatsEnabledTest}. In the *rare* case it can't
* you would need to annotate the test as {@link NeedsOwnMiniClusterTest}
* otherwise the test won't be executed when you run mvn verify or mvn install.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
* these tests use random table names generated by {@link BaseTest#generateRandomString}.
*
* Tests using a mini cluster need to be classified either
* as {@link ParallelStatsDisabledTest} or {@link ClientManagedTimeTest}
* or {@link NeedsOwnMiniClusterTest} or {@link HBaseManagedTimeTest} otherwise they won't be run
* as {@link ParallelStatsDisabledTest} or {@link ParallelStatsEnabledTest}
* or {@link NeedsOwnMiniClusterTest} otherwise they won't be run
* when one runs mvn verify or mvn install.
*
* @since 4.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
* these tests use random table names generated by {@link BaseTest#generateRandomString}.
*
* Tests using a mini cluster need to be classified either
* as {@link ParallelStatsEnabledTest} or {@link ClientManagedTimeTest}
* or {@link NeedsOwnMiniClusterTest} or {@link HBaseManagedTimeTest} otherwise they won't be run
* as {@link ParallelStatsDisabledTest} or {@link ParallelStatsEnabledTest}
* or {@link NeedsOwnMiniClusterTest} otherwise they won't be run
* when one runs mvn verify or mvn install.
*
* @since 4.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* Base class for tests that run with split SYSTEM.CATALOG.
*
*/
@Category(SplitSystemCatalogTests.class)
@Category(NeedsOwnMiniClusterTest.class)
public class SplitSystemCatalogIT extends BaseTest {

protected static String SCHEMA1 = "SCHEMA1";
Expand Down

This file was deleted.

17 changes: 11 additions & 6 deletions phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
import org.apache.hadoop.hbase.regionserver.RSRpcServices;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.SystemExitRule;
import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
import org.apache.phoenix.exception.SQLExceptionCode;
import org.apache.phoenix.exception.SQLExceptionInfo;
import org.apache.phoenix.jdbc.PhoenixConnection;
Expand Down Expand Up @@ -171,13 +170,19 @@
* Base class that contains all the methods needed by
* client-time and hbase-time managed tests.
*
* * Tests using a mini cluster need to be classified either
* as {@link ParallelStatsDisabledTest} or {@link ParallelStatsEnabledTest}
* or {@link NeedsOwnMiniClusterTest} otherwise they won't be run
* when one runs mvn verify or mvn install.
*
* For tests needing connectivity to a cluster, please use
* {@link BaseHBaseManagedTimeIT}.
* {@link ParallelStatsDisabledIt} or {@link ParallelStatsEnabledIt}.
*
* In the rare case when a test can't share the same mini cluster as the
* ones used by {@link BaseHBaseManagedTimeIT},
* one could extend this class and spin up your own mini cluster. Please
* make sure to shutdown the mini cluster in a method annotated by @AfterClass.
* In the case when a test can't share the same mini cluster as the
* ones used by {@link ParallelStatsDisabledIt} or {@link ParallelStatsEnabledIt},
* one could extend this class and spin up your own mini cluster. Please
* make sure to annotate such clesses with {@link NeedsOwnMiniClusterTest} and
* shutdown the mini cluster in a method annotated by @AfterClass.
*
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,22 @@
import java.util.List;
import java.util.Properties;

import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import org.apache.phoenix.pherf.configuration.XMLConfigParser;
import org.apache.phoenix.pherf.result.ResultUtil;
import org.apache.phoenix.pherf.schema.SchemaReader;
import org.apache.phoenix.pherf.util.PhoenixUtil;
import org.apache.phoenix.query.BaseTest;
import org.apache.phoenix.util.ReadOnlyProps;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.experimental.categories.Category;

public class ResultBaseTestIT extends BaseHBaseManagedTimeIT {
@Category(NeedsOwnMiniClusterTest.class)
public class ResultBaseTestIT extends BaseTest {
protected static final String matcherScenario = ".*scenario/.*test.*xml";
protected static final String matcherSchema = ".*datamodel/.*test.*sql";

Expand All @@ -41,6 +48,11 @@ public class ResultBaseTestIT extends BaseHBaseManagedTimeIT {
protected static List<Path> resources;
protected static ResultUtil resultUtil = new ResultUtil();

protected static Configuration getTestClusterConfig() {
// don't want callers to modify config.
return new Configuration(config);
}

@BeforeClass public static synchronized void setUp() throws Exception {

PherfConstants constants = PherfConstants.create();
Expand All @@ -51,9 +63,17 @@ public class ResultBaseTestIT extends BaseHBaseManagedTimeIT {
PhoenixUtil.setZookeeper("localhost");
reader = new SchemaReader(util, matcherSchema);
parser = new XMLConfigParser(matcherScenario);

setUpTestDriver(ReadOnlyProps.EMPTY_PROPS);
}

@AfterClass public static synchronized void tearDown() throws Exception {
resultUtil.deleteDir(properties.getProperty("pherf.default.results.dir"));
dropNonSystemTables();
resultUtil.deleteDir(properties.getProperty("pherf.default.results.dir"));
}

@After
public void cleanUpAfterTest() throws Exception {
deletePriorMetaData(HConstants.LATEST_TIMESTAMP, getUrl());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,45 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
import org.apache.phoenix.pherf.configuration.Column;
import org.apache.phoenix.pherf.configuration.DataModel;
import org.apache.phoenix.pherf.configuration.Scenario;
import org.apache.phoenix.pherf.configuration.XMLConfigParser;
import org.apache.phoenix.pherf.schema.SchemaReader;
import org.apache.phoenix.pherf.util.PhoenixUtil;
import org.apache.phoenix.query.BaseTest;
import org.apache.phoenix.util.ReadOnlyProps;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;


public class SchemaReaderIT extends BaseHBaseManagedTimeIT {
@Category(NeedsOwnMiniClusterTest.class)
public class SchemaReaderIT extends BaseTest {
protected static PhoenixUtil util = PhoenixUtil.create(true);

protected static Configuration getTestClusterConfig() {
// don't want callers to modify config.
return new Configuration(config);
}

@BeforeClass public static synchronized void setUp() throws Exception {
setUpTestDriver(ReadOnlyProps.EMPTY_PROPS);
}

@AfterClass public static synchronized void tearDown() throws Exception {
dropNonSystemTables();
}

@After
public void cleanUpAfterTest() throws Exception {
deletePriorMetaData(HConstants.LATEST_TIMESTAMP, getUrl());
}

@Test
public void testSchemaReader() {
// Test for the unit test version of the schema files.
Expand Down
Loading