You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by lh...@apache.org on 2013/05/04 23:44:03 UTC
svn commit: r1479187 - in /shiro/branches/1.2.x: samples/aspectj/pom.xml
samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java
samples/aspectj/src/test/resources/shiroBankServiceTest.ini
support/aspectj/pom.xml
Author: lhazlewood
Date: Sat May 4 21:44:02 2013
New Revision: 1479187
URL: http://svn.apache.org/r1479187
Log:
SHIRO-399: applied patch, but upgraded AspectJ maven plugin to 1.4
Modified:
shiro/branches/1.2.x/samples/aspectj/pom.xml
shiro/branches/1.2.x/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java
shiro/branches/1.2.x/samples/aspectj/src/test/resources/shiroBankServiceTest.ini
shiro/branches/1.2.x/support/aspectj/pom.xml
Modified: shiro/branches/1.2.x/samples/aspectj/pom.xml
URL: http://svn.apache.org/viewvc/shiro/branches/1.2.x/samples/aspectj/pom.xml?rev=1479187&r1=1479186&r2=1479187&view=diff
==============================================================================
--- shiro/branches/1.2.x/samples/aspectj/pom.xml (original)
+++ shiro/branches/1.2.x/samples/aspectj/pom.xml Sat May 4 21:44:02 2013
@@ -36,7 +36,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
- <version>1.3</version>
+ <version>1.4</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
@@ -52,6 +52,7 @@
<execution>
<id>aspectj-compile</id>
<goals>
+ <goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
Modified: shiro/branches/1.2.x/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java
URL: http://svn.apache.org/viewvc/shiro/branches/1.2.x/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java?rev=1479187&r1=1479186&r2=1479187&view=diff
==============================================================================
--- shiro/branches/1.2.x/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java (original)
+++ shiro/branches/1.2.x/samples/aspectj/src/test/java/org/apache/shiro/samples/aspectj/bank/SecureBankServiceTest.java Sat May 4 21:44:02 2013
@@ -21,6 +21,7 @@ package org.apache.shiro.samples.aspectj
import junit.framework.Assert;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.config.IniSecurityManagerFactory;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.subject.Subject;
@@ -196,6 +197,12 @@ public class SecureBankServiceTest {
service.closeAccount(accountId);
}
+ @Test(expected = UnauthorizedException.class)
+ public void testCloseAccount_unauthorizedAttempt() throws Exception {
+ loginAsUser();
+ long accountId = createAndValidateAccountFor("Chris Smith");
+ service.closeAccount(accountId);
+ }
protected long createAndValidateAccountFor(String anOwner) throws Exception {
long createdId = service.createNewAccount(anOwner);
Modified: shiro/branches/1.2.x/samples/aspectj/src/test/resources/shiroBankServiceTest.ini
URL: http://svn.apache.org/viewvc/shiro/branches/1.2.x/samples/aspectj/src/test/resources/shiroBankServiceTest.ini?rev=1479187&r1=1479186&r2=1479187&view=diff
==============================================================================
--- shiro/branches/1.2.x/samples/aspectj/src/test/resources/shiroBankServiceTest.ini (original)
+++ shiro/branches/1.2.x/samples/aspectj/src/test/resources/shiroBankServiceTest.ini Sat May 4 21:44:02 2013
@@ -38,5 +38,5 @@ dan = 123, user
# -----------------------------------------------------------------------------
[roles]
admin = bankAccount:*
-superviser = bankAccount:create, bankAccount:read bankAccount:close
+superviser = bankAccount:create, bankAccount:read, bankAccount:close
user = bankAccount:create, bankAccount:read, bankAccount:operate
Modified: shiro/branches/1.2.x/support/aspectj/pom.xml
URL: http://svn.apache.org/viewvc/shiro/branches/1.2.x/support/aspectj/pom.xml?rev=1479187&r1=1479186&r2=1479187&view=diff
==============================================================================
--- shiro/branches/1.2.x/support/aspectj/pom.xml (original)
+++ shiro/branches/1.2.x/support/aspectj/pom.xml Sat May 4 21:44:02 2013
@@ -64,7 +64,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
- <version>1.3</version>
+ <version>1.4</version>
<configuration>
<source>1.5</source>
<target>1.5</target>