This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new dfaa0db  ISIS-1865 fix test-setup by adding default config
dfaa0db is described below

commit dfaa0db6e20824b4e25dc92298287cebf01b972f
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Mon Feb 19 10:19:14 2018 +0100

    ISIS-1865 fix test-setup by adding default config
---
 .../WicketObjectModule_bindingsStandard.java       | 63 +++++++++++++---------
 1 file changed, 39 insertions(+), 24 deletions(-)

diff --git 
a/core/viewer-wicket-impl/src/test/java/org/apache/isis/viewer/wicket/viewer/WicketObjectModule_bindingsStandard.java
 
b/core/viewer-wicket-impl/src/test/java/org/apache/isis/viewer/wicket/viewer/WicketObjectModule_bindingsStandard.java
index 6121101..ac9a592 100644
--- 
a/core/viewer-wicket-impl/src/test/java/org/apache/isis/viewer/wicket/viewer/WicketObjectModule_bindingsStandard.java
+++ 
b/core/viewer-wicket-impl/src/test/java/org/apache/isis/viewer/wicket/viewer/WicketObjectModule_bindingsStandard.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertThat;
 import java.util.Arrays;
 import java.util.Collection;
 
+import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
@@ -34,7 +35,8 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
-
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistrar;
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistry;
 import org.apache.isis.viewer.wicket.ui.pages.PageClassList;
@@ -47,32 +49,45 @@ import 
org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassRegistryDe
 @RunWith(Parameterized.class)
 public class WicketObjectModule_bindingsStandard {
 
-    private IsisWicketModule wicketObjectsModule;
-    private Injector injector;
-    private final Class<?> from;
-    private final Class<?> to;
+       private IsisWicketModule wicketObjectsModule;
+       private Injector injector;
+       private final Class<?> from;
+       private final Class<?> to;
+
+       @Parameters
+       public static Collection<Object[]> params() {
+               return Arrays.asList(new Object[][] { 
+                       { ComponentFactoryRegistrar.class, 
ComponentFactoryRegistrarDefault.class }, 
+                       { ComponentFactoryRegistry.class, 
ComponentFactoryRegistryDefault.class }, 
+                       { PageClassList.class, PageClassListDefault.class },
+                       { PageClassRegistry.class, 
PageClassRegistryDefault.class }, 
+               });
+       }
+
+       public WicketObjectModule_bindingsStandard(final Class<?> from, final 
Class<?> to) {
+               this.from = from;
+               this.to = to;
+       }
 
-    @Parameters
-    public static Collection<Object[]> params() {
-        return Arrays.asList(new Object[][] { { 
ComponentFactoryRegistrar.class, ComponentFactoryRegistrarDefault.class }, { 
ComponentFactoryRegistry.class, ComponentFactoryRegistryDefault.class }, { 
PageClassList.class, PageClassListDefault.class },
-                { PageClassRegistry.class, PageClassRegistryDefault.class }, 
});
-    }
+       @Before
+       public void setUp() throws Exception {
+               wicketObjectsModule = new IsisWicketModule();
+               injector = Guice.createInjector(wicketObjectsModule, new 
ConfigModule());
+       }
 
-    public WicketObjectModule_bindingsStandard(final Class<?> from, final 
Class<?> to) {
-        this.from = from;
-        this.to = to;
-    }
+       @Test
+       public void binding() {
+               final Object instance = injector.getInstance(from);
+               assertThat(instance, is(instanceOf(to)));
+       }
 
-    @Before
-    public void setUp() throws Exception {
-        wicketObjectsModule = new IsisWicketModule();
-        injector = Guice.createInjector(wicketObjectsModule);
-    }
+       // -- CONFIGURATION BINDING
 
-    @Test
-    public void binding() {
-        final Object instance = injector.getInstance(from);
-        assertThat(instance, is(instanceOf(to)));
-    }
+       public static class ConfigModule extends AbstractModule {
+               @Override 
+               protected void configure() {
+                       
bind(IsisConfiguration.class).to(IsisConfigurationDefault.class);
+               }
+       }
 
 }

-- 
To stop receiving notification emails like this one, please contact
ahu...@apache.org.

Reply via email to