diff --git a/sandbox/itest/context/pom.xml b/sandbox/itest/context/pom.xml new file mode 100644 index 0000000000..0549afce86 --- /dev/null +++ b/sandbox/itest/context/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.springframework.security + spring-security-itest + 2.0.4-SNAPSHOT + + spring-security-itest-context + Spring Security - Miscellaneous Application Context Integration Tests + jar + + + + junit + junit + 4.4 + test + + + diff --git a/sandbox/itest/context/src/main/java/org/springframework/security/integration/UserDetailsServiceImpl.java b/sandbox/itest/context/src/main/java/org/springframework/security/integration/UserDetailsServiceImpl.java new file mode 100755 index 0000000000..d98cb3bd37 --- /dev/null +++ b/sandbox/itest/context/src/main/java/org/springframework/security/integration/UserDetailsServiceImpl.java @@ -0,0 +1,21 @@ +package org.springframework.security.integration; + +import org.springframework.beans.factory.annotation.Required; +import org.springframework.security.userdetails.UserDetails; +import org.springframework.security.userdetails.UserDetailsService; +import org.springframework.transaction.annotation.Transactional; + +public class UserDetailsServiceImpl implements UserDetailsService{ + + private UserRepository userRepository; + + @Transactional(readOnly=true) + public UserDetails loadUserByUsername(String username) { + return null; + } + + @Required + public void setUserRepository(UserRepository userRepository) { + this.userRepository = userRepository; + } +} \ No newline at end of file diff --git a/sandbox/itest/context/src/main/java/org/springframework/security/integration/UserRepository.java b/sandbox/itest/context/src/main/java/org/springframework/security/integration/UserRepository.java new file mode 100755 index 0000000000..81909816e3 --- /dev/null +++ b/sandbox/itest/context/src/main/java/org/springframework/security/integration/UserRepository.java @@ -0,0 +1,7 @@ +package org.springframework.security.integration; + +public interface UserRepository { + + public void doSomething(); + +} diff --git a/sandbox/itest/context/src/test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java b/sandbox/itest/context/src/test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java new file mode 100644 index 0000000000..6eedfa36ae --- /dev/null +++ b/sandbox/itest/context/src/test/java/org/springframework/security/integration/SEC933ApplicationContextTests.java @@ -0,0 +1,23 @@ +package org.springframework.security.integration; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.userdetails.UserDetailsService; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@ContextConfiguration(locations={"/sec-933-app-context.xml"}) +@RunWith(SpringJUnit4ClassRunner.class) +public class SEC933ApplicationContextTests { + + @Autowired + private UserDetailsService userDetailsService; + + @Test + public void testSimpleApplicationContextBootstrap() throws Exception { + assertNotNull(userDetailsService); + } +} diff --git a/sandbox/itest/context/src/test/java/org/springframework/security/integration/StubUserRepository.java b/sandbox/itest/context/src/test/java/org/springframework/security/integration/StubUserRepository.java new file mode 100644 index 0000000000..908e970078 --- /dev/null +++ b/sandbox/itest/context/src/test/java/org/springframework/security/integration/StubUserRepository.java @@ -0,0 +1,7 @@ +package org.springframework.security.integration; + +public class StubUserRepository implements UserRepository { + + public void doSomething() { + } +} \ No newline at end of file diff --git a/sandbox/itest/context/src/test/resources/sec-933-app-context.xml b/sandbox/itest/context/src/test/resources/sec-933-app-context.xml new file mode 100755 index 0000000000..47962f22f8 --- /dev/null +++ b/sandbox/itest/context/src/test/resources/sec-933-app-context.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/itest/misc/src/main/resources/log4j.properties b/sandbox/itest/misc/src/main/resources/log4j.properties index e5340c70b2..bf3e537e46 100644 --- a/sandbox/itest/misc/src/main/resources/log4j.properties +++ b/sandbox/itest/misc/src/main/resources/log4j.properties @@ -4,5 +4,4 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %p %c - %m%n -log4j.category.org.mortbay.log=INFO log4j.category.org.springframework.security=DEBUG \ No newline at end of file diff --git a/sandbox/itest/pom.xml b/sandbox/itest/pom.xml index f6e5a315a8..5f16b3f54e 100644 --- a/sandbox/itest/pom.xml +++ b/sandbox/itest/pom.xml @@ -1,12 +1,5 @@ - 4.0.0 - + 4.0.0 org.springframework.security spring-security-itest Spring Security - Integration Tests @@ -15,24 +8,9 @@ web - misc + context - - - org.testng - testng - 5.8 - test - jdk15 - - + org.springframework spring @@ -44,6 +22,17 @@ + + org.springframework + spring-test + 2.5.5 + + + commons-logging + commons-logging + + + org.springframework.security spring-security-core @@ -82,6 +71,16 @@ + + org.aspectj + aspectjrt + 1.6.1 + + + org.aspectj + aspectjweaver + 1.6.1 + org.slf4j slf4j-api @@ -112,41 +111,6 @@ - - jwebunit - jwebunit - 1.2 - test - - - org.mortbay.jetty - jetty - ${jetty.version} - test - - - org.mortbay.jetty - jetty-naming - ${jetty.version} - test - - - org.mortbay.jetty - jetty-plus - ${jetty.version} - test - - - org.mortbay.jetty - jsp-2.1 - ${jetty.version} - test - - - org.mortbay.jetty - jsp-api-2.1 - ${jetty.version} - org.springframework.ldap spring-ldap diff --git a/sandbox/itest/web/pom.xml b/sandbox/itest/web/pom.xml index 269544e5d3..175652368d 100644 --- a/sandbox/itest/web/pom.xml +++ b/sandbox/itest/web/pom.xml @@ -10,8 +10,51 @@ spring-security-itest-web Spring Security - Web Integration Tests war - ---> + + + + + + + + + + + \ No newline at end of file