Commit 461a2a4e by Shwetha GS

ATLAS-209 Use testng and delete junit and scalatest (ltfxyz via shwethags)

parent 538fa496
......@@ -991,13 +991,6 @@
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.binary.version}</artifactId>
<version>2.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamacros</groupId>
<artifactId>quasiquotes_${scala.binary.version}</artifactId>
<version>${scala.macros.version}</version>
......@@ -1108,14 +1101,6 @@
<scope>test</scope>
</dependency>
<!-- todo - use testng and delete junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
......@@ -1409,11 +1394,6 @@
<artifactId>surefire-testng</artifactId>
<version>2.18.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.18.1</version>
</dependency>
</dependencies>
</plugin>
......
......@@ -9,6 +9,7 @@ ATLAS-54 Rename configs in hive hook (shwethags)
ATLAS-3 Mixed Index creation fails with Date types (sumasai via shwethags)
ALL CHANGES:
ATLAS-209 Use testng and delete junit and scalatest (ltfxyz via shwethags)
ATLAS-163 New Trait UI (Tag) ( darshankumar89 via sumasai)
ATLAS-199 webapp build fails (grunt + tests) ( darshankumar89 via sumasai)
ATLAS-204 Lineage I/O Lineage Enhancement ( Anilsg via sumasai )
......
......@@ -155,12 +155,6 @@
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.binary.version}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamacros</groupId>
<artifactId>quasiquotes_${scala.binary.version}</artifactId>
</dependency>
......@@ -176,11 +170,6 @@
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
......
......@@ -19,10 +19,10 @@
package org.apache.atlas.repository;
import org.apache.atlas.typesystem.types.TypeSystem;
import org.junit.Before;
import org.testng.annotations.BeforeMethod;
public abstract class BaseTest {
@Before
@BeforeMethod
public void setup() throws Exception {
TypeSystem ts = TypeSystem.getInstance();
ts.reset();
......
......@@ -23,7 +23,6 @@ import com.thinkaurelius.titan.core.util.TitanCleanup;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
import junit.framework.Assert;
import org.apache.atlas.AtlasException;
import org.apache.atlas.GraphTransaction;
import org.apache.atlas.RepositoryMetadataModule;
......@@ -44,6 +43,7 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import org.testng.Assert;
import javax.inject.Inject;
import java.util.List;
......@@ -121,7 +121,7 @@ public class GraphBackedTypeStoreTest {
clsTypeFound = true;
}
}
Assert.assertTrue("Manager type not restored", clsTypeFound);
Assert.assertTrue(clsTypeFound, "Manager type not restored");
//validate trait
List<HierarchicalTypeDefinition<TraitType>> traitTypes = types.traitTypesAsJavaList();
......
......@@ -20,11 +20,11 @@ package org.apache.atlas.query
import org.apache.atlas.query.Expressions._
import org.apache.atlas.repository.BaseTest
import org.junit.{Before, Test}
import org.testng.annotations.{BeforeMethod,Test}
class ExpressionTest extends BaseTest {
@Before
@BeforeMethod
override def setup {
super.setup
......
......@@ -24,18 +24,16 @@ import org.apache.atlas.discovery.graph.DefaultGraphPersistenceStrategy
import org.apache.atlas.query.Expressions._
import org.apache.atlas.repository.graph.{TitanGraphProvider, GraphBackedMetadataRepository}
import org.apache.atlas.typesystem.types.TypeSystem
import org.junit.runner.RunWith
import org.scalatest._
import org.scalatest.junit.JUnitRunner
import org.testng.annotations.{Test,BeforeClass,AfterClass}
@RunWith(classOf[JUnitRunner])
class GremlinTest2 extends FunSuite with BeforeAndAfterAll with BaseGremlinTest {
class GremlinTest2 extends BaseGremlinTest {
var g: TitanGraph = null
var gProvider:TitanGraphProvider = null;
var gp:GraphPersistenceStrategies = null;
override def beforeAll() {
@BeforeClass
def beforeAll() {
TypeSystem.getInstance().reset()
QueryTestsUtils.setupTypes
gProvider = new TitanGraphProvider();
......@@ -43,7 +41,8 @@ class GremlinTest2 extends FunSuite with BeforeAndAfterAll with BaseGremlinTest
g = QueryTestsUtils.setupTestGraph(gProvider)
}
override def afterAll() {
@AfterClass
def afterAll() {
g.shutdown()
try {
TitanCleanup.clear(g);
......@@ -53,43 +52,43 @@ class GremlinTest2 extends FunSuite with BeforeAndAfterAll with BaseGremlinTest
}
}
test("testTraitSelect") {
@Test def testTraitSelect {
val r = QueryProcessor.evaluate(_class("Table").as("t").join("Dimension").as("dim").select(id("t"), id("dim")), g)
validateJson(r, "{\n \"query\":\"Table as t.Dimension as dim select t as _col_0, dim as _col_1\",\n \"dataType\":{\n \"typeName\":\"\",\n \"attributeDefinitions\":[\n {\n \"name\":\"_col_0\",\n \"dataTypeName\":\"Table\",\n \"multiplicity\":{\n \"lower\":0,\n \"upper\":1,\n \"isUnique\":false\n },\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"_col_1\",\n \"dataTypeName\":\"Dimension\",\n \"multiplicity\":{\n \"lower\":0,\n \"upper\":1,\n \"isUnique\":false\n },\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n }\n ]\n },\n \"rows\":[\n {\n \"$typeName$\":\"\",\n \"_col_1\":{\n \"$typeName$\":\"Dimension\"\n },\n \"_col_0\":{\n \"id\":\"3328\",\n \"$typeName$\":\"Table\",\n \"version\":0\n }\n },\n {\n \"$typeName$\":\"\",\n \"_col_1\":{\n \"$typeName$\":\"Dimension\"\n },\n \"_col_0\":{\n \"id\":\"4864\",\n \"$typeName$\":\"Table\",\n \"version\":0\n }\n },\n {\n \"$typeName$\":\"\",\n \"_col_1\":{\n \"$typeName$\":\"Dimension\"\n },\n \"_col_0\":{\n \"id\":\"6656\",\n \"$typeName$\":\"Table\",\n \"version\":0\n }\n }\n ]\n}")
}
test("testTrait") {
@Test def testTrait {
val r = QueryProcessor.evaluate(_trait("Dimension"), g)
validateJson(r)
}
test("testTraitInstance") {
@Test def testTraitInstance {
val r = QueryProcessor.evaluate(_trait("Dimension").traitInstance(), g)
validateJson(r)
}
test("testInstanceAddedToFilter") {
@Test def testInstanceAddedToFilter {
val r = QueryProcessor.evaluate(_trait("Dimension").hasField("typeName"), g)
validateJson(r)
}
test("testInstanceFilter") {
@Test def testInstanceFilter {
val r = QueryProcessor.evaluate(_trait("Dimension").traitInstance().hasField("name"), g)
validateJson(r)
}
test("testLineageWithPath") {
@Test def testLineageWithPath {
val r = QueryProcessor.evaluate(_class("Table").loop(id("LoadProcess").field("outputTable")).path(), g)
validateJson(r)
}
test("testLineageAllSelectWithPath") {
@Test def testLineageAllSelectWithPath {
val r = QueryProcessor.evaluate(_class("Table").as("src").loop(id("LoadProcess").field("outputTable")).as("dest").
select(id("src").field("name").as("srcTable"), id("dest").field("name").as("destTable")).path(), g)
validateJson(r)
}
test("testLineageAllSelectWithPathFromParser") {
@Test def testLineageAllSelectWithPathFromParser {
val p = new QueryParser
val e = p("Table as src loop (LoadProcess outputTable) as dest " +
"select src.name as srcTable, dest.name as destTable withPath").right.get
......@@ -98,7 +97,7 @@ class GremlinTest2 extends FunSuite with BeforeAndAfterAll with BaseGremlinTest
validateJson(r)
}
test("testLineageAllSelectWithPathFromParser2") {
@Test def testLineageAllSelectWithPathFromParser2 {
val p = new QueryParser
val e = p("Table as src loop (`LoadProcess->outputTable` inputTables) as dest " +
......@@ -107,7 +106,7 @@ class GremlinTest2 extends FunSuite with BeforeAndAfterAll with BaseGremlinTest
validateJson(r)
}
test("testHighLevelLineage") {
@Test def testHighLevelLineage {
val r = HiveLineageQuery("Table", "sales_fact_monthly_mv",
"LoadProcess",
"inputTables",
......@@ -116,7 +115,7 @@ class GremlinTest2 extends FunSuite with BeforeAndAfterAll with BaseGremlinTest
validateJson(r)
}
test("testHighLevelLineageReturnGraph") {
@Test def testHighLevelLineageReturnGraph {
val r = HiveLineageQuery("Table", "sales_fact_monthly_mv",
"LoadProcess",
"inputTables",
......@@ -127,7 +126,7 @@ class GremlinTest2 extends FunSuite with BeforeAndAfterAll with BaseGremlinTest
//validateJson(r)
}
test("testHighLevelWhereUsed") {
@Test def testHighLevelWhereUsed {
val r = HiveWhereUsedQuery("Table", "sales_fact",
"LoadProcess",
"inputTables",
......@@ -136,7 +135,7 @@ class GremlinTest2 extends FunSuite with BeforeAndAfterAll with BaseGremlinTest
validateJson(r)
}
test("testHighLevelWhereUsedReturnGraph") {
@Test def testHighLevelWhereUsedReturnGraph {
val r = HiveWhereUsedQuery("Table", "sales_fact",
"LoadProcess",
"inputTables",
......
......@@ -18,7 +18,8 @@
package org.apache.atlas.query
import org.junit.{Assert, Test}
import org.testng.Assert
import org.testng.annotations.Test
import scala.util.parsing.input.CharArrayReader
......
......@@ -24,18 +24,16 @@ import org.apache.atlas.discovery.graph.DefaultGraphPersistenceStrategy
import org.apache.atlas.query.Expressions._
import org.apache.atlas.repository.graph.{GraphBackedMetadataRepository, TitanGraphProvider}
import org.apache.atlas.typesystem.types.TypeSystem
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.{Assertions, BeforeAndAfterAll, FunSuite}
import org.testng.annotations.{Test,BeforeClass,AfterClass}
@RunWith(classOf[JUnitRunner])
class LineageQueryTest extends FunSuite with BeforeAndAfterAll with BaseGremlinTest {
class LineageQueryTest extends BaseGremlinTest {
var g: TitanGraph = null
var gProvider:TitanGraphProvider = null;
var gp:GraphPersistenceStrategies = null;
override def beforeAll() {
@BeforeClass
def beforeAll() {
TypeSystem.getInstance().reset()
QueryTestsUtils.setupTypes
gProvider = new TitanGraphProvider();
......@@ -43,7 +41,8 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll with BaseGremlinT
g = QueryTestsUtils.setupTestGraph(gProvider)
}
override def afterAll() {
@AfterClass
def afterAll() {
g.shutdown()
try {
TitanCleanup.clear(g);
......@@ -55,7 +54,7 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll with BaseGremlinT
val PREFIX_SPACES_REGEX = ("\\n\\s*").r
test("testInputTables") {
@Test def testInputTables {
val r = QueryProcessor.evaluate(_class("LoadProcess").field("inputTables"), g, gp)
val x = r.toJson
validateJson(r,"""{
......@@ -183,12 +182,12 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll with BaseGremlinT
""".stripMargin)
}
test("testLoadProcessOut") {
@Test def testLoadProcessOut {
val r = QueryProcessor.evaluate(_class("Table").field("LoadProcess").field("outputTable"), g, gp)
validateJson(r, null)
}
test("testLineageAll") {
@Test def testLineageAll {
val r = QueryProcessor.evaluate(_class("Table").loop(id("LoadProcess").field("outputTable")), g, gp)
validateJson(r, """{
| "query":"Table as _loop0 loop (LoadProcess outputTable)",
......@@ -343,7 +342,7 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll with BaseGremlinT
|}""".stripMargin)
}
test("testLineageAllSelect") {
@Test def testLineageAllSelect {
val r = QueryProcessor.evaluate(_class("Table").as("src").loop(id("LoadProcess").field("outputTable")).as("dest").
select(id("src").field("name").as("srcTable"), id("dest").field("name").as("destTable")), g, gp)
validateJson(r, """{
......@@ -409,7 +408,7 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll with BaseGremlinT
}""".stripMargin)
}
test("testLineageFixedDepth") {
@Test def testLineageFixedDepth {
val r = QueryProcessor.evaluate(_class("Table").loop(id("LoadProcess").field("outputTable"), int(1)), g, gp)
validateJson(r, """{
| "query":"Table as _loop0 loop (LoadProcess outputTable) times 1",
......
......@@ -19,12 +19,12 @@
package org.apache.atlas.query
import org.apache.atlas.repository.BaseTest
import org.junit.{Before, Test}
import org.testng.annotations.{BeforeMethod,Test}
class ParserTest extends BaseTest {
@Before
@BeforeMethod
override def setup {
super.setup
QueryTestsUtils.setupTypes
......
......@@ -30,7 +30,6 @@ import org.apache.atlas.typesystem.types._
import org.apache.commons.configuration.{Configuration, ConfigurationException, MapConfiguration}
import org.apache.commons.io.FileUtils
import org.json.JSONObject
import org.scalatest.{Assertions, BeforeAndAfterAll, FunSuite}
import org.skyscreamer.jsonassert.JSONAssert
......@@ -170,8 +169,6 @@ object QueryTestsUtils extends GraphUtils {
}
trait BaseGremlinTest {
self : FunSuite with BeforeAndAfterAll =>
val STRUCT_NAME_REGEX = (TypeUtils.TEMP_STRUCT_NAME_PREFIX + "\\d+").r
def validateJson(r: GremlinQueryResult, expected: String = null): Unit = {
val rJ = r.toJson
......
......@@ -70,12 +70,6 @@
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.binary.version}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamacros</groupId>
<artifactId>quasiquotes_${scala.binary.version}</artifactId>
</dependency>
......@@ -106,11 +100,6 @@
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
......
......@@ -34,9 +34,9 @@ import org.apache.atlas.typesystem.types.Multiplicity;
import org.apache.atlas.typesystem.types.StructTypeDefinition;
import org.apache.atlas.typesystem.types.TraitType;
import org.apache.atlas.typesystem.types.TypeSystem;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.testng.Assert;
import static org.apache.atlas.typesystem.types.utils.TypesUtil.createClassTypeDef;
import static org.apache.atlas.typesystem.types.utils.TypesUtil.createRequiredAttrDef;
......@@ -45,7 +45,7 @@ import static org.apache.atlas.typesystem.types.utils.TypesUtil.createTraitTypeD
public class SerializationJavaTest extends BaseTest {
@Before
@BeforeMethod
public void setup() throws Exception {
super.setup();
}
......
......@@ -25,7 +25,7 @@ import org.apache.atlas.AtlasException;
import org.apache.atlas.typesystem.Referenceable;
import org.apache.atlas.typesystem.Struct;
import org.apache.atlas.typesystem.types.utils.TypesUtil;
import org.junit.Before;
import org.testng.annotations.BeforeMethod;
import java.math.BigDecimal;
import java.math.BigInteger;
......@@ -67,7 +67,7 @@ public abstract class BaseTest {
return TypeSystem.getInstance();
}
@Before
@BeforeMethod
public void setup() throws Exception {
TypeSystem ts = TypeSystem.getInstance();
ts.reset();
......@@ -86,9 +86,8 @@ public abstract class BaseTest {
TypesUtil.createOptionalAttrDef("k", DataTypes.BIGDECIMAL_TYPE),
TypesUtil.createOptionalAttrDef("l", DataTypes.DATE_TYPE),
TypesUtil.createOptionalAttrDef("m", ts.defineArrayType(DataTypes.INT_TYPE)),
TypesUtil.createOptionalAttrDef("n", ts.defineArrayType(DataTypes.BIGDECIMAL_TYPE)), TypesUtil
.createOptionalAttrDef("o",
ts.defineMapType(DataTypes.STRING_TYPE, DataTypes.DOUBLE_TYPE)));
TypesUtil.createOptionalAttrDef("n", ts.defineArrayType(DataTypes.BIGDECIMAL_TYPE)),
TypesUtil.createOptionalAttrDef("o", ts.defineMapType(DataTypes.STRING_TYPE, DataTypes.DOUBLE_TYPE)));
System.out.println("defined structType = " + structType);
StructType recursiveStructType =
......
......@@ -21,13 +21,13 @@ package org.apache.atlas.typesystem.types;
import org.apache.atlas.AtlasException;
import org.apache.atlas.typesystem.ITypedReferenceableInstance;
import org.apache.atlas.typesystem.Referenceable;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
public class ClassTest extends BaseTest {
@Before
@BeforeMethod
public void setup() throws Exception {
super.setup();
}
......
......@@ -27,9 +27,9 @@ import org.apache.atlas.typesystem.ITypedReferenceableInstance;
import org.apache.atlas.typesystem.ITypedStruct;
import org.apache.atlas.typesystem.Referenceable;
import org.apache.atlas.typesystem.Struct;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
import java.math.BigDecimal;
import java.math.BigInteger;
......@@ -42,7 +42,7 @@ import static org.apache.atlas.typesystem.types.utils.TypesUtil.createRequiredAt
public class EnumTest extends BaseTest {
@Before
@BeforeMethod
public void setup() throws Exception {
super.setup();
}
......
......@@ -21,16 +21,16 @@ package org.apache.atlas.typesystem.types;
import org.apache.atlas.AtlasException;
import org.apache.atlas.typesystem.ITypedStruct;
import org.apache.atlas.typesystem.Struct;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
public class StructTest extends BaseTest {
StructType structType;
StructType recursiveStructType;
@Before
@BeforeMethod
public void setup() throws Exception {
super.setup();
structType = getTypeSystem().getDataType(StructType.class, STRUCT_TYPE_1);
......
......@@ -23,10 +23,9 @@ import org.apache.atlas.AtlasException;
import org.apache.atlas.typesystem.IStruct;
import org.apache.atlas.typesystem.ITypedStruct;
import org.apache.atlas.typesystem.Struct;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.Map;
......@@ -37,7 +36,7 @@ import static org.apache.atlas.typesystem.types.utils.TypesUtil.createTraitTypeD
public class TraitTest extends BaseTest {
@Before
@BeforeMethod
public void setup() throws Exception {
super.setup();
}
......@@ -54,7 +53,7 @@ public class TraitTest extends BaseTest {
* complete Path.
* For e.g. the 'b' attribute in A (that is a superType for B) is hidden the 'b' attribute
* in B.
* So it is availabel by the name 'A.B.D.b'
* So it is available by the name 'A.B.D.b'
*
* - Another way to set attributes is to cast. Casting a 'D' instance of 'B' makes the 'A.B.D
* .b' attribute
......@@ -176,8 +175,8 @@ public class TraitTest extends BaseTest {
createOptionalAttrDef("d", DataTypes.SHORT_TYPE));
HierarchicalTypeDefinition B = createTraitTypeDef("B", ImmutableList.<String>of("A"),
createOptionalAttrDef("b", DataTypes.BOOLEAN_TYPE));
HierarchicalTypeDefinition C =
createTraitTypeDef("C", ImmutableList.<String>of("A"), createOptionalAttrDef("c", DataTypes.BYTE_TYPE));
HierarchicalTypeDefinition C = createTraitTypeDef("C", ImmutableList.<String>of("A"),
createOptionalAttrDef("c", DataTypes.BYTE_TYPE));
HierarchicalTypeDefinition D = createTraitTypeDef("D", ImmutableList.<String>of("B", "C"),
createOptionalAttrDef("d", DataTypes.SHORT_TYPE));
......
......@@ -20,13 +20,14 @@ package org.apache.atlas.typesystem.builders
import org.apache.atlas.typesystem.TypesDef
import org.apache.atlas.typesystem.types.TypeSystem
import org.scalatest.{BeforeAndAfter, FunSuite}
import org.testng.annotations.BeforeMethod
abstract class BuilderTest extends FunSuite with BeforeAndAfter {
abstract class BuilderTest {
var tDef : TypesDef = null
before {
@BeforeMethod
def before {
TypeSystem.getInstance().reset()
val b = new TypesBuilder
......
......@@ -19,11 +19,11 @@
package org.apache.atlas.typesystem.builders
import org.apache.atlas.typesystem.types.{ClassType, Multiplicity, TypeSystem}
import org.testng.annotations.Test
class InstanceBuilderTest extends BuilderTest {
test("test1") {
@Test def test1 {
TypeSystem.getInstance().defineTypes(tDef)
val b = new InstanceBuilder
......
......@@ -20,12 +20,12 @@ package org.apache.atlas.typesystem.builders
import org.apache.atlas.AtlasException
import org.apache.atlas.typesystem.types.{ClassType, Multiplicity, TypeSystem}
import org.scalatest.{BeforeAndAfterAll, FunSuite}
import org.testng.annotations.{BeforeMethod,Test}
class MultiplicityTest {
class MultiplicityTest extends FunSuite with BeforeAndAfterAll {
override def beforeAll() = {
@BeforeMethod
def beforeAll {
TypeSystem.getInstance().reset()
val b = new TypesBuilder
......@@ -83,7 +83,8 @@ class MultiplicityTest extends FunSuite with BeforeAndAfterAll {
TypeSystem.getInstance().defineTypes(tDef)
}
test("test1") {
@Test
def test1 {
val b = new InstanceBuilder
import b._
......@@ -108,7 +109,8 @@ class MultiplicityTest extends FunSuite with BeforeAndAfterAll {
}
}
test("WrongMultiplicity") {
@Test(expectedExceptions = Array(classOf[AtlasException]) , expectedExceptionsMessageRegExp = "A multiplicty of more than one requires a collection type for attribute 'stringSet'")
def WrongMultiplicity {
val b = new TypesBuilder
import b._
val tDef = types {
......@@ -117,9 +119,6 @@ class MultiplicityTest extends FunSuite with BeforeAndAfterAll {
"stringSet" ~ (string, multiplicty(0, Int.MaxValue, true))
}
}
val me = intercept[AtlasException] {
TypeSystem.getInstance().defineTypes(tDef)
}
assert("A multiplicty of more than one requires a collection type for attribute 'stringSet'" == me.getMessage)
TypeSystem.getInstance().defineTypes(tDef)
}
}
......@@ -20,14 +20,12 @@ package org.apache.atlas.typesystem.builders
import org.apache.atlas.typesystem.json.TypesSerialization
import org.apache.atlas.typesystem.types.TypeSystem
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.testng.annotations.Test
@RunWith(classOf[JUnitRunner])
class TypesBuilderTest extends BuilderTest {
test("test1") {
@Test def test1 {
TypeSystem.getInstance().defineTypes(tDef)
println(TypesSerialization.toJson(TypeSystem.getInstance(), x => true))
......
......@@ -26,14 +26,15 @@ import org.apache.atlas.typesystem.{ITypedReferenceableInstance, ITypedStruct, R
import org.json4s.native.JsonMethods._
import org.json4s.native.Serialization.{write => swrite, _}
import org.json4s.{NoTypeHints, _}
import org.junit.{Assert, Before, Test}
import org.testng.Assert
import org.testng.annotations.{BeforeMethod,Test}
class SerializationTest extends BaseTest {
private[atlas] var structType: StructType = null
private[atlas] var recursiveStructType: StructType = null
@Before
@BeforeMethod
override def setup {
super.setup
structType = getTypeSystem.getDataType(classOf[StructType], BaseTest.STRUCT_TYPE_1).asInstanceOf[StructType]
......
......@@ -20,7 +20,8 @@ package org.apache.atlas.typesystem.json
import com.google.common.collect.ImmutableList
import org.apache.atlas.typesystem.types._
import org.junit.{Assert, Test}
import org.testng.Assert
import org.testng.annotations.Test
class TypesSerializationTest extends BaseTest with TypeHelpers {
......
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