Skip to content

Commit

Permalink
[dbs-leipzig#1452] Change test execution logic in module gradoop-hbase
Browse files Browse the repository at this point in the history
  - Removes testng unit group (every test NOT belonging to the the
integration test group gets countet as unit test.
  - Removes unneeded testng xml suite files.
  - Adds new testng suite xml file "complete"
  • Loading branch information
Lucas Schons committed Dec 17, 2019
1 parent 64ec7f4 commit 4785dab
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 74 deletions.
9 changes: 9 additions & 0 deletions gradoop-store/gradoop-hbase/gradoop-hbase-complete-testng.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="Gradoop HBase Complete">
<test name="HBase complete Test">
<packages>
<package name="org.gradoop.storage.impl.hbase.*"/>
</packages>
</test>
</suite>
14 changes: 0 additions & 14 deletions gradoop-store/gradoop-hbase/gradoop-hbase-integration-testng.xml

This file was deleted.

24 changes: 0 additions & 24 deletions gradoop-store/gradoop-hbase/gradoop-hbase-testng.xml

This file was deleted.

2 changes: 1 addition & 1 deletion gradoop-store/gradoop-hbase/gradoop-hbase-unit-testng.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<test name="Unit Test">
<groups>
<run>
<include name="unit"/>
<exclude name="integration"/>
</run>
</groups>
<packages>
Expand Down
14 changes: 1 addition & 13 deletions gradoop-store/gradoop-hbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>gradoop-hbase-testng.xml</suiteXmlFile>
<suiteXmlFile>gradoop-hbase-complete-testng.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
<name>surefire.testng.verbose</name>
<value>2</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -94,12 +88,6 @@
<suiteXmlFiles>
<suiteXmlFile>gradoop-hbase-unit-testng.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
<name>surefire.testng.verbose</name>
<value>2</value>
</property>
</properties>
</configuration>
</plugin>
<!-- Creates an extra *-tests.jar which can be used as dependency -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class HBaseDataSinkSourceTest extends GradoopFlinkTestBase {
*
* @throws IOException on failure
*/
@BeforeClass
@BeforeClass(groups = {"integration"})
public static void setUp() throws IOException {
epgmStores = new HBaseEPGMStore[3];

Expand All @@ -97,7 +97,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 @@ -120,7 +120,7 @@ public static Object[][] storeIndexProvider() {
/**
* Test the configuration of the stores.
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testConfig(int storeIndex) {
switch (storeIndex) {
case 1:
Expand Down Expand Up @@ -158,7 +158,7 @@ public void testConfig(int storeIndex) {
*
* @throws IOException on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadFromSource(int storeIndex) throws Exception {
// read social graph from HBase via EPGMDatabase
GraphCollection collection = new HBaseDataSource(epgmStores[storeIndex], getConfig())
Expand Down Expand Up @@ -186,7 +186,7 @@ public void testReadFromSource(int storeIndex) throws Exception {
*
* @throws Exception on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadFromSourceWithEmptyPredicates(int storeIndex) throws Exception {
// Define HBase source
HBaseDataSource hBaseDataSource = new HBaseDataSource(epgmStores[storeIndex], getConfig());
Expand Down Expand Up @@ -225,7 +225,7 @@ public void testReadFromSourceWithEmptyPredicates(int storeIndex) throws Excepti
/**
* Test reading a graph collection from {@link HBaseDataSource} with graph head id predicates
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithGraphIdPredicate(int storeIndex) throws Throwable {
List<EPGMGraphHead> testGraphs = new ArrayList<>(getSocialGraphHeads())
.subList(1, 3);
Expand Down Expand Up @@ -259,7 +259,7 @@ public void testReadWithGraphIdPredicate(int storeIndex) throws Throwable {
/**
* Test reading a graph collection from {@link HBaseDataSource} with vertex id predicates
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithVertexIdPredicate(int storeIndex) throws Throwable {
List<EPGMVertex> testVertices = new ArrayList<>(getSocialVertices())
.subList(0, 3);
Expand Down Expand Up @@ -294,7 +294,7 @@ public void testReadWithVertexIdPredicate(int storeIndex) throws Throwable {
/**
* Test reading a graph collection from {@link HBaseDataSource} with edge id predicates
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithEdgeIdPredicate(int storeIndex) throws Throwable {
List<EPGMEdge> testEdges = new ArrayList<>(getSocialEdges())
.subList(0, 3);
Expand Down Expand Up @@ -332,7 +332,7 @@ public void testReadWithEdgeIdPredicate(int storeIndex) throws Throwable {
*
* @throws Exception on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithLabelInPredicate(int storeIndex) throws Exception {
// Extract parts of social graph to filter for
List<EPGMGraphHead> graphHeads = Lists.newArrayList(getSocialGraphHeads())
Expand Down Expand Up @@ -390,7 +390,7 @@ public void testReadWithLabelInPredicate(int storeIndex) throws Exception {
*
* @throws Exception on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithLabelRegPredicate(int storeIndex) throws Exception {
// Extract parts of social graph to filter for
List<EPGMGraphHead> graphHeads = Lists.newArrayList(getSocialGraphHeads())
Expand Down Expand Up @@ -444,7 +444,7 @@ public void testReadWithLabelRegPredicate(int storeIndex) throws Exception {
*
* @throws Exception on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithPropEqualsPredicate(int storeIndex) throws Exception {
PropertyValue propertyValueVertexCount = PropertyValue.create(3);
PropertyValue propertyValueSince = PropertyValue.create(2013);
Expand Down Expand Up @@ -506,7 +506,7 @@ public void testReadWithPropEqualsPredicate(int storeIndex) throws Exception {
*
* @throws Exception on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithPropLargerThanPredicate(int storeIndex) throws Exception {
PropertyValue propertyValueVertexCount = PropertyValue.create(3);
PropertyValue propertyValueSince = PropertyValue.create(2014);
Expand Down Expand Up @@ -574,7 +574,7 @@ public void testReadWithPropLargerThanPredicate(int storeIndex) throws Exception
*
* @throws Exception on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithPropRegPredicate(int storeIndex) throws Exception {
// Extract parts of social graph to filter for
List<EPGMGraphHead> graphHeads = Lists.newArrayList(getSocialGraphHeads())
Expand Down Expand Up @@ -642,7 +642,7 @@ public void testReadWithPropRegPredicate(int storeIndex) throws Exception {
*
* @throws Exception on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testReadWithChainedPredicates(int storeIndex) throws Exception {
// Extract parts of social graph to filter for
List<EPGMGraphHead> graphHeads = getSocialGraphHeads()
Expand Down Expand Up @@ -716,7 +716,7 @@ public void testReadWithChainedPredicates(int storeIndex) throws Exception {
*
* @throws Exception on failure
*/
@Test(dataProvider = "store index")
@Test(dataProvider = "store index", groups = {"integration"})
public void testWriteToSink(int storeIndex) throws Exception {
// Create an empty store
HBaseEPGMStore newStore;
Expand Down Expand Up @@ -786,7 +786,7 @@ public void testWriteToSink(int storeIndex) throws Exception {
*
* @throws Exception on failure
*/
@Test
@Test(groups = {"integration"})
public void testWriteToSinkWithOverWrite() throws Exception {
// Create an empty store
HBaseEPGMStore store = createEmptyEPGMStore("testWriteToSinkWithOverwrite");
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(groups = {"unit"})
@Test
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(groups = {"unit"})
@Test
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", groups = {"unit"})
@Test(dataProvider = "property values")
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", groups = {"unit"})
@Test(dataProvider = "property values")
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,12 +34,12 @@
/**
* Test class for {@link HBasePropReg}
*/
@Test(groups = "unit")
@Test
public class HBasePropRegTest {
/**
* Test the toHBaseFilter function
*/
@Test(groups = {"unit"})
@Test
public void testToHBaseFilter() {
String key = "key";
Pattern pattern = Pattern.compile("^FooBar.*$");
Expand Down

0 comments on commit 4785dab

Please sign in to comment.