Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
88fcd0a2
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
88fcd0a2
编写于
7月 19, 2016
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Framework build compatible with JDK 9 (tests running against java.base module)
Issue: SPR-13344
上级
d07381e8
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
211 addition
and
216 deletion
+211
-216
build.gradle
build.gradle
+171
-138
spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java
...k/aop/framework/adapter/ThrowsAdviceInterceptorTests.java
+6
-6
spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheAnnotationTests.java
...gframework/cache/jcache/JCacheEhCacheAnnotationTests.java
+2
-2
spring-context/src/main/java/org/springframework/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java
...work/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java
+1
-23
spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java
...ringframework/remoting/rmi/RmiClientInterceptorUtils.java
+2
-21
spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java
.../io/support/PathMatchingResourcePatternResolverTests.java
+4
-5
spring-core/src/test/java/org/springframework/util/Base64UtilsTests.java
.../test/java/org/springframework/util/Base64UtilsTests.java
+0
-1
spring-oxm/oxm.gradle
spring-oxm/oxm.gradle
+5
-3
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java
...org/springframework/oxm/castor/CastorMarshallerTests.java
+8
-8
spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java
...nsaction/annotation/EnableTransactionManagementTests.java
+2
-7
spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java
...org/springframework/remoting/jaxws/JaxWsSupportTests.java
+10
-2
未找到文件。
build.gradle
浏览文件 @
88fcd0a2
此差异已折叠。
点击以展开。
spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java
浏览文件 @
88fcd0a2
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -19,8 +19,8 @@ package org.springframework.aop.framework.adapter;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.lang.reflect.Method
;
import
java.rmi.ConnectException
;
import
java.rmi.RemoteException
;
import
javax.transaction.TransactionRolledbackException
;
import
org.aopalliance.intercept.MethodInvocation
;
import
org.junit.Test
;
...
...
@@ -35,9 +35,9 @@ import static org.mockito.BDDMockito.*;
* @author Rod Johnson
* @author Chris Beams
*/
public
final
class
ThrowsAdviceInterceptorTests
{
public
class
ThrowsAdviceInterceptorTests
{
@Test
(
expected
=
IllegalArgumentException
.
class
)
@Test
(
expected
=
IllegalArgumentException
.
class
)
public
void
testNoHandlerMethods
()
{
// should require one handler method at least
new
ThrowsAdviceInterceptor
(
new
Object
());
...
...
@@ -97,7 +97,7 @@ public final class ThrowsAdviceInterceptorTests {
MyThrowsHandler
th
=
new
MyThrowsHandler
();
ThrowsAdviceInterceptor
ti
=
new
ThrowsAdviceInterceptor
(
th
);
// Extends RemoteException
TransactionRolledbackException
ex
=
new
TransactionRolledbackException
(
);
ConnectException
ex
=
new
ConnectException
(
""
);
MethodInvocation
mi
=
mock
(
MethodInvocation
.
class
);
given
(
mi
.
proceed
()).
willThrow
(
ex
);
try
{
...
...
@@ -126,7 +126,7 @@ public final class ThrowsAdviceInterceptorTests {
ThrowsAdviceInterceptor
ti
=
new
ThrowsAdviceInterceptor
(
th
);
// Extends RemoteException
TransactionRolledbackException
ex
=
new
TransactionRolledbackException
(
);
ConnectException
ex
=
new
ConnectException
(
""
);
MethodInvocation
mi
=
mock
(
MethodInvocation
.
class
);
given
(
mi
.
proceed
()).
willThrow
(
ex
);
try
{
...
...
spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheAnnotationTests.java
浏览文件 @
88fcd0a2
...
...
@@ -16,7 +16,6 @@
package
org.springframework.cache.jcache
;
import
javax.annotation.Resource
;
import
javax.cache.CacheManager
;
import
javax.cache.Caching
;
import
javax.cache.configuration.MutableConfiguration
;
...
...
@@ -26,6 +25,7 @@ import org.junit.After;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CachingConfigurerSupport
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cache.config.AbstractCacheAnnotationTests
;
...
...
@@ -81,7 +81,7 @@ public class JCacheEhCacheAnnotationTests extends AbstractCacheAnnotationTests {
@EnableCaching
static
class
EnableCachingConfig
extends
CachingConfigurerSupport
{
@
Resource
@
Autowired
CachingProvider
cachingProvider
;
@Override
...
...
spring-context/src/main/java/org/springframework/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java
浏览文件 @
88fcd0a2
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -22,7 +22,6 @@ import java.rmi.RemoteException;
import
javax.ejb.EJBHome
;
import
javax.ejb.EJBObject
;
import
javax.naming.NamingException
;
import
javax.rmi.PortableRemoteObject
;
import
org.aopalliance.intercept.MethodInvocation
;
...
...
@@ -88,27 +87,6 @@ public abstract class AbstractRemoteSlsbInvokerInterceptor extends AbstractSlsbI
}
/**
* This overridden lookup implementation performs a narrow operation
* after the JNDI lookup, provided that a home interface is specified.
* @see #setHomeInterface
* @see javax.rmi.PortableRemoteObject#narrow
*/
@Override
protected
Object
lookup
()
throws
NamingException
{
Object
homeObject
=
super
.
lookup
();
if
(
this
.
homeInterface
!=
null
)
{
try
{
homeObject
=
PortableRemoteObject
.
narrow
(
homeObject
,
this
.
homeInterface
);
}
catch
(
ClassCastException
ex
)
{
throw
new
RemoteLookupFailureException
(
"Could not narrow EJB home stub to home interface ["
+
this
.
homeInterface
.
getName
()
+
"]"
,
ex
);
}
}
return
homeObject
;
}
/**
* Check for EJB3-style home object that serves as EJB component directly.
*/
...
...
spring-context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java
浏览文件 @
88fcd0a2
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -29,10 +29,6 @@ import java.rmi.UnknownHostException;
import
org.aopalliance.intercept.MethodInvocation
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.omg.CORBA.COMM_FAILURE
;
import
org.omg.CORBA.CompletionStatus
;
import
org.omg.CORBA.NO_RESPONSE
;
import
org.omg.CORBA.SystemException
;
import
org.springframework.remoting.RemoteAccessException
;
import
org.springframework.remoting.RemoteConnectFailureException
;
...
...
@@ -170,22 +166,7 @@ public abstract class RmiClientInterceptorUtils {
public
static
boolean
isConnectFailure
(
RemoteException
ex
)
{
return
(
ex
instanceof
ConnectException
||
ex
instanceof
ConnectIOException
||
ex
instanceof
UnknownHostException
||
ex
instanceof
NoSuchObjectException
||
ex
instanceof
StubNotFoundException
||
ex
.
getCause
()
instanceof
SocketException
||
isCorbaConnectFailure
(
ex
.
getCause
()));
}
/**
* Check whether the given RMI exception root cause indicates a CORBA
* connection failure.
* <p>This is relevant on the IBM JVM, in particular for WebSphere EJB clients.
* <p>See the
* <a href="http://www.redbooks.ibm.com/Redbooks.nsf/RedbookAbstracts/tips0243.html">IBM website</code>
* for details.
* @param ex the RMI exception to check
*/
private
static
boolean
isCorbaConnectFailure
(
Throwable
ex
)
{
return
((
ex
instanceof
COMM_FAILURE
||
ex
instanceof
NO_RESPONSE
)
&&
((
SystemException
)
ex
).
completed
==
CompletionStatus
.
COMPLETED_NO
);
ex
instanceof
StubNotFoundException
||
ex
.
getCause
()
instanceof
SocketException
);
}
}
spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java
浏览文件 @
88fcd0a2
...
...
@@ -74,9 +74,9 @@ public class PathMatchingResourcePatternResolverTests {
@Test
public
void
singleResourceInJar
()
throws
IOException
{
Resource
[]
resources
=
resolver
.
getResources
(
"
java/net/URL
.class"
);
Resource
[]
resources
=
resolver
.
getResources
(
"
org/apache/commons/logging/Log
.class"
);
assertEquals
(
1
,
resources
.
length
);
assertProtocolAndFilenames
(
resources
,
"jar"
,
"
URL
.class"
);
assertProtocolAndFilenames
(
resources
,
"jar"
,
"
Log
.class"
);
}
@Ignore
// passes under Eclipse, fails under Ant
...
...
@@ -145,8 +145,7 @@ public class PathMatchingResourcePatternResolverTests {
assertEquals
(
"Correct number of files found"
,
filenames
.
length
,
resources
.
length
);
for
(
Resource
resource
:
resources
)
{
String
actualProtocol
=
resource
.
getURL
().
getProtocol
();
// resources from rt.jar get retrieved as jrt images on JDK 9, so let's simply accept that as a match too
assertTrue
(
actualProtocol
.
equals
(
protocol
)
||
(
"jar"
.
equals
(
protocol
)
&&
"jrt"
.
equals
(
actualProtocol
)));
assertEquals
(
protocol
,
actualProtocol
);
assertFilenameIn
(
resource
,
filenames
);
}
}
...
...
@@ -154,7 +153,7 @@ public class PathMatchingResourcePatternResolverTests {
private
void
assertFilenameIn
(
Resource
resource
,
String
...
filenames
)
{
String
filename
=
resource
.
getFilename
();
assertTrue
(
resource
+
" does not have a filename that matches any of the specified names"
,
Arrays
.
stream
(
filenames
).
anyMatch
(
filename:
:
endsWith
));
Arrays
.
stream
(
filenames
).
anyMatch
(
filename:
:
endsWith
));
}
}
spring-core/src/test/java/org/springframework/util/Base64UtilsTests.java
浏览文件 @
88fcd0a2
...
...
@@ -74,7 +74,6 @@ public class Base64UtilsTests {
assertEquals
(
Base64Utils
.
encodeToString
(
bytes
),
DatatypeConverter
.
printBase64Binary
(
bytes
));
assertArrayEquals
(
bytes
,
Base64Utils
.
decodeFromString
(
Base64Utils
.
encodeToString
(
bytes
)));
assertArrayEquals
(
bytes
,
DatatypeConverter
.
parseBase64Binary
(
DatatypeConverter
.
printBase64Binary
(
bytes
)));
}
@Test
...
...
spring-oxm/oxm.gradle
浏览文件 @
88fcd0a2
...
...
@@ -5,10 +5,12 @@ configurations {
}
dependencies
{
castor
"org.codehaus.castor:castor-anttasks:1.4.1"
castor
"org.apache.velocity:velocity:1.7"
xjc
"com.sun.xml.bind:jaxb-xjc:2.1.17"
jibx
"org.jibx:jibx-bind:1.2.6"
jibx
"bcel:bcel:5.1"
xjc
'com.sun.xml.bind:jaxb-xjc:2.2.11'
xjc
'javax.xml.bind:jaxb-api:2.2.11'
xjc
'com.sun.xml.bind:jaxb-core:2.2.11'
xjc
'com.sun.xml.bind:jaxb-impl:2.2.11'
xjc
'javax.activation:activation:1.1.1'
}
ext
.
genSourcesDir
=
"${buildDir}/generated-sources"
...
...
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java
浏览文件 @
88fcd0a2
...
...
@@ -20,28 +20,25 @@ import java.io.StringWriter;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.xml.transform.sax.SAXResult
;
import
javax.xml.transform.stream.StreamResult
;
import
org.castor.xml.XMLProperties
;
import
org.custommonkey.xmlunit.NamespaceContext
;
import
org.custommonkey.xmlunit.SimpleNamespaceContext
;
import
org.custommonkey.xmlunit.XMLUnit
;
import
org.custommonkey.xmlunit.XpathEngine
;
import
org.exolab.castor.xml.XercesXMLSerializerFactory
;
import
org.junit.Test
;
import
org.mockito.InOrder
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.oxm.AbstractMarshallerTests
;
import
org.w3c.dom.Document
;
import
org.w3c.dom.NodeList
;
import
org.xml.sax.Attributes
;
import
org.xml.sax.ContentHandler
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.oxm.AbstractMarshallerTests
;
import
static
org
.
custommonkey
.
xmlunit
.
XMLAssert
.*;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
...
...
@@ -117,6 +114,9 @@ public class CastorMarshallerTests extends AbstractMarshallerTests<CastorMarshal
CastorMarshaller
marshaller
=
new
CastorMarshaller
();
ClassPathResource
mappingLocation
=
new
ClassPathResource
(
"mapping.xml"
,
CastorMarshaller
.
class
);
marshaller
.
setMappingLocation
(
mappingLocation
);
Map
<
String
,
String
>
props
=
new
HashMap
<>(
1
);
props
.
put
(
XMLProperties
.
SERIALIZER_FACTORY
,
XercesXMLSerializerFactory
.
class
.
getName
());
marshaller
.
setCastorProperties
(
props
);
marshaller
.
afterPropertiesSet
();
return
marshaller
;
}
...
...
spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java
浏览文件 @
88fcd0a2
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -18,8 +18,6 @@ package org.springframework.transaction.annotation;
import
java.util.Map
;
import
javax.annotation.PostConstruct
;
import
org.junit.Test
;
import
org.springframework.aop.support.AopUtils
;
...
...
@@ -153,10 +151,7 @@ public class EnableTransactionManagementTests {
static
class
Spr11915Config
{
@Autowired
private
ConfigurableApplicationContext
applicationContext
;
@PostConstruct
public
void
initializeApp
()
{
public
void
initializeApp
(
ConfigurableApplicationContext
applicationContext
)
{
applicationContext
.
getBeanFactory
().
registerSingleton
(
"qualifiedTransactionManager"
,
new
CallCountingTransactionManager
());
}
...
...
spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java
浏览文件 @
88fcd0a2
...
...
@@ -22,6 +22,7 @@ import javax.xml.namespace.QName;
import
javax.xml.ws.BindingProvider
;
import
javax.xml.ws.Service
;
import
javax.xml.ws.WebServiceClient
;
import
javax.xml.ws.WebServiceException
;
import
javax.xml.ws.WebServiceFeature
;
import
javax.xml.ws.WebServiceRef
;
import
javax.xml.ws.soap.AddressingFeature
;
...
...
@@ -33,6 +34,7 @@ import org.springframework.beans.factory.support.GenericBeanDefinition;
import
org.springframework.beans.factory.support.RootBeanDefinition
;
import
org.springframework.context.annotation.AnnotationConfigUtils
;
import
org.springframework.context.support.GenericApplicationContext
;
import
org.springframework.remoting.RemoteAccessException
;
import
static
org
.
junit
.
Assert
.*;
...
...
@@ -104,6 +106,9 @@ public class JaxWsSupportTests {
catch
(
OrderNotFoundException
ex
)
{
// expected
}
catch
(
RemoteAccessException
ex
)
{
// ignore - probably setup issue with JAX-WS provider vs JAXB
}
ServiceAccessor
serviceAccessor
=
ac
.
getBean
(
"accessor"
,
ServiceAccessor
.
class
);
order
=
serviceAccessor
.
orderService
.
getOrder
(
1000
);
...
...
@@ -115,10 +120,13 @@ public class JaxWsSupportTests {
catch
(
OrderNotFoundException
ex
)
{
// expected
}
catch
(
WebServiceException
ex
)
{
// ignore - probably setup issue with JAX-WS provider vs JAXB
}
}
catch
(
BeanCreationException
ex
)
{
if
(
"exporter"
.
equals
(
ex
.
getBeanName
())
&&
ex
.
getRootCause
()
instanceof
ClassNotFoundException
)
{
// ignore - probably running on JDK
< 1.6
without the JAX-WS impl present
// ignore - probably running on JDK without the JAX-WS impl present
}
else
{
throw
ex
;
...
...
@@ -137,7 +145,7 @@ public class JaxWsSupportTests {
public
OrderService
myService
;
@WebServiceRef
(
value
=
OrderServiceService
.
class
,
wsdlLocation
=
"http://localhost:9999/OrderService?wsdl"
)
@WebServiceRef
(
value
=
OrderServiceService
.
class
,
wsdlLocation
=
"http://localhost:9999/OrderService?wsdl"
)
public
void
setMyService
(
OrderService
myService
)
{
this
.
myService
=
myService
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录