added org.springframework.testsuite back into the top-level build
This commit is contained in:
parent
1e628e6af1
commit
f389a9a7b2
|
@ -20,6 +20,7 @@
|
|||
<pathelement location="../org.springframework.web.portlet"/>
|
||||
<pathelement location="../org.springframework.test"/>
|
||||
<pathelement location="../org.springframework.spring-library"/>
|
||||
<pathelement location="../org.springframework.testsuite"/>
|
||||
</path>
|
||||
|
||||
<property file="${basedir}/../build.properties"/>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<conf name="groovy" extends="runtime" description="JARs needed to develop Groovy beans"/>
|
||||
<conf name="instrumentation" extends="runtime" description="JARs needed to develop with Spring VM Instrumentation"/>
|
||||
<conf name="jpa" extends="runtime" description="JARs needed to develop JPA beans"/>
|
||||
<conf name="jruby" extends="runtime" description="JARs needed to develop Groovy beans"/>
|
||||
<conf name="jruby" extends="runtime" description="JARs needed to develop JRuby beans"/>
|
||||
<conf name="ws" extends="runtime" description="JARs needed to develop web service beans"/>
|
||||
</configurations>
|
||||
|
||||
|
@ -48,11 +48,11 @@
|
|||
<dependency org="org.springframework" name="org.springframework.aop" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.expression" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.expression" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.instrument" rev="latest.integration" conf="optional, instrumentation->compile"/>
|
||||
<!-- test dependencies -->
|
||||
<dependency org="org.apache.log4j" name="com.springsource.org.apache.log4j" rev="1.2.15" conf="test->runtime"/>
|
||||
<dependency org="org.junit" name="com.springsource.org.junit" rev="4.5.0" conf="test->runtime"/>
|
||||
<dependency org="org.junit" name="com.springsource.org.junit" rev="4.5.0" conf="test->runtime"/>
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="2.3.0" conf="test->compile"/>
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<dependency org="com.caucho" name="com.springsource.com.caucho" rev="3.1.5" conf="test->compile"/>
|
||||
<dependency org="com.ibm.websphere" name="com.springsource.com.ibm.websphere.uow" rev="6.0.2.17" conf="test->compile"/>
|
||||
<dependency org="com.opensymphony.quartz" name="com.springsource.org.quartz" rev="1.6.2" conf="test->compile"/>
|
||||
<dependency org="com.oracle.oc4j" name="com.springsource.oracle.classloader" rev="10.1.3.1" conf="provided->compile"/>
|
||||
<dependency org="com.oracle.toplink.essentials" name="com.springsource.oracle.toplink.essentials" rev="2.0.0.b41-beta2" conf="test->compile"/>
|
||||
<dependency org="com.sun.enterprise" name="com.springsource.com.sun.enterprise.loader" rev="1.0.0" conf="test->compile"/>
|
||||
<dependency org="com.sun.syndication" name="com.springsource.com.sun.syndication" rev="0.9.0" conf="test->compile"/>
|
||||
|
@ -37,13 +38,12 @@
|
|||
<dependency org="javax.servlet" name="com.springsource.javax.servlet" rev="2.5.0" conf="test->compile"/>
|
||||
<dependency org="javax.servlet" name="com.springsource.javax.servlet.jsp" rev="2.1.0" conf="test->compile"/>
|
||||
<dependency org="javax.servlet" name="com.springsource.javax.servlet.jsp.jstl" rev="1.1.2" conf="test->compile"/>
|
||||
<dependency org="javax.xml.rpc" name="com.springsource.javax.xml.rpc" rev="1.1.0" conf="test->compile"/>
|
||||
<dependency org="javax.transaction" name="com.springsource.javax.transaction" rev="1.1.0" conf="test->compile"/>
|
||||
<dependency org="javax.xml.rpc" name="com.springsource.javax.xml.rpc" rev="1.1.0" conf="test->compile"/>
|
||||
<dependency org="net.sourceforge.cglib" name="com.springsource.net.sf.cglib" rev="2.1.3" conf="test->compile"/>
|
||||
<dependency org="net.sourceforge.ehcache" name="com.springsource.net.sf.ehcache" rev="1.3.0" conf="test->compile"/>
|
||||
<dependency org="net.sourceforge.jexcelapi" name="com.springsource.jxl" rev="2.6.6" conf="test->compile"/>
|
||||
<dependency org="net.sourceforge.jasperreports" name="com.springsource.net.sf.jasperreports" rev="2.0.5" conf="test->compile"/>
|
||||
<dependency org="org.dom4j" name="com.springsource.org.dom4j" rev="1.6.1" conf="test->compile"/>
|
||||
<dependency org="net.sourceforge.jexcelapi" name="com.springsource.jxl" rev="2.6.6" conf="test->compile"/>
|
||||
<dependency org="org.antlr" name="com.springsource.antlr" rev="2.7.6" conf="test->compile"/>
|
||||
<dependency org="org.apache.commons" name="com.springsource.org.apache.commons.dbcp" rev="1.2.2.osgi" conf="test->runtime"/>
|
||||
<dependency org="org.apache.commons" name="com.springsource.org.apache.commons.fileupload" rev="1.2.0" conf="test->compile"/>
|
||||
|
@ -51,19 +51,20 @@
|
|||
<dependency org="org.apache.ibatis" name="com.springsource.com.ibatis" rev="2.3.4.726" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.java5" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.persistence" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.persistence.jdbc" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.jdbc.java5" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.lib" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.lib.java5" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.jdbc.java5" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.persistence" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.openjpa" name="com.springsource.org.apache.openjpa.persistence.jdbc" rev="1.0.2" conf="test->compile"/>
|
||||
<dependency org="org.apache.poi" name="com.springsource.org.apache.poi" rev="3.0.2.FINAL" conf="test->compile"/>
|
||||
<dependency org="org.apache.tiles" name="com.springsource.org.apache.tiles" rev="2.0.5" conf="test->compile"/>
|
||||
<dependency org="org.apache.tiles" name="com.springsource.org.apache.tiles.core" rev="2.0.5.osgi" conf="test->compile"/>
|
||||
<dependency org="org.apache.tiles" name="com.springsource.org.apache.tiles.jsp" rev="2.0.5" conf="test->compile"/>
|
||||
<dependency org="org.apache.velocity" name="com.springsource.org.apache.velocity" rev="1.5.0" conf="test->compile"/>
|
||||
<dependency org="org.apache.velocity" name="com.springsource.org.apache.velocity.tools.view" rev="1.4.0" conf="test->compile"/>
|
||||
<dependency org="org.apache.tiles" name="com.springsource.org.apache.tiles.jsp" rev="2.0.5" conf="test->compile"/>
|
||||
<dependency org="org.aspectj" name="com.springsource.org.aspectj.weaver" rev="1.5.4" conf="test->compile"/>
|
||||
<dependency org="org.codehaus.groovy" name="com.springsource.org.codehaus.groovy" rev="1.5.1" conf="test->compile"/>
|
||||
<dependency org="org.dom4j" name="com.springsource.org.dom4j" rev="1.6.1" conf="test->compile"/>
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="2.3.0" conf="test->compile"/>
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock.classextension" rev="2.3.0" conf="test->compile"/>
|
||||
<dependency org="org.eclipse.persistence" name="com.springsource.org.eclipse.persistence.jpa" rev="1.0.1" conf="test->compile"/>
|
||||
|
@ -73,6 +74,7 @@
|
|||
<dependency org="org.hibernate" name="com.springsource.org.hibernate.annotations.common" rev="3.3.0.ga" conf="test->compile"/>
|
||||
<dependency org="org.hibernate" name="com.springsource.org.hibernate.ejb" rev="3.3.1.ga" conf="test->compile"/>
|
||||
<dependency org="org.hsqldb" name="com.springsource.org.hsqldb" rev="1.8.0.9" conf="test->compile"/>
|
||||
<dependency org="org.jruby" name="com.springsource.org.jruby" rev="1.1.0" conf="optional, runtime->compile"/>
|
||||
<dependency org="org.objectweb.asm" name="com.springsource.org.objectweb.asm" rev="2.2.3" conf="test->runtime" />
|
||||
<dependency org="org.objectweb.asm" name="com.springsource.org.objectweb.asm.commons" rev="2.2.3" conf="test->runtime" />
|
||||
<dependency org="org.springframework" name="org.springframework.aop" rev="latest.integration" conf="test->compile"/>
|
||||
|
@ -86,13 +88,13 @@
|
|||
<dependency org="org.springframework" name="org.springframework.test" rev="latest.integration" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.transaction" rev="latest.integration" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="latest.integration" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="latest.integration" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.portlet" rev="latest.integration" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="latest.integration" conf="test->compile"/>
|
||||
<!-- test dependencies -->
|
||||
<dependency org="org.junit" name="com.springsource.org.junit" rev="4.5.0" conf="test->runtime"/>
|
||||
<dependency org="org.apache.log4j" name="com.springsource.org.apache.log4j" rev="1.2.15" conf="test->compile"/>
|
||||
<dependency org="org.custommonkey.xmlunit" name="com.springsource.org.custommonkey.xmlunit" rev="1.2.0" conf="test->compile"/>
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="2.3.0" conf="test->compile"/>
|
||||
<dependency org="org.junit" name="com.springsource.org.junit" rev="4.5.0" conf="test->runtime"/>
|
||||
<dependency org="org.testng" name="com.springsource.org.testng" rev="5.8.0" conf="test->compile"/>
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
|
||||
package org.springframework.core.io;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
@ -23,8 +28,8 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.util.HashSet;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.context.support.ServletContextResource;
|
||||
|
@ -33,8 +38,9 @@ import org.springframework.web.context.support.ServletContextResource;
|
|||
* @author Juergen Hoeller
|
||||
* @since 09.09.2004
|
||||
*/
|
||||
public class ResourceTests extends TestCase {
|
||||
public class ResourceTests {
|
||||
|
||||
@Test
|
||||
public void testByteArrayResource() throws IOException {
|
||||
Resource resource = new ByteArrayResource("testString".getBytes());
|
||||
assertTrue(resource.exists());
|
||||
|
@ -44,6 +50,7 @@ public class ResourceTests extends TestCase {
|
|||
assertEquals(resource, new ByteArrayResource("testString".getBytes()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testByteArrayResourceWithDescription() throws IOException {
|
||||
Resource resource = new ByteArrayResource("testString".getBytes(), "my description");
|
||||
assertTrue(resource.exists());
|
||||
|
@ -54,6 +61,7 @@ public class ResourceTests extends TestCase {
|
|||
assertEquals(resource, new ByteArrayResource("testString".getBytes()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInputStreamResource() throws IOException {
|
||||
InputStream is = new ByteArrayInputStream("testString".getBytes());
|
||||
Resource resource = new InputStreamResource(is);
|
||||
|
@ -64,6 +72,7 @@ public class ResourceTests extends TestCase {
|
|||
assertEquals(resource, new InputStreamResource(is));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInputStreamResourceWithDescription() throws IOException {
|
||||
InputStream is = new ByteArrayInputStream("testString".getBytes());
|
||||
Resource resource = new InputStreamResource(is, "my description");
|
||||
|
@ -75,6 +84,7 @@ public class ResourceTests extends TestCase {
|
|||
assertEquals(resource, new InputStreamResource(is));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassPathResource() throws IOException {
|
||||
Resource resource = new ClassPathResource("org/springframework/core/io/Resource.class");
|
||||
doTestResource(resource);
|
||||
|
@ -90,6 +100,7 @@ public class ResourceTests extends TestCase {
|
|||
assertEquals(1, resources.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassPathResourceWithClassLoader() throws IOException {
|
||||
Resource resource =
|
||||
new ClassPathResource("org/springframework/core/io/Resource.class", getClass().getClassLoader());
|
||||
|
@ -98,12 +109,15 @@ public class ResourceTests extends TestCase {
|
|||
new ClassPathResource("org/springframework/core/../core/io/./Resource.class", getClass().getClassLoader()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassPathResourceWithClass() throws IOException {
|
||||
Resource resource = new ClassPathResource("Resource.class", getClass());
|
||||
doTestResource(resource);
|
||||
assertEquals(resource, new ClassPathResource("Resource.class", getClass()));
|
||||
}
|
||||
|
||||
@Ignore // passes under eclipse, fails under ant
|
||||
@Test
|
||||
public void testFileSystemResource() throws IOException {
|
||||
Resource resource = new FileSystemResource(getClass().getResource("Resource.class").getFile());
|
||||
doTestResource(resource);
|
||||
|
@ -112,6 +126,7 @@ public class ResourceTests extends TestCase {
|
|||
assertEquals(resource2, new FileSystemResource("core/../core/io/./Resource.class"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlResource() throws IOException {
|
||||
Resource resource = new UrlResource(getClass().getResource("Resource.class"));
|
||||
doTestResource(resource);
|
||||
|
@ -120,6 +135,7 @@ public class ResourceTests extends TestCase {
|
|||
assertEquals(resource2, new UrlResource("file:core/../core/io/./Resource.class"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testServletContextResource() throws IOException {
|
||||
MockServletContext sc = new MockServletContext();
|
||||
Resource resource = new ServletContextResource(sc, "org/springframework/core/io/Resource.class");
|
||||
|
@ -149,24 +165,28 @@ public class ResourceTests extends TestCase {
|
|||
*/
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassPathResourceWithRelativePath() throws IOException {
|
||||
Resource resource = new ClassPathResource("dir/");
|
||||
Resource relative = resource.createRelative("subdir");
|
||||
assertEquals(new ClassPathResource("dir/subdir"), relative);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFileSystemResourceWithRelativePath() throws IOException {
|
||||
Resource resource = new FileSystemResource("dir/");
|
||||
Resource relative = resource.createRelative("subdir");
|
||||
assertEquals(new FileSystemResource("dir/subdir"), relative);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlResourceWithRelativePath() throws IOException {
|
||||
Resource resource = new UrlResource("file:dir/");
|
||||
Resource relative = resource.createRelative("subdir");
|
||||
assertEquals(new UrlResource("file:dir/subdir"), relative);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testServletContextResourceWithRelativePath() throws IOException {
|
||||
MockServletContext sc = new MockServletContext();
|
||||
Resource resource = new ServletContextResource(sc, "dir/");
|
||||
|
@ -175,12 +195,14 @@ public class ResourceTests extends TestCase {
|
|||
}
|
||||
|
||||
/*
|
||||
* @Test
|
||||
public void testNonFileResourceExists() throws Exception {
|
||||
Resource resource = new UrlResource("http://www.springframework.org");
|
||||
assertTrue(resource.exists());
|
||||
}
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void testAbstractResourceExceptions() throws Exception {
|
||||
final String name = "test-resource";
|
||||
|
||||
|
|
|
@ -16,14 +16,17 @@
|
|||
|
||||
package org.springframework.core.io.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
/**
|
||||
|
@ -34,7 +37,7 @@ import org.springframework.core.io.Resource;
|
|||
* @author Juergen Hoeller
|
||||
* @since 17.11.2004
|
||||
*/
|
||||
public class PathMatchingResourcePatternResolverTests extends TestCase {
|
||||
public class PathMatchingResourcePatternResolverTests {
|
||||
|
||||
private static final String[] CLASSES_IN_CORE_IO_SUPPORT =
|
||||
new String[] {"EncodedResource.class", "LocalizedResourceHelper.class",
|
||||
|
@ -54,6 +57,7 @@ public class PathMatchingResourcePatternResolverTests extends TestCase {
|
|||
private PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
|
||||
|
||||
@Test
|
||||
public void testInvalidPrefixWithPatternElementInIt() throws IOException {
|
||||
try {
|
||||
resolver.getResources("xx**:**/*.xy");
|
||||
|
@ -64,6 +68,7 @@ public class PathMatchingResourcePatternResolverTests extends TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSingleResourceOnFileSystem() throws IOException {
|
||||
Resource[] resources =
|
||||
resolver.getResources("org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.class");
|
||||
|
@ -71,12 +76,15 @@ public class PathMatchingResourcePatternResolverTests extends TestCase {
|
|||
assertProtocolAndFilename(resources[0], "file", "PathMatchingResourcePatternResolverTests.class");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSingleResourceInJar() throws IOException {
|
||||
Resource[] resources = resolver.getResources("java/net/URL.class");
|
||||
assertEquals(1, resources.length);
|
||||
assertProtocolAndFilename(resources[0], "jar", "URL.class");
|
||||
}
|
||||
|
||||
@Ignore // passes under eclipse, fails under ant
|
||||
@Test
|
||||
public void testClasspathStarWithPatternOnFileSystem() throws IOException {
|
||||
Resource[] resources = resolver.getResources("classpath*:org/springframework/core/io/sup*/*.class");
|
||||
// Have to exclude Clover-generated class files here,
|
||||
|
@ -91,11 +99,13 @@ public class PathMatchingResourcePatternResolverTests extends TestCase {
|
|||
assertProtocolAndFilenames(resources, "file", CLASSES_IN_CORE_IO_SUPPORT, TEST_CLASSES_IN_CORE_IO_SUPPORT);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClasspathWithPatternInJar() throws IOException {
|
||||
Resource[] resources = resolver.getResources("classpath:org/aopalliance/**/*.class");
|
||||
assertProtocolAndFilenames(resources, "jar", CLASSES_IN_AOPALLIANCE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClasspathStartWithPatternInJar() throws IOException {
|
||||
Resource[] resources = resolver.getResources("classpath*:org/aopalliance/**/*.class");
|
||||
assertProtocolAndFilenames(resources, "jar", CLASSES_IN_AOPALLIANCE);
|
||||
|
|
|
@ -80,13 +80,13 @@ public class JmxUtilsTests extends TestCase {
|
|||
}
|
||||
|
||||
public void testGetAttributeNameWithStrictCasing() {
|
||||
PropertyDescriptor pd = new BeanWrapperImpl(AttributeTest.class).getPropertyDescriptor("name");
|
||||
PropertyDescriptor pd = new BeanWrapperImpl(AttributeTestBean.class).getPropertyDescriptor("name");
|
||||
String attributeName = JmxUtils.getAttributeName(pd, true);
|
||||
assertEquals("Incorrect casing on attribute name", "Name", attributeName);
|
||||
}
|
||||
|
||||
public void testGetAttributeNameWithoutStrictCasing() {
|
||||
PropertyDescriptor pd = new BeanWrapperImpl(AttributeTest.class).getPropertyDescriptor("name");
|
||||
PropertyDescriptor pd = new BeanWrapperImpl(AttributeTestBean.class).getPropertyDescriptor("name");
|
||||
String attributeName = JmxUtils.getAttributeName(pd, false);
|
||||
assertEquals("Incorrect casing on attribute name", "name", attributeName);
|
||||
}
|
||||
|
@ -121,17 +121,17 @@ public class JmxUtilsTests extends TestCase {
|
|||
|
||||
public void testIsMBean() {
|
||||
// Correctly returns true for a class
|
||||
assertTrue(JmxUtils.isMBean(JmxClassTest.class));
|
||||
assertTrue(JmxUtils.isMBean(JmxClass.class));
|
||||
|
||||
// Correctly returns false since JmxUtils won't navigate to the extended interface
|
||||
assertFalse(JmxUtils.isMBean(SpecializedJmxInterfaceTest.class));
|
||||
assertFalse(JmxUtils.isMBean(SpecializedJmxInterface.class));
|
||||
|
||||
// Incorrectly returns true since it doesn't detect that this is an interface
|
||||
assertFalse(JmxUtils.isMBean(JmxInterfaceTest.class));
|
||||
assertFalse(JmxUtils.isMBean(JmxInterface.class));
|
||||
}
|
||||
|
||||
|
||||
public static class AttributeTest {
|
||||
public static class AttributeTestBean {
|
||||
|
||||
private String name;
|
||||
|
||||
|
@ -216,27 +216,27 @@ public class JmxUtilsTests extends TestCase {
|
|||
}
|
||||
|
||||
|
||||
private static interface JmxInterfaceTestMBean {
|
||||
private static interface JmxInterfaceMBean {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static interface JmxInterfaceTest extends JmxInterfaceTestMBean {
|
||||
private static interface JmxInterface extends JmxInterfaceMBean {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static interface SpecializedJmxInterfaceTest extends JmxInterfaceTest {
|
||||
private static interface SpecializedJmxInterface extends JmxInterface {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static interface JmxClassTestMBean {
|
||||
private static interface JmxClassMBean {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static class JmxClassTest implements JmxClassTestMBean {
|
||||
private static class JmxClass implements JmxClassMBean {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -111,15 +111,15 @@ public class TestContextManagerTests {
|
|||
@Before
|
||||
public void setUpTestContextManager() throws Throwable {
|
||||
|
||||
final Method testMethod = ExampleTest.class.getDeclaredMethod("exampleTestMethod", (Class<?>[]) null);
|
||||
this.testContextManager = new TestContextManager(ExampleTest.class);
|
||||
final Method testMethod = ExampleTestCase.class.getDeclaredMethod("exampleTestMethod", (Class<?>[]) null);
|
||||
this.testContextManager = new TestContextManager(ExampleTestCase.class);
|
||||
this.testContextManager.registerTestExecutionListeners(new NamedTestExecutionListener(FIRST),
|
||||
new NamedTestExecutionListener(SECOND), new NamedTestExecutionListener(THIRD));
|
||||
|
||||
assertEquals("Verifying the number of registered TestExecutionListeners.", 6,
|
||||
this.testContextManager.getTestExecutionListeners().size());
|
||||
|
||||
this.testContextManager.beforeTestMethod(new ExampleTest(), testMethod);
|
||||
this.testContextManager.beforeTestMethod(new ExampleTestCase(), testMethod);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -135,14 +135,14 @@ public class TestContextManagerTests {
|
|||
|
||||
@After
|
||||
public void tearDownTestContextManager() throws Throwable {
|
||||
final Method testMethod = ExampleTest.class.getDeclaredMethod("exampleTestMethod", (Class<?>[]) null);
|
||||
this.testContextManager.afterTestMethod(new ExampleTest(), testMethod, null);
|
||||
final Method testMethod = ExampleTestCase.class.getDeclaredMethod("exampleTestMethod", (Class<?>[]) null);
|
||||
this.testContextManager.afterTestMethod(new ExampleTestCase(), testMethod, null);
|
||||
this.testContextManager = null;
|
||||
}
|
||||
|
||||
|
||||
@ContextConfiguration
|
||||
private static class ExampleTest {
|
||||
private static class ExampleTestCase {
|
||||
|
||||
public void exampleTestMethod() {
|
||||
assertTrue(true);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.springframework.test.context;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -43,14 +44,14 @@ public class TestExecutionListenersTests {
|
|||
|
||||
@Test
|
||||
public void verifyNumDefaultListenersRegistered() throws Exception {
|
||||
TestContextManager testContextManager = new TestContextManager(DefaultListenersExampleTest.class);
|
||||
TestContextManager testContextManager = new TestContextManager(DefaultListenersExampleTestCase.class);
|
||||
assertEquals("Verifying the number of registered TestExecutionListeners for DefaultListenersExampleTest.", 3,
|
||||
testContextManager.getTestExecutionListeners().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyNumNonInheritedDefaultListenersRegistered() throws Exception {
|
||||
TestContextManager testContextManager = new TestContextManager(NonInheritedDefaultListenersExampleTest.class);
|
||||
TestContextManager testContextManager = new TestContextManager(NonInheritedDefaultListenersExampleTestCase.class);
|
||||
assertEquals(
|
||||
"Verifying the number of registered TestExecutionListeners for NonInheritedDefaultListenersExampleTest.",
|
||||
1, testContextManager.getTestExecutionListeners().size());
|
||||
|
@ -58,17 +59,17 @@ public class TestExecutionListenersTests {
|
|||
|
||||
@Test
|
||||
public void verifyNumInheritedDefaultListenersRegistered() throws Exception {
|
||||
TestContextManager testContextManager = new TestContextManager(InheritedDefaultListenersExampleTest.class);
|
||||
TestContextManager testContextManager = new TestContextManager(InheritedDefaultListenersExampleTestCase.class);
|
||||
assertEquals(
|
||||
"Verifying the number of registered TestExecutionListeners for InheritedDefaultListenersExampleTest.",
|
||||
1, testContextManager.getTestExecutionListeners().size());
|
||||
|
||||
testContextManager = new TestContextManager(SubInheritedDefaultListenersExampleTest.class);
|
||||
testContextManager = new TestContextManager(SubInheritedDefaultListenersExampleTestCase.class);
|
||||
assertEquals(
|
||||
"Verifying the number of registered TestExecutionListeners for SubInheritedDefaultListenersExampleTest.",
|
||||
1, testContextManager.getTestExecutionListeners().size());
|
||||
|
||||
testContextManager = new TestContextManager(SubSubInheritedDefaultListenersExampleTest.class);
|
||||
testContextManager = new TestContextManager(SubSubInheritedDefaultListenersExampleTestCase.class);
|
||||
assertEquals(
|
||||
"Verifying the number of registered TestExecutionListeners for SubSubInheritedDefaultListenersExampleTest.",
|
||||
2, testContextManager.getTestExecutionListeners().size());
|
||||
|
@ -76,55 +77,58 @@ public class TestExecutionListenersTests {
|
|||
|
||||
@Test
|
||||
public void verifyNumListenersRegistered() throws Exception {
|
||||
TestContextManager testContextManager = new TestContextManager(ExampleTest.class);
|
||||
TestContextManager testContextManager = new TestContextManager(ExampleTestCase.class);
|
||||
assertEquals("Verifying the number of registered TestExecutionListeners for ExampleTest.", 3,
|
||||
testContextManager.getTestExecutionListeners().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyNumNonInheritedListenersRegistered() throws Exception {
|
||||
TestContextManager testContextManager = new TestContextManager(NonInheritedListenersExampleTest.class);
|
||||
TestContextManager testContextManager = new TestContextManager(NonInheritedListenersExampleTestCase.class);
|
||||
assertEquals("Verifying the number of registered TestExecutionListeners for NonInheritedListenersExampleTest.",
|
||||
1, testContextManager.getTestExecutionListeners().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyNumInheritedListenersRegistered() throws Exception {
|
||||
TestContextManager testContextManager = new TestContextManager(InheritedListenersExampleTest.class);
|
||||
TestContextManager testContextManager = new TestContextManager(InheritedListenersExampleTestCase.class);
|
||||
assertEquals("Verifying the number of registered TestExecutionListeners for InheritedListenersExampleTest.", 4,
|
||||
testContextManager.getTestExecutionListeners().size());
|
||||
}
|
||||
|
||||
|
||||
static class DefaultListenersExampleTest {
|
||||
static class DefaultListenersExampleTestCase {
|
||||
}
|
||||
|
||||
@TestExecutionListeners( { QuuxTestExecutionListener.class })
|
||||
static class InheritedDefaultListenersExampleTest extends DefaultListenersExampleTest {
|
||||
static class InheritedDefaultListenersExampleTestCase extends DefaultListenersExampleTestCase {
|
||||
public void testDoSomething() {
|
||||
fail("whaa?");
|
||||
}
|
||||
}
|
||||
|
||||
static class SubInheritedDefaultListenersExampleTest extends InheritedDefaultListenersExampleTest {
|
||||
static class SubInheritedDefaultListenersExampleTestCase extends InheritedDefaultListenersExampleTestCase {
|
||||
}
|
||||
|
||||
@TestExecutionListeners( { EnigmaTestExecutionListener.class })
|
||||
static class SubSubInheritedDefaultListenersExampleTest extends SubInheritedDefaultListenersExampleTest {
|
||||
static class SubSubInheritedDefaultListenersExampleTestCase extends SubInheritedDefaultListenersExampleTestCase {
|
||||
}
|
||||
|
||||
@TestExecutionListeners(value = { QuuxTestExecutionListener.class }, inheritListeners = false)
|
||||
static class NonInheritedDefaultListenersExampleTest extends InheritedDefaultListenersExampleTest {
|
||||
static class NonInheritedDefaultListenersExampleTestCase extends InheritedDefaultListenersExampleTestCase {
|
||||
}
|
||||
|
||||
@TestExecutionListeners( { FooTestExecutionListener.class, BarTestExecutionListener.class,
|
||||
BazTestExecutionListener.class })
|
||||
static class ExampleTest {
|
||||
static class ExampleTestCase {
|
||||
}
|
||||
|
||||
@TestExecutionListeners( { QuuxTestExecutionListener.class })
|
||||
static class InheritedListenersExampleTest extends ExampleTest {
|
||||
static class InheritedListenersExampleTestCase extends ExampleTestCase {
|
||||
}
|
||||
|
||||
@TestExecutionListeners(value = { QuuxTestExecutionListener.class }, inheritListeners = false)
|
||||
static class NonInheritedListenersExampleTest extends InheritedListenersExampleTest {
|
||||
static class NonInheritedListenersExampleTestCase extends InheritedListenersExampleTestCase {
|
||||
}
|
||||
|
||||
static class FooTestExecutionListener extends AbstractTestExecutionListener {
|
||||
|
|
|
@ -63,49 +63,49 @@ public class GenericXmlContextLoaderResourceLocationsTests {
|
|||
@Parameters
|
||||
public static Collection<Object[]> contextConfigurationLocationsData() {
|
||||
@ContextConfiguration
|
||||
class ClasspathDefaultLocationsTest {
|
||||
class ClasspathDefaultLocationsTestCase {
|
||||
}
|
||||
|
||||
@ContextConfiguration(locations = { "context1.xml", "context2.xml" })
|
||||
class ImplicitClasspathLocationsTest {
|
||||
class ImplicitClasspathLocationsTestCase {
|
||||
}
|
||||
|
||||
@ContextConfiguration(locations = { "classpath:context.xml" })
|
||||
class ExplicitClasspathLocationsTest {
|
||||
class ExplicitClasspathLocationsTestCase {
|
||||
}
|
||||
|
||||
@ContextConfiguration(locations = { "file:/testing/directory/context.xml" })
|
||||
class ExplicitFileLocationsTest {
|
||||
class ExplicitFileLocationsTestCase {
|
||||
}
|
||||
|
||||
@ContextConfiguration(locations = { "http://example.com/context.xml" })
|
||||
class ExplicitUrlLocationsTest {
|
||||
class ExplicitUrlLocationsTestCase {
|
||||
}
|
||||
|
||||
@ContextConfiguration(locations = { "context1.xml", "classpath:context2.xml", "/context3.xml",
|
||||
"file:/testing/directory/context.xml", "http://example.com/context.xml" })
|
||||
class ExplicitMixedPathTypesLocationsTest {
|
||||
class ExplicitMixedPathTypesLocationsTestCase {
|
||||
}
|
||||
|
||||
return Arrays.asList(new Object[][] {
|
||||
|
||||
{
|
||||
ClasspathDefaultLocationsTest.class,
|
||||
new String[] { "classpath:/org/springframework/test/context/support/GenericXmlContextLoaderResourceLocationsTests$1ClasspathDefaultLocationsTest-context.xml" } },
|
||||
ClasspathDefaultLocationsTestCase.class,
|
||||
new String[] { "classpath:/org/springframework/test/context/support/GenericXmlContextLoaderResourceLocationsTests$1ClasspathDefaultLocationsTestCase-context.xml" } },
|
||||
|
||||
{
|
||||
ImplicitClasspathLocationsTest.class,
|
||||
ImplicitClasspathLocationsTestCase.class,
|
||||
new String[] { "classpath:/org/springframework/test/context/support/context1.xml",
|
||||
"classpath:/org/springframework/test/context/support/context2.xml" } },
|
||||
|
||||
{ ExplicitClasspathLocationsTest.class, new String[] { "classpath:context.xml" } },
|
||||
{ ExplicitClasspathLocationsTestCase.class, new String[] { "classpath:context.xml" } },
|
||||
|
||||
{ ExplicitFileLocationsTest.class, new String[] { "file:/testing/directory/context.xml" } },
|
||||
{ ExplicitFileLocationsTestCase.class, new String[] { "file:/testing/directory/context.xml" } },
|
||||
|
||||
{ ExplicitUrlLocationsTest.class, new String[] { "http://example.com/context.xml" } },
|
||||
{ ExplicitUrlLocationsTestCase.class, new String[] { "http://example.com/context.xml" } },
|
||||
|
||||
{
|
||||
ExplicitMixedPathTypesLocationsTest.class,
|
||||
ExplicitMixedPathTypesLocationsTestCase.class,
|
||||
new String[] { "classpath:/org/springframework/test/context/support/context1.xml",
|
||||
"classpath:context2.xml", "classpath:/context3.xml", "file:/testing/directory/context.xml",
|
||||
"http://example.com/context.xml" } }
|
||||
|
@ -114,7 +114,6 @@ public class GenericXmlContextLoaderResourceLocationsTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void assertContextConfigurationLocations() throws Exception {
|
||||
|
||||
final ContextConfiguration contextConfig = this.testClass.getAnnotation(ContextConfiguration.class);
|
||||
|
|
|
@ -26,6 +26,7 @@ import static org.testng.Assert.assertTrue;
|
|||
import javax.annotation.Resource;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.springframework.beans.Employee;
|
||||
import org.springframework.beans.Pet;
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
|
@ -51,8 +52,9 @@ import org.testng.annotations.Test;
|
|||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
*/
|
||||
@Ignore // renamed to Tests_ to avoid being picked up by junit. Spring Build support for TestNG is pending.
|
||||
@ContextConfiguration
|
||||
public class ConcreteTransactionalTestNGSpringContextTests extends AbstractTransactionalTestNGSpringContextTests
|
||||
public class ConcreteTransactionalTestNGSpringContextTests_ extends AbstractTransactionalTestNGSpringContextTests
|
||||
implements BeanNameAware, InitializingBean {
|
||||
|
||||
// ------------------------------------------------------------------------|
|
|
@ -21,6 +21,7 @@ import static org.testng.Assert.assertNotNull;
|
|||
import static org.testng.Assert.assertNotSame;
|
||||
import static org.testng.Assert.assertSame;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
@ -47,8 +48,9 @@ import org.testng.annotations.Test;
|
|||
* @author Sam Brannen
|
||||
* @since 2.5
|
||||
*/
|
||||
@Ignore // renamed to Tests_ to avoid being picked up by junit. Spring Build support for TestNG is pending.
|
||||
@ContextConfiguration
|
||||
public class DirtiesContextTransactionalTestNGSpringContextTests extends AbstractTransactionalTestNGSpringContextTests {
|
||||
public class DirtiesContextTransactionalTestNGSpringContextTests_ extends AbstractTransactionalTestNGSpringContextTests {
|
||||
|
||||
private ApplicationContext dirtiedApplicationContext;
|
||||
|
Loading…
Reference in New Issue