Skip to content

Commit

Permalink
[dbs-leipzig#1452] Assign every test in gradoop-hbase to group 'inter…
Browse files Browse the repository at this point in the history
…gration or

'unit'
  * Create two testng suite xml files to run either of the new groups
  * Configure surefire to only run unit tests
  • Loading branch information
Lucas Schons committed Nov 26, 2019
1 parent 2b59dbf commit 63042a8
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 30 deletions.
14 changes: 14 additions & 0 deletions gradoop-store/gradoop-hbase/gradoop-hbase-integration-testng.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="Gradoop HBase Unit Tests">
<test name="Unit Test">
<groups>
<run>
<include name="integration"/>
</run>
</groups>
<packages>
<package name="org.gradoop.storage.impl.hbase.*"/>
</packages>
</test>
</suite>
14 changes: 14 additions & 0 deletions gradoop-store/gradoop-hbase/gradoop-hbase-unit-testng.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="Gradoop HBase Unit Tests">
<test name="Unit Test">
<groups>
<run>
<include name="unit"/>
</run>
</groups>
<packages>
<package name="org.gradoop.storage.impl.hbase.*"/>
</packages>
</test>
</suite>
2 changes: 1 addition & 1 deletion gradoop-store/gradoop-hbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>gradoop-hbase-testng.xml</suiteXmlFile>
<suiteXmlFile>gradoop-hbase-unit-testng.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class GradoopHBaseTestBase {
*
* @throws Exception if setting up HBase test cluster fails
*/
@BeforeSuite
@BeforeSuite(groups = {"integration"})
public static void setUpHBase() throws Exception {
if (utility == null) {
utility = new HBaseTestingUtility(HBaseConfiguration.create());
Expand All @@ -88,7 +88,7 @@ public static void setUpHBase() throws Exception {
*
* @throws Exception if closing HBase test cluster fails
*/
@AfterSuite
@AfterSuite(groups = {"integration"})
public static void tearDownHBase() throws Exception {
if (utility != null) {
utility.shutdownMiniCluster();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class HBaseEPGMStoreTest extends GradoopHBaseTestBase {
*
* @throws IOException on failure
*/
@Test
@Test(groups = {"integration"})
public void writeCloseOpenReadTest() throws IOException {
HBaseEPGMStore graphStore = createEmptyEPGMStore();

Expand Down Expand Up @@ -86,7 +86,7 @@ public void writeCloseOpenReadTest() throws IOException {
*
* @throws IOException on failure
*/
@Test
@Test(groups = {"integration"})
public void writeCloseOpenReadTestWithPrefix() throws IOException {
String prefix = "test.";
HBaseEPGMStore graphStore = createEmptyEPGMStore(prefix);
Expand Down Expand Up @@ -118,7 +118,7 @@ public void writeCloseOpenReadTestWithPrefix() throws IOException {
*
* @throws IOException on failure
*/
@Test
@Test(groups = {"integration"})
public void writeFlushReadTest() throws IOException {
HBaseEPGMStore graphStore = createEmptyEPGMStore();
graphStore.setAutoFlush(false);
Expand Down Expand Up @@ -150,7 +150,7 @@ public void writeFlushReadTest() throws IOException {
*
* @throws IOException if read to or write from store fails
*/
@Test
@Test(groups = "integration")
public void iteratorTest() throws IOException {
HBaseEPGMStore graphStore = createEmptyEPGMStore();

Expand Down Expand Up @@ -203,7 +203,7 @@ public void iteratorTest() throws IOException {
*
* @throws IOException on failure
*/
@Test(expectedExceptions = UnsupportedTypeException.class)
@Test(expectedExceptions = UnsupportedTypeException.class, groups = {"integration"})
public void wrongPropertyTypeTest() throws IOException {
HBaseEPGMStore graphStore = createEmptyEPGMStore();

Expand All @@ -229,7 +229,7 @@ public void wrongPropertyTypeTest() throws IOException {
*
* @throws IOException on failure
*/
@Test
@Test(groups = {"integration"})
public void propertyTypeTest() throws IOException {
HBaseEPGMStore graphStore = createEmptyEPGMStore();

Expand Down Expand Up @@ -328,7 +328,7 @@ public void propertyTypeTest() throws IOException {
/**
* Test the truncate tables functionality.
*/
@Test
@Test(groups = {"integration"})
public void truncateTablesTest() throws IOException {
HBaseEPGMStore store = createEmptyEPGMStore("truncateTest");
AsciiGraphLoader<EPGMGraphHead, EPGMVertex, EPGMEdge> loader = getMinimalFullFeaturedGraphLoader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class HBaseGraphStoreTest extends GradoopHBaseTestBase {
*
* @throws IOException on failure
*/
@BeforeClass
@BeforeClass(groups = {"integration"})
public static void setUp() throws IOException {
epgmStores = new HBaseEPGMStore[3];

Expand All @@ -83,7 +83,7 @@ public static void setUp() throws IOException {
*
* @throws IOException on failure
*/
@AfterClass
@AfterClass(groups = {"integration"})
public static void tearDown() throws IOException {
for (HBaseEPGMStore store : epgmStores) {
if (store != null) {
Expand All @@ -106,7 +106,7 @@ public static Object[][] storeIndexProvider() {
/**
* Test, whether the store uses the correct region splitting.
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testConfig(int storeIndex) {
switch (storeIndex) {
case 1:
Expand All @@ -128,7 +128,7 @@ public void testConfig(int storeIndex) {
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetGraphSpaceWithIdPredicate(int storeIndex) throws IOException {
// Fetch all graph heads from gdl file
List<EPGMGraphHead> graphHeads = Lists.newArrayList(getSocialGraphHeads());
Expand All @@ -153,7 +153,7 @@ public void testGetGraphSpaceWithIdPredicate(int storeIndex) throws IOException
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = "integration")
public void testGetGraphSpaceWithoutIdPredicate(int storeIndex) throws IOException {
// Fetch all graph heads from gdl file
List<EPGMGraphHead> graphHeads = Lists.newArrayList(getSocialGraphHeads());
Expand All @@ -172,7 +172,7 @@ public void testGetGraphSpaceWithoutIdPredicate(int storeIndex) throws IOExcepti
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetVertexSpaceWithIdPredicate(int storeIndex) throws IOException {
// Fetch all vertices from gdl file
List<EPGMVertex> vertices = Lists.newArrayList(getSocialVertices());
Expand All @@ -198,7 +198,7 @@ public void testGetVertexSpaceWithIdPredicate(int storeIndex) throws IOException
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetVertexSpaceWithoutIdPredicate(int storeIndex) throws IOException {
// Fetch all vertices from gdl file
List<EPGMVertex> vertices = Lists.newArrayList(getSocialVertices());
Expand All @@ -217,7 +217,7 @@ public void testGetVertexSpaceWithoutIdPredicate(int storeIndex) throws IOExcept
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetEdgeSpaceWithIdPredicate(int storeIndex) throws IOException {
// Fetch all edges from gdl file
List<EPGMEdge> edges = Lists.newArrayList(getSocialEdges());
Expand All @@ -242,7 +242,7 @@ public void testGetEdgeSpaceWithIdPredicate(int storeIndex) throws IOException {
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetEdgeSpaceWithoutIdPredicate(int storeIndex) throws IOException {
// Fetch all edges from gdl file
List<EPGMEdge> edges = Lists.newArrayList(getSocialEdges());
Expand All @@ -262,7 +262,7 @@ public void testGetEdgeSpaceWithoutIdPredicate(int storeIndex) throws IOExceptio
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetElementSpaceWithLabelInPredicate(int storeIndex) throws IOException {
// Extract parts of social graph to filter for
List<EPGMGraphHead> graphHeads = Lists.newArrayList(getSocialGraphHeads())
Expand Down Expand Up @@ -311,7 +311,7 @@ public void testGetElementSpaceWithLabelInPredicate(int storeIndex) throws IOExc
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetElementSpaceWithLabelRegPredicate(int storeIndex) throws IOException {
// Extract parts of social graph to filter for
List<EPGMGraphHead> graphHeads = Lists.newArrayList(getSocialGraphHeads())
Expand Down Expand Up @@ -359,7 +359,7 @@ public void testGetElementSpaceWithLabelRegPredicate(int storeIndex) throws IOEx
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = "integration")
public void testGetElementSpaceWithPropEqualsPredicate(int storeIndex) throws IOException {
// Create the expected graph elements
PropertyValue propertyValueVertexCount = PropertyValue.create(3);
Expand Down Expand Up @@ -415,7 +415,7 @@ public void testGetElementSpaceWithPropEqualsPredicate(int storeIndex) throws IO
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetElementSpaceWithPropLargerThanPredicate(int storeIndex) throws IOException {
// Create the expected graph elements
PropertyValue propertyValueVertexCount = PropertyValue.create(3);
Expand Down Expand Up @@ -475,7 +475,7 @@ public void testGetElementSpaceWithPropLargerThanPredicate(int storeIndex) throw
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetElementSpaceWithPropRegPredicate(int storeIndex) throws IOException {
// Extract parts of social graph to filter for
List<EPGMGraphHead> graphHeads = Lists.newArrayList(getSocialGraphHeads())
Expand Down Expand Up @@ -533,7 +533,7 @@ public void testGetElementSpaceWithPropRegPredicate(int storeIndex) throws IOExc
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testGetElementSpaceWithChainedPredicates(int storeIndex) throws IOException {
// Extract parts of social graph to filter for
List<EPGMGraphHead> graphHeads = getSocialGraphHeads()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class HBaseLabelInTest {
/**
* Test the toHBaseFilter function
*/
@Test
@Test(groups = {"unit"})
public void testToHBaseFilter() {
String testLabel1 = "test1";
String testLabel2 = "test2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class HBaseLabelRegTest {
/**
* Test the toHBaseFilter function
*/
@Test
@Test(groups = {"unit"})
public void testToHBaseFilter() {

HBaseLabelReg<EPGMVertex> vertexFilter = new HBaseLabelReg<>(PATTERN_VERTEX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class HBasePropEqualsTest {
/**
* Test the toHBaseFilter function
*/
@Test(dataProvider = "property values")
@Test(dataProvider = "property values", groups = {"unit"})
public void testToHBaseFilter(String propertyKey, Object value) {
PropertyValue propertyValue = PropertyValue.create(value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class HBasePropLargerThanTest {
/**
* Test the toHBaseFilter function
*/
@Test(dataProvider = "property values")
@Test(dataProvider = "property values", groups = {"unit"})
public void testToHBaseFilter(String propertyKey, Object value, boolean isInclude) {
PropertyValue propertyValue = PropertyValue.create(value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
/**
* Test class for {@link HBasePropReg}
*/
@Test(groups = "unit")
public class HBasePropRegTest {
/**
* Test the toHBaseFilter function
*/
@Test
@Test(groups = {"unit"})
public void testToHBaseFilter() {
String key = "key";
Pattern pattern = Pattern.compile("^FooBar.*$");
Expand Down

0 comments on commit 63042a8

Please sign in to comment.