Jelajahi Sumber

SEC-904: Moved test module out of sandbox

Luke Taylor 17 tahun lalu
induk
melakukan
6a68a2531c
32 mengubah file dengan 17 tambahan dan 9 penghapusan
  1. 0 0
      itest/context/pom.xml
  2. 0 0
      itest/context/src/main/java/org/springframework/security/integration/UserDetailsServiceImpl.java
  3. 0 0
      itest/context/src/main/java/org/springframework/security/integration/UserRepository.java
  4. 0 0
      itest/context/src/test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java
  5. 0 0
      itest/context/src/test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java
  6. 0 0
      itest/context/src/test/java/org/springframework/security/integration/StubUserRepository.java
  7. 0 0
      itest/context/src/test/resources/sec-933-app-context.xml
  8. 0 0
      itest/context/src/test/resources/sec-936-app-context.xml
  9. 0 0
      itest/misc/pom.xml
  10. 0 0
      itest/misc/src/main/resources/log4j.properties
  11. 0 0
      itest/misc/src/test/java/org/springframework/security/concurrent/SessionRegistryImplMTTests.java
  12. 0 0
      itest/misc/src/test/java/org/springframework/security/context/SecurityContextHolderMTTests.java
  13. 0 0
      itest/pom.xml
  14. 0 0
      itest/web/pom.xml
  15. 0 0
      itest/web/src/main/resources/log4j.properties
  16. 0 0
      itest/web/src/main/resources/test-server.ldif
  17. 0 0
      itest/web/src/main/webapp/META-INF/MANIFEST.MF
  18. 0 0
      itest/web/src/main/webapp/WEB-INF/custom-filters.xml
  19. 0 0
      itest/web/src/main/webapp/WEB-INF/http-security.xml
  20. 0 0
      itest/web/src/main/webapp/WEB-INF/in-memory-provider.xml
  21. 0 0
      itest/web/src/main/webapp/WEB-INF/ldap-provider.xml
  22. 0 0
      itest/web/src/main/webapp/WEB-INF/web.xml
  23. 0 0
      itest/web/src/main/webapp/login.jsp
  24. 0 0
      itest/web/src/main/webapp/secure/index.html
  25. 0 0
      itest/web/src/main/webapp/secure/secure1.jsp
  26. 0 0
      itest/web/src/main/webapp/secure/secure1body.jsp
  27. 0 0
      itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java
  28. 0 0
      itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java
  29. 0 0
      itest/web/src/test/java/org/springframework/security/integration/LdapWebAppTests.java
  30. 4 6
      sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-persistence.xml
  31. 12 2
      sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-security.xml
  32. 1 1
      sandbox/heavyduty/src/main/webapp/WEB-INF/classes/jdbc.properties

+ 0 - 0
sandbox/itest/context/pom.xml → itest/context/pom.xml


+ 0 - 0
sandbox/itest/context/src/main/java/org/springframework/security/integration/UserDetailsServiceImpl.java → itest/context/src/main/java/org/springframework/security/integration/UserDetailsServiceImpl.java


+ 0 - 0
sandbox/itest/context/src/main/java/org/springframework/security/integration/UserRepository.java → itest/context/src/main/java/org/springframework/security/integration/UserRepository.java


+ 0 - 0
sandbox/itest/context/src/test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java → itest/context/src/test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java


+ 0 - 0
sandbox/itest/context/src/test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java → itest/context/src/test/java/org/springframework/security/integration/SEC936ApplicationContextTests.java


+ 0 - 0
sandbox/itest/context/src/test/java/org/springframework/security/integration/StubUserRepository.java → itest/context/src/test/java/org/springframework/security/integration/StubUserRepository.java


+ 0 - 0
sandbox/itest/context/src/test/resources/sec-933-app-context.xml → itest/context/src/test/resources/sec-933-app-context.xml


+ 0 - 0
sandbox/itest/context/src/test/resources/sec-936-app-context.xml → itest/context/src/test/resources/sec-936-app-context.xml


+ 0 - 0
sandbox/itest/misc/pom.xml → itest/misc/pom.xml


+ 0 - 0
sandbox/itest/misc/src/main/resources/log4j.properties → itest/misc/src/main/resources/log4j.properties


+ 0 - 0
sandbox/itest/misc/src/test/java/org/springframework/security/concurrent/SessionRegistryImplMTTests.java → itest/misc/src/test/java/org/springframework/security/concurrent/SessionRegistryImplMTTests.java


+ 0 - 0
sandbox/itest/misc/src/test/java/org/springframework/security/context/SecurityContextHolderMTTests.java → itest/misc/src/test/java/org/springframework/security/context/SecurityContextHolderMTTests.java


+ 0 - 0
sandbox/itest/pom.xml → itest/pom.xml


+ 0 - 0
sandbox/itest/web/pom.xml → itest/web/pom.xml


+ 0 - 0
sandbox/itest/web/src/main/resources/log4j.properties → itest/web/src/main/resources/log4j.properties


+ 0 - 0
sandbox/itest/web/src/main/resources/test-server.ldif → itest/web/src/main/resources/test-server.ldif


+ 0 - 0
sandbox/itest/web/src/main/webapp/META-INF/MANIFEST.MF → itest/web/src/main/webapp/META-INF/MANIFEST.MF


+ 0 - 0
sandbox/itest/web/src/main/webapp/WEB-INF/custom-filters.xml → itest/web/src/main/webapp/WEB-INF/custom-filters.xml


+ 0 - 0
sandbox/itest/web/src/main/webapp/WEB-INF/http-security.xml → itest/web/src/main/webapp/WEB-INF/http-security.xml


+ 0 - 0
sandbox/itest/web/src/main/webapp/WEB-INF/in-memory-provider.xml → itest/web/src/main/webapp/WEB-INF/in-memory-provider.xml


+ 0 - 0
sandbox/itest/web/src/main/webapp/WEB-INF/ldap-provider.xml → itest/web/src/main/webapp/WEB-INF/ldap-provider.xml


+ 0 - 0
sandbox/itest/web/src/main/webapp/WEB-INF/web.xml → itest/web/src/main/webapp/WEB-INF/web.xml


+ 0 - 0
sandbox/itest/web/src/main/webapp/login.jsp → itest/web/src/main/webapp/login.jsp


+ 0 - 0
sandbox/itest/web/src/main/webapp/secure/index.html → itest/web/src/main/webapp/secure/index.html


+ 0 - 0
sandbox/itest/web/src/main/webapp/secure/secure1.jsp → itest/web/src/main/webapp/secure/secure1.jsp


+ 0 - 0
sandbox/itest/web/src/main/webapp/secure/secure1body.jsp → itest/web/src/main/webapp/secure/secure1body.jsp


+ 0 - 0
sandbox/itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java → itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java


+ 0 - 0
sandbox/itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java → itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java


+ 0 - 0
sandbox/itest/web/src/test/java/org/springframework/security/integration/LdapWebAppTests.java → itest/web/src/test/java/org/springframework/security/integration/LdapWebAppTests.java


+ 4 - 6
sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-persistence.xml

@@ -16,18 +16,16 @@
   
   <bean id="AllPropertiesConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
     <property name="location" value="classpath:jdbc.properties"/>
-  </bean>
+  </bean>
 
   <tx:annotation-driven transaction-manager="transactionManager" />
 
   <bean id="userDAO" class="sample.dao.impl.UserDAOImpl"/>
   
-  <bean id="daoUserService" class="sample.service.impl.UserServiceImpl">
-    <property name="userDAO" ref="userDAO"/>
-  </bean>
+  <bean id="daoUserService" class="sample.service.impl.UserServiceImpl"/>
 
-  <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
-    <!--  property name="order" value="0"/ -->
+  <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
+    <!--  property name="order" value="0"/ -->
   </bean>
   
   <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">

+ 12 - 2
sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-security.xml

@@ -9,14 +9,24 @@
 <b:beans xmlns="http://www.springframework.org/schema/security"
     xmlns:b="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xmlns:context="http://www.springframework.org/schema/context"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+						http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+                        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
                         http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.2.xsd">
 
     <!--b:import resource="appContext-misc.xml"/-->
+	<context:component-scan base-package='sample'/>
     
-	<!-- global-method-security secured-annotations="enabled" access-decision-manager-ref="methodAccessMgr"/ -->
+	<global-method-security secured-annotations="enabled" access-decision-manager-ref="methodAccessMgr">
+		<protect-pointcut expression="execution(* sample.service.UserService+.*(..))"
+					access="ROLE_LOGGEDIN" />
+	</global-method-security>
 	
-	<b:bean id="methodAccessmanager" class="org.springframework.security.vote.AffirmativeBased">
+	<aop:aspectj-autoproxy/>
+	
+	<b:bean id="methodAccessMgr" class="org.springframework.security.vote.AffirmativeBased">
 	   <b:property name="decisionVoters">
 	       <b:list>
 	           <b:bean class="sample.TestVoter"/>

+ 1 - 1
sandbox/heavyduty/src/main/webapp/WEB-INF/classes/jdbc.properties

@@ -3,6 +3,6 @@ jpa.generateDdl=true
 jpa.showSql=true
 
 jdbc.driver=org.hsqldb.jdbcDriver
-jdbc.url=jdbc:hsqldb:res:/database/heavyduty
+jdbc.url=jdbc:hsqldb:mem:heavyduty
 jdbc.username=sa
 jdbc.password=