incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098935 [14/20] - in /incubator/isis/trunk/runtimes/dflt: bytecode/dflt/src/main/java/org/apache/isis/runtimes/dflt/bytecode/dflt/classsubstitutor/ bytecode/dflt/src/main/java/org/apache/isis/runtimes/dflt/bytecode/dflt/objectfactory/ byte...
Date Tue, 03 May 2011 06:22:23 GMT
Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfileLoaderDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfileLoaderDefault.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfileLoaderDefault.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfileLoaderDefault.java Tue May  3 06:22:09 2011
@@ -113,12 +113,12 @@ public class UserProfileLoaderDefault im
     // //////////////////////////////////////////////////////
 
     @Override
-    public void saveAsDefault(UserProfile userProfile) {
+    public void saveAsDefault(final UserProfile userProfile) {
         store.save("_default", userProfile);
     }
 
     @Override
-    public void saveForUser(String userName, UserProfile userProfile) {
+    public void saveForUser(final String userName, final UserProfile userProfile) {
         store.save(userName, userProfile);
     }
 
@@ -127,13 +127,13 @@ public class UserProfileLoaderDefault im
     // //////////////////////////////////////////////////////
 
     @Override
-    public void saveSession(List<ObjectAdapter> objects) {
+    public void saveSession(final List<ObjectAdapter> objects) {
         loadOrCreateProfile();
         userProfile.saveObjects(objects);
         save(userProfile);
     }
 
-    private void save(UserProfile userProfile) {
+    private void save(final UserProfile userProfile) {
         saveForUser(userName(), userProfile);
     }
 
@@ -142,9 +142,9 @@ public class UserProfileLoaderDefault im
     // //////////////////////////////////////////////////////
 
     @Override
-    public UserProfile getProfile(AuthenticationSession session) {
-        String userName = session.getUserName();
-        UserProfile profile = store.getUserProfile(userName);
+    public UserProfile getProfile(final AuthenticationSession session) {
+        final String userName = session.getUserName();
+        final UserProfile profile = store.getUserProfile(userName);
         userProfile = profile != null ? profile : createUserProfile(userName);
         return userProfile;
     }
@@ -162,14 +162,14 @@ public class UserProfileLoaderDefault im
 
     private void loadOrCreateProfile() {
         if (userProfile == null) {
-            String userName = userName();
-            UserProfile profile = store.getUserProfile(userName);
+            final String userName = userName();
+            final UserProfile profile = store.getUserProfile(userName);
             userProfile = profile != null ? profile : createUserProfile(userName);
         }
     }
 
-    private UserProfile createUserProfile(String userName) {
-        UserProfile template = store.getUserProfile("_default");
+    private UserProfile createUserProfile(final String userName) {
+        final UserProfile template = store.getUserProfile("_default");
         if (template == null) {
             return createDefaultProfile(userName);
         } else {
@@ -177,24 +177,24 @@ public class UserProfileLoaderDefault im
         }
     }
 
-    private UserProfile createDefaultProfile(String userName) {
-        UserProfile profile = new UserProfile();
+    private UserProfile createDefaultProfile(final String userName) {
+        final UserProfile profile = new UserProfile();
         profile.newPerspective(DEFAULT_PERSPECTIVE_NAME
             + (IsisContext.getDeploymentType().isExploring() ? EXPLORATION : ""));
 
-        List<Object> services = getServices();
+        final List<Object> services = getServices();
         if (services.size() == 0 && mode == Mode.STRICT) {
             throw new IsisException("No known services");
         }
-        for (Object service : services) {
+        for (final Object service : services) {
             profile.getPerspective().addToServices(service);
         }
         LOG.info("creating exploration UserProfile for " + userName);
         return profile;
     }
 
-    private UserProfile createProfileFromTemplate(String userName, UserProfile template) {
-        UserProfile userProfile = new UserProfile();
+    private UserProfile createProfileFromTemplate(final String userName, final UserProfile template) {
+        final UserProfile userProfile = new UserProfile();
         userProfile.copy(template);
         LOG.info("creating UserProfile, from template, for " + userName);
         return userProfile;
@@ -205,7 +205,7 @@ public class UserProfileLoaderDefault im
     // //////////////////////////////////////////////////////
 
     @Override
-    public void debugData(DebugBuilder debug) {
+    public void debugData(final DebugBuilder debug) {
         debug.appendln("Store", store.toString());
         debug.appendln("Mode", mode);
 
@@ -228,7 +228,7 @@ public class UserProfileLoaderDefault im
     }
 
     @Override
-    public void setServices(List<Object> serviceList) {
+    public void setServices(final List<Object> serviceList) {
         this.serviceList = serviceList;
     }
 

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfileStoreInstaller.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfileStoreInstaller.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfileStoreInstaller.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfileStoreInstaller.java Tue May  3 06:22:09 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.userprofile;
 
 import org.apache.isis.core.commons.components.Installer;
@@ -26,10 +25,8 @@ import org.apache.isis.core.runtime.user
 
 public interface UserProfileStoreInstaller extends Installer {
 
-	public static String TYPE = "user-profile-store";
+    public static String TYPE = "user-profile-store";
 
     UserProfileStore createUserProfileStore(final IsisConfiguration objectConfiguration);
 
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfilesDebugUtil.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfilesDebugUtil.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfilesDebugUtil.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/userprofile/UserProfilesDebugUtil.java Tue May  3 06:22:09 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.userprofile;
 
 import org.apache.isis.core.commons.debug.DebugBuilder;
@@ -37,38 +36,37 @@ public final class UserProfilesDebugUtil
 
     public static DebuggableWithTitle asDebuggableWithTitle(final UserProfile userProfile) {
         return new DebuggableWithTitle() {
-            
+
             @Override
-            public void debugData(DebugBuilder debug) {
+            public void debugData(final DebugBuilder debug) {
                 debug.appendTitle("Options");
                 debug.indent();
                 debug.append(userProfile.getOptions());
                 debug.unindent();
 
                 debug.appendTitle("Perspectives");
-                for (PerspectiveEntry entry : userProfile.getEntries()) {
+                for (final PerspectiveEntry entry : userProfile.getEntries()) {
                     asDebuggableWithTitle(entry).debugData(debug);
                 }
             }
-            
-             @Override
+
+            @Override
             public String debugTitle() {
                 return toString();
             }
         };
     }
 
-
     public static DebuggableWithTitle asDebuggableWithTitle(final PerspectiveEntry perspectiveEntry) {
         return new DebuggableWithTitle() {
-            
+
             @Override
-            public void debugData(DebugBuilder debug) {
+            public void debugData(final DebugBuilder debug) {
                 debug.appendln("Name", perspectiveEntry.getName());
                 debug.blankLine();
                 debug.appendTitle("Services (Ids)");
                 debug.indent();
-                for (Object service : perspectiveEntry.getServices()) {
+                for (final Object service : perspectiveEntry.getServices()) {
                     debug.appendln(ServiceUtil.id(service));
                 }
                 debug.unindent();
@@ -76,8 +74,8 @@ public final class UserProfilesDebugUtil
                 debug.blankLine();
                 debug.appendTitle("Objects");
                 debug.indent();
-                AdapterMap adapterMap = getAdapterMap();
-                for (Object obj : perspectiveEntry.getObjects()) {
+                final AdapterMap adapterMap = getAdapterMap();
+                for (final Object obj : perspectiveEntry.getObjects()) {
                     debug.appendln(adapterMap.adapterFor(obj).toString());
                 }
                 debug.unindent();
@@ -90,9 +88,9 @@ public final class UserProfilesDebugUtil
         };
     }
 
-    /////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////
     // Dependencies (from Context)
-    /////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////
 
     private static AdapterMap getAdapterMap() {
         return getPersistenceSession().getAdapterManager();
@@ -102,7 +100,4 @@ public final class UserProfilesDebugUtil
         return IsisContext.getPersistenceSession();
     }
 
-
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewer.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewer.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewer.java Tue May  3 06:22:09 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.viewer;
 
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
@@ -25,15 +24,15 @@ import org.apache.isis.core.commons.conf
 import org.apache.isis.runtimes.dflt.runtime.systemdependencyinjector.SystemDependencyInjectorAware;
 import org.apache.isis.runtimes.dflt.runtime.viewer.web.WebAppSpecification;
 
-
 /**
  * Defines an mechanism for manipulating the domain objects.
  * 
  * <p>
- * The mechanism may be realized as a user interface (for example the DnD viewer or HTML viewer) but might
- * also be an abstract 'remoting' viewer of sockets or HTTP servlet requests.
+ * The mechanism may be realized as a user interface (for example the DnD viewer or HTML viewer) but might also be an
+ * abstract 'remoting' viewer of sockets or HTTP servlet requests.
  */
-public interface IsisViewer extends ApplicationScopedComponent, SystemDependencyInjectorAware, IsisConfigurationBuilderAware {
+public interface IsisViewer extends ApplicationScopedComponent, SystemDependencyInjectorAware,
+    IsisConfigurationBuilderAware {
 
     /**
      * Provide requirement for running a viewer from within an embedded web container.
@@ -43,4 +42,3 @@ public interface IsisViewer extends Appl
      */
     WebAppSpecification getWebAppSpecification();
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewerAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewerAbstract.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewerAbstract.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewerAbstract.java Tue May  3 06:22:09 2011
@@ -17,19 +17,20 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.viewer;
 
-package org.apache.isis.runtimes.dflt.runtime.viewer;
-
-import org.apache.isis.applib.fixtures.LogonFixture;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+
+import org.apache.isis.applib.fixtures.LogonFixture;
+import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilderAware;
-import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.ensure.Ensure;
 import org.apache.isis.core.runtime.authentication.AuthenticationManager;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword;
-import org.apache.isis.runtimes.dflt.runtime.installerregistry.InstallerLookup;
-import org.apache.isis.runtimes.dflt.runtime.installerregistry.InstallerLookupAware;
 import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
 import org.apache.isis.runtimes.dflt.runtime.system.IsisSystem;
 import org.apache.isis.runtimes.dflt.runtime.system.SystemConstants;
@@ -37,127 +38,126 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.runtimes.dflt.runtime.systemdependencyinjector.SystemDependencyInjector;
 import org.apache.isis.runtimes.dflt.runtime.systemdependencyinjector.SystemDependencyInjectorAware;
 import org.apache.isis.runtimes.dflt.runtime.viewer.web.WebAppSpecification;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-
-
-public abstract class IsisViewerAbstract implements IsisViewer {
-
-    /**
-     * @see {@link #setDeploymentType(DeploymentType)}
-     */
-    private DeploymentType deploymentType;
-
-    private SystemDependencyInjector systemDependencyInjector;
-    private IsisConfigurationBuilder isisConfigurationBuilder;
-    private IsisSystem system; // never written to!!!
-
-    /**
-     * Optionally set, see {@link #setAuthenticationRequestViaArgs(AuthenticationRequest)}
-     */
-    private AuthenticationRequest authenticationRequestViaArgs;
-
-    // ////////////////////////////////////////////////////////////////
-    // Settings
-    // ////////////////////////////////////////////////////////////////
-
-    public void init() {
-
-        ensureDependenciesInjected();
-
-        IsisConfiguration configuration = isisConfigurationBuilder.getConfiguration();
-        deploymentType = DeploymentType.lookup(configuration.getString(SystemConstants.DEPLOYMENT_TYPE_KEY));
-
-        String user = configuration.getString(SystemConstants.USER_KEY);
-        String password = configuration.getString(SystemConstants.PASSWORD_KEY);
-
-        if (user != null) {
-            authenticationRequestViaArgs = new AuthenticationRequestPassword(user, password);
-        }
-    }
-
-    public void shutdown() {
-    // does nothing
-    }
-
-    // ////////////////////////////////////////////////////////////////
-    // Settings
-    // ////////////////////////////////////////////////////////////////
-
-    public final DeploymentType getDeploymentType() {
-        return deploymentType;
-    }
-
-    /**
-     * Default implementation to return null, indicating that this viewer should not be run in a web
-     * container.
-     */
-    public WebAppSpecification getWebAppSpecification() {
-        return null;
-    }
-
-    public AuthenticationRequest getAuthenticationRequestViaArgs() {
-        return authenticationRequestViaArgs;
-    }
-
-    protected void clearAuthenticationRequestViaArgs() {
-        authenticationRequestViaArgs = null;
-    }
-
-    // ////////////////////////////////////////////////////////////////
-    // Post-bootstrapping
-    // ////////////////////////////////////////////////////////////////
-
-    public LogonFixture getLogonFixture() {
-        // REVIEW: findBugs says this will always return null, since 'system' never written to...
-        return system != null ? system.getLogonFixture() : null;
-    }
-
-    // ////////////////////////////////////////////////////////////////
-    // Dependencies (injected)
-    // ////////////////////////////////////////////////////////////////
-
-    protected void ensureDependenciesInjected() {
-        Ensure.ensureThatState(systemDependencyInjector, is(not(nullValue())));
-        Ensure.ensureThatState(isisConfigurationBuilder, is(not(nullValue())));
-    }
-
-    /**
-     * Injected by virtue of being {@link SystemDependencyInjectorAware}.
-     */
-    public void setSystemDependencyInjector(SystemDependencyInjector dependencyInjector) {
-        this.systemDependencyInjector = dependencyInjector;
-    }
-
-    protected IsisConfigurationBuilder getConfigurationBuilder() {
-		return isisConfigurationBuilder;
-	}
-
-    /**
-     * Injected by virtue of being {@link IsisConfigurationBuilderAware}.
-     */
-    public void setConfigurationBuilder(final IsisConfigurationBuilder isisConfigurationBuilder) {
-        this.isisConfigurationBuilder = isisConfigurationBuilder;
-    }
-
-    // ////////////////////////////////////////////////////////////////
-    // Dependencies (from context)
-    // ////////////////////////////////////////////////////////////////
-
-    /**
-     * Available after {@link IsisSystem} has been bootstrapped.
-     */
-    protected static IsisConfiguration getConfiguration() {
-        return IsisContext.getConfiguration();
-    }
-
-    /**
-     * Available after {@link IsisSystem} has been bootstrapped.
-     */
-    public static AuthenticationManager getAuthenticationManager() {
-        return IsisContext.getAuthenticationManager();
-    }
-
-}
+
+public abstract class IsisViewerAbstract implements IsisViewer {
+
+    /**
+     * @see {@link #setDeploymentType(DeploymentType)}
+     */
+    private DeploymentType deploymentType;
+
+    private SystemDependencyInjector systemDependencyInjector;
+    private IsisConfigurationBuilder isisConfigurationBuilder;
+    private IsisSystem system; // never written to!!!
+
+    /**
+     * Optionally set, see {@link #setAuthenticationRequestViaArgs(AuthenticationRequest)}
+     */
+    private AuthenticationRequest authenticationRequestViaArgs;
+
+    // ////////////////////////////////////////////////////////////////
+    // Settings
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public void init() {
+
+        ensureDependenciesInjected();
+
+        final IsisConfiguration configuration = isisConfigurationBuilder.getConfiguration();
+        deploymentType = DeploymentType.lookup(configuration.getString(SystemConstants.DEPLOYMENT_TYPE_KEY));
+
+        final String user = configuration.getString(SystemConstants.USER_KEY);
+        final String password = configuration.getString(SystemConstants.PASSWORD_KEY);
+
+        if (user != null) {
+            authenticationRequestViaArgs = new AuthenticationRequestPassword(user, password);
+        }
+    }
+
+    @Override
+    public void shutdown() {
+        // does nothing
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // Settings
+    // ////////////////////////////////////////////////////////////////
+
+    public final DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
+
+    /**
+     * Default implementation to return null, indicating that this viewer should not be run in a web container.
+     */
+    @Override
+    public WebAppSpecification getWebAppSpecification() {
+        return null;
+    }
+
+    public AuthenticationRequest getAuthenticationRequestViaArgs() {
+        return authenticationRequestViaArgs;
+    }
+
+    protected void clearAuthenticationRequestViaArgs() {
+        authenticationRequestViaArgs = null;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // Post-bootstrapping
+    // ////////////////////////////////////////////////////////////////
+
+    public LogonFixture getLogonFixture() {
+        // REVIEW: findBugs says this will always return null, since 'system' never written to...
+        return system != null ? system.getLogonFixture() : null;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // Dependencies (injected)
+    // ////////////////////////////////////////////////////////////////
+
+    protected void ensureDependenciesInjected() {
+        Ensure.ensureThatState(systemDependencyInjector, is(not(nullValue())));
+        Ensure.ensureThatState(isisConfigurationBuilder, is(not(nullValue())));
+    }
+
+    /**
+     * Injected by virtue of being {@link SystemDependencyInjectorAware}.
+     */
+    @Override
+    public void setSystemDependencyInjector(final SystemDependencyInjector dependencyInjector) {
+        this.systemDependencyInjector = dependencyInjector;
+    }
+
+    protected IsisConfigurationBuilder getConfigurationBuilder() {
+        return isisConfigurationBuilder;
+    }
+
+    /**
+     * Injected by virtue of being {@link IsisConfigurationBuilderAware}.
+     */
+    @Override
+    public void setConfigurationBuilder(final IsisConfigurationBuilder isisConfigurationBuilder) {
+        this.isisConfigurationBuilder = isisConfigurationBuilder;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // Dependencies (from context)
+    // ////////////////////////////////////////////////////////////////
+
+    /**
+     * Available after {@link IsisSystem} has been bootstrapped.
+     */
+    protected static IsisConfiguration getConfiguration() {
+        return IsisContext.getConfiguration();
+    }
+
+    /**
+     * Available after {@link IsisSystem} has been bootstrapped.
+     */
+    public static AuthenticationManager getAuthenticationManager() {
+        return IsisContext.getAuthenticationManager();
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewerNoop.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewerNoop.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewerNoop.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/IsisViewerNoop.java Tue May  3 06:22:09 2011
@@ -17,37 +17,38 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.viewer;
 
-package org.apache.isis.runtimes.dflt.runtime.viewer;
-
 import org.apache.isis.core.commons.components.Noop;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
-import org.apache.isis.runtimes.dflt.runtime.installerregistry.InstallerLookup;
 import org.apache.isis.runtimes.dflt.runtime.systemdependencyinjector.SystemDependencyInjector;
 import org.apache.isis.runtimes.dflt.runtime.viewer.web.WebAppSpecification;
-
-public class IsisViewerNoop implements IsisViewer, Noop {
-
-    public void init() {}
-
-    public void shutdown() {}
-
-
-	public void setConfigurationBuilder(IsisConfigurationBuilder configurationLoader) {
-	}
-
+
+public class IsisViewerNoop implements IsisViewer, Noop {
+
+    @Override
+    public void init() {
+    }
+
+    @Override
+    public void shutdown() {
+    }
+
+    @Override
+    public void setConfigurationBuilder(final IsisConfigurationBuilder configurationLoader) {
+    }
+
+    @Override
+    public void setSystemDependencyInjector(final SystemDependencyInjector dependencyInjector) {
+    }
+
+    public boolean bootstrapsSystem() {
+        return false;
+    }
+
     @Override
-    public void setSystemDependencyInjector(SystemDependencyInjector dependencyInjector) {
+    public WebAppSpecification getWebAppSpecification() {
+        return null;
     }
 
-    public boolean bootstrapsSystem() {
-		return false;
-	}
-
-	public WebAppSpecification getWebAppSpecification() {
-	    return null;
-	}
-
-}
-
-
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/package-info.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/package-info.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/package-info.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/package-info.java Tue May  3 06:22:09 2011
@@ -17,8 +17,7 @@
  *  under the License.
  */
 
-
-/**
- * Viewer API.
- */
+/**
+ * Viewer API.
+ */
 package org.apache.isis.runtimes.dflt.runtime.viewer;
\ No newline at end of file

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/AbstractServletOrFilterMapping.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/AbstractServletOrFilterMapping.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/AbstractServletOrFilterMapping.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/AbstractServletOrFilterMapping.java Tue May  3 06:22:09 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.viewer.web;
 
 import java.util.ArrayList;
@@ -26,23 +25,18 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
-
 public abstract class AbstractServletOrFilterMapping {
     private final Class<?> servletOrFilterClass;
     private final List<String> pathSpecs;
-	private final Map<String, String> initParams;
+    private final Map<String, String> initParams;
 
     @SuppressWarnings("unchecked")
-	public AbstractServletOrFilterMapping(
-			final Class<?> servletOrFilterClass, 
-			final String... pathSpecs) {
+    public AbstractServletOrFilterMapping(final Class<?> servletOrFilterClass, final String... pathSpecs) {
         this(servletOrFilterClass, Collections.EMPTY_MAP, pathSpecs);
     }
 
-    public AbstractServletOrFilterMapping(
-    		final Class<?> servletOrFilterClass, 
-    		final Map<String,String> initParams, 
-    		final String... pathSpecs) {
+    public AbstractServletOrFilterMapping(final Class<?> servletOrFilterClass, final Map<String, String> initParams,
+        final String... pathSpecs) {
         this.servletOrFilterClass = servletOrFilterClass;
         this.initParams = initParams;
         this.pathSpecs = new ArrayList<String>(Arrays.asList(pathSpecs));
@@ -53,12 +47,11 @@ public abstract class AbstractServletOrF
     }
 
     public Map<String, String> getInitParams() {
-		return Collections.unmodifiableMap(initParams);
-	}
-    
+        return Collections.unmodifiableMap(initParams);
+    }
+
     public List<String> getPathSpecs() {
         return Collections.unmodifiableList(pathSpecs);
     }
 
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/FilterSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/FilterSpecification.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/FilterSpecification.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/FilterSpecification.java Tue May  3 06:22:09 2011
@@ -17,37 +17,31 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.viewer.web;
 
 import java.util.Map;
 
-
-
 public final class FilterSpecification extends AbstractServletOrFilterMapping {
 
     /**
-     * @param filterClass - should extend <tt>javax.servlet.Filter</tt>
+     * @param filterClass
+     *            - should extend <tt>javax.servlet.Filter</tt>
      */
-    public FilterSpecification(
-    		final Class<?> filterClass, 
-    		final Map<String, String> initParams,
-    		final String... mappings) {
-		super(filterClass, initParams, mappings);
-	}
+    public FilterSpecification(final Class<?> filterClass, final Map<String, String> initParams,
+        final String... mappings) {
+        super(filterClass, initParams, mappings);
+    }
 
     /**
-     * @param filterClass - should extend <tt>javax.servlet.Filter</tt>
+     * @param filterClass
+     *            - should extend <tt>javax.servlet.Filter</tt>
      */
-	public FilterSpecification(
-			final Class<?> filterClass, 
-			final String... pathSpecs) {
-		super(filterClass, pathSpecs);
-	}
+    public FilterSpecification(final Class<?> filterClass, final String... pathSpecs) {
+        super(filterClass, pathSpecs);
+    }
 
-	public Class<?> getFilterClass() {
+    public Class<?> getFilterClass() {
         return getServletOrFilterClass();
     }
 
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/ServletSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/ServletSpecification.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/ServletSpecification.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/ServletSpecification.java Tue May  3 06:22:09 2011
@@ -17,39 +17,31 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.viewer.web;
 
 import java.util.Map;
 
-
-
-
 public final class ServletSpecification extends AbstractServletOrFilterMapping {
-	
 
     /**
-     * @param servletClass - should extend <tt>javax.servlet.Servlet</tt>
+     * @param servletClass
+     *            - should extend <tt>javax.servlet.Servlet</tt>
      */
-    public ServletSpecification(
-    		final Class<?> servletClass, 
-    		final Map<String, String> initParams,
-    		final String... mappings) {
-		super(servletClass, initParams, mappings);
-	}
+    public ServletSpecification(final Class<?> servletClass, final Map<String, String> initParams,
+        final String... mappings) {
+        super(servletClass, initParams, mappings);
+    }
 
     /**
-     * @param servletClass - should extend <tt>javax.servlet.Servlet</tt>
+     * @param servletClass
+     *            - should extend <tt>javax.servlet.Servlet</tt>
      */
-	public ServletSpecification(
-			final Class<?> servletClass, 
-			final String... pathSpecs) {
-		super(servletClass, pathSpecs);
-	}
+    public ServletSpecification(final Class<?> servletClass, final String... pathSpecs) {
+        super(servletClass, pathSpecs);
+    }
 
-	public Class<?> getServletClass() {
+    public Class<?> getServletClass() {
         return getServletOrFilterClass();
     }
 
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/WebAppSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/WebAppSpecification.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/WebAppSpecification.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/viewer/web/WebAppSpecification.java Tue May  3 06:22:09 2011
@@ -17,128 +17,121 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.viewer.web;
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.isis.core.commons.lang.MapUtils;
 
-
 /**
  * Defines what servlets, mappings etc are required from an embedded web server.
  */
 public final class WebAppSpecification {
-	
-	private Map<String,String> contextParams = new LinkedHashMap<String, String>();
-    private List<Class<?>> servletContextListeners = new ArrayList<Class<?>>();
-    private List<ServletSpecification> servletSpecifications = new ArrayList<ServletSpecification>();
-    private List<FilterSpecification> filterSpecifications = new ArrayList<FilterSpecification>();
-    private List<String> resourcePaths = new ArrayList<String>();
-    private List<String> welcomeFiles = new ArrayList<String>();
-	private String logHint;
 
-    
+    private Map<String, String> contextParams = new LinkedHashMap<String, String>();
+    private final List<Class<?>> servletContextListeners = new ArrayList<Class<?>>();
+    private final List<ServletSpecification> servletSpecifications = new ArrayList<ServletSpecification>();
+    private final List<FilterSpecification> filterSpecifications = new ArrayList<FilterSpecification>();
+    private final List<String> resourcePaths = new ArrayList<String>();
+    private final List<String> welcomeFiles = new ArrayList<String>();
+    private String logHint;
 
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
     // Context Params
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
 
-	public void addContextParams(String... contextParams) {
-		this.contextParams = MapUtils.asMap(contextParams);
-	}
-	
-	public Map<String, String> getContextParams() {
-		return Collections.unmodifiableMap(contextParams);
-	}
+    public void addContextParams(final String... contextParams) {
+        this.contextParams = MapUtils.asMap(contextParams);
+    }
+
+    public Map<String, String> getContextParams() {
+        return Collections.unmodifiableMap(contextParams);
+    }
 
-	
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
     // Servlet Context Listeners
-    /////////////////////////////////////////////////////////////
-    
-    public void addServletContextListener(Class<?> servletContextListenerClass) {
-        servletContextListeners.add(servletContextListenerClass);        
+    // ///////////////////////////////////////////////////////////
+
+    public void addServletContextListener(final Class<?> servletContextListenerClass) {
+        servletContextListeners.add(servletContextListenerClass);
     }
-    
+
     public List<Class<?>> getServletContextListeners() {
         return servletContextListeners;
     }
 
-
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
     // Servlet Mappings
-    /////////////////////////////////////////////////////////////
-    
-    public void addServletSpecification(Class<?> servletClass, String... pathSpecs) {
-        servletSpecifications.add(new ServletSpecification(servletClass, pathSpecs));        
-    }
-    
-    public void addServletSpecification(Class<?> servletClass, Map<String,String> initParams, String... pathSpecs) {
-        servletSpecifications.add(new ServletSpecification(servletClass, initParams, pathSpecs));        
+    // ///////////////////////////////////////////////////////////
+
+    public void addServletSpecification(final Class<?> servletClass, final String... pathSpecs) {
+        servletSpecifications.add(new ServletSpecification(servletClass, pathSpecs));
+    }
+
+    public void addServletSpecification(final Class<?> servletClass, final Map<String, String> initParams,
+        final String... pathSpecs) {
+        servletSpecifications.add(new ServletSpecification(servletClass, initParams, pathSpecs));
     }
-    
+
     public List<ServletSpecification> getServletSpecifications() {
         return servletSpecifications;
     }
 
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
     // Filter Mappings
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
 
-    public void addFilterSpecification(Class<?> filterClass, String... pathSpecs) {
+    public void addFilterSpecification(final Class<?> filterClass, final String... pathSpecs) {
         filterSpecifications.add(new FilterSpecification(filterClass, pathSpecs));
     }
 
-    public void addFilterSpecification(Class<?> filterClass, Map<String,String> initParams, String... pathSpecs) {
+    public void addFilterSpecification(final Class<?> filterClass, final Map<String, String> initParams,
+        final String... pathSpecs) {
         filterSpecifications.add(new FilterSpecification(filterClass, initParams, pathSpecs));
     }
 
     public List<FilterSpecification> getFilterSpecifications() {
         return filterSpecifications;
     }
-    
-    /////////////////////////////////////////////////////////////
+
+    // ///////////////////////////////////////////////////////////
     // Resources
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
 
-    public void addResourcePath(String path) {
+    public void addResourcePath(final String path) {
         resourcePaths.add(path);
     }
+
     public List<String> getResourcePaths() {
         return resourcePaths;
     }
 
-
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
     // Welcome Files
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
 
-    public void addWelcomeFile(String path) {
+    public void addWelcomeFile(final String path) {
         welcomeFiles.add(path);
     }
-    
+
     public List<String> getWelcomeFiles() {
         return welcomeFiles;
     }
 
-    
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
     // Candifloss
-    /////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////
 
-	public String getLogHint() {
-		return logHint;
-	}
-
-	public void setLogHint(String logHint) {
-		this.logHint = logHint;
-	}
+    public String getLogHint() {
+        return logHint;
+    }
 
-}
+    public void setLogHint(final String logHint) {
+        this.logHint = logHint;
+    }
 
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebServer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebServer.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebServer.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebServer.java Tue May  3 06:22:09 2011
@@ -17,16 +17,13 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.web;
 
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.runtimes.dflt.runtime.viewer.web.WebAppSpecification;
 
 public interface EmbeddedWebServer extends ApplicationScopedComponent {
-    
+
     void addWebAppSpecification(WebAppSpecification webContainerRequirements);
 
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebServerAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebServerAbstract.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebServerAbstract.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebServerAbstract.java Tue May  3 06:22:09 2011
@@ -17,25 +17,22 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.web;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.runtimes.dflt.runtime.viewer.web.WebAppSpecification;
-
+import org.apache.log4j.Logger;
 
 public abstract class EmbeddedWebServerAbstract implements EmbeddedWebServer {
 
     @SuppressWarnings("unused")
     private final static Logger LOG = Logger.getLogger(EmbeddedWebServerAbstract.class);
 
-    private List<WebAppSpecification> specifications = new ArrayList<WebAppSpecification>();
+    private final List<WebAppSpecification> specifications = new ArrayList<WebAppSpecification>();
 
     // ///////////////////////////////////////////////////////
     // WebApp Specifications
@@ -44,7 +41,8 @@ public abstract class EmbeddedWebServerA
     /**
      * Must be called prior to {@link #init() initialization}.
      */
-    public void addWebAppSpecification(WebAppSpecification specification) {
+    @Override
+    public void addWebAppSpecification(final WebAppSpecification specification) {
         specifications.add(specification);
     }
 
@@ -56,12 +54,14 @@ public abstract class EmbeddedWebServerA
     // init, shutdown
     // ///////////////////////////////////////////////////////
 
+    @Override
     public void init() {
-    // does nothing
+        // does nothing
     }
 
+    @Override
     public void shutdown() {
-    // does nothing
+        // does nothing
     }
 
     // ///////////////////////////////////////////////////////
@@ -73,4 +73,3 @@ public abstract class EmbeddedWebServerA
     }
 
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebViewer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebViewer.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebViewer.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/web/EmbeddedWebViewer.java Tue May  3 06:22:09 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.web;
 
 import org.apache.isis.runtimes.dflt.runtime.viewer.IsisViewerAbstract;
@@ -25,5 +24,3 @@ import org.apache.isis.runtimes.dflt.run
 public abstract class EmbeddedWebViewer extends IsisViewerAbstract {
 
 }
-
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/AuthenticatorAbstractForDfltRuntimeTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/AuthenticatorAbstractForDfltRuntimeTest.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/AuthenticatorAbstractForDfltRuntimeTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/AuthenticatorAbstractForDfltRuntimeTest.java Tue May  3 06:22:09 2011
@@ -17,11 +17,15 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
 
-import java.util.List;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
 
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
+import org.apache.isis.runtimes.dflt.runtime.authentication.AuthenticatorAbstractForDfltRuntime;
+import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
 import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.jmock.integration.junit4.JMock;
@@ -30,94 +34,92 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.exceptions.IsisException;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
-import org.apache.isis.core.runtime.authentication.AuthenticationRequestAbstract;
-import org.apache.isis.core.runtime.authentication.standard.AuthenticatorAbstract;
-import org.apache.isis.runtimes.dflt.runtime.authentication.AuthenticatorAbstractForDfltRuntime;
-import org.apache.isis.runtimes.dflt.runtime.authentication.exploration.AuthenticationRequestExploration;
-import org.apache.isis.runtimes.dflt.runtime.authentication.exploration.MultiUserExplorationSession;
-import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
-
-import static org.junit.Assert.assertThat;
-import static org.hamcrest.CoreMatchers.*;
-
 @RunWith(JMock.class)
 public class AuthenticatorAbstractForDfltRuntimeTest {
-	
-	private Mockery mockery = new JUnit4Mockery();
 
-	private IsisConfiguration mockConfiguration;
-    private AuthenticatorAbstractForDfltRuntime authenticator;
+    private final Mockery mockery = new JUnit4Mockery();
 
+    private IsisConfiguration mockConfiguration;
+    private AuthenticatorAbstractForDfltRuntime authenticator;
 
     @Before
     public void setUp() {
-    	mockConfiguration = mockery.mock(IsisConfiguration.class);
-    	 
-    	authenticator = new AuthenticatorAbstractForDfltRuntime(mockConfiguration){
-			public boolean canAuthenticate(AuthenticationRequest request) {
-				return false;
-			}
-			public boolean isValid(AuthenticationRequest request) {
-				return false;
-			}};
+        mockConfiguration = mockery.mock(IsisConfiguration.class);
+
+        authenticator = new AuthenticatorAbstractForDfltRuntime(mockConfiguration) {
+            @Override
+            public boolean canAuthenticate(final AuthenticationRequest request) {
+                return false;
+            }
+
+            @Override
+            public boolean isValid(final AuthenticationRequest request) {
+                return false;
+            }
+        };
     }
 
     @Test
     public void getConfiguration() throws Exception {
-    	assertThat(authenticator.getConfiguration(), is(mockConfiguration));
+        assertThat(authenticator.getConfiguration(), is(mockConfiguration));
     }
 
-
     @Test
     public void getDeploymentTypeForExploration() throws Exception {
-    	final DeploymentType deploymentType = DeploymentType.EXPLORATION;
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.deploymentType");
-    		will(returnValue(deploymentType.name()));
-    	}});
-    	assertThat(authenticator.getDeploymentType(), is(deploymentType));
+        final DeploymentType deploymentType = DeploymentType.EXPLORATION;
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.deploymentType");
+                will(returnValue(deploymentType.name()));
+            }
+        });
+        assertThat(authenticator.getDeploymentType(), is(deploymentType));
     }
 
     @Test
     public void getDeploymentTypeForPrototype() throws Exception {
-    	final DeploymentType deploymentType = DeploymentType.PROTOTYPE;
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.deploymentType");
-    		will(returnValue(deploymentType.name()));
-    	}});
-    	assertThat(authenticator.getDeploymentType(), is(deploymentType));
+        final DeploymentType deploymentType = DeploymentType.PROTOTYPE;
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.deploymentType");
+                will(returnValue(deploymentType.name()));
+            }
+        });
+        assertThat(authenticator.getDeploymentType(), is(deploymentType));
     }
 
     @Test
     public void getDeploymentTypeForServer() throws Exception {
-    	final DeploymentType deploymentType = DeploymentType.SERVER;
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.deploymentType");
-    		will(returnValue(deploymentType.name()));
-    	}});
-    	assertThat(authenticator.getDeploymentType(), is(deploymentType));
+        final DeploymentType deploymentType = DeploymentType.SERVER;
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.deploymentType");
+                will(returnValue(deploymentType.name()));
+            }
+        });
+        assertThat(authenticator.getDeploymentType(), is(deploymentType));
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void expectsThereToBeADeploymentTypeInIsisConfiguration() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.deploymentType");
-    		will(returnValue(null));
-    	}});
-    	authenticator.getDeploymentType();
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.deploymentType");
+                will(returnValue(null));
+            }
+        });
+        authenticator.getDeploymentType();
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void expectsThereToBeAValidDeploymentTypeInIsisConfiguration() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.deploymentType");
-    		will(returnValue("GARBAGE"));
-    	}});
-    	authenticator.getDeploymentType();
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.deploymentType");
+                will(returnValue("GARBAGE"));
+            }
+        });
+        authenticator.getDeploymentType();
     }
 
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/MultiUserExplorationSessionTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/MultiUserExplorationSessionTest.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/MultiUserExplorationSessionTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/MultiUserExplorationSessionTest.java Tue May  3 06:22:09 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
 
 import static org.hamcrest.CoreMatchers.equalTo;
@@ -29,14 +28,6 @@ import java.util.Set;
 
 import junit.framework.Assert;
 
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.runtime.authentication.standard.SimpleSession;
@@ -47,146 +38,177 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.runtimes.dflt.runtime.authentication.exploration.MultiUserExplorationSession;
 import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
 import org.apache.isis.runtimes.dflt.runtime.system.SystemConstants;
-
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class MultiUserExplorationSessionTest {
 
-	private Mockery mockery = new JUnit4Mockery();
-	
+    private final Mockery mockery = new JUnit4Mockery();
+
     private MultiUserExplorationSession session;
-	private IsisConfiguration mockConfiguration;
-	private ExplorationAuthenticator authenticator;
+    private IsisConfiguration mockConfiguration;
+    private ExplorationAuthenticator authenticator;
 
     @Before
     public void setUp() {
-    	mockConfiguration = mockery.mock(IsisConfiguration.class);
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(SystemConstants.DEPLOYMENT_TYPE_KEY);
-    		will(returnValue(DeploymentType.EXPLORATION.name()));
-    	}});
+        mockConfiguration = mockery.mock(IsisConfiguration.class);
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(SystemConstants.DEPLOYMENT_TYPE_KEY);
+                will(returnValue(DeploymentType.EXPLORATION.name()));
+            }
+        });
     }
 
     @Test
     public void testNameDefaultsToFirstUser() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-    	AuthenticationSession session = authenticator.authenticate(new AuthenticationRequestExploration(), "");
-    	
-    	Assert.assertEquals("fred", session.getUserName());
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+        final AuthenticationSession session = authenticator.authenticate(new AuthenticationRequestExploration(), "");
+
+        Assert.assertEquals("fred", session.getUserName());
     }
 
     @Test
     public void testValidateCode() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-    	AuthenticationSession session = authenticator.authenticate(new AuthenticationRequestExploration(), "xxx");
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+        final AuthenticationSession session = authenticator.authenticate(new AuthenticationRequestExploration(), "xxx");
 
-    	Assert.assertEquals("xxx", session.getValidationCode());
+        Assert.assertEquals("xxx", session.getValidationCode());
     }
 
     @Test
     public void testNoRolesSpecifiedForFirstUser() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-    	AuthenticationSession session = authenticator.authenticate(new AuthenticationRequestExploration(), "");
-    	
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+        final AuthenticationSession session = authenticator.authenticate(new AuthenticationRequestExploration(), "");
+
         Assert.assertEquals(0, session.getRoles().size());
     }
 
     @Test
     public void testForMultipleUser() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-    	AuthenticationSession authSession = authenticator.authenticate(new AuthenticationRequestExploration(), "");
-    	
-    	assertThat(authSession, is(MultiUserExplorationSession.class));
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+        final AuthenticationSession authSession =
+            authenticator.authenticate(new AuthenticationRequestExploration(), "");
+
+        assertThat(authSession, is(MultiUserExplorationSession.class));
 
         assertThat(authSession.getUserName(), is(equalTo("fred")));
     }
 
     @Test
     public void testForSingleUser() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue("sven"));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-    	AuthenticationSession authSession = authenticator.authenticate(new AuthenticationRequestExploration(), "");
-    	assertThat(authSession, is(SimpleSession.class));
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue("sven"));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+        final AuthenticationSession authSession =
+            authenticator.authenticate(new AuthenticationRequestExploration(), "");
+        assertThat(authSession, is(SimpleSession.class));
 
         assertThat(authSession.getUserName(), is(equalTo("sven")));
     }
 
     @Test
     public void testNoUsersSpecified() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue(null));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-
-    	AuthenticationSession authSession = authenticator.authenticate(new AuthenticationRequestExploration(), "");
-    	assertThat(authSession, is(ExplorationSession.class));
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue(null));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+
+        final AuthenticationSession authSession =
+            authenticator.authenticate(new AuthenticationRequestExploration(), "");
+        assertThat(authSession, is(ExplorationSession.class));
     }
 
     @Test
     public void testOtherUsers() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-    	this.session = (MultiUserExplorationSession) authenticator.authenticate(new AuthenticationRequestExploration(), "");
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+        this.session =
+            (MultiUserExplorationSession) authenticator.authenticate(new AuthenticationRequestExploration(), "");
 
-    	Set<String> availableSessions = session.getUserNames();
+        final Set<String> availableSessions = session.getUserNames();
         Assert.assertEquals(4, availableSessions.size());
         Assert.assertTrue(availableSessions.contains("fred"));
         Assert.assertTrue(availableSessions.contains("sven"));
         Assert.assertTrue(availableSessions.contains("bob"));
         Assert.assertTrue(availableSessions.contains("dick"));
     }
-    
+
     @Test
     public void testChangeUser() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-    	this.session = (MultiUserExplorationSession) authenticator.authenticate(new AuthenticationRequestExploration(), "");
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+        this.session =
+            (MultiUserExplorationSession) authenticator.authenticate(new AuthenticationRequestExploration(), "");
 
-    	session.setCurrentSession("bob");
+        session.setCurrentSession("bob");
         Assert.assertEquals("bob", session.getUserName());
     }
-    
+
     @Test
     public void testRolesExist() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
-    		will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
-    	}});
-    	authenticator = new ExplorationAuthenticator(mockConfiguration);
-    	this.session = (MultiUserExplorationSession) authenticator.authenticate(new AuthenticationRequestExploration(), "");
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString(ExplorationAuthenticatorConstants.NAKEDOBJECTS_USERS);
+                will(returnValue("fred, sven:admin|sales|marketing, bob:sales, dick"));
+            }
+        });
+        authenticator = new ExplorationAuthenticator(mockConfiguration);
+        this.session =
+            (MultiUserExplorationSession) authenticator.authenticate(new AuthenticationRequestExploration(), "");
 
-    	session.setCurrentSession("sven");
-        List<String> roles = session.getRoles();
+        session.setCurrentSession("sven");
+        final List<String> roles = session.getRoles();
         Assert.assertEquals(3, roles.size());
         Assert.assertEquals("admin", roles.get(0));
         Assert.assertEquals("sales", roles.get(1));
         Assert.assertEquals("marketing", roles.get(2));
     }
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityNoRolesTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityNoRolesTest.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityNoRolesTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityNoRolesTest.java Tue May  3 06:22:09 2011
@@ -17,28 +17,19 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
 
-package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import org.jmock.integration.junit4.JMock;
-import org.junit.runner.RunWith;
-
-import org.apache.isis.core.commons.encoding.EncodabilityContractTest;
 import org.apache.isis.core.commons.encoding.Encodable;
 import org.apache.isis.core.runtime.authentication.standard.SimpleSession;
-
-@RunWith(JMock.class)
-public class SimpleSessionEncodabilityNoRolesTest extends SimpleSessionEncodabilityTestAbstract {
-
-	@Override
-	protected Encodable createEncodable() {
-		return new SimpleSession("joe", new String[]{});
-	}
-
-}
-
-
+import org.jmock.integration.junit4.JMock;
+import org.junit.runner.RunWith;
+
+@RunWith(JMock.class)
+public class SimpleSessionEncodabilityNoRolesTest extends SimpleSessionEncodabilityTestAbstract {
+
+    @Override
+    protected Encodable createEncodable() {
+        return new SimpleSession("joe", new String[] {});
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityTestAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityTestAbstract.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityTestAbstract.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityTestAbstract.java Tue May  3 06:22:09 2011
@@ -17,29 +17,24 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
 
-package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
 import org.apache.isis.core.commons.encoding.EncodabilityContractTest;
 import org.apache.isis.core.runtime.authentication.standard.SimpleSession;
-
-public abstract class SimpleSessionEncodabilityTestAbstract extends EncodabilityContractTest {
-
-	@Override
-	protected void assertRoundtripped(
-			Object decodedEncodable,
-			Object originalEncodable) {
-		SimpleSession decoded = (SimpleSession) decodedEncodable;
-		SimpleSession original = (SimpleSession) originalEncodable;
-		
-		assertThat(decoded.getUserName(), is(equalTo(original.getUserName())));
-		assertThat(decoded.getRoles(), is(equalTo(original.getRoles())));
-	}
-
-}
-
-
+
+public abstract class SimpleSessionEncodabilityTestAbstract extends EncodabilityContractTest {
+
+    @Override
+    protected void assertRoundtripped(final Object decodedEncodable, final Object originalEncodable) {
+        final SimpleSession decoded = (SimpleSession) decodedEncodable;
+        final SimpleSession original = (SimpleSession) originalEncodable;
+
+        assertThat(decoded.getUserName(), is(equalTo(original.getUserName())));
+        assertThat(decoded.getRoles(), is(equalTo(original.getRoles())));
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityWithRolesTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityWithRolesTest.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityWithRolesTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/SimpleSessionEncodabilityWithRolesTest.java Tue May  3 06:22:09 2011
@@ -17,23 +17,19 @@
  *  under the License.
  */
 
-
-package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
-
-import org.jmock.integration.junit4.JMock;
-import org.junit.runner.RunWith;
+package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
 
 import org.apache.isis.core.commons.encoding.Encodable;
 import org.apache.isis.core.runtime.authentication.standard.SimpleSession;
-
-@RunWith(JMock.class)
-public class SimpleSessionEncodabilityWithRolesTest extends SimpleSessionEncodabilityTestAbstract {
-
-	@Override
-	protected Encodable createEncodable() {
-		return new SimpleSession("joe", new String[]{"role1", "role2"});
-	}
-
-}
-
-
+import org.jmock.integration.junit4.JMock;
+import org.junit.runner.RunWith;
+
+@RunWith(JMock.class)
+public class SimpleSessionEncodabilityWithRolesTest extends SimpleSessionEncodabilityTestAbstract {
+
+    @Override
+    protected Encodable createEncodable() {
+        return new SimpleSession("joe", new String[] { "role1", "role2" });
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/StandardAuthenticationManager_AuthenticationTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/StandardAuthenticationManager_AuthenticationTest.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/StandardAuthenticationManager_AuthenticationTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/StandardAuthenticationManager_AuthenticationTest.java Tue May  3 06:22:09 2011
@@ -17,22 +17,10 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
 
-package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.sameInstance;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
 
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfiguration;
@@ -41,65 +29,68 @@ import org.apache.isis.core.runtime.auth
 import org.apache.isis.core.runtime.authentication.standard.AuthenticationManagerStandard;
 import org.apache.isis.core.runtime.authentication.standard.Authenticator;
 import org.apache.isis.core.runtime.authentication.standard.RandomCodeGenerator;
-
-@RunWith(JMock.class)
-public class StandardAuthenticationManager_AuthenticationTest {
-
-	private Mockery mockery = new JUnit4Mockery();
-	
-    private AuthenticationManagerStandard authenticationManager;
-
-    private IsisConfiguration mockConfiguration;
-    private RandomCodeGenerator mockRandomCodeGenerator;
-    private Authenticator mockAuthenticator;
-    private AuthenticationSession mockAuthSession;
-
-    
-    @Before
-    public void setUp() throws Exception {
-    	mockConfiguration = mockery.mock(IsisConfiguration.class);
-    	mockRandomCodeGenerator = mockery.mock(RandomCodeGenerator.class);
-    	mockAuthenticator = mockery.mock(Authenticator.class);
-    	mockAuthSession = mockery.mock(AuthenticationSession.class);
-    	
-        authenticationManager = new AuthenticationManagerStandard(mockConfiguration);
-        authenticationManager.addAuthenticator(mockAuthenticator);
-		authenticationManager.setRandomCodeGenerator(mockRandomCodeGenerator);
-
-    	mockery.checking(new Expectations(){{
-    		allowing(mockAuthenticator).canAuthenticate(with(any(AuthenticationRequest.class)));
-    		will(returnValue(true));
-
-    		allowing(mockAuthenticator).authenticate(
-    				with(any(AuthenticationRequest.class)), 
-    				with(any(String.class)));
-    		will(returnValue(mockAuthSession));
-
-    		allowing(mockRandomCodeGenerator).generateRandomCode();
-    		will(returnValue("123456"));
-    		
-    		allowing(mockAuthSession).getValidationCode();
-    		will(returnValue("123456"));
-
-    		allowing(mockAuthSession).hasUserNameOf("foo");
-    		will(returnValue(true));
-
-    		allowing(mockAuthSession).getUserName();
-    		will(returnValue("foo"));
-
-    	}});
-    }
-
-
-    @Test
-    public void newlyCreatedAuthenticationSessionShouldBeValid() throws Exception {
-    	AuthenticationRequestPassword request = new AuthenticationRequestPassword("foo", "bar");
-		AuthenticationSession session = authenticationManager.authenticate(request);
-		
-		assertThat(authenticationManager.isSessionValid(session), is(true));
-    }
-
-
-}
-
-
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(JMock.class)
+public class StandardAuthenticationManager_AuthenticationTest {
+
+    private final Mockery mockery = new JUnit4Mockery();
+
+    private AuthenticationManagerStandard authenticationManager;
+
+    private IsisConfiguration mockConfiguration;
+    private RandomCodeGenerator mockRandomCodeGenerator;
+    private Authenticator mockAuthenticator;
+    private AuthenticationSession mockAuthSession;
+
+    @Before
+    public void setUp() throws Exception {
+        mockConfiguration = mockery.mock(IsisConfiguration.class);
+        mockRandomCodeGenerator = mockery.mock(RandomCodeGenerator.class);
+        mockAuthenticator = mockery.mock(Authenticator.class);
+        mockAuthSession = mockery.mock(AuthenticationSession.class);
+
+        authenticationManager = new AuthenticationManagerStandard(mockConfiguration);
+        authenticationManager.addAuthenticator(mockAuthenticator);
+        authenticationManager.setRandomCodeGenerator(mockRandomCodeGenerator);
+
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockAuthenticator).canAuthenticate(with(any(AuthenticationRequest.class)));
+                will(returnValue(true));
+
+                allowing(mockAuthenticator).authenticate(with(any(AuthenticationRequest.class)),
+                    with(any(String.class)));
+                will(returnValue(mockAuthSession));
+
+                allowing(mockRandomCodeGenerator).generateRandomCode();
+                will(returnValue("123456"));
+
+                allowing(mockAuthSession).getValidationCode();
+                will(returnValue("123456"));
+
+                allowing(mockAuthSession).hasUserNameOf("foo");
+                will(returnValue(true));
+
+                allowing(mockAuthSession).getUserName();
+                will(returnValue("foo"));
+
+            }
+        });
+    }
+
+    @Test
+    public void newlyCreatedAuthenticationSessionShouldBeValid() throws Exception {
+        final AuthenticationRequestPassword request = new AuthenticationRequestPassword("foo", "bar");
+        final AuthenticationSession session = authenticationManager.authenticate(request);
+
+        assertThat(authenticationManager.isSessionValid(session), is(true));
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/StandardAuthenticationManager_AuthenticatorsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/StandardAuthenticationManager_AuthenticatorsTest.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/StandardAuthenticationManager_AuthenticatorsTest.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/authentication/standard/StandardAuthenticationManager_AuthenticatorsTest.java Tue May  3 06:22:09 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
 
-package org.apache.isis.runtimes.dflt.runtime.authentication.standard;
-
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.sameInstance;
 import static org.junit.Assert.assertThat;
@@ -37,46 +36,44 @@ import org.jmock.integration.junit4.JUni
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-
-@RunWith(JMock.class)
-public class StandardAuthenticationManager_AuthenticatorsTest {
-
-	private Mockery mockery = new JUnit4Mockery();
-
-	private IsisConfiguration mockConfiguration;
-	private AuthenticationManagerStandard authenticationManager;
-	private Authenticator mockAuthenticator;
-    
-    @Before
-    public void setUp() throws Exception {
-        mockConfiguration = mockery.mock(IsisConfiguration.class);
-        mockAuthenticator = mockery.mock(Authenticator.class);
-    	authenticationManager = new AuthenticationManagerStandard(mockConfiguration);
-    }
-
-    @Test
-    public void shouldInitiallyHaveNoAuthenticators() throws Exception {
-        assertThat(authenticationManager.getAuthenticators().size(), is(0));
-    }
-
-    @Test(expected=NoAuthenticatorException.class)
-    public void shouldNotBeAbleToAuthenticateWithNoAuthenticators() throws Exception {
-        authenticationManager.authenticate(new AuthenticationRequestPassword("foo", "bar"));
-    }
-
-    @Test
-    public void shouldBeAbleToAddAuthenticators() throws Exception {
-        authenticationManager.addAuthenticator(mockAuthenticator);
-        assertThat(authenticationManager.getAuthenticators().size(), is(1));
-        assertThat(authenticationManager.getAuthenticators().get(0), is(sameInstance(mockAuthenticator)));
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void shouldNotBeAbleToModifyReturnedAuthenticators() throws Exception {
-        List<Authenticator> authenticators = authenticationManager.getAuthenticators();
-        authenticators.add(mockAuthenticator);
-    }
-
-}
-
-
+
+@RunWith(JMock.class)
+public class StandardAuthenticationManager_AuthenticatorsTest {
+
+    private final Mockery mockery = new JUnit4Mockery();
+
+    private IsisConfiguration mockConfiguration;
+    private AuthenticationManagerStandard authenticationManager;
+    private Authenticator mockAuthenticator;
+
+    @Before
+    public void setUp() throws Exception {
+        mockConfiguration = mockery.mock(IsisConfiguration.class);
+        mockAuthenticator = mockery.mock(Authenticator.class);
+        authenticationManager = new AuthenticationManagerStandard(mockConfiguration);
+    }
+
+    @Test
+    public void shouldInitiallyHaveNoAuthenticators() throws Exception {
+        assertThat(authenticationManager.getAuthenticators().size(), is(0));
+    }
+
+    @Test(expected = NoAuthenticatorException.class)
+    public void shouldNotBeAbleToAuthenticateWithNoAuthenticators() throws Exception {
+        authenticationManager.authenticate(new AuthenticationRequestPassword("foo", "bar"));
+    }
+
+    @Test
+    public void shouldBeAbleToAddAuthenticators() throws Exception {
+        authenticationManager.addAuthenticator(mockAuthenticator);
+        assertThat(authenticationManager.getAuthenticators().size(), is(1));
+        assertThat(authenticationManager.getAuthenticators().get(0), is(sameInstance(mockAuthenticator)));
+    }
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void shouldNotBeAbleToModifyReturnedAuthenticators() throws Exception {
+        final List<Authenticator> authenticators = authenticationManager.getAuthenticators();
+        authenticators.add(mockAuthenticator);
+    }
+
+}



Mime
View raw message