You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/02/14 14:33:37 UTC
[isis] 04/06: ISIS-1846: fixes unit test (had accidentally changed
contract)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit c1d0732604857ebf0d9496914e737d824617e1e0
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Feb 14 14:26:44 2018 +0000
ISIS-1846: fixes unit test (had accidentally changed contract)
---
.../models/LowestCommonSuperclassClosureTest.java | 26 +++++++++-------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java b/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
index 523bf37..4114cda 100644
--- a/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
+++ b/core/viewer-wicket-model/src/test/java/org/apache/isis/viewer/wicket/model/models/LowestCommonSuperclassClosureTest.java
@@ -19,14 +19,14 @@
package org.apache.isis.viewer.wicket.model.models;
-import static org.junit.Assert.assertThat;
-
+import java.util.Arrays;
import java.util.List;
-import org.apache.isis.core.commons.matchers.IsisMatchers;
import org.junit.Test;
-import com.google.common.collect.Lists;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
+
+import static org.junit.Assert.assertThat;
public class LowestCommonSuperclassClosureTest {
@@ -37,30 +37,26 @@ public class LowestCommonSuperclassClosureTest {
static class Lion extends Mammal {}
@Test
- public void nothingInCommon() throws Exception {
- assertLowestCommonOfListIs(listOf(Animal.class, Mineral.class, Vegetable.class), Object.class);
+ public void nothingInCommon() {
+ assertLowestCommonOfListIs(Arrays.asList(new Animal(), new Mineral(), new Vegetable()), Object.class);
}
@Test
- public void superclassInCommon() throws Exception {
- assertLowestCommonOfListIs(listOf(Animal.class, Mammal.class), Animal.class);
+ public void superclassInCommon() {
+ assertLowestCommonOfListIs(Arrays.asList(new Animal(), new Mammal()), Animal.class);
}
@Test
- public void subclassInCommon() throws Exception {
- assertLowestCommonOfListIs(listOf(Lion.class, Lion.class), Lion.class);
+ public void subclassInCommon() {
+ assertLowestCommonOfListIs(Arrays.asList(new Lion(), new Lion()), Lion.class);
}
- private static void assertLowestCommonOfListIs(List<Class<?>> list, Class<?> expected) {
+ private static void assertLowestCommonOfListIs(List<Object> list, Class<?> expected) {
EntityCollectionModel.LowestCommonSuperclassFinder finder =
new EntityCollectionModel.LowestCommonSuperclassFinder();
finder.searchThrough(list);
assertThat(finder.getLowestCommonSuperclass(), IsisMatchers.classEqualTo(expected));
}
- private static List<Class<? extends Object>> listOf(Class<?>... classes) {
- return Lists.newArrayList(classes);
- }
-
}
--
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.