diff options
author | Alexander Kiselev | 2016-04-07 11:03:24 +0000 |
---|---|---|
committer | Alexander Kiselev | 2016-04-07 11:47:30 +0000 |
commit | 61da1cd52838a98c8c601fbe55b364b730b537ae (patch) | |
tree | b7d05fa9fd8cf29c2b0176b6c19a2330640649d6 | |
parent | fdb60a8b04131e7cfae0d50dad0eefcbbbf69b97 (diff) | |
download | eclipse.platform.runtime-Y20160407-1000.tar.gz eclipse.platform.runtime-Y20160407-1000.tar.xz eclipse.platform.runtime-Y20160407-1000.zip |
Bug 491211 - Prefer usage of @Test(expected = ExpectedException.class)Y20160407-1000
in e4.core.tests
Change-Id: I27d429a6251c1e70f0eece7d74d933a8f9f40141
Signed-off-by: Alexander Kiselev <alexander.kiselev@outlook.de>
-rw-r--r-- | tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/GenericsListTest.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/GenericsListTest.java b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/GenericsListTest.java index be76f7a1a..011ae3434 100644 --- a/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/GenericsListTest.java +++ b/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/contexts/inject/GenericsListTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 vogella GmbH and others. + * Copyright (c) 2015, 2016 vogella GmbH and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,7 +11,6 @@ package org.eclipse.e4.core.internal.tests.contexts.inject; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; import java.util.ArrayList; import java.util.List; @@ -62,7 +61,7 @@ public class GenericsListTest { assertEquals(list, userObject.field); } - @Test + @Test(expected = ClassCastException.class) public void testTypeErasure() { List<Integer> list = new ArrayList<>(); @@ -78,13 +77,7 @@ public class GenericsListTest { // of the type erasure assertEquals(list, userObject.field); - // create ClassCastExeception - try { - userObject.combineIt(); - fail(); - } catch (ClassCastException e) { - // this exception is supposed to happen - } + userObject.combineIt(); } |