Commit 59f83fc0 by apoorvnaik

ATLAS-2201: Test dependency, plugin version and test code fixes

parent a3bafb1e
......@@ -18,32 +18,24 @@
package org.apache.atlas.security;
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.hadoop.util.StringUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;
//Unstable test. Disabling
@Test(enabled=false)
public class InMemoryJAASConfigurationTest extends TestCase {
public class InMemoryJAASConfigurationTest {
private static final String ATLAS_JAAS_PROP_FILE = "atlas-jaas.properties";
@BeforeClass
protected void setUp() throws Exception {
super.setUp();
try {
InMemoryJAASConfiguration.init(ATLAS_JAAS_PROP_FILE);
} catch(Throwable t) {
fail("InMemoryJAASConfiguration.init() is not expected to throw Exception:" + t);
}
}
protected void tearDown() throws Exception {
super.tearDown();
}
@Test(enabled=false)
......
......@@ -18,34 +18,25 @@
package org.apache.atlas.security;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.testng.annotations.Test;
@Test
public class InMemoryJAASConfigurationTicketBasedKafkaClientTest extends TestCase {
public class InMemoryJAASConfigurationTicketBasedKafkaClientTest {
private static final String ATLAS_JAAS_PROP_FILE = "atlas-jaas.properties";
protected void setUp() throws Exception {
super.setUp();
try {
@BeforeClass
public void setUp() throws Exception {
InMemoryJAASConfiguration.init(ATLAS_JAAS_PROP_FILE);
InMemoryJAASConfiguration.setConfigSectionRedirect("KafkaClient", "ticketBased-KafkaClient");
} catch (Throwable t) {
fail("InMemoryJAASConfiguration.init() is not expected to throw Exception:" + t);
}
}
protected void tearDown() throws Exception {
super.tearDown();
}
@Test
public void testGetAppConfigurationEntryStringForticketBasedKafkaClient() {
......
......@@ -586,10 +586,14 @@
<titan.index.backend>elasticsearch</titan.index.backend>
<entity.repository.impl>org.apache.atlas.repository.audit.InMemoryEntityAuditRepository</entity.repository.impl>
<graphdb.backend.impl>org.apache.atlas.repository.graphdb.titan0.Titan0GraphDatabase</graphdb.backend.impl>
<surefire.version>2.18.1</surefire.version>
<surefire.forkCount>2C</surefire.forkCount>
<failsafe.version>2.18.1</failsafe.version>
<atlas.surefire.options></atlas.surefire.options>
<aspectj.runtime.version>1.8.7</aspectj.runtime.version>
<project.build.dashboardv2.gruntBuild>build-minify</project.build.dashboardv2.gruntBuild>
<testng.version>6.9.4</testng.version>
</properties>
<profiles>
......@@ -1382,6 +1386,7 @@
<groupId>org.apache.atlas</groupId>
<artifactId>atlas-client</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
......@@ -1655,7 +1660,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
......@@ -1805,13 +1810,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<version>${surefire.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<version>${failsafe.version}</version>
</plugin>
<plugin>
......@@ -1934,7 +1939,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<version>${surefire.version}</version>
<configuration>
<systemProperties>
<user.dir>${project.basedir}</user.dir>
......@@ -1942,7 +1947,7 @@
<log4j.configuration>atlas-log4j.xml</log4j.configuration>
</systemProperties>
<skipTests>${skipTests}</skipTests>
<forkCount>2C</forkCount>
<forkCount>${surefire.forkCount}</forkCount>
<reuseForks>false</reuseForks>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<argLine>-Djava.awt.headless=true -Dproject.version=${project.version}
......@@ -1963,7 +1968,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<version>${failsafe.version}</version>
<configuration>
<systemPropertyVariables>
<projectBaseDir>${projectBaseDir}</projectBaseDir>
......
......@@ -57,7 +57,7 @@ public class AtlasTypeDefGraphStoreTest {
RequestContextV1.get().setUser(TestUtilsV2.TEST_USER);
}
@Test(priority = 1)
@Test
public void testGet() {
try {
AtlasTypesDef typesDef = typeDefStore.searchTypesDef(new SearchFilter());
......@@ -73,7 +73,7 @@ public class AtlasTypeDefGraphStoreTest {
}
}
@Test(dataProvider = "invalidGetProvider", priority = 2)
@Test(dataProvider = "invalidGetProvider", dependsOnMethods = "testGet")
public void testInvalidGet(String name, String guid){
try {
assertNull(typeDefStore.getEnumDefByName(name));
......@@ -540,7 +540,7 @@ public class AtlasTypeDefGraphStoreTest {
}
}
@Test
@Test(dependsOnMethods = "testGet")
public void testTypeDeletionAndRecreate() {
AtlasClassificationDef aTag = new AtlasClassificationDef("testTag");
AtlasAttributeDef attributeDef = new AtlasAttributeDef("testAttribute", "string", true,
......@@ -579,7 +579,7 @@ public class AtlasTypeDefGraphStoreTest {
}
}
@Test
@Test(dependsOnMethods = "testGet")
public void testTypeRegistryIsUpdatedAfterGraphStorage() throws AtlasBaseException {
String classificationDef = "{"
+ "\"name\":\"test_classification_11\","
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment