incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098948 [16/16] - in /incubator/isis/trunk/viewer: restful/applib/src/main/java/org/apache/isis/viewer/restful/applib/ restful/applib/src/main/java/org/apache/isis/viewer/restful/applib/providers/ restful/applib/src/main/java/org/apache/is...
Date Tue, 03 May 2011 07:44:50 GMT
Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_Pages.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_Pages.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_Pages.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_Pages.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer;
 
 import static org.hamcrest.Matchers.is;
@@ -27,7 +26,6 @@ import org.apache.isis.core.testsupport.
 import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
 import org.apache.isis.viewer.wicket.ui.pages.PageType;
 import org.apache.isis.viewer.wicket.ui.pages.home.HomePage;
-import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
 import org.apache.wicket.Page;
 import org.apache.wicket.markup.html.WebPage;
 import org.jmock.Expectations;
@@ -39,62 +37,62 @@ import org.junit.runner.RunWith;
 @RunWith(JMock.class)
 public class IsisWicketApplication_Pages {
 
-	private FixtureMockery context = new FixtureMockery() {
-		{
-			setImposteriser(ClassImposteriser.INSTANCE);
-		}
-	};
-
-	private IsisWicketApplication application;
-
-	@Test
-	public void delegatesToPageClassRegistryToObtainPageTypes() {
-		final PageType pageType = PageType.HOME;
-		final Class<HomePage> expectedPageClass = HomePage.class;
+    private final FixtureMockery context = new FixtureMockery() {
+        {
+            setImposteriser(ClassImposteriser.INSTANCE);
+        }
+    };
+
+    private IsisWicketApplication application;
+
+    @Test
+    public void delegatesToPageClassRegistryToObtainPageTypes() {
+        final PageType pageType = PageType.HOME;
+        final Class<HomePage> expectedPageClass = HomePage.class;
 
-		final PageClassRegistry mockPageClassRegistry = context.mock(PageClassRegistry.class);
-		application = new IsisWicketApplication() {
+        final PageClassRegistry mockPageClassRegistry = context.mock(PageClassRegistry.class);
+        application = new IsisWicketApplication() {
             private static final long serialVersionUID = 1L;
 
             @Override
-			public PageClassRegistry getPageClassRegistry() {
-				return mockPageClassRegistry;
-			}
-
-		};
-		context.checking(new Expectations() {
-			{
-				one(mockPageClassRegistry).getPageClass(pageType);
-				will(returnValue(expectedPageClass));
-			}
-		});
-		final Class<? extends Page> pageClass = application.getHomePage();
-		assertThat(expectedPageClass.isAssignableFrom(pageClass), is(true));
-	}
+            public PageClassRegistry getPageClassRegistry() {
+                return mockPageClassRegistry;
+            }
+
+        };
+        context.checking(new Expectations() {
+            {
+                one(mockPageClassRegistry).getPageClass(pageType);
+                will(returnValue(expectedPageClass));
+            }
+        });
+        final Class<? extends Page> pageClass = application.getHomePage();
+        assertThat(expectedPageClass.isAssignableFrom(pageClass), is(true));
+    }
 
-	@Test
-	public void delegatesToPageClassRegistryToObtainPageTypes_ForSignIn() {
+    @Test
+    public void delegatesToPageClassRegistryToObtainPageTypes_ForSignIn() {
 
-		final PageType pageType = PageType.SIGN_IN;
-		final Class<WebPage> expectedPageClass = WebPage.class;
+        final PageType pageType = PageType.SIGN_IN;
+        final Class<WebPage> expectedPageClass = WebPage.class;
 
-		final PageClassRegistry mockPageClassRegistry = context.mock(PageClassRegistry.class);
-		application = new IsisWicketApplication() {
+        final PageClassRegistry mockPageClassRegistry = context.mock(PageClassRegistry.class);
+        application = new IsisWicketApplication() {
             private static final long serialVersionUID = 1L;
 
             @Override
-			public PageClassRegistry getPageClassRegistry() {
-				return mockPageClassRegistry;
-			}
-		};
-		context.checking(new Expectations() {
-			{
-				one(mockPageClassRegistry).getPageClass(pageType);
-				will(returnValue(expectedPageClass));
-			}
-		});
-		final Class<? extends Page> pageClass = application.getSignInPageClass();
-		assertThat(expectedPageClass.isAssignableFrom(pageClass), is(true));
-	}
+            public PageClassRegistry getPageClassRegistry() {
+                return mockPageClassRegistry;
+            }
+        };
+        context.checking(new Expectations() {
+            {
+                one(mockPageClassRegistry).getPageClass(pageType);
+                will(returnValue(expectedPageClass));
+            }
+        });
+        final Class<? extends Page> pageClass = application.getSignInPageClass();
+        assertThat(expectedPageClass.isAssignableFrom(pageClass), is(true));
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_init.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_init.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_init.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication_init.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer;
 
 import static org.hamcrest.Matchers.is;
@@ -25,7 +24,6 @@ import static org.hamcrest.Matchers.notN
 import static org.junit.Assert.assertThat;
 
 import org.apache.isis.core.testsupport.jmock.AbstractJMockForInterfacesTest;
-import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
 import org.apache.wicket.settings.IResourceSettings;
 import org.apache.wicket.settings.ISecuritySettings;
 import org.junit.Before;
@@ -35,40 +33,43 @@ import com.google.inject.Injector;
 
 public class IsisWicketApplication_init extends AbstractJMockForInterfacesTest {
 
-	private IsisWicketApplication application;
+    private IsisWicketApplication application;
 
     private ISecuritySettings mockSecuritySettings;
     private IResourceSettings mockResourceSettings;
 
-	@Before
-	public void setUp() throws Exception {
-	    mockSecuritySettings = context.mock(ISecuritySettings.class);
+    @Before
+    public void setUp() throws Exception {
+        mockSecuritySettings = context.mock(ISecuritySettings.class);
         mockResourceSettings = context.mock(IResourceSettings.class);
-	    ignoring(mockSecuritySettings);
+        ignoring(mockSecuritySettings);
         ignoring(mockResourceSettings);
-	    
-		application = new IsisWicketApplication() {
+
+        application = new IsisWicketApplication() {
             private static final long serialVersionUID = 1L;
+
             @Override
             protected void initWicketComponentInjection(final Injector injector) {
                 // ignore
             }
+
             @Override
             public ISecuritySettings getSecuritySettings() {
                 return mockSecuritySettings;
             }
+
             @Override
             public IResourceSettings getResourceSettings() {
                 return mockResourceSettings;
             }
-		};
-	}
+        };
+    }
 
-	@Test
-	public void injectedApplicationCssUrl() {
-	    application.init();
-	    assertThat(application.getApplicationCssUrl(), is(notNullValue()));
-	}
+    @Test
+    public void injectedApplicationCssUrl() {
+        application.init();
+        assertThat(application.getApplicationCssUrl(), is(notNullValue()));
+    }
 
     @Test
     public void injectedComponentFactoryRegistry() {

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicket_providers.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicket_providers.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicket_providers.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/IsisWicket_providers.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer;
 
 import static org.hamcrest.Matchers.is;
@@ -27,7 +26,6 @@ import static org.junit.Assert.assertTha
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
 import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
 import org.apache.isis.runtimes.dflt.runtime.system.IsisSystem;
-import org.apache.isis.viewer.wicket.viewer.IsisWicketModule;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -46,11 +44,11 @@ public class IsisWicket_providers {
         injector = Guice.createInjector(wicketObjectsModule);
     }
 
-	@Test
-	public void deploymentType() {
-	    final DeploymentType instance = injector.getInstance(DeploymentType.class);
-	    assertThat(instance, is(notNullValue()));
-	}
+    @Test
+    public void deploymentType() {
+        final DeploymentType instance = injector.getInstance(DeploymentType.class);
+        assertThat(instance, is(notNullValue()));
+    }
 
     @Test
     public void configurationBuilder() {
@@ -58,8 +56,8 @@ public class IsisWicket_providers {
         assertThat(instance, is(notNullValue()));
     }
 
-
-    @Ignore // need to handle config
+    @Ignore
+    // need to handle config
     @Test
     public void isisSystem() {
         final IsisSystem instance = injector.getInstance(IsisSystem.class);

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/WicketObjectModule_bindingsStandard.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/WicketObjectModule_bindingsStandard.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/WicketObjectModule_bindingsStandard.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/WicketObjectModule_bindingsStandard.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer;
 
 import static org.hamcrest.Matchers.instanceOf;
@@ -31,7 +30,6 @@ import org.apache.isis.viewer.wicket.ui.
 import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistry;
 import org.apache.isis.viewer.wicket.ui.pages.PageClassList;
 import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
-import org.apache.isis.viewer.wicket.viewer.IsisWicketModule;
 import org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryListDefault;
 import org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault;
 import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassListDefault;
@@ -50,20 +48,18 @@ public class WicketObjectModule_bindings
 
     private IsisWicketModule wicketObjectsModule;
     private Injector injector;
-    private Class<?> from;
-    private Class<?> to;
-    
+    private final Class<?> from;
+    private final Class<?> to;
+
     @Parameters
     public static Collection<Object[]> params() {
-        return Arrays.asList(new Object[][]{
-                {ComponentFactoryList.class, ComponentFactoryListDefault.class},
-                {ComponentFactoryRegistry.class, ComponentFactoryRegistryDefault.class},
-                {PageClassList.class, PageClassListDefault.class},
-                {PageClassRegistry.class, PageClassRegistryDefault.class},
-                });
+        return Arrays.asList(new Object[][] { { ComponentFactoryList.class, ComponentFactoryListDefault.class
},
+            { ComponentFactoryRegistry.class, ComponentFactoryRegistryDefault.class },
+            { PageClassList.class, PageClassListDefault.class },
+            { PageClassRegistry.class, PageClassRegistryDefault.class }, });
     }
-    
-    public WicketObjectModule_bindingsStandard(Class<?> from, Class<?> to) {
+
+    public WicketObjectModule_bindingsStandard(final Class<?> from, final Class<?>
to) {
         this.from = from;
         this.to = to;
     }
@@ -74,11 +70,10 @@ public class WicketObjectModule_bindings
         injector = Guice.createInjector(wicketObjectsModule);
     }
 
-	@Test
-	public void binding() {
-		final Object instance = injector.getInstance(from);
-		assertThat(instance, is(instanceOf(to)));
-	}
-
+    @Test
+    public void binding() {
+        final Object instance = injector.getInstance(from);
+        assertThat(instance, is(instanceOf(to)));
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_Authenticate.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_Authenticate.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_Authenticate.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_Authenticate.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.app.wicket;
 
 import static org.hamcrest.Matchers.is;
@@ -42,53 +41,55 @@ import org.junit.runner.RunWith;
 @RunWith(JMock.class)
 public class AuthenticatedWebSessionForIsis_Authenticate {
 
-	private FixtureMockery context = new FixtureMockery() {{
-		setImposteriser(ClassImposteriser.INSTANCE);
-	}};
-	
-	private AuthenticatedWebSessionForIsis webSession;
-	private Request stubRequest;
-	
-	@Before
-	public void setUp() throws Exception {
-		stubRequest = context.fixture(Fixture_Request_Stub.class).object();
-	}
-	
-	@Test
-	public void delegatesToAuthenticationManagerAndCachesAuthSessionIfOk() {
-		final AuthenticationManager mockAuthMgr = context.fixture(Fixture_AuthenticationManager_AuthenticateOk.class).object();
-		webSession = new AuthenticatedWebSessionForIsis(stubRequest) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			protected AuthenticationManager getAuthenticationManager() {
-				return mockAuthMgr;
-			}
-		};
-		assertThat(webSession.authenticate("jsmith", "secret"), is(true));
-		assertThat(webSession.getAuthenticationSession(), is(not(nullValue())));
-	}
-
-	
-	@Test
-	public void delegatesToAuthenticationManagerAndHandlesIfNotAuthenticated() {
-		final AuthenticationManager mockAuthMgr = context.mock(AuthenticationManager.class);
-		context.checking(new Expectations() {
-			{
-				one(mockAuthMgr).authenticate(with(any(AuthenticationRequest.class)));
-				will(returnValue(null));
-			}
-		});
-		webSession = new AuthenticatedWebSessionForIsis(stubRequest) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			protected AuthenticationManager getAuthenticationManager() {
-				return mockAuthMgr;
-			}
-		};
-		assertThat(webSession.authenticate("jsmith", "secret"), is(false));
-		assertThat(webSession.getAuthenticationSession(), is(nullValue()));
-	}
+    private final FixtureMockery context = new FixtureMockery() {
+        {
+            setImposteriser(ClassImposteriser.INSTANCE);
+        }
+    };
+
+    private AuthenticatedWebSessionForIsis webSession;
+    private Request stubRequest;
+
+    @Before
+    public void setUp() throws Exception {
+        stubRequest = context.fixture(Fixture_Request_Stub.class).object();
+    }
+
+    @Test
+    public void delegatesToAuthenticationManagerAndCachesAuthSessionIfOk() {
+        final AuthenticationManager mockAuthMgr =
+            context.fixture(Fixture_AuthenticationManager_AuthenticateOk.class).object();
+        webSession = new AuthenticatedWebSessionForIsis(stubRequest) {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            protected AuthenticationManager getAuthenticationManager() {
+                return mockAuthMgr;
+            }
+        };
+        assertThat(webSession.authenticate("jsmith", "secret"), is(true));
+        assertThat(webSession.getAuthenticationSession(), is(not(nullValue())));
+    }
+
+    @Test
+    public void delegatesToAuthenticationManagerAndHandlesIfNotAuthenticated() {
+        final AuthenticationManager mockAuthMgr = context.mock(AuthenticationManager.class);
+        context.checking(new Expectations() {
+            {
+                one(mockAuthMgr).authenticate(with(any(AuthenticationRequest.class)));
+                will(returnValue(null));
+            }
+        });
+        webSession = new AuthenticatedWebSessionForIsis(stubRequest) {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            protected AuthenticationManager getAuthenticationManager() {
+                return mockAuthMgr;
+            }
+        };
+        assertThat(webSession.authenticate("jsmith", "secret"), is(false));
+        assertThat(webSession.getAuthenticationSession(), is(nullValue()));
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_DownCastsInheritedFunctionality.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_DownCastsInheritedFunctionality.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_DownCastsInheritedFunctionality.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_DownCastsInheritedFunctionality.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.app.wicket;
 
 import org.junit.Before;
@@ -26,19 +25,18 @@ import org.junit.Test;
 
 public class AuthenticatedWebSessionForIsis_DownCastsInheritedFunctionality {
 
-	@Before
-	public void setUp() throws Exception {
-	}
-	
-	@Ignore("thread-safe downcast of inherited functionality")
-	@Test
-	public void testGet() {
-	}
-	
-	@Ignore("thread-safe downcast of inherited functionality")
-	@Test
-	public void testGetClientInfo() {
-	}
-	
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    @Ignore("thread-safe downcast of inherited functionality")
+    @Test
+    public void testGet() {
+    }
+
+    @Ignore("thread-safe downcast of inherited functionality")
+    @Test
+    public void testGetClientInfo() {
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_Instantiation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_Instantiation.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_Instantiation.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_Instantiation.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.app.wicket;
 
 import org.apache.isis.core.testsupport.jmock.FixtureMockery;
@@ -32,19 +31,21 @@ import org.junit.runner.RunWith;
 @RunWith(JMock.class)
 public class AuthenticatedWebSessionForIsis_Instantiation {
 
-	private FixtureMockery context = new FixtureMockery() {{
-		setImposteriser(ClassImposteriser.INSTANCE);
-	}};
-	
-	@Test
-	public void canInstantiateIfProvideRequest() {
-		final Request stubRequest = context.fixture(Fixture_Request_Stub.class).object();
-		new AuthenticatedWebSessionForIsis(stubRequest);
-	}
-
-	@Test(expected=IllegalArgumentException.class)
-	public void requestMustBeProvided() {
-		new AuthenticatedWebSessionForIsis(null);
-	}
+    private final FixtureMockery context = new FixtureMockery() {
+        {
+            setImposteriser(ClassImposteriser.INSTANCE);
+        }
+    };
+
+    @Test
+    public void canInstantiateIfProvideRequest() {
+        final Request stubRequest = context.fixture(Fixture_Request_Stub.class).object();
+        new AuthenticatedWebSessionForIsis(stubRequest);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void requestMustBeProvided() {
+        new AuthenticatedWebSessionForIsis(null);
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_NotYetImplemented.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_NotYetImplemented.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_NotYetImplemented.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_NotYetImplemented.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.app.wicket;
 
 import org.junit.Before;
@@ -26,13 +25,13 @@ import org.junit.Test;
 
 public class AuthenticatedWebSessionForIsis_NotYetImplemented {
 
-	@Before
-	public void setUp() throws Exception {
-	}
-	
-	@Ignore("not yet implemented")
-	@Test
-	public void testIsDebugMode() {
-	}
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    @Ignore("not yet implemented")
+    @Test
+    public void testIsDebugMode() {
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_SignIn.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_SignIn.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_SignIn.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_SignIn.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.app.wicket;
 
 import static org.hamcrest.Matchers.is;
@@ -38,30 +37,33 @@ import org.junit.runner.RunWith;
 @RunWith(JMock.class)
 public class AuthenticatedWebSessionForIsis_SignIn {
 
-	private FixtureMockery context = new FixtureMockery() {{
-		setImposteriser(ClassImposteriser.INSTANCE);
-	}};
-	
-	private AuthenticatedWebSessionForIsis webSession;
-	private Request stubRequest;
-	
-	@Before
-	public void setUp() throws Exception {
-		stubRequest = context.fixture(Fixture_Request_Stub.class).object();
-	}
-	
-	@Test
-	public void signInJustDelegatesToAuthenticateAndSavesState() {
-		final AuthenticationManager mockAuthMgr = context.fixture(Fixture_AuthenticationManager_AuthenticateOk.class).object();
-		webSession = new AuthenticatedWebSessionForIsis(stubRequest) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			protected AuthenticationManager getAuthenticationManager() {
-				return mockAuthMgr;
-			}
-		};
-		webSession.signIn("john", "secret");
-		assertThat(webSession.isSignedIn(), is(true));
-	}
+    private final FixtureMockery context = new FixtureMockery() {
+        {
+            setImposteriser(ClassImposteriser.INSTANCE);
+        }
+    };
+
+    private AuthenticatedWebSessionForIsis webSession;
+    private Request stubRequest;
+
+    @Before
+    public void setUp() throws Exception {
+        stubRequest = context.fixture(Fixture_Request_Stub.class).object();
+    }
+
+    @Test
+    public void signInJustDelegatesToAuthenticateAndSavesState() {
+        final AuthenticationManager mockAuthMgr =
+            context.fixture(Fixture_AuthenticationManager_AuthenticateOk.class).object();
+        webSession = new AuthenticatedWebSessionForIsis(stubRequest) {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            protected AuthenticationManager getAuthenticationManager() {
+                return mockAuthMgr;
+            }
+        };
+        webSession.signIn("john", "secret");
+        assertThat(webSession.isSignedIn(), is(true));
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_ThreadManagement.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_ThreadManagement.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_ThreadManagement.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/AuthenticatedWebSessionForIsis_ThreadManagement.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.app.wicket;
 
 import static org.hamcrest.Matchers.is;
@@ -36,31 +35,33 @@ import org.junit.runner.RunWith;
 @RunWith(JMock.class)
 public class AuthenticatedWebSessionForIsis_ThreadManagement {
 
-	private FixtureMockery context = new FixtureMockery() {{
-		setImposteriser(ClassImposteriser.INSTANCE);
-	}};
-	
-	private AuthenticatedWebSessionForIsis webSession;
-	private Request stubRequest;
-	
-	@Before
-	public void setUp() throws Exception {
-		stubRequest = context.fixture(Fixture_Request_Stub.class).object();
-		webSession = new AuthenticatedWebSessionForIsis(stubRequest);
-	}
-
-	@Test
-	public void testRegisterUseByThread() {
-		assertThat(webSession.getThreadUsage(), is(0));
-		webSession.registerUseByThread();
-		assertThat(webSession.getThreadUsage(), is(1));
-	}
-
-	@Test
-	public void testDeregisterUseByThread() {
-		webSession.registerUseByThread();
-		assertThat(webSession.getThreadUsage(), is(1));
-		webSession.deregisterUseByThread();
-		assertThat(webSession.getThreadUsage(), is(0));
-	}
+    private final FixtureMockery context = new FixtureMockery() {
+        {
+            setImposteriser(ClassImposteriser.INSTANCE);
+        }
+    };
+
+    private AuthenticatedWebSessionForIsis webSession;
+    private Request stubRequest;
+
+    @Before
+    public void setUp() throws Exception {
+        stubRequest = context.fixture(Fixture_Request_Stub.class).object();
+        webSession = new AuthenticatedWebSessionForIsis(stubRequest);
+    }
+
+    @Test
+    public void testRegisterUseByThread() {
+        assertThat(webSession.getThreadUsage(), is(0));
+        webSession.registerUseByThread();
+        assertThat(webSession.getThreadUsage(), is(1));
+    }
+
+    @Test
+    public void testDeregisterUseByThread() {
+        webSession.registerUseByThread();
+        assertThat(webSession.getThreadUsage(), is(1));
+        webSession.deregisterUseByThread();
+        assertThat(webSession.getThreadUsage(), is(0));
+    }
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/Fixture_AuthenticatedWebSessionForIsis_SignedIn.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/Fixture_AuthenticatedWebSessionForIsis_SignedIn.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/Fixture_AuthenticatedWebSessionForIsis_SignedIn.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/Fixture_AuthenticatedWebSessionForIsis_SignedIn.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.app.wicket;
 
 import static org.hamcrest.Matchers.is;
@@ -37,30 +36,31 @@ import org.apache.wicket.Request;
  */
 public class Fixture_AuthenticatedWebSessionForIsis_SignedIn extends MockFixtureAdapter<AuthenticatedWebSessionForIsis>
{
 
-	private AuthenticatedWebSessionForIsis webSession;
+    private AuthenticatedWebSessionForIsis webSession;
 
-	public void setUp(MockFixture.Context fixtureContext) {
-		final FixtureMockery mockery = fixtureContext.getMockery();
-		
-		
-		final AuthenticationManager mockAuthMgr = mockery.fixture(Fixture_AuthenticationManager_AuthenticateOk.class).object();
-		Request stubRequest = mockery.fixture(Fixture_Request_Stub.class).object();
-		
-		webSession = new AuthenticatedWebSessionForIsis(stubRequest) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			protected AuthenticationManager getAuthenticationManager() {
-				return mockAuthMgr;
-			}
-		};
-		webSession.signIn("john", "secret");
-		assertThat(webSession.isSignedIn(), is(true));
-
-	}
-	
-	@Override
-	public AuthenticatedWebSessionForIsis object() {
-		return webSession;
-	}
+    @Override
+    public void setUp(final MockFixture.Context fixtureContext) {
+        final FixtureMockery mockery = fixtureContext.getMockery();
+
+        final AuthenticationManager mockAuthMgr =
+            mockery.fixture(Fixture_AuthenticationManager_AuthenticateOk.class).object();
+        final Request stubRequest = mockery.fixture(Fixture_Request_Stub.class).object();
+
+        webSession = new AuthenticatedWebSessionForIsis(stubRequest) {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            protected AuthenticationManager getAuthenticationManager() {
+                return mockAuthMgr;
+            }
+        };
+        webSession.signIn("john", "secret");
+        assertThat(webSession.isSignedIn(), is(true));
+
+    }
+
+    @Override
+    public AuthenticatedWebSessionForIsis object() {
+        return webSession;
+    }
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/WebRequestCycleForIsisTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/WebRequestCycleForIsisTest.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/WebRequestCycleForIsisTest.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/app/wicket/WebRequestCycleForIsisTest.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.app.wicket;
 
 import static org.junit.Assert.fail;
@@ -32,47 +31,47 @@ import org.junit.Test;
 
 public class WebRequestCycleForIsisTest extends AbstractJMockForClassesTest {
 
-	@Ignore
-	@Test
-	public void testOnBeginRequest() {
+    @Ignore
+    @Test
+    public void testOnBeginRequest() {
+        fail("Not yet implemented");
+    }
+
+    @Ignore
+    @Test
+    public void testOnEndRequest() {
+        fail("Not yet implemented");
+    }
+
+    @Test
+    public void testIsisWebRequestCycle() {
+        final WebApplication mockApplication = context.mockAndIgnoreAnyInteraction(WebApplication.class);
+        final WebRequest mockRequest = context.mock(WebRequest.class);
+        final Response mockResponse = context.mock(Response.class);
+        new WebRequestCycleForIsis(mockApplication, mockRequest, mockResponse);
+    }
+
+    @Ignore("downcast")
+    @Test
+    public void testGetWebSession() {
+    }
+
+    @Ignore
+    @Test
+    public void testGetIsisContext() {
+        fail("Not yet implemented");
+    }
+
+    @Ignore
+    @Test
+    public void testNewClientInfo() {
         fail("Not yet implemented");
-	}
+    }
 
-	@Ignore
-	@Test
-	public void testOnEndRequest() {
-		fail("Not yet implemented");
-	}
-
-	@Test
-	public void testIsisWebRequestCycle() {
-		final WebApplication mockApplication = context.mockAndIgnoreAnyInteraction(WebApplication.class);
-		final WebRequest mockRequest = context.mock(WebRequest.class);
-		final Response mockResponse = context.mock(Response.class);
-		new WebRequestCycleForIsis(mockApplication, mockRequest, mockResponse);
-	}
-
-	@Ignore("downcast")
-	@Test
-	public void testGetWebSession() {
-	}
-
-	@Ignore
-	@Test
-	public void testGetIsisContext() {
-		fail("Not yet implemented");
-	}
-
-	@Ignore
-	@Test
-	public void testNewClientInfo() {
-		fail("Not yet implemented");
-	}
-
-	@Ignore
-	@Test
-	public void testGetTransactionManager() {
-		fail("Not yet implemented");
-	}
+    @Ignore
+    @Test
+    public void testGetTransactionManager() {
+        fail("Not yet implemented");
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.pages;
 
 import org.apache.isis.viewer.wicket.ui.pages.PageClassList;
@@ -36,35 +35,34 @@ import org.junit.runner.RunWith;
 @RunWith(JMock.class)
 public class PageClassListDefault_Instantiation {
 
-	private Mockery context = new JUnit4Mockery();
-	
-	
-	@Before
-	public void setUp() throws Exception {
-	}
-
-	@After
-	public void tearDown() throws Exception {
-	}
-
-	@Test
-	public void shouldCauseAllPagesToBeRegistered() {
-		// necessary to provide an implementation that will register
-		// all pages with the registry.
-		final PageClassListDefault pageClassList = new PageClassListDefault();
-		new PageClassRegistryDefault(pageClassList);
-	}
-
-	@Test(expected=IllegalStateException.class)
-	public void shouldFailIfNoPagesRegistered() {
-		// no side effects, ie doesn't register
-		final PageClassList mockPageClassList = context.mock(PageClassList.class);
-		context.checking(new Expectations() {
-			{
-				mockPageClassList.registerPages(with(any(PageRegistrySpi.class)));
-			}
-		});
-		new PageClassRegistryDefault(mockPageClassList);
-	}
+    private final Mockery context = new JUnit4Mockery();
+
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public void shouldCauseAllPagesToBeRegistered() {
+        // necessary to provide an implementation that will register
+        // all pages with the registry.
+        final PageClassListDefault pageClassList = new PageClassListDefault();
+        new PageClassRegistryDefault(pageClassList);
+    }
+
+    @Test(expected = IllegalStateException.class)
+    public void shouldFailIfNoPagesRegistered() {
+        // no side effects, ie doesn't register
+        final PageClassList mockPageClassList = context.mock(PageClassList.class);
+        context.checking(new Expectations() {
+            {
+                mockPageClassList.registerPages(with(any(PageRegistrySpi.class)));
+            }
+        });
+        new PageClassRegistryDefault(mockPageClassList);
+    }
 
 }

Modified: incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_RegistrationAndCaching.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_RegistrationAndCaching.java?rev=1098948&r1=1098947&r2=1098948&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_RegistrationAndCaching.java
(original)
+++ incubator/isis/trunk/viewer/wicket/viewer/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_RegistrationAndCaching.java
Tue May  3 07:44:41 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.wicket.viewer.pages;
 
 import static org.hamcrest.Matchers.is;
@@ -36,32 +35,33 @@ import org.junit.Test;
 
 public class PageClassListDefault_RegistrationAndCaching {
 
-	private PageClassRegistryDefault registryImpl;
-	
-	@Before
-	public void setUp() throws Exception {
-		// necessary to provide an implementation that will register
-		// all pages with the registry.
-		final PageClassListDefault pageClassList = new PageClassListDefault();
-		registryImpl =new PageClassRegistryDefault(pageClassList);
-	}
-
-	@Test
-	public void cachesPageByPageType() {
-		final Class<? extends Page> pageClass = registryImpl.getPageClass(PageType.ACTION);
-		assertThat(pageClass, is(not(nullValue())));
-	}
-
-	@Test
-	public void canRegisterNewPageType() {
-		class TestingActionPage extends ActionPage {
-			TestingActionPage() { super((ActionModel)null); }
-		}
-		registryImpl.registerPage(PageType.ACTION, TestingActionPage.class);
-
-		final Class<? extends Page> pageClass = registryImpl.getPageClass(PageType.ACTION);
-		assertThat(pageClass.equals(TestingActionPage.class),  is(true));
-	}
+    private PageClassRegistryDefault registryImpl;
 
-}
+    @Before
+    public void setUp() throws Exception {
+        // necessary to provide an implementation that will register
+        // all pages with the registry.
+        final PageClassListDefault pageClassList = new PageClassListDefault();
+        registryImpl = new PageClassRegistryDefault(pageClassList);
+    }
+
+    @Test
+    public void cachesPageByPageType() {
+        final Class<? extends Page> pageClass = registryImpl.getPageClass(PageType.ACTION);
+        assertThat(pageClass, is(not(nullValue())));
+    }
+
+    @Test
+    public void canRegisterNewPageType() {
+        class TestingActionPage extends ActionPage {
+            TestingActionPage() {
+                super((ActionModel) null);
+            }
+        }
+        registryImpl.registerPage(PageType.ACTION, TestingActionPage.class);
+
+        final Class<? extends Page> pageClass = registryImpl.getPageClass(PageType.ACTION);
+        assertThat(pageClass.equals(TestingActionPage.class), is(true));
+    }
 
+}



Mime
View raw message