Spring Security OAuth2 的 mvn install 在测试阶段失败
mvn install of Spring Security OAuth2 fails during test Phase
我尝试根据 github 上 Spring OAuth 项目的 "Getting started" 部分安装和 运行 样本:https://github.com/spring-projects/spring-security-oauth。我尝试了不同的方式,并且在 运行ning mvn install -P bootstrap
的 Maven 测试阶段总是 运行 出现相同的错误
以下是我尝试过的一些变体:
- 已使用 Eclipse egit 下载 v.2.0.9-SNAPSHOT
- 更改为标记版本 v2.0.8
- 更改为标记版本 v2.0.7
- 更改为标记版本 v2.0.6
- 从 master 下载 2.0.9-SNAPSHOT 作为 zip
- 已下载 2.0.8 发行版 zip
- 清除了本地 maven 存储库(实际上在 maven settings.xml 中引用了一个空白目录)
- 用于不同的 maven 版本(3.0.5 和 3.3.3)
- 使用了三个不同的 JDK
测试阶段的结果总是这样:
Results :
Tests in error:
testExpiringRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testExpiringRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testExpiringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testExpiringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRetrieveAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRetrieveAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingRefreshTokenForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingRefreshTokenForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testFindAccessTokensByClientId(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testFindAccessTokensByClientId(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testFindAccessTokensByClientIdAndUserName(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testFindAccessTokensByClientIdAndUserName(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRemovedTokenCannotBeFoundByUsername(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRemovedTokenCannotBeFoundByUsername(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingAccessTokenForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingAccessTokenForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRemoveRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRemoveRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingAuthenticationForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingAuthenticationForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreAccessTokenTwice(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreAccessTokenTwice(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRefreshTokenIsNotStoredDuringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRefreshTokenIsNotStoredDuringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testGetAccessTokenForDeletedUser(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testGetAccessTokenForDeletedUser(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
Tests run: 610, Failures: 0, Errors: 30, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] OAuth for Spring Security .......................... SUCCESS [ 2.044 s]
[INFO] OAuth 1(a) for Spring Security ..................... SUCCESS [ 20.215 s]
[INFO] OAuth2 for Spring Security ......................... FAILURE [ 29.350 s]
[INFO] spring-oauth2-tests ................................ SKIPPED
[INFO] spring-oauth2-tests-common ......................... SKIPPED
[INFO] spring-oauth2-tests-vanilla ........................ SKIPPED
[INFO] spring-oauth2-tests-mappings ....................... SKIPPED
[INFO] spring-oauth2-tests-form ........................... SKIPPED
[INFO] spring-oauth2-tests-jwt ............................ SKIPPED
[INFO] spring-oauth2-tests-approval ....................... SKIPPED
[INFO] spring-oauth2-tests-jdbc ........................... SKIPPED
[INFO] spring-oauth-tests-custom-grant .................... SKIPPED
[INFO] spring-oauth2-tests-multi .......................... SKIPPED
[INFO] spring-oauth2-tests-client ......................... SKIPPED
[INFO] spring-oauth2-tests-resource ....................... SKIPPED
[INFO] spring-oauth2-tests-custom-authentication .......... SKIPPED
[INFO] spring-oauth2-tests-xml ............................ SKIPPED
[INFO] spring-oauth2-tests-xml-common ..................... SKIPPED
[INFO] spring-oauth2-tests-xml-vanilla .................... SKIPPED
[INFO] spring-oauth2-tests-xml-mappings ................... SKIPPED
[INFO] spring-oauth2-tests-xml-form ....................... SKIPPED
[INFO] spring-oauth2-tests-xml-jwt ........................ SKIPPED
[INFO] spring-oauth2-tests-xml-approval ................... SKIPPED
[INFO] spring-oauth2-tests-xml-jdbc ....................... SKIPPED
[INFO] spring-oauth2-tests-xml-client ..................... SKIPPED
[INFO] OAuth for Spring Security - Integration Tests ...... SKIPPED
[INFO] OAuth for Spring Security - Sparklr (OAuth 1 Provider Example) SKIPPED
[INFO] OAuth for Spring Security - Tonr (OAuth 1 Consumer Example) SKIPPED
[INFO] OAuth for Spring Security - Sparklr2 (OAuth 2 Provider Example) SKIPPED
[INFO] OAuth for Spring Security - Tonr2 (OAuth 2 Client Example) SKIPPED
[INFO] OAuth for Spring Security - Samples ................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52.860 s
[INFO] Finished at: 2015-12-03T16:53:58+01:00
[INFO] Final Memory: 59M/172M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project spring-security-oauth2: There are test failures.
[...]
以下是我在测试中遇到的一些异常:
[...]
testExpiringRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests) Time elapsed: 0.008 sec <<< ERROR!
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.nio.file.Files.copy(Files.java:2984)
at redis.embedded.RedisServer.extractExecutableFromJar(RedisServer.java:85)
at redis.embedded.RedisServer.<init>(RedisServer.java:69)
at redis.embedded.RedisServer.<init>(RedisServer.java:63)
at redis.embedded.RedisServer.<init>(RedisServer.java:55)
at org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests.setup(RedisTokenStoreTests.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access[=12=]0(ParentRunner.java:53)
at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
testExpiringRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests) Time elapsed: 0.008 sec <<< ERROR!
java.lang.NullPointerException
at org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests.tearDown(RedisTokenStoreTests.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access[=12=]0(ParentRunner.java:53)
at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
testExpiringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests) Time elapsed: 0 sec <<< ERROR!
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.nio.file.Files.copy(Files.java:2984)
at redis.embedded.RedisServer.extractExecutableFromJar(RedisServer.java:85)
at redis.embedded.RedisServer.<init>(RedisServer.java:69)
at redis.embedded.RedisServer.<init>(RedisServer.java:63)
at redis.embedded.RedisServer.<init>(RedisServer.java:55)
at org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests.setup(RedisTokenStoreTests.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access[=12=]0(ParentRunner.java:53)
at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
[...]
由于显然没有其他人遇到这种行为,所以我肯定做错了什么,但我不知道它可能是什么。
希望得到帮助,
比约恩
我认为这实际上是您操作系统 (OS) 上的嵌入式 Redis 的问题。我们尝试在 Spring 会话中利用嵌入式 Redis,但它对各种 OS 造成了许多问题。参见 spring-session/issues/121
简而言之,我认为这是测试的一个错误。
我尝试根据 github 上 Spring OAuth 项目的 "Getting started" 部分安装和 运行 样本:https://github.com/spring-projects/spring-security-oauth。我尝试了不同的方式,并且在 运行ning mvn install -P bootstrap
以下是我尝试过的一些变体:
- 已使用 Eclipse egit 下载 v.2.0.9-SNAPSHOT
- 更改为标记版本 v2.0.8
- 更改为标记版本 v2.0.7
- 更改为标记版本 v2.0.6
- 从 master 下载 2.0.9-SNAPSHOT 作为 zip
- 已下载 2.0.8 发行版 zip
- 清除了本地 maven 存储库(实际上在 maven settings.xml 中引用了一个空白目录)
- 用于不同的 maven 版本(3.0.5 和 3.3.3)
- 使用了三个不同的 JDK
测试阶段的结果总是这样:
Results :
Tests in error:
testExpiringRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testExpiringRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testExpiringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testExpiringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRetrieveAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRetrieveAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingRefreshTokenForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingRefreshTokenForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testFindAccessTokensByClientId(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testFindAccessTokensByClientId(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testFindAccessTokensByClientIdAndUserName(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testFindAccessTokensByClientIdAndUserName(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRemovedTokenCannotBeFoundByUsername(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRemovedTokenCannotBeFoundByUsername(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingAccessTokenForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingAccessTokenForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRemoveRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRemoveRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingAuthenticationForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testReadingAuthenticationForTokenThatDoesNotExist(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreAccessTokenTwice(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testStoreAccessTokenTwice(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRefreshTokenIsNotStoredDuringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testRefreshTokenIsNotStoredDuringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testGetAccessTokenForDeletedUser(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
testGetAccessTokenForDeletedUser(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests)
Tests run: 610, Failures: 0, Errors: 30, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] OAuth for Spring Security .......................... SUCCESS [ 2.044 s]
[INFO] OAuth 1(a) for Spring Security ..................... SUCCESS [ 20.215 s]
[INFO] OAuth2 for Spring Security ......................... FAILURE [ 29.350 s]
[INFO] spring-oauth2-tests ................................ SKIPPED
[INFO] spring-oauth2-tests-common ......................... SKIPPED
[INFO] spring-oauth2-tests-vanilla ........................ SKIPPED
[INFO] spring-oauth2-tests-mappings ....................... SKIPPED
[INFO] spring-oauth2-tests-form ........................... SKIPPED
[INFO] spring-oauth2-tests-jwt ............................ SKIPPED
[INFO] spring-oauth2-tests-approval ....................... SKIPPED
[INFO] spring-oauth2-tests-jdbc ........................... SKIPPED
[INFO] spring-oauth-tests-custom-grant .................... SKIPPED
[INFO] spring-oauth2-tests-multi .......................... SKIPPED
[INFO] spring-oauth2-tests-client ......................... SKIPPED
[INFO] spring-oauth2-tests-resource ....................... SKIPPED
[INFO] spring-oauth2-tests-custom-authentication .......... SKIPPED
[INFO] spring-oauth2-tests-xml ............................ SKIPPED
[INFO] spring-oauth2-tests-xml-common ..................... SKIPPED
[INFO] spring-oauth2-tests-xml-vanilla .................... SKIPPED
[INFO] spring-oauth2-tests-xml-mappings ................... SKIPPED
[INFO] spring-oauth2-tests-xml-form ....................... SKIPPED
[INFO] spring-oauth2-tests-xml-jwt ........................ SKIPPED
[INFO] spring-oauth2-tests-xml-approval ................... SKIPPED
[INFO] spring-oauth2-tests-xml-jdbc ....................... SKIPPED
[INFO] spring-oauth2-tests-xml-client ..................... SKIPPED
[INFO] OAuth for Spring Security - Integration Tests ...... SKIPPED
[INFO] OAuth for Spring Security - Sparklr (OAuth 1 Provider Example) SKIPPED
[INFO] OAuth for Spring Security - Tonr (OAuth 1 Consumer Example) SKIPPED
[INFO] OAuth for Spring Security - Sparklr2 (OAuth 2 Provider Example) SKIPPED
[INFO] OAuth for Spring Security - Tonr2 (OAuth 2 Client Example) SKIPPED
[INFO] OAuth for Spring Security - Samples ................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52.860 s
[INFO] Finished at: 2015-12-03T16:53:58+01:00
[INFO] Final Memory: 59M/172M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project spring-security-oauth2: There are test failures.
[...]
以下是我在测试中遇到的一些异常:
[...]
testExpiringRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests) Time elapsed: 0.008 sec <<< ERROR!
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.nio.file.Files.copy(Files.java:2984)
at redis.embedded.RedisServer.extractExecutableFromJar(RedisServer.java:85)
at redis.embedded.RedisServer.<init>(RedisServer.java:69)
at redis.embedded.RedisServer.<init>(RedisServer.java:63)
at redis.embedded.RedisServer.<init>(RedisServer.java:55)
at org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests.setup(RedisTokenStoreTests.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access[=12=]0(ParentRunner.java:53)
at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
testExpiringRefreshToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests) Time elapsed: 0.008 sec <<< ERROR!
java.lang.NullPointerException
at org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests.tearDown(RedisTokenStoreTests.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access[=12=]0(ParentRunner.java:53)
at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
testExpiringAccessToken(org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests) Time elapsed: 0 sec <<< ERROR!
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.nio.file.Files.copy(Files.java:2984)
at redis.embedded.RedisServer.extractExecutableFromJar(RedisServer.java:85)
at redis.embedded.RedisServer.<init>(RedisServer.java:69)
at redis.embedded.RedisServer.<init>(RedisServer.java:63)
at redis.embedded.RedisServer.<init>(RedisServer.java:55)
at org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreTests.setup(RedisTokenStoreTests.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access[=12=]0(ParentRunner.java:53)
at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
[...]
由于显然没有其他人遇到这种行为,所以我肯定做错了什么,但我不知道它可能是什么。
希望得到帮助, 比约恩
我认为这实际上是您操作系统 (OS) 上的嵌入式 Redis 的问题。我们尝试在 Spring 会话中利用嵌入式 Redis,但它对各种 OS 造成了许多问题。参见 spring-session/issues/121
简而言之,我认为这是测试的一个错误。