Skip to content
Permalink
Browse files
Migrate all tests to JUnit5 (#198)
  • Loading branch information
DomGarguilo committed Mar 25, 2022
1 parent 62a9b06 commit d1993ba4a81612bdf9f3f58937c687352612e0e4
Showing 3 changed files with 19 additions and 16 deletions.
10 pom.xml
@@ -95,11 +95,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-minicluster</artifactId>
@@ -110,6 +105,11 @@
<artifactId>accumulo-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
@@ -16,8 +16,8 @@
*/
package org.apache.accumulo.testing.randomwalk;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

import java.io.File;
import java.io.IOException;
@@ -37,7 +37,7 @@ public class FrameworkTest {

// Need to use fully qualified name here because of conflict with
// org.apache.accumulo.testing.randomwalk.Test
@org.junit.Test
@org.junit.jupiter.api.Test
public void testXML()
throws SAXException, URISyntaxException, ParserConfigurationException, IOException {
SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
@@ -49,21 +49,21 @@ public void testXML()
DocumentBuilder docbuilder = dbf.newDocumentBuilder();
Document document = docbuilder.parse(getFile("/randomwalk/modules/unit/Basic.xml"));

assertNotEquals("Parsing randomwalk xml should result in nodes.", 0,
document.getChildNodes().getLength());
assertNotEquals(0, document.getChildNodes().getLength(),
"Parsing randomwalk xml should result in nodes.");
}

private File getFile(String resource) throws URISyntaxException {
return new File(this.getClass().getResource(resource).toURI());
}

@org.junit.Test
@org.junit.jupiter.api.Test
public void testRWTest() {
Test t1 = new CreateTable();
assertEquals("org.apache.accumulo.testing.randomwalk.unit.CreateTable", t1.toString());

Test t2 = new CreateTable();
assertEquals("CreateTable test nodes were not equal.", t1, t2);
assertEquals(t1, t2, "CreateTable test nodes were not equal.");
}

}
@@ -16,6 +16,7 @@
*/
package org.apache.accumulo.testing.randomwalk;

import static java.util.concurrent.TimeUnit.MINUTES;
import static org.apache.accumulo.core.conf.Property.TSERV_NATIVEMAP_ENABLED;
import static org.apache.accumulo.core.conf.Property.TSERV_WAL_MAX_SIZE;

@@ -25,10 +26,11 @@
import org.apache.accumulo.test.functional.ConfigurableMacBase;
import org.apache.hadoop.conf.Configuration;
import org.easymock.EasyMock;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

@Ignore("Replication ITs are not stable and not currently maintained")
@Disabled("Replication ITs are not stable and not currently maintained")
public class ReplicationRandomWalkIT extends ConfigurableMacBase {

@Override
@@ -39,7 +41,8 @@ protected void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSit
}

@Deprecated
@Test(timeout = 5 * 60 * 1000)
@Test
@Timeout(value = 5, unit = MINUTES)
public void runReplicationRandomWalkStep() throws Exception {
var r = new org.apache.accumulo.testing.randomwalk.concurrent.Replication();

0 comments on commit d1993ba

Please sign in to comment.