| Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java
|
| index 0c4a3ba6149f83dce48941806dd48fc169903034..645435bd27bf72b56c604b099d1c86988d77843c 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/type/UnionTypeImplTest.java
|
| @@ -22,22 +22,20 @@ import com.google.dart.engine.type.UnionType;
|
|
|
| import static com.google.dart.engine.element.ElementFactory.classElement;
|
|
|
| -import junit.framework.AssertionFailedError;
|
| -
|
| import java.util.Set;
|
|
|
| public class UnionTypeImplTest extends EngineTestCase {
|
| + private ClassElement classA;
|
| + private InterfaceType typeA;
|
| + private ClassElement classB;
|
| + private InterfaceType typeB;
|
|
|
| - private ClassElement classA = classElement("A");
|
| - private InterfaceType typeA = classA.getType();
|
| - private ClassElement classB = classElement("B", typeA);
|
| - private InterfaceType typeB = classB.getType();
|
| + private Type uA;
|
| + private Type uB;
|
| + private Type uAB;
|
| + private Type uBA;
|
|
|
| - private Type uA = UnionTypeImpl.union(typeA);
|
| - private Type uB = UnionTypeImpl.union(typeB);
|
| - private Type uAB = UnionTypeImpl.union(typeA, typeB);
|
| - private Type uBA = UnionTypeImpl.union(typeB, typeA);
|
| - private Type[] us = {uA, uB, uAB, uBA};
|
| + private Type[] us;
|
|
|
| public void fail_isSubtypeOf_element() {
|
| // Elements of union are sub types
|
| @@ -63,7 +61,7 @@ public class UnionTypeImplTest extends EngineTestCase {
|
| } catch (IllegalArgumentException e) {
|
| return;
|
| }
|
| - throw new AssertionFailedError("Expected illegal argument exception.");
|
| + fail("Expected illegal argument exception.");
|
| }
|
|
|
| public void test_equality_beingASubtypeOfAnElementIsNotSufficient() {
|
| @@ -116,7 +114,7 @@ public class UnionTypeImplTest extends EngineTestCase {
|
| UnionType u = (UnionType) UnionTypeImpl.union(uAB, typeA);
|
| for (Type t : u.getElements()) {
|
| if (t instanceof UnionType) {
|
| - throw new AssertionFailedError("Expected only non-union types but found " + t + "!");
|
| + fail("Expected only non-union types but found " + t + "!");
|
| }
|
| }
|
| }
|
| @@ -133,4 +131,20 @@ public class UnionTypeImplTest extends EngineTestCase {
|
| // Singleton unions collapse to the the single type.
|
| assertEquals("A", uA.toString());
|
| }
|
| +
|
| + @Override
|
| + protected void setUp() throws Exception {
|
| + super.setUp();
|
| + classA = classElement("A");
|
| + typeA = classA.getType();
|
| + classB = classElement("B", typeA);
|
| + typeB = classB.getType();
|
| +
|
| + uA = UnionTypeImpl.union(typeA);
|
| + uB = UnionTypeImpl.union(typeB);
|
| + uAB = UnionTypeImpl.union(typeA, typeB);
|
| + uBA = UnionTypeImpl.union(typeB, typeA);
|
| +
|
| + us = new Type[] {uA, uB, uAB, uBA};
|
| + }
|
| }
|
|
|