portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r725977 [22/48] - in /portals/jetspeed-2/portal/trunk: ./ app-servers/security/jboss/src/java/META-INF/jboss-secsvc/ app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/ applications/jetspeed/src/main/javascrip...
Date Fri, 12 Dec 2008 12:07:04 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/MultiSourceUserInfoManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/MultiSourceUserInfoManagerImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/MultiSourceUserInfoManagerImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/MultiSourceUserInfoManagerImpl.java Fri Dec 12 04:06:29 2008
@@ -4,18 +4,18 @@
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.userinfo.impl;
-
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.userinfo.impl;
+
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -33,78 +33,78 @@
 import org.apache.jetspeed.userinfo.UserAttributeRetrievalException;
 import org.apache.jetspeed.userinfo.UserAttributeSource;
 import org.apache.jetspeed.userinfo.UserInfoManager;
-
-/**
- * Multisource User Information manager
- * One or more sources are assembled in Spring configuration and setter injected
- * 
- * @author <a href="mailto:KeithGarry.Boyce@bcbsma.com">Keith Garry Boyce </a>
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
- * @version $Id: $
- */
-public class MultiSourceUserInfoManagerImpl extends AbstractUserInfoManagerImpl
-        implements UserInfoManager
-{
-
-    /** Logger */
-    private static final Log log = LogFactory
-            .getLog(MultiSourceUserInfoManagerImpl.class);
-
-    private List sources;
-
-    private PortletRegistry portletRegistry;
+
+/**
+ * Multisource User Information manager
+ * One or more sources are assembled in Spring configuration and setter injected
+ * 
+ * @author <a href="mailto:KeithGarry.Boyce@bcbsma.com">Keith Garry Boyce </a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
+ * @version $Id: $
+ */
+public class MultiSourceUserInfoManagerImpl extends AbstractUserInfoManagerImpl
+        implements UserInfoManager
+{
+
+    /** Logger */
+    private static final Log log = LogFactory
+            .getLog(MultiSourceUserInfoManagerImpl.class);
+
+    private List sources;
+
+    private PortletRegistry portletRegistry;
    
-    public Map getUserInfoMap(String appName, RequestContext context)
-    {
-
-        try
-        {
-            Map userInfoMap = new HashMap();
-            Subject subject = context.getSubject();
-            PortletApplication pa = portletRegistry.getPortletApplication(appName);
-            if (null == pa)
-            {
-                log.debug(PortletRequest.USER_INFO + " is set to null");
-                return null;
-            }
-            Collection userAttributes = pa.getUserAttributes();
-            Collection userAttributeRefs = pa.getUserAttributeRefs();
-            Collection linkedUserAttributes = mapLinkedUserAttributes(
-                    userAttributes, userAttributeRefs);
-            for (Iterator iter = sources.iterator(); iter.hasNext();)
-            {
-                UserAttributeSource source = (UserAttributeSource) iter.next();
-                Map sourceMap;
-
-                sourceMap = source.getUserAttributeMap(subject,
-                        linkedUserAttributes, context);
-                userInfoMap.putAll(sourceMap);
-            }
-            return userInfoMap;
-        } catch (UserAttributeRetrievalException e)
-        {
-            // Until external api is changed return
-            e.printStackTrace();            
-            return null;
-        }
-    }
-
-    /**
-     * @param sources
-     *            The sources to set.
-     */
-    public void setSources(List sources)
-    {
-        this.sources = sources;
-    }
-
-    /**
-     * @param portletRegistry
-     *            The portletRegistry to set.
-     */
-    public void setPortletRegistry(PortletRegistry portletRegistry)
-    {
-        this.portletRegistry = portletRegistry;
+    public Map getUserInfoMap(String appName, RequestContext context)
+    {
+
+        try
+        {
+            Map userInfoMap = new HashMap();
+            Subject subject = context.getSubject();
+            PortletApplication pa = portletRegistry.getPortletApplication(appName);
+            if (null == pa)
+            {
+                log.debug(PortletRequest.USER_INFO + " is set to null");
+                return null;
+            }
+            Collection userAttributes = pa.getUserAttributes();
+            Collection userAttributeRefs = pa.getUserAttributeRefs();
+            Collection linkedUserAttributes = mapLinkedUserAttributes(
+                    userAttributes, userAttributeRefs);
+            for (Iterator iter = sources.iterator(); iter.hasNext();)
+            {
+                UserAttributeSource source = (UserAttributeSource) iter.next();
+                Map sourceMap;
+
+                sourceMap = source.getUserAttributeMap(subject,
+                        linkedUserAttributes, context);
+                userInfoMap.putAll(sourceMap);
+            }
+            return userInfoMap;
+        } catch (UserAttributeRetrievalException e)
+        {
+            // Until external api is changed return
+            e.printStackTrace();            
+            return null;
+        }
+    }
+
+    /**
+     * @param sources
+     *            The sources to set.
+     */
+    public void setSources(List sources)
+    {
+        this.sources = sources;
+    }
+
+    /**
+     * @param portletRegistry
+     *            The portletRegistry to set.
+     */
+    public void setPortletRegistry(PortletRegistry portletRegistry)
+    {
+        this.portletRegistry = portletRegistry;
     }
 
-}
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/MultiSourceUserInfoManagerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/UserManagerUserAttributeSourceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/UserManagerUserAttributeSourceImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/UserManagerUserAttributeSourceImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/UserManagerUserAttributeSourceImpl.java Fri Dec 12 04:06:29 2008
@@ -4,18 +4,18 @@
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.userinfo.impl;
-
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.userinfo.impl;
+
 import java.security.Principal;
 import java.util.Collection;
 import java.util.HashMap;
@@ -33,70 +33,70 @@
 import org.apache.jetspeed.security.UserManager;
 import org.apache.jetspeed.userinfo.UserAttributeRetrievalException;
 import org.apache.jetspeed.userinfo.UserAttributeSource;
-
-/**
- * Default implementation of a UserAttribute source Provides users attributes from standard prefs implementation
- * 
- * @author <a href="mailto:KeithGarry.Boyce@bcbsma.com">Keith Garry Boyce</a>
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
- */
-public class UserManagerUserAttributeSourceImpl implements UserAttributeSource
-{
-
-    /** Logger */
-    private static final Log log = LogFactory.getLog(UserManagerUserAttributeSourceImpl.class);
-
-    /** The user manager */
-    private UserManager userManager;
-
-    /**
-     * @param userManager
-     *            The userManager to set.
-     */
-    public void setUserManager(UserManager userManager)
-    {
-        this.userManager = userManager;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.jetspeed.userinfo.UserAttributeSource#getUserAttributeMap(javax.security.auth.Subject, java.util.Set)
-     */
-    public Map<String, String> getUserAttributeMap(Subject subject, Collection<UserAttributeRef> userAttributeRefs, RequestContext context)
-            throws UserAttributeRetrievalException
-    {
-
-        Map<String,String> userAttributeMap = new HashMap<String,String>();
-        Principal userPrincipal = SubjectHelper.getPrincipal(subject, User.class);
-        if (null != userPrincipal)
-        {
-            log.debug("Got user principal: " + userPrincipal.getName());
-            try
-            {
-                if (userManager.userExists(userPrincipal.getName()))
-                {
-                    User user = userManager.getUser(userPrincipal.getName());
+
+/**
+ * Default implementation of a UserAttribute source Provides users attributes from standard prefs implementation
+ * 
+ * @author <a href="mailto:KeithGarry.Boyce@bcbsma.com">Keith Garry Boyce</a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class UserManagerUserAttributeSourceImpl implements UserAttributeSource
+{
+
+    /** Logger */
+    private static final Log log = LogFactory.getLog(UserManagerUserAttributeSourceImpl.class);
+
+    /** The user manager */
+    private UserManager userManager;
+
+    /**
+     * @param userManager
+     *            The userManager to set.
+     */
+    public void setUserManager(UserManager userManager)
+    {
+        this.userManager = userManager;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.jetspeed.userinfo.UserAttributeSource#getUserAttributeMap(javax.security.auth.Subject, java.util.Set)
+     */
+    public Map<String, String> getUserAttributeMap(Subject subject, Collection<UserAttributeRef> userAttributeRefs, RequestContext context)
+            throws UserAttributeRetrievalException
+    {
+
+        Map<String,String> userAttributeMap = new HashMap<String,String>();
+        Principal userPrincipal = SubjectHelper.getPrincipal(subject, User.class);
+        if (null != userPrincipal)
+        {
+            log.debug("Got user principal: " + userPrincipal.getName());
+            try
+            {
+                if (userManager.userExists(userPrincipal.getName()))
+                {
+                    User user = userManager.getUser(userPrincipal.getName());
                     Map<String, String> userInfo = user.getInfoMap();
                     for (UserAttributeRef currentAttributeRef : userAttributeRefs)
-                    {
-                        String value = userInfo.get(currentAttributeRef.getName());
-                        if (value != null)
-                        {
-                            userAttributeMap.put(currentAttributeRef.getName(), value);
-                        }
-
-                    }
-                }
-            }
-            catch (SecurityException sex)
-            {
-                log.warn("Unexpected SecurityException in UserInfoManager", sex);
-            }
-        }
-
-        return userAttributeMap;
-    }
-
-}
+                    {
+                        String value = userInfo.get(currentAttributeRef.getName());
+                        if (value != null)
+                        {
+                            userAttributeMap.put(currentAttributeRef.getName(), value);
+                        }
+
+                    }
+                }
+            }
+            catch (SecurityException sex)
+            {
+                log.warn("Unexpected SecurityException in UserInfoManager", sex);
+            }
+        }
+
+        return userAttributeMap;
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/userinfo/impl/UserManagerUserAttributeSourceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/util/MultiFileChecksumHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/assembly/page-manager.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/assembly/test-layout-api.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/assembly/test-layout-constraints-api.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/deployment/deploy/README.txt
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/deployment/deploy/README.txt?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/deployment/deploy/README.txt (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/deployment/deploy/README.txt Fri Dec 12 04:06:29 2008
@@ -3,14 +3,14 @@
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
 This is were you things to be deployed to Jetspeed (not implemented yet)
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/deployment/deploy/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java Fri Dec 12 04:06:29 2008
@@ -1,50 +1,50 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.jetspeed.components.util.RegistrySupportedTestCase;
-
-public class AbstractRequestContextTestCase extends RegistrySupportedTestCase
-{
-
-    protected String[] getConfigurations()
-    {
-//        File webapp = new File("../../src/webapp");
-//        System.setProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY, webapp.getAbsolutePath());        
-        String[] confs = super.getConfigurations();
-        List confList = new ArrayList(Arrays.asList(confs));
-        confList.add("rc2.xml");
-        confList.add("static-bean-references.xml");
-        confList.add("security-managers.xml");
-        confList.add("security-providers.xml");
-        confList.add("security-spi.xml");
-        confList.add("security-atn.xml");
-        confList.add("security-spi-atn.xml");
-        confList.add("security-atz.xml");
-        return (String[]) confList.toArray(new String[confList.size()]);
-    }
-
-    protected String getBeanDefinitionFilterCategories()
-    {
-        return super.getBeanDefinitionFilterCategories()+",security,dbSecurity";
-    }
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.jetspeed.components.util.RegistrySupportedTestCase;
+
+public class AbstractRequestContextTestCase extends RegistrySupportedTestCase
+{
+
+    protected String[] getConfigurations()
+    {
+//        File webapp = new File("../../src/webapp");
+//        System.setProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY, webapp.getAbsolutePath());        
+        String[] confs = super.getConfigurations();
+        List confList = new ArrayList(Arrays.asList(confs));
+        confList.add("rc2.xml");
+        confList.add("static-bean-references.xml");
+        confList.add("security-managers.xml");
+        confList.add("security-providers.xml");
+        confList.add("security-spi.xml");
+        confList.add("security-atn.xml");
+        confList.add("security-spi-atn.xml");
+        confList.add("security-atz.xml");
+        return (String[]) confList.toArray(new String[confList.size()]);
+    }
+
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return super.getBeanDefinitionFilterCategories()+",security,dbSecurity";
+    }
 }
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/AbstractRequestContextTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/PortletFactoryMock.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java Fri Dec 12 04:06:29 2008
@@ -14,79 +14,79 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.jetspeed.administration;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.apache.jetspeed.aggregator.TestWorkerMonitor;
-
-
-public class TestPortalAdministrationImpl extends  TestCase
-
-{
-
-    
-    public static void main(String args[])
-    {
-        junit.awtui.TestRunner.main(new String[] { TestWorkerMonitor.class.getName()});
-    }
-
-    protected void setUp() throws Exception
-    {
-        super.setUp();
-        
-        
-        
-    }
-    
-    public static Test suite()
-    {
-        // All methods starting with "test" will be executed in the test suite.
-        return new TestSuite(TestPortalAdministrationImpl.class);
-    }
-
-    public void testPasswordGen() throws Exception
-    {
-        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null);
-        String newPassword = pai.generatePassword();
-        assertNotNull("new password was NULL!!!",newPassword);
-        assertTrue("password is not long enough",(newPassword.length() > 4) );
-        
-    }
-    
-    public void xtestSendEmail() throws Exception {
-        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null);
-        pai.sendEmail("chris@bluesunrise.com","this is a unittest","chris@bluesunrise.com","this is the content of the message");
-        
-    }
-    
-    // this needs too much init to test easily right now
-    public void xtestRegUser() throws Exception
-    {
-        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null);
-        String user = "user"+(Math.abs(new Date().getTime()));
-        String password = "password";
-        List emptyList = new ArrayList();
-        Map emptyMap = new HashMap();
-        Map userAttributes = new HashMap();
-        String emailTemplate = "";
-        pai.registerUser(user, 
-                password, 
-                emptyList, 
-                emptyList, 
-               userAttributes,              // note use of only PLT.D  values here.
-               emptyMap, 
-               emailTemplate);
-        
-    }
-    
-
-}
+package org.apache.jetspeed.administration;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.aggregator.TestWorkerMonitor;
+
+
+public class TestPortalAdministrationImpl extends  TestCase
+
+{
+
+    
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[] { TestWorkerMonitor.class.getName()});
+    }
+
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        
+        
+        
+    }
+    
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestPortalAdministrationImpl.class);
+    }
+
+    public void testPasswordGen() throws Exception
+    {
+        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null);
+        String newPassword = pai.generatePassword();
+        assertNotNull("new password was NULL!!!",newPassword);
+        assertTrue("password is not long enough",(newPassword.length() > 4) );
+        
+    }
+    
+    public void xtestSendEmail() throws Exception {
+        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null);
+        pai.sendEmail("chris@bluesunrise.com","this is a unittest","chris@bluesunrise.com","this is the content of the message");
+        
+    }
+    
+    // this needs too much init to test easily right now
+    public void xtestRegUser() throws Exception
+    {
+        PortalAdministrationImpl pai = new PortalAdministrationImpl(null,null,null,null,null,null,null);
+        String user = "user"+(Math.abs(new Date().getTime()));
+        String password = "password";
+        List emptyList = new ArrayList();
+        Map emptyMap = new HashMap();
+        Map userAttributes = new HashMap();
+        String emailTemplate = "";
+        pai.registerUser(user, 
+                password, 
+                emptyList, 
+                emptyList, 
+               userAttributes,              // note use of only PLT.D  values here.
+               emptyMap, 
+               emailTemplate);
+        
+    }
+    
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/administration/TestPortalAdministrationImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java Fri Dec 12 04:06:29 2008
@@ -1,183 +1,183 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.aggregator;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.jetspeed.om.page.ContentFragment;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.jetspeed.container.PortletWindow;
-
-
-/**
- * MockRenderJob
- * 
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
- */
-
-public class MockRenderJob  implements RenderingJob
-{
-    private long mockTime;
-    private String jobName;
-    private PortletWindow window;
-
-    protected long startTimeMillis = 0;
-    protected long timeout;
-    
-    public MockRenderJob(String jobName, long mockTime, PortletWindow window)
-    {
-        this.mockTime = mockTime;
-        this.jobName = jobName;
-        this.window = window;
-    }
-
-    /**
-     * Sets portlet timout in milliseconds.
-     */
-    public void setTimeout(long timeout) {
-        this.timeout = timeout;
-    }
-
-    /**
-     * Gets portlet timout in milliseconds.
-     */
-    public long getTimeout() {
-        return this.timeout;
-    }
-
-    /**
-     * Checks if the portlet rendering is timeout
-     */
-    public boolean isTimeout() {
-        if ((this.timeout > 0) && (this.startTimeMillis > 0)) {
-            return (System.currentTimeMillis() - this.startTimeMillis > this.timeout);
-        }
-
-        return false;
-    }
-    
-    public void run()
-    {       
-        if (this.timeout > 0) {
-            this.startTimeMillis = System.currentTimeMillis();
-        }
-
-        execute();
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.aggregator.RenderingJob#execute()
-     */
-    public void execute()
-    {
-        System.out.println("Running mock rendering job ..." + jobName);
-        try
-        {
-            Thread.sleep(mockTime);
-        }
-        catch (InterruptedException e)
-        {
-            System.out.println("Interrupted job..." + jobName);
-        }
-        System.out.println("mock job completed " + jobName);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.aggregator.RenderingJob#getWindow()
-     */
-    public PortletWindow getWindow()
-    {
-        // TODO Auto-generated method stub
-        return window;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.aggregator.RenderingJob#getPortletContent()
-     */
-    public PortletContent getPortletContent()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public ContentDispatcherCtrl getDispatcher()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public int getExpirationCache()
-    {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public ContentFragment getFragment()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public PortletDefinition getPortletDefinition()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public HttpServletRequest getRequest()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public RequestContext getRequestContext()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public HttpServletResponse getResponse()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public boolean isContentCached()
-    {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public Object getWorkerAttribute(String name)
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public void removeWorkerAttribute(String name)
-    {
-        // TODO Auto-generated method stub
-    }
-
-    public void setWorkerAttribute(String name, Object value)
-    {
-        // TODO Auto-generated method stub
-    }
-}
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.aggregator;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.jetspeed.om.page.ContentFragment;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.jetspeed.container.PortletWindow;
+
+
+/**
+ * MockRenderJob
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+
+public class MockRenderJob  implements RenderingJob
+{
+    private long mockTime;
+    private String jobName;
+    private PortletWindow window;
+
+    protected long startTimeMillis = 0;
+    protected long timeout;
+    
+    public MockRenderJob(String jobName, long mockTime, PortletWindow window)
+    {
+        this.mockTime = mockTime;
+        this.jobName = jobName;
+        this.window = window;
+    }
+
+    /**
+     * Sets portlet timout in milliseconds.
+     */
+    public void setTimeout(long timeout) {
+        this.timeout = timeout;
+    }
+
+    /**
+     * Gets portlet timout in milliseconds.
+     */
+    public long getTimeout() {
+        return this.timeout;
+    }
+
+    /**
+     * Checks if the portlet rendering is timeout
+     */
+    public boolean isTimeout() {
+        if ((this.timeout > 0) && (this.startTimeMillis > 0)) {
+            return (System.currentTimeMillis() - this.startTimeMillis > this.timeout);
+        }
+
+        return false;
+    }
+    
+    public void run()
+    {       
+        if (this.timeout > 0) {
+            this.startTimeMillis = System.currentTimeMillis();
+        }
+
+        execute();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.aggregator.RenderingJob#execute()
+     */
+    public void execute()
+    {
+        System.out.println("Running mock rendering job ..." + jobName);
+        try
+        {
+            Thread.sleep(mockTime);
+        }
+        catch (InterruptedException e)
+        {
+            System.out.println("Interrupted job..." + jobName);
+        }
+        System.out.println("mock job completed " + jobName);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.aggregator.RenderingJob#getWindow()
+     */
+    public PortletWindow getWindow()
+    {
+        // TODO Auto-generated method stub
+        return window;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.aggregator.RenderingJob#getPortletContent()
+     */
+    public PortletContent getPortletContent()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public ContentDispatcherCtrl getDispatcher()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public int getExpirationCache()
+    {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public ContentFragment getFragment()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public PortletDefinition getPortletDefinition()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public HttpServletRequest getRequest()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public RequestContext getRequestContext()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public HttpServletResponse getResponse()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public boolean isContentCached()
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public Object getWorkerAttribute(String name)
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void removeWorkerAttribute(String name)
+    {
+        // TODO Auto-generated method stub
+    }
+
+    public void setWorkerAttribute(String name, Object value)
+    {
+        // TODO Auto-generated method stub
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestWorkerMonitor.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestWorkerMonitor.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestWorkerMonitor.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestWorkerMonitor.java Fri Dec 12 04:06:29 2008
@@ -1,87 +1,87 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.aggregator;
- 
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.apache.jetspeed.aggregator.impl.WorkerMonitorImpl;
-import org.apache.jetspeed.om.window.impl.PortletWindowImpl;
-import org.apache.jetspeed.container.PortletWindow;
-
-/**
- * <P>Test the aggregation service</P>
- *
- * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
- * @version $Id: $
- * 
- */
-public class TestWorkerMonitor extends TestCase
-{    
-    /**
-     * Start the tests.
-     *
-     * @param args the arguments. Not used
-     */
-    public static void main(String args[])
-    {
-        junit.awtui.TestRunner.main(new String[] { TestWorkerMonitor.class.getName()});
-    }
-
-    protected void setUp() throws Exception
-    {
-        super.setUp();
-        
-        
-        
-    }
-    
-    public static Test suite()
-    {
-        // All methods starting with "test" will be executed in the test suite.
-        return new TestSuite(TestWorkerMonitor.class);
-    }
-
-    private static final int JOB_COUNT = 2;
-    
-    public void testBasic() throws Exception
-    {
-        WorkerMonitor monitor = new WorkerMonitorImpl(1, 2, 1, 1);
-        
-        List jobs = new ArrayList(JOB_COUNT);
-        for (int ix = 0; ix < JOB_COUNT; ix++)
-        {
-            PortletWindow window = new PortletWindowImpl("w" + String.valueOf(ix));       
-            jobs.add(new MockRenderJob("Job-" + (ix + 1), 4000, window));
-        }
-        assertNotNull("monitor is null", monitor);
-        monitor.start();
-        for (int ix = 0; ix < JOB_COUNT; ix++)
-           monitor.process((RenderingJob)jobs.get(ix));
-        
-        Thread.sleep(2000);
-        assertTrue("available jobs expect 0", monitor.getAvailableJobsCount() == 0);
-        assertTrue("running jobs expect 2", monitor.getRunningJobsCount() == 2);
-        assertTrue("queued jobs expect 0", monitor.getQueuedJobsCount() == 0);
-        monitor.stop();
-    }
-
-}
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.aggregator;
+ 
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.aggregator.impl.WorkerMonitorImpl;
+import org.apache.jetspeed.om.window.impl.PortletWindowImpl;
+import org.apache.jetspeed.container.PortletWindow;
+
+/**
+ * <P>Test the aggregation service</P>
+ *
+ * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
+ * @version $Id: $
+ * 
+ */
+public class TestWorkerMonitor extends TestCase
+{    
+    /**
+     * Start the tests.
+     *
+     * @param args the arguments. Not used
+     */
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[] { TestWorkerMonitor.class.getName()});
+    }
+
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        
+        
+        
+    }
+    
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestWorkerMonitor.class);
+    }
+
+    private static final int JOB_COUNT = 2;
+    
+    public void testBasic() throws Exception
+    {
+        WorkerMonitor monitor = new WorkerMonitorImpl(1, 2, 1, 1);
+        
+        List jobs = new ArrayList(JOB_COUNT);
+        for (int ix = 0; ix < JOB_COUNT; ix++)
+        {
+            PortletWindow window = new PortletWindowImpl("w" + String.valueOf(ix));       
+            jobs.add(new MockRenderJob("Job-" + (ix + 1), 4000, window));
+        }
+        assertNotNull("monitor is null", monitor);
+        monitor.start();
+        for (int ix = 0; ix < JOB_COUNT; ix++)
+           monitor.process((RenderingJob)jobs.get(ix));
+        
+        Thread.sleep(2000);
+        assertTrue("available jobs expect 0", monitor.getAvailableJobsCount() == 0);
+        assertTrue("running jobs expect 2", monitor.getRunningJobsCount() == 2);
+        assertTrue("queued jobs expect 0", monitor.getQueuedJobsCount() == 0);
+        monitor.stop();
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/TestWorkerMonitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java Fri Dec 12 04:06:29 2008
@@ -1,105 +1,105 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.cluster;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
-
-/**
- * <p>
- * TestCluster
- * </p>
- * 
- * @author <a href="mailto:weaver@apache.org">Scott T. Weaver </a>
- * @version $Id: TestCluster.java 463270 2006-10-12 15:19:29Z taylor $
- *  
- */
-public class TestCluster extends DatasourceEnabledSpringTestCase
-{
- 
-	   /** The node manager. */
-    private NodeManager single;
-
-    /**
-     * @see junit.framework.TestCase#setUp()
-     */
-    public void setUp() throws Exception
-    {
-        super.setUp();
-
-        single = (NodeManager) scm.getComponent("org.apache.jetspeed.cluster.NodeManager");
-    }
-  
-    public static Test suite()
-    {
-        // All methods starting with "test" will be executed in the test suite.
-        return new TestSuite(TestCluster.class);
-    }
-
-    /** Test set user info map. * */
-    public void testCluser() throws Exception
-    {
-    	String contextName = "SOME_NEW_PORTLET_APPLICATION";
-    	Long revision = new Long(10);
-    	
-        assertNotNull("Manager should be instantiated", single);
-        
-        int numExistingApps = single.getNumberOfNodes();
-        
-        //create a new node
-        int status = single.checkNode(revision, contextName);
-        if (status != NodeManager.NODE_NEW)
-        {
-        	single.removeNode(contextName); //previous run didn't clean up
-        	status = single.checkNode(revision, contextName);
-            assertEquals("Should be a new node",NodeManager.NODE_NEW,status);
-        }
-        
-        // ok - create a new node
-        single.addNode(revision, contextName);
-        int newApps = single.getNumberOfNodes();
-
-        assertEquals("Should have added new node",newApps, numExistingApps+1);
-        
-        status = single.checkNode(revision, contextName);
-        assertEquals("Should be a current (saved) node",NodeManager.NODE_SAVED,status);
-        
-    	revision = new Long(20);
-        status = single.checkNode(revision, contextName);
-        assertEquals("Should be an outdated node",NodeManager.NODE_OUTDATED,status);
-
-        single.addNode(revision, contextName);
-        status = single.checkNode(revision, contextName);
-        assertEquals("Should be again a current (saved) node",NodeManager.NODE_SAVED,status);
-
-    	revision = new Long(10);
-        status = single.checkNode(revision, contextName);
-        assertEquals("Should still be a current (saved) node",NodeManager.NODE_SAVED,status);
-
-    	single.removeNode(contextName); //previous run didn't clean up
-        status = single.checkNode(revision, contextName);
-        assertEquals("Node should be gone....",NodeManager.NODE_NEW,status);
-    }
-    protected String[] getConfigurations()
-    {
-        return new String[]
-        { "system-properties.xml", "cluster-node.xml"};
-    }
-
-}
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.cluster;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+
+/**
+ * <p>
+ * TestCluster
+ * </p>
+ * 
+ * @author <a href="mailto:weaver@apache.org">Scott T. Weaver </a>
+ * @version $Id: TestCluster.java 463270 2006-10-12 15:19:29Z taylor $
+ *  
+ */
+public class TestCluster extends DatasourceEnabledSpringTestCase
+{
+ 
+	   /** The node manager. */
+    private NodeManager single;
+
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    public void setUp() throws Exception
+    {
+        super.setUp();
+
+        single = (NodeManager) scm.getComponent("org.apache.jetspeed.cluster.NodeManager");
+    }
+  
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestCluster.class);
+    }
+
+    /** Test set user info map. * */
+    public void testCluser() throws Exception
+    {
+    	String contextName = "SOME_NEW_PORTLET_APPLICATION";
+    	Long revision = new Long(10);
+    	
+        assertNotNull("Manager should be instantiated", single);
+        
+        int numExistingApps = single.getNumberOfNodes();
+        
+        //create a new node
+        int status = single.checkNode(revision, contextName);
+        if (status != NodeManager.NODE_NEW)
+        {
+        	single.removeNode(contextName); //previous run didn't clean up
+        	status = single.checkNode(revision, contextName);
+            assertEquals("Should be a new node",NodeManager.NODE_NEW,status);
+        }
+        
+        // ok - create a new node
+        single.addNode(revision, contextName);
+        int newApps = single.getNumberOfNodes();
+
+        assertEquals("Should have added new node",newApps, numExistingApps+1);
+        
+        status = single.checkNode(revision, contextName);
+        assertEquals("Should be a current (saved) node",NodeManager.NODE_SAVED,status);
+        
+    	revision = new Long(20);
+        status = single.checkNode(revision, contextName);
+        assertEquals("Should be an outdated node",NodeManager.NODE_OUTDATED,status);
+
+        single.addNode(revision, contextName);
+        status = single.checkNode(revision, contextName);
+        assertEquals("Should be again a current (saved) node",NodeManager.NODE_SAVED,status);
+
+    	revision = new Long(10);
+        status = single.checkNode(revision, contextName);
+        assertEquals("Should still be a current (saved) node",NodeManager.NODE_SAVED,status);
+
+    	single.removeNode(contextName); //previous run didn't clean up
+        status = single.checkNode(revision, contextName);
+        assertEquals("Node should be gone....",NodeManager.NODE_NEW,status);
+    }
+    protected String[] getConfigurations()
+    {
+        return new String[]
+        { "system-properties.xml", "cluster-node.xml"};
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/cluster/TestCluster.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/FragmentUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/LocalFragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/LocalFragmentImpl.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/LocalFragmentImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/LocalFragmentImpl.java Fri Dec 12 04:06:29 2008
@@ -1,83 +1,83 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.layout;
-
-import java.util.List;
-import org.apache.jetspeed.om.page.Fragment;
-import org.apache.jetspeed.om.page.psml.FragmentImpl;
-import java.util.ArrayList;
-
-/**
- * Test for Fragment placement
- * 
- * @author <a>David Gurney </a>
- * @version $Id: $
- */
-public class LocalFragmentImpl extends FragmentImpl
-{
-    private ArrayList m_oFragments = new ArrayList();
-
-    private String m_sName = null;
-
-    private String m_sType = null;
-
-    private String m_sID = null;
-
-    public LocalFragmentImpl()
-    {
-    }
-
-    public void addFragment(Fragment p_oFragment)
-    {
-        m_oFragments.add(p_oFragment);
-    }
-
-    public List getFragments()
-    {
-        return m_oFragments;
-    }
-
-    public String getId()
-    {
-        return m_sID;
-    }
-
-    public String getName()
-    {
-        return m_sName;
-    }
-
-    public String getType()
-    {
-        return m_sType;
-    }
-
-    public void setId(String p_sID)
-    {
-        m_sID = p_sID;
-    }
-
-    public void setName(String p_sName)
-    {
-        m_sName = p_sName;
-    }
-
-    public void setType(String p_sType)
-    {
-        m_sType = p_sType;
-    }
-}
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.layout;
+
+import java.util.List;
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.psml.FragmentImpl;
+import java.util.ArrayList;
+
+/**
+ * Test for Fragment placement
+ * 
+ * @author <a>David Gurney </a>
+ * @version $Id: $
+ */
+public class LocalFragmentImpl extends FragmentImpl
+{
+    private ArrayList m_oFragments = new ArrayList();
+
+    private String m_sName = null;
+
+    private String m_sType = null;
+
+    private String m_sID = null;
+
+    public LocalFragmentImpl()
+    {
+    }
+
+    public void addFragment(Fragment p_oFragment)
+    {
+        m_oFragments.add(p_oFragment);
+    }
+
+    public List getFragments()
+    {
+        return m_oFragments;
+    }
+
+    public String getId()
+    {
+        return m_sID;
+    }
+
+    public String getName()
+    {
+        return m_sName;
+    }
+
+    public String getType()
+    {
+        return m_sType;
+    }
+
+    public void setId(String p_sID)
+    {
+        m_sID = p_sID;
+    }
+
+    public void setName(String p_sName)
+    {
+        m_sName = p_sName;
+    }
+
+    public void setType(String p_sType)
+    {
+        m_sType = p_sType;
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/LocalFragmentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/Log4j.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/Log4j.properties?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/Log4j.properties (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/Log4j.properties Fri Dec 12 04:06:29 2008
@@ -13,45 +13,45 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#
-# If we don't know the logging facility, put it into the jetspeed.log
-# 
-#
-log4j.rootLogger = INFO, php
-
-#
-# Jetspeed goes into Jetspeed Log
-#
-log4j.category.com.fmr.portal.pipieline = DEBUG, jetspeed
-log4j.additivity.com.fmr.portal.pipeline = false
-
-########################################################################
-#
-# Logfile definitions
-#
-########################################################################
-
-
-#
-# php.log
-#
-log4j.appender.php = org.apache.log4j.FileAppender
-log4j.appender.php.file = ${applicationRoot}/logs/php.log
-log4j.appender.php.layout = org.apache.log4j.PatternLayout
-log4j.appender.php.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.php.append = false
-
-log4j.appender.digester = org.apache.log4j.FileAppender
-log4j.appender.digester.file = ${applicationRoot}/logs/digester.log
-log4j.appender.digester.layout = org.apache.log4j.PatternLayout
-log4j.appender.digester.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.digester.append = false
-
-#
-# Console
-#
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-
-# Pattern to output the caller's file name and line number.
-log4j.appender.console.layout.ConversionPattern=%5p: %m%n
+#
+# If we don't know the logging facility, put it into the jetspeed.log
+# 
+#
+log4j.rootLogger = INFO, php
+
+#
+# Jetspeed goes into Jetspeed Log
+#
+log4j.category.com.fmr.portal.pipieline = DEBUG, jetspeed
+log4j.additivity.com.fmr.portal.pipeline = false
+
+########################################################################
+#
+# Logfile definitions
+#
+########################################################################
+
+
+#
+# php.log
+#
+log4j.appender.php = org.apache.log4j.FileAppender
+log4j.appender.php.file = ${applicationRoot}/logs/php.log
+log4j.appender.php.layout = org.apache.log4j.PatternLayout
+log4j.appender.php.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.php.append = false
+
+log4j.appender.digester = org.apache.log4j.FileAppender
+log4j.appender.digester.file = ${applicationRoot}/logs/digester.log
+log4j.appender.digester.layout = org.apache.log4j.PatternLayout
+log4j.appender.digester.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.digester.append = false
+
+#
+# Console
+#
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.console.layout.ConversionPattern=%5p: %m%n

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/layout/Log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message