You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by ad...@apache.org on 2010/05/26 20:34:49 UTC

svn commit: r948527 [10/38] - in /incubator/shiro: branches/shiro-root-1.0.x/ branches/shiro-root-1.0.x/all/ branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/ branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/aop/ branches/shir...

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractRememberMeManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractRememberMeManagerTest.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractRememberMeManagerTest.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractRememberMeManagerTest.java Wed May 26 18:34:28 2010
@@ -1,77 +1,77 @@
-/*
- * 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.shiro.mgt;
-
-import org.apache.shiro.subject.PrincipalCollection;
-import org.apache.shiro.subject.Subject;
-import org.apache.shiro.subject.SubjectContext;
-import org.apache.shiro.subject.support.DefaultSubjectContext;
-import org.junit.Test;
-
-import static org.junit.Assert.assertNull;
-
-/**
- * Test cases for the {@link AbstractRememberMeManager} implementation.
- */
-public class AbstractRememberMeManagerTest {
-
-    /**
-     * Tests the {@link AbstractRememberMeManager#getRememberedPrincipals(SubjectContext)} method
-     * implementation when the internal
-     * {@link AbstractRememberMeManager#getRememberedSerializedIdentity(SubjectContext)} method
-     * returns null or empty bytes.
-     */
-    @Test
-    public void testGetRememberedPrincipalsWithEmptySerializedBytes() {
-        AbstractRememberMeManager rmm = new DummyRememberMeManager();
-        //Since the dummy's getRememberedSerializedIdentity implementation returns an empty byte
-        //array, we should be ok:
-        PrincipalCollection principals = rmm.getRememberedPrincipals(new DefaultSubjectContext());
-        assertNull(principals);
-
-        //try with a null return value too:
-        rmm = new DummyRememberMeManager() {
-            @Override
-            protected byte[] getRememberedSerializedIdentity(SubjectContext subjectContext) {
-                return null;
-            }
-        };
-        principals = rmm.getRememberedPrincipals(new DefaultSubjectContext());
-        assertNull(principals);
-    }
-
-    private static class DummyRememberMeManager extends AbstractRememberMeManager {
-        public void forgetIdentity(SubjectContext subjectContext) {
-            //do nothing
-        }
-
-        @Override
-        protected void forgetIdentity(Subject subject) {
-        }
-
-        @Override
-        protected void rememberSerializedIdentity(Subject subject, byte[] serialized) {
-        }
-
-        @Override
-        protected byte[] getRememberedSerializedIdentity(SubjectContext subjectContext) {
-            return new byte[0];
-        }
-    }
-}
+/*
+ * 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.shiro.mgt;
+
+import org.apache.shiro.subject.PrincipalCollection;
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.subject.SubjectContext;
+import org.apache.shiro.subject.support.DefaultSubjectContext;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNull;
+
+/**
+ * Test cases for the {@link AbstractRememberMeManager} implementation.
+ */
+public class AbstractRememberMeManagerTest {
+
+    /**
+     * Tests the {@link AbstractRememberMeManager#getRememberedPrincipals(SubjectContext)} method
+     * implementation when the internal
+     * {@link AbstractRememberMeManager#getRememberedSerializedIdentity(SubjectContext)} method
+     * returns null or empty bytes.
+     */
+    @Test
+    public void testGetRememberedPrincipalsWithEmptySerializedBytes() {
+        AbstractRememberMeManager rmm = new DummyRememberMeManager();
+        //Since the dummy's getRememberedSerializedIdentity implementation returns an empty byte
+        //array, we should be ok:
+        PrincipalCollection principals = rmm.getRememberedPrincipals(new DefaultSubjectContext());
+        assertNull(principals);
+
+        //try with a null return value too:
+        rmm = new DummyRememberMeManager() {
+            @Override
+            protected byte[] getRememberedSerializedIdentity(SubjectContext subjectContext) {
+                return null;
+            }
+        };
+        principals = rmm.getRememberedPrincipals(new DefaultSubjectContext());
+        assertNull(principals);
+    }
+
+    private static class DummyRememberMeManager extends AbstractRememberMeManager {
+        public void forgetIdentity(SubjectContext subjectContext) {
+            //do nothing
+        }
+
+        @Override
+        protected void forgetIdentity(Subject subject) {
+        }
+
+        @Override
+        protected void rememberSerializedIdentity(Subject subject, byte[] serialized) {
+        }
+
+        @Override
+        protected byte[] getRememberedSerializedIdentity(SubjectContext subjectContext) {
+            return new byte[0];
+        }
+    }
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractRememberMeManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractSecurityManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractSecurityManagerTest.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractSecurityManagerTest.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractSecurityManagerTest.java Wed May 26 18:34:28 2010
@@ -1,45 +1,45 @@
-/*
- * 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.shiro.mgt;
-
-import org.apache.shiro.subject.Subject;
-import org.apache.shiro.subject.support.SubjectThreadState;
-import org.apache.shiro.util.ThreadContext;
-import org.apache.shiro.util.ThreadState;
-import org.junit.After;
-
-/**
- * @since 1.0
- */
-public abstract class AbstractSecurityManagerTest {
-
-    protected ThreadState threadState;
-
-    @After
-    public void tearDown() {
-        ThreadContext.remove();
-    }
-
-    protected Subject newSubject(SecurityManager securityManager) {
-        Subject subject = new Subject.Builder(securityManager).buildSubject();
-        threadState = new SubjectThreadState(subject);
-        threadState.bind();
-        return subject;
-    }
-}
+/*
+ * 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.shiro.mgt;
+
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.subject.support.SubjectThreadState;
+import org.apache.shiro.util.ThreadContext;
+import org.apache.shiro.util.ThreadState;
+import org.junit.After;
+
+/**
+ * @since 1.0
+ */
+public abstract class AbstractSecurityManagerTest {
+
+    protected ThreadState threadState;
+
+    @After
+    public void tearDown() {
+        ThreadContext.remove();
+    }
+
+    protected Subject newSubject(SecurityManager securityManager) {
+        Subject subject = new Subject.Builder(securityManager).buildSubject();
+        threadState = new SubjectThreadState(subject);
+        threadState.bind();
+        return subject;
+    }
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/AbstractSecurityManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/DefaultSecurityManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/mgt/VMSingletonDefaultSecurityManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/AuthorizingRealmTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UserIdPrincipal.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UserIdPrincipal.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UserIdPrincipal.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UserIdPrincipal.java Wed May 26 18:34:28 2010
@@ -1,39 +1,39 @@
-/*
- * 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.shiro.realm;
-
-import java.io.Serializable;
-import java.security.Principal;
-
-public class UserIdPrincipal implements Principal, Serializable {
-
-    private int userId;
-
-    public UserIdPrincipal(int userId) {
-        this.userId = userId;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public String getName() {
-        return String.valueOf(userId);
-    }
+/*
+ * 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.shiro.realm;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+public class UserIdPrincipal implements Principal, Serializable {
+
+    private int userId;
+
+    public UserIdPrincipal(int userId) {
+        this.userId = userId;
+    }
+
+    public int getUserId() {
+        return userId;
+    }
+
+    public String getName() {
+        return String.valueOf(userId);
+    }
 }
\ No newline at end of file

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UserIdPrincipal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UsernamePrincipal.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UsernamePrincipal.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UsernamePrincipal.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UsernamePrincipal.java Wed May 26 18:34:28 2010
@@ -1,39 +1,39 @@
-/*
- * 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.shiro.realm;
-
-import java.io.Serializable;
-import java.security.Principal;
-
-public class UsernamePrincipal implements Principal, Serializable {
-
-    private String username;
-
-    public UsernamePrincipal(String username) {
-        this.username = username;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public String getName() {
-        return String.valueOf(username);
-    }
-}
+/*
+ * 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.shiro.realm;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+public class UsernamePrincipal implements Principal, Serializable {
+
+    private String username;
+
+    public UsernamePrincipal(String username) {
+        this.username = username;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public String getName() {
+        return String.valueOf(username);
+    }
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/UsernamePrincipal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/activedirectory/ActiveDirectoryRealmTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/text/IniRealmTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/text/IniRealmTest.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/text/IniRealmTest.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/text/IniRealmTest.java Wed May 26 18:34:28 2010
@@ -1,70 +1,70 @@
-/*
- * 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.shiro.realm.text;
-
-import org.apache.shiro.authc.AuthenticationInfo;
-import org.apache.shiro.authc.UsernamePasswordToken;
-import org.apache.shiro.config.Ini;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import org.junit.Test;
-
-/**
- * Unit tests for the {@link IniRealm} class.
- *
- * @author The Apache Shiro Project (shiro-dev@incubator.apache.org)
- * @since 1.0
- */
-public class IniRealmTest {
-
-    @Test
-    public void testNullIni() {
-        IniRealm realm = new IniRealm((Ini) null);
-    }
-
-    @Test
-    public void testEmptyIni() {
-        new IniRealm(new Ini());
-    }
-
-    @Test(expected = IllegalStateException.class)
-    public void testInitWithoutIniResource() {
-        new IniRealm().init();
-    }
-
-    @Test
-    public void testIniFile() {
-        IniRealm realm = new IniRealm();
-        realm.setResourcePath("classpath:org/apache/shiro/realm/text/IniRealmTest.simple.ini");
-        realm.init();
-        assertTrue(realm.roleExists("admin"));
-        UsernamePasswordToken token = new UsernamePasswordToken("user1", "user1");
-        AuthenticationInfo info = realm.getAuthenticationInfo(token);
-        assertNotNull(info);
-        assertTrue(realm.hasRole(info.getPrincipals(), "admin"));
-    }
-
-    @Test
-    public void testIniFileWithoutUsers() {
-        IniRealm realm = new IniRealm();
-        realm.setResourcePath("classpath:org/apache/shiro/realm/text/IniRealmTest.noUsers.ini");
-        realm.init();
-        assertTrue(realm.roleExists("admin"));
-    }
-}
+/*
+ * 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.shiro.realm.text;
+
+import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.config.Ini;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+/**
+ * Unit tests for the {@link IniRealm} class.
+ *
+ * @author The Apache Shiro Project (shiro-dev@incubator.apache.org)
+ * @since 1.0
+ */
+public class IniRealmTest {
+
+    @Test
+    public void testNullIni() {
+        IniRealm realm = new IniRealm((Ini) null);
+    }
+
+    @Test
+    public void testEmptyIni() {
+        new IniRealm(new Ini());
+    }
+
+    @Test(expected = IllegalStateException.class)
+    public void testInitWithoutIniResource() {
+        new IniRealm().init();
+    }
+
+    @Test
+    public void testIniFile() {
+        IniRealm realm = new IniRealm();
+        realm.setResourcePath("classpath:org/apache/shiro/realm/text/IniRealmTest.simple.ini");
+        realm.init();
+        assertTrue(realm.roleExists("admin"));
+        UsernamePasswordToken token = new UsernamePasswordToken("user1", "user1");
+        AuthenticationInfo info = realm.getAuthenticationInfo(token);
+        assertNotNull(info);
+        assertTrue(realm.hasRole(info.getPrincipals(), "admin"));
+    }
+
+    @Test
+    public void testIniFileWithoutUsers() {
+        IniRealm realm = new IniRealm();
+        realm.setResourcePath("classpath:org/apache/shiro/realm/text/IniRealmTest.noUsers.ini");
+        realm.init();
+        assertTrue(realm.roleExists("admin"));
+    }
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/realm/text/IniRealmTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DefaultSessionManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DefaultSessionManagerTest.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DefaultSessionManagerTest.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DefaultSessionManagerTest.java Wed May 26 18:34:28 2010
@@ -1,193 +1,193 @@
-/*
- * 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.shiro.session.mgt;
-
-import org.apache.shiro.session.*;
-import org.apache.shiro.session.mgt.eis.SessionDAO;
-import org.apache.shiro.util.ThreadContext;
-import org.easymock.EasyMock;
-import org.easymock.IArgumentMatcher;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.UUID;
-
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
-
-/**
- * Unit test for the {@link DefaultSessionManager DefaultSessionManager} implementation.
- */
-public class DefaultSessionManagerTest {
-
-    DefaultSessionManager sm = null;
-
-    @Before
-    public void setup() {
-        ThreadContext.remove();
-        sm = new DefaultSessionManager();
-    }
-
-    @After
-    public void tearDown() {
-        sm.destroy();
-        ThreadContext.remove();
-    }
-
-    public void sleep(long millis) {
-        try {
-            Thread.sleep(millis);
-        } catch (InterruptedException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    @Test
-    public void testGlobalTimeout() {
-        long timeout = 1000;
-        sm.setGlobalSessionTimeout(timeout);
-        Session session = sm.start(null);
-        assertNotNull(session);
-        assertNotNull(session.getId());
-        assertEquals(session.getTimeout(), timeout);
-    }
-
-    @Test
-    public void testSessionListenerStartNotification() {
-        final boolean[] started = new boolean[1];
-        SessionListener listener = new SessionListenerAdapter() {
-            public void onStart(Session session) {
-                started[0] = true;
-            }
-        };
-        sm.getSessionListeners().add(listener);
-        sm.start(null);
-        assertTrue(started[0]);
-    }
-
-    @Test
-    public void testSessionListenerStopNotification() {
-        final boolean[] stopped = new boolean[1];
-        SessionListener listener = new SessionListenerAdapter() {
-            public void onStop(Session session) {
-                stopped[0] = true;
-            }
-        };
-        sm.getSessionListeners().add(listener);
-        Session session = sm.start(null);
-        sm.stop(new DefaultSessionKey(session.getId()));
-        assertTrue(stopped[0]);
-    }
-
-    @Test
-    public void testSessionListenerExpiredNotification() {
-        final boolean[] expired = new boolean[1];
-        SessionListener listener = new SessionListenerAdapter() {
-            public void onExpiration(Session session) {
-                expired[0] = true;
-            }
-        };
-        sm.getSessionListeners().add(listener);
-        sm.setGlobalSessionTimeout(100);
-        Session session = sm.start(null);
-        sleep(150);
-        try {
-            sm.checkValid(new DefaultSessionKey(session.getId()));
-            fail("check should have thrown an exception.");
-        } catch (InvalidSessionException expected) {
-            //do nothing - expected.
-        }
-        assertTrue(expired[0]);
-    }
-
-    @Test
-    public void testSessionDeleteOnExpiration() {
-        sm.setGlobalSessionTimeout(100);
-
-        SessionDAO sessionDAO = createMock(SessionDAO.class);
-        sm.setSessionDAO(sessionDAO);
-
-        String sessionId1 = UUID.randomUUID().toString();
-        final SimpleSession session1 = new SimpleSession();
-        session1.setId(sessionId1);
-
-        final Session[] activeSession = new SimpleSession[]{session1};
-        sm.setSessionFactory(new SessionFactory() {
-            public Session createSession(SessionContext initData) {
-                return activeSession[0];
-            }
-        });
-
-        expect(sessionDAO.create(eq(session1))).andReturn(sessionId1);
-        sessionDAO.update(eq(session1));
-        expectLastCall().anyTimes();
-        replay(sessionDAO);
-        Session session = sm.start(null);
-        assertNotNull(session);
-        verify(sessionDAO);
-        reset(sessionDAO);
-
-        expect(sessionDAO.readSession(sessionId1)).andReturn(session1).anyTimes();
-        sessionDAO.update(eq(session1));
-        replay(sessionDAO);
-        sm.setTimeout(new DefaultSessionKey(sessionId1), 1);
-        verify(sessionDAO);
-        reset(sessionDAO);
-
-        sleep(20);
-
-        expect(sessionDAO.readSession(sessionId1)).andReturn(session1);
-        sessionDAO.update(eq(session1)); //update's the stop timestamp
-        sessionDAO.delete(session1);
-        replay(sessionDAO);
-
-        //Try to access the same session, but it should throw an UnknownSessionException due to timeout:
-        try {
-            sm.getTimeout(new DefaultSessionKey(sessionId1));
-            fail("Session with id [" + sessionId1 + "] should have expired due to timeout.");
-        } catch (ExpiredSessionException expected) {
-            //expected
-        }
-
-        verify(sessionDAO); //verify that the delete call was actually made on the DAO
-    }
-
-    public static <T extends Session> T eqSessionTimeout(long timeout) {
-        EasyMock.reportMatcher(new SessionTimeoutMatcher(timeout));
-        return null;
-    }
-
-    private static class SessionTimeoutMatcher implements IArgumentMatcher {
-
-        private final long timeout;
-
-        public SessionTimeoutMatcher(long timeout) {
-            this.timeout = timeout;
-        }
-
-        public void appendTo(StringBuffer buffer) {
-            buffer.append("eqSession(timeout=").append(this.timeout).append(")");
-        }
-
-        public boolean matches(Object o) {
-            return o instanceof Session && ((Session) o).getTimeout() == this.timeout;
-        }
-    }
-}
+/*
+ * 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.shiro.session.mgt;
+
+import org.apache.shiro.session.*;
+import org.apache.shiro.session.mgt.eis.SessionDAO;
+import org.apache.shiro.util.ThreadContext;
+import org.easymock.EasyMock;
+import org.easymock.IArgumentMatcher;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.UUID;
+
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
+
+/**
+ * Unit test for the {@link DefaultSessionManager DefaultSessionManager} implementation.
+ */
+public class DefaultSessionManagerTest {
+
+    DefaultSessionManager sm = null;
+
+    @Before
+    public void setup() {
+        ThreadContext.remove();
+        sm = new DefaultSessionManager();
+    }
+
+    @After
+    public void tearDown() {
+        sm.destroy();
+        ThreadContext.remove();
+    }
+
+    public void sleep(long millis) {
+        try {
+            Thread.sleep(millis);
+        } catch (InterruptedException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    @Test
+    public void testGlobalTimeout() {
+        long timeout = 1000;
+        sm.setGlobalSessionTimeout(timeout);
+        Session session = sm.start(null);
+        assertNotNull(session);
+        assertNotNull(session.getId());
+        assertEquals(session.getTimeout(), timeout);
+    }
+
+    @Test
+    public void testSessionListenerStartNotification() {
+        final boolean[] started = new boolean[1];
+        SessionListener listener = new SessionListenerAdapter() {
+            public void onStart(Session session) {
+                started[0] = true;
+            }
+        };
+        sm.getSessionListeners().add(listener);
+        sm.start(null);
+        assertTrue(started[0]);
+    }
+
+    @Test
+    public void testSessionListenerStopNotification() {
+        final boolean[] stopped = new boolean[1];
+        SessionListener listener = new SessionListenerAdapter() {
+            public void onStop(Session session) {
+                stopped[0] = true;
+            }
+        };
+        sm.getSessionListeners().add(listener);
+        Session session = sm.start(null);
+        sm.stop(new DefaultSessionKey(session.getId()));
+        assertTrue(stopped[0]);
+    }
+
+    @Test
+    public void testSessionListenerExpiredNotification() {
+        final boolean[] expired = new boolean[1];
+        SessionListener listener = new SessionListenerAdapter() {
+            public void onExpiration(Session session) {
+                expired[0] = true;
+            }
+        };
+        sm.getSessionListeners().add(listener);
+        sm.setGlobalSessionTimeout(100);
+        Session session = sm.start(null);
+        sleep(150);
+        try {
+            sm.checkValid(new DefaultSessionKey(session.getId()));
+            fail("check should have thrown an exception.");
+        } catch (InvalidSessionException expected) {
+            //do nothing - expected.
+        }
+        assertTrue(expired[0]);
+    }
+
+    @Test
+    public void testSessionDeleteOnExpiration() {
+        sm.setGlobalSessionTimeout(100);
+
+        SessionDAO sessionDAO = createMock(SessionDAO.class);
+        sm.setSessionDAO(sessionDAO);
+
+        String sessionId1 = UUID.randomUUID().toString();
+        final SimpleSession session1 = new SimpleSession();
+        session1.setId(sessionId1);
+
+        final Session[] activeSession = new SimpleSession[]{session1};
+        sm.setSessionFactory(new SessionFactory() {
+            public Session createSession(SessionContext initData) {
+                return activeSession[0];
+            }
+        });
+
+        expect(sessionDAO.create(eq(session1))).andReturn(sessionId1);
+        sessionDAO.update(eq(session1));
+        expectLastCall().anyTimes();
+        replay(sessionDAO);
+        Session session = sm.start(null);
+        assertNotNull(session);
+        verify(sessionDAO);
+        reset(sessionDAO);
+
+        expect(sessionDAO.readSession(sessionId1)).andReturn(session1).anyTimes();
+        sessionDAO.update(eq(session1));
+        replay(sessionDAO);
+        sm.setTimeout(new DefaultSessionKey(sessionId1), 1);
+        verify(sessionDAO);
+        reset(sessionDAO);
+
+        sleep(20);
+
+        expect(sessionDAO.readSession(sessionId1)).andReturn(session1);
+        sessionDAO.update(eq(session1)); //update's the stop timestamp
+        sessionDAO.delete(session1);
+        replay(sessionDAO);
+
+        //Try to access the same session, but it should throw an UnknownSessionException due to timeout:
+        try {
+            sm.getTimeout(new DefaultSessionKey(sessionId1));
+            fail("Session with id [" + sessionId1 + "] should have expired due to timeout.");
+        } catch (ExpiredSessionException expected) {
+            //expected
+        }
+
+        verify(sessionDAO); //verify that the delete call was actually made on the DAO
+    }
+
+    public static <T extends Session> T eqSessionTimeout(long timeout) {
+        EasyMock.reportMatcher(new SessionTimeoutMatcher(timeout));
+        return null;
+    }
+
+    private static class SessionTimeoutMatcher implements IArgumentMatcher {
+
+        private final long timeout;
+
+        public SessionTimeoutMatcher(long timeout) {
+            this.timeout = timeout;
+        }
+
+        public void appendTo(StringBuffer buffer) {
+            buffer.append("eqSession(timeout=").append(this.timeout).append(")");
+        }
+
+        public boolean matches(Object o) {
+            return o instanceof Session && ((Session) o).getTimeout() == this.timeout;
+        }
+    }
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DefaultSessionManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java Wed May 26 18:34:28 2010
@@ -1,76 +1,76 @@
-/*
- * 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.shiro.session.mgt;
-
-import org.apache.shiro.session.ExpiredSessionException;
-import org.apache.shiro.util.ThreadContext;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.Serializable;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-/**
- * Unit test for the {@link DelegatingSession} class.
- */
-public class DelegatingSessionTest {
-
-    DelegatingSession session = null;
-    DefaultSessionManager sm = null;
-
-    @Before
-    public void setup() {
-        ThreadContext.remove();
-        sm = new DefaultSessionManager();
-        this.session = new DelegatingSession(sm, new DefaultSessionKey(sm.start(null).getId()));
-    }
-
-    @After
-    public void tearDown() {
-        sm.destroy();
-        ThreadContext.remove();
-    }
-
-    public void sleep(long millis) {
-        try {
-            Thread.sleep(millis);
-        } catch (InterruptedException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    @Test
-    public void testTimeout() {
-        Serializable origId = session.getId();
-        assertEquals(session.getTimeout(), AbstractSessionManager.DEFAULT_GLOBAL_SESSION_TIMEOUT);
-        session.touch();
-        session.setTimeout(100);
-        assertEquals(100, session.getTimeout());
-        sleep(150);
-        try {
-            session.getTimeout();
-            fail("Session should have expired.");
-        } catch (ExpiredSessionException expected) {
-        }
-    }
-
-}
+/*
+ * 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.shiro.session.mgt;
+
+import org.apache.shiro.session.ExpiredSessionException;
+import org.apache.shiro.util.ThreadContext;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.Serializable;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * Unit test for the {@link DelegatingSession} class.
+ */
+public class DelegatingSessionTest {
+
+    DelegatingSession session = null;
+    DefaultSessionManager sm = null;
+
+    @Before
+    public void setup() {
+        ThreadContext.remove();
+        sm = new DefaultSessionManager();
+        this.session = new DelegatingSession(sm, new DefaultSessionKey(sm.start(null).getId()));
+    }
+
+    @After
+    public void tearDown() {
+        sm.destroy();
+        ThreadContext.remove();
+    }
+
+    public void sleep(long millis) {
+        try {
+            Thread.sleep(millis);
+        } catch (InterruptedException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    @Test
+    public void testTimeout() {
+        Serializable origId = session.getId();
+        assertEquals(session.getTimeout(), AbstractSessionManager.DEFAULT_GLOBAL_SESSION_TIMEOUT);
+        session.touch();
+        session.setTimeout(100);
+        assertEquals(100, session.getTimeout());
+        sleep(150);
+        try {
+            session.getTimeout();
+            fail("Session should have expired.");
+        } catch (ExpiredSessionException expected) {
+        }
+    }
+
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/subject/DelegatingSubjectTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/subject/DelegatingSubjectTest.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/subject/DelegatingSubjectTest.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/subject/DelegatingSubjectTest.java Wed May 26 18:34:28 2010
@@ -1,180 +1,180 @@
-/*
- * 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.shiro.subject;
-
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authc.UsernamePasswordToken;
-import org.apache.shiro.config.Ini;
-import org.apache.shiro.config.IniSecurityManagerFactory;
-import org.apache.shiro.mgt.DefaultSecurityManager;
-import org.apache.shiro.mgt.SecurityManager;
-import org.apache.shiro.session.Session;
-import org.apache.shiro.subject.support.DelegatingSubject;
-import org.apache.shiro.util.CollectionUtils;
-import org.apache.shiro.util.LifecycleUtils;
-import org.apache.shiro.util.ThreadContext;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.Serializable;
-import java.util.concurrent.Callable;
-
-import static org.easymock.EasyMock.createNiceMock;
-import static org.junit.Assert.*;
-
-
-/**
- * @author Les Hazlewood
- * @since Aug 1, 2008 2:11:17 PM
- */
-public class DelegatingSubjectTest {
-
-    @Before
-    public void setup() {
-        ThreadContext.remove();
-    }
-
-    @After
-    public void tearDown() {
-        ThreadContext.remove();
-    }
-
-    @Test
-    public void testSessionStopThenStart() {
-        String key = "testKey";
-        String value = "testValue";
-        DefaultSecurityManager sm = new DefaultSecurityManager();
-
-        DelegatingSubject subject = new DelegatingSubject(sm);
-
-        Session session = subject.getSession();
-        session.setAttribute(key, value);
-        assertTrue(session.getAttribute(key).equals(value));
-        Serializable firstSessionId = session.getId();
-        assertNotNull(firstSessionId);
-
-        session.stop();
-
-        session = subject.getSession();
-        assertNotNull(session);
-        assertNull(session.getAttribute(key));
-        Serializable secondSessionId = session.getId();
-        assertNotNull(secondSessionId);
-        assertFalse(firstSessionId.equals(secondSessionId));
-
-        subject.logout();
-
-        sm.destroy();
-    }
-
-    @Test
-    public void testExecuteCallable() {
-
-        String username = "jsmith";
-
-        SecurityManager securityManager = createNiceMock(SecurityManager.class);
-        PrincipalCollection identity = new SimplePrincipalCollection(username, "testRealm");
-        final Subject sourceSubject = new DelegatingSubject(identity, true, null, null, securityManager);
-
-        assertNull(ThreadContext.getSubject());
-        assertNull(ThreadContext.getSecurityManager());
-
-        Callable<String> callable = new Callable<String>() {
-            public String call() throws Exception {
-                Subject callingSubject = SecurityUtils.getSubject();
-                assertNotNull(callingSubject);
-                assertNotNull(SecurityUtils.getSecurityManager());
-                assertEquals(callingSubject, sourceSubject);
-                return "Hello " + callingSubject.getPrincipal();
-            }
-        };
-        String response = sourceSubject.execute(callable);
-
-        assertNotNull(response);
-        assertEquals("Hello " + username, response);
-
-        assertNull(ThreadContext.getSubject());
-        assertNull(ThreadContext.getSecurityManager());
-    }
-
-    @Test
-    public void testExecuteRunnable() {
-
-        String username = "jsmith";
-
-        SecurityManager securityManager = createNiceMock(SecurityManager.class);
-        PrincipalCollection identity = new SimplePrincipalCollection(username, "testRealm");
-        final Subject sourceSubject = new DelegatingSubject(identity, true, null, null, securityManager);
-
-        assertNull(ThreadContext.getSubject());
-        assertNull(ThreadContext.getSecurityManager());
-
-        Runnable runnable = new Runnable() {
-            public void run() {
-                Subject callingSubject = SecurityUtils.getSubject();
-                assertNotNull(callingSubject);
-                assertNotNull(SecurityUtils.getSecurityManager());
-                assertEquals(callingSubject, sourceSubject);
-            }
-        };
-        sourceSubject.execute(runnable);
-
-        assertNull(ThreadContext.getSubject());
-        assertNull(ThreadContext.getSecurityManager());
-    }
-
-    @Test
-    public void testRunAs() {
-
-        Ini ini = new Ini();
-        Ini.Section users = ini.addSection("users");
-        users.put("user1", "user1,role1");
-        users.put("user2", "user2,role2");
-        IniSecurityManagerFactory factory = new IniSecurityManagerFactory(ini);
-        SecurityManager sm = factory.getInstance();
-
-        Subject subject = new Subject.Builder(sm).buildSubject();
-        subject.login(new UsernamePasswordToken("user1", "user1"));
-
-        assertTrue(subject.getPrincipal().equals("user1"));
-        assertTrue(subject.hasRole("role1"));
-        assertFalse(subject.isRunAs());
-        assertNull(subject.getPreviousPrincipals());
-
-        subject.runAs(new SimplePrincipalCollection("user2", IniSecurityManagerFactory.INI_REALM_NAME));
-
-        assertFalse(subject.getPrincipal().equals("user1"));
-        assertFalse(subject.hasRole("role1"));
-        assertTrue(subject.getPrincipal().equals("user2"));
-        assertTrue(subject.hasRole("role2"));
-        assertTrue(subject.isRunAs());
-        assertFalse(CollectionUtils.isEmpty(subject.getPreviousPrincipals()));
-        assertTrue(subject.getPreviousPrincipals().getPrimaryPrincipal().equals("user1"));
-
-        subject.releaseRunAs();
-        assertTrue(subject.getPrincipal().equals("user1"));
-        assertTrue(subject.hasRole("role1"));
-        assertFalse(subject.isRunAs());
-        assertNull(subject.getPreviousPrincipals());
-
-        subject.logout();
-        LifecycleUtils.destroy(sm);
-    }
-}
+/*
+ * 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.shiro.subject;
+
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.config.Ini;
+import org.apache.shiro.config.IniSecurityManagerFactory;
+import org.apache.shiro.mgt.DefaultSecurityManager;
+import org.apache.shiro.mgt.SecurityManager;
+import org.apache.shiro.session.Session;
+import org.apache.shiro.subject.support.DelegatingSubject;
+import org.apache.shiro.util.CollectionUtils;
+import org.apache.shiro.util.LifecycleUtils;
+import org.apache.shiro.util.ThreadContext;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.Serializable;
+import java.util.concurrent.Callable;
+
+import static org.easymock.EasyMock.createNiceMock;
+import static org.junit.Assert.*;
+
+
+/**
+ * @author Les Hazlewood
+ * @since Aug 1, 2008 2:11:17 PM
+ */
+public class DelegatingSubjectTest {
+
+    @Before
+    public void setup() {
+        ThreadContext.remove();
+    }
+
+    @After
+    public void tearDown() {
+        ThreadContext.remove();
+    }
+
+    @Test
+    public void testSessionStopThenStart() {
+        String key = "testKey";
+        String value = "testValue";
+        DefaultSecurityManager sm = new DefaultSecurityManager();
+
+        DelegatingSubject subject = new DelegatingSubject(sm);
+
+        Session session = subject.getSession();
+        session.setAttribute(key, value);
+        assertTrue(session.getAttribute(key).equals(value));
+        Serializable firstSessionId = session.getId();
+        assertNotNull(firstSessionId);
+
+        session.stop();
+
+        session = subject.getSession();
+        assertNotNull(session);
+        assertNull(session.getAttribute(key));
+        Serializable secondSessionId = session.getId();
+        assertNotNull(secondSessionId);
+        assertFalse(firstSessionId.equals(secondSessionId));
+
+        subject.logout();
+
+        sm.destroy();
+    }
+
+    @Test
+    public void testExecuteCallable() {
+
+        String username = "jsmith";
+
+        SecurityManager securityManager = createNiceMock(SecurityManager.class);
+        PrincipalCollection identity = new SimplePrincipalCollection(username, "testRealm");
+        final Subject sourceSubject = new DelegatingSubject(identity, true, null, null, securityManager);
+
+        assertNull(ThreadContext.getSubject());
+        assertNull(ThreadContext.getSecurityManager());
+
+        Callable<String> callable = new Callable<String>() {
+            public String call() throws Exception {
+                Subject callingSubject = SecurityUtils.getSubject();
+                assertNotNull(callingSubject);
+                assertNotNull(SecurityUtils.getSecurityManager());
+                assertEquals(callingSubject, sourceSubject);
+                return "Hello " + callingSubject.getPrincipal();
+            }
+        };
+        String response = sourceSubject.execute(callable);
+
+        assertNotNull(response);
+        assertEquals("Hello " + username, response);
+
+        assertNull(ThreadContext.getSubject());
+        assertNull(ThreadContext.getSecurityManager());
+    }
+
+    @Test
+    public void testExecuteRunnable() {
+
+        String username = "jsmith";
+
+        SecurityManager securityManager = createNiceMock(SecurityManager.class);
+        PrincipalCollection identity = new SimplePrincipalCollection(username, "testRealm");
+        final Subject sourceSubject = new DelegatingSubject(identity, true, null, null, securityManager);
+
+        assertNull(ThreadContext.getSubject());
+        assertNull(ThreadContext.getSecurityManager());
+
+        Runnable runnable = new Runnable() {
+            public void run() {
+                Subject callingSubject = SecurityUtils.getSubject();
+                assertNotNull(callingSubject);
+                assertNotNull(SecurityUtils.getSecurityManager());
+                assertEquals(callingSubject, sourceSubject);
+            }
+        };
+        sourceSubject.execute(runnable);
+
+        assertNull(ThreadContext.getSubject());
+        assertNull(ThreadContext.getSecurityManager());
+    }
+
+    @Test
+    public void testRunAs() {
+
+        Ini ini = new Ini();
+        Ini.Section users = ini.addSection("users");
+        users.put("user1", "user1,role1");
+        users.put("user2", "user2,role2");
+        IniSecurityManagerFactory factory = new IniSecurityManagerFactory(ini);
+        SecurityManager sm = factory.getInstance();
+
+        Subject subject = new Subject.Builder(sm).buildSubject();
+        subject.login(new UsernamePasswordToken("user1", "user1"));
+
+        assertTrue(subject.getPrincipal().equals("user1"));
+        assertTrue(subject.hasRole("role1"));
+        assertFalse(subject.isRunAs());
+        assertNull(subject.getPreviousPrincipals());
+
+        subject.runAs(new SimplePrincipalCollection("user2", IniSecurityManagerFactory.INI_REALM_NAME));
+
+        assertFalse(subject.getPrincipal().equals("user1"));
+        assertFalse(subject.hasRole("role1"));
+        assertTrue(subject.getPrincipal().equals("user2"));
+        assertTrue(subject.hasRole("role2"));
+        assertTrue(subject.isRunAs());
+        assertFalse(CollectionUtils.isEmpty(subject.getPreviousPrincipals()));
+        assertTrue(subject.getPreviousPrincipals().getPrimaryPrincipal().equals("user1"));
+
+        subject.releaseRunAs();
+        assertTrue(subject.getPrincipal().equals("user1"));
+        assertTrue(subject.hasRole("role1"));
+        assertFalse(subject.isRunAs());
+        assertNull(subject.getPreviousPrincipals());
+
+        subject.logout();
+        LifecycleUtils.destroy(sm);
+    }
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/subject/DelegatingSubjectTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/test/SecurityManagerTestSupport.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/test/SecurityManagerTestSupport.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/test/SecurityManagerTestSupport.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/test/SecurityManagerTestSupport.java Wed May 26 18:34:28 2010
@@ -1,76 +1,76 @@
-/*
- * 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.shiro.test;
-
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.config.Ini;
-import org.apache.shiro.mgt.DefaultSecurityManager;
-import org.apache.shiro.mgt.SecurityManager;
-import org.apache.shiro.realm.text.IniRealm;
-import org.apache.shiro.subject.Subject;
-import org.apache.shiro.util.LifecycleUtils;
-import org.apache.shiro.util.ThreadContext;
-import org.junit.After;
-import org.junit.Before;
-
-/**
- * Utility methods for use by Shiro test case subclasses.  You can use these methods as examples for your own
- * test cases, but you SHOULD NOT use any ThreadContext API calls in your actual application code.
- * The utility methods here make heavy assumptions about Shiro's implementation details, and your
- * application code should definitely not.
- * <p/>
- * See the <a href="http://cwiki.apache.org/confluence/display/SHIRO/Subject">wiki Subject documentation</a>
- * for proper application practices using Subject instances with threads.
- */
-public class SecurityManagerTestSupport {
-
-    protected static SecurityManager createTestSecurityManager() {
-        Ini ini = new Ini();
-        ini.setSectionProperty("users", "test", "test");
-        return new DefaultSecurityManager(new IniRealm(ini));
-    }
-
-    protected void destroy(SecurityManager sm) {
-        LifecycleUtils.destroy(sm);
-    }
-
-    protected SecurityManager createAndBindTestSecurityManager() {
-        SecurityManager sm = createTestSecurityManager();
-        ThreadContext.bind(sm);
-        return sm;
-    }
-
-    protected Subject createAndBindTestSubject() {
-        SecurityManager sm = ThreadContext.getSecurityManager();
-        if (sm == null) {
-            createAndBindTestSecurityManager();
-        }
-        return SecurityUtils.getSubject();
-    }
-
-    @Before
-    public void setup() {
-        createAndBindTestSubject();
-    }
-
-    @After
-    public void teardown() {
-        ThreadContext.remove();
-    }
-}
+/*
+ * 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.shiro.test;
+
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.config.Ini;
+import org.apache.shiro.mgt.DefaultSecurityManager;
+import org.apache.shiro.mgt.SecurityManager;
+import org.apache.shiro.realm.text.IniRealm;
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.util.LifecycleUtils;
+import org.apache.shiro.util.ThreadContext;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * Utility methods for use by Shiro test case subclasses.  You can use these methods as examples for your own
+ * test cases, but you SHOULD NOT use any ThreadContext API calls in your actual application code.
+ * The utility methods here make heavy assumptions about Shiro's implementation details, and your
+ * application code should definitely not.
+ * <p/>
+ * See the <a href="http://cwiki.apache.org/confluence/display/SHIRO/Subject">wiki Subject documentation</a>
+ * for proper application practices using Subject instances with threads.
+ */
+public class SecurityManagerTestSupport {
+
+    protected static SecurityManager createTestSecurityManager() {
+        Ini ini = new Ini();
+        ini.setSectionProperty("users", "test", "test");
+        return new DefaultSecurityManager(new IniRealm(ini));
+    }
+
+    protected void destroy(SecurityManager sm) {
+        LifecycleUtils.destroy(sm);
+    }
+
+    protected SecurityManager createAndBindTestSecurityManager() {
+        SecurityManager sm = createTestSecurityManager();
+        ThreadContext.bind(sm);
+        return sm;
+    }
+
+    protected Subject createAndBindTestSubject() {
+        SecurityManager sm = ThreadContext.getSecurityManager();
+        if (sm == null) {
+            createAndBindTestSecurityManager();
+        }
+        return SecurityUtils.getSubject();
+    }
+
+    @Before
+    public void setup() {
+        createAndBindTestSubject();
+    }
+
+    @After
+    public void teardown() {
+        ThreadContext.remove();
+    }
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/test/SecurityManagerTestSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/util/RegExPatternMatcherTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/util/RegExPatternMatcherTest.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/util/RegExPatternMatcherTest.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/util/RegExPatternMatcherTest.java Wed May 26 18:34:28 2010
@@ -1,43 +1,43 @@
-/*
- * 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.shiro.util;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-import java.util.regex.Pattern;
-
-/**
- * Unit tests for the {@link RegExPatternMatcher}.
- *
- * @since 1.0
- */
-public class RegExPatternMatcherTest {
-
-    @Test
-    public void testSimplePattern() {
-        PatternMatcher pm = new RegExPatternMatcher();
-        String pattern = "a*b";
-        String test = "aaaaaaab";
-        //not necessary for the test, but Idea performs auto validation when it sees this:
-        Pattern.compile(pattern);
-        assertTrue(pm.matches(pattern, test));
-    }
-
-}
+/*
+ * 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.shiro.util;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import java.util.regex.Pattern;
+
+/**
+ * Unit tests for the {@link RegExPatternMatcher}.
+ *
+ * @since 1.0
+ */
+public class RegExPatternMatcherTest {
+
+    @Test
+    public void testSimplePattern() {
+        PatternMatcher pm = new RegExPatternMatcher();
+        String pattern = "a*b";
+        String test = "aaaaaaab";
+        //not necessary for the test, but Idea performs auto validation when it sees this:
+        Pattern.compile(pattern);
+        assertTrue(pm.matches(pattern, test));
+    }
+
+}

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/util/RegExPatternMatcherTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/java/org/apache/shiro/util/StringUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/config/IniSecurityManagerFactoryTest.ini
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/config/IniSecurityManagerFactoryTest.ini?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/config/IniSecurityManagerFactoryTest.ini (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/config/IniSecurityManagerFactoryTest.ini Wed May 26 18:34:28 2010
@@ -1,24 +1,24 @@
-#
-# 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.
-#
-
-[users]
-user1 = user1, admin
-
-[roles]
+#
+# 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.
+#
+
+[users]
+user1 = user1, admin
+
+[roles]
 admin = *
\ No newline at end of file

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/config/IniSecurityManagerFactoryTest.ini
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/config/IniSecurityManagerFactoryTest.propsRealm.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.noUsers.ini
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.noUsers.ini?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.noUsers.ini (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.noUsers.ini Wed May 26 18:34:28 2010
@@ -1,21 +1,21 @@
-#
-# 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.
-#
-
-[roles]
-admin = *
+#
+# 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.
+#
+
+[roles]
+admin = *

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.noUsers.ini
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.simple.ini
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.simple.ini?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.simple.ini (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.simple.ini Wed May 26 18:34:28 2010
@@ -1,25 +1,25 @@
-#
-# 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.
-#
-
-[users]
-user1 = user1, admin
-
-[roles]
-admin = *
-
+#
+# 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.
+#
+
+[users]
+user1 = user1, admin
+
+[roles]
+admin = *
+

Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/test/resources/org/apache/shiro/realm/text/IniRealmTest.simple.ini
------------------------------------------------------------------------------
    svn:eol-style = native