[spring-extensions] 02/04: Make test file location consistent.

Rod Widdowson rdw at steadingsoftware.com
Mon Sep 19 12:24:34 EDT 2016


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository spring-extensions.

View the commit online:
http://git.shibboleth.net/view/?p=spring-extensions.git;a=commit;h=904425c85974ce3438ba28f42e76306b93555e80

commit 904425c85974ce3438ba28f42e76306b93555e80
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun Sep 18 15:57:40 2016 +0100

    Make test file location consistent.
    
    Some tests files were in data some were in net/shibboleth, some
    tests used one, some the other, some both.
    
    For the sake of consistency move everything to net/shibboleth/...
---
 .../spring/factory/DOMDocumentFactoryBeanTest.java |  2 +-
 .../resource/FileBackedHTTPResourceTest.java       | 26 +++++++++++-----------
 .../ext/spring/resource/HTTPResourceTest.java      | 14 ++++++------
 .../ext/spring/resource/SVNResourceTest.java       |  4 ++--
 .../ext/spring/resource}/FileBackedHTTPBean.xml    |  0
 .../ext/spring/resource}/MemBackedHTTPBean.xml     |  0
 .../shibboleth/ext/spring/resource}/SVNBean.xml    |  0
 .../ext/spring/resource}/TestResource.txt          |  0
 .../shibboleth/ext/spring/resource}/document.xml   |  0
 .../shibboleth/ext/spring/resource}/newStyle.xml   |  0
 .../shibboleth/ext/spring/resource}/oldStyle.xml   |  0
 11 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/test/java/net/shibboleth/ext/spring/factory/DOMDocumentFactoryBeanTest.java b/src/test/java/net/shibboleth/ext/spring/factory/DOMDocumentFactoryBeanTest.java
index d872a03..69f362e 100644
--- a/src/test/java/net/shibboleth/ext/spring/factory/DOMDocumentFactoryBeanTest.java
+++ b/src/test/java/net/shibboleth/ext/spring/factory/DOMDocumentFactoryBeanTest.java
@@ -37,7 +37,7 @@ public class DOMDocumentFactoryBeanTest {
     @Test
     public void getObject() throws Exception {
         final DOMDocumentFactoryBean factory = new DOMDocumentFactoryBean();
-        final Resource resource = new ClassPathResource("data/document.xml");
+        final Resource resource = new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml");
         final BasicParserPool pool = new BasicParserPool();
         pool.initialize();
         factory.setResource(resource);
diff --git a/src/test/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResourceTest.java b/src/test/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResourceTest.java
index 5c0bf6c..02c21bd 100644
--- a/src/test/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResourceTest.java
+++ b/src/test/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResourceTest.java
@@ -78,10 +78,10 @@ public class FileBackedHTTPResourceTest {
     @SuppressWarnings("deprecation") @Test public void testCompare() throws IOException {
 
         Assert.assertTrue(ResourceTestHelper.compare(new FileBackedHTTPResource(client, existsURL,
-                new FileSystemResource(existsFile)), new ClassPathResource("data/document.xml")));
+                new FileSystemResource(existsFile)), new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
         // With that done compare via the backup
         Assert.assertTrue(ResourceTestHelper.compare(new FileBackedHTTPResource(existsFile, client, nonExistsURL),
-                new ClassPathResource("data/document.xml")));
+                new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
     }
 
     public GenericApplicationContext getContext(final String location) {
@@ -118,21 +118,21 @@ public class FileBackedHTTPResourceTest {
 
     @Test public void testParsingOld() throws IOException {
 
-        final GenericApplicationContext context = getContext("data/oldStyle.xml");
+        final GenericApplicationContext context = getContext("net/shibboleth/ext/spring/resource/oldStyle.xml");
 
         try {
 
             Assert.assertTrue(ResourceTestHelper.compare(context.getBean("namedString", FileBackedHTTPResource.class),
-                    new ClassPathResource("data/document.xml")));
+                    new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
             Assert.assertTrue(ResourceTestHelper.compare(context.getBean("namedFileString",
-                    FileBackedHTTPResource.class), new ClassPathResource("data/document.xml")));
+                    FileBackedHTTPResource.class), new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
             Assert.assertTrue(ResourceTestHelper.compare(context.getBean("namedURL", FileBackedHTTPResource.class),
-                    new ClassPathResource("data/document.xml")));
+                    new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
             Assert.assertTrue(ResourceTestHelper.compare(context
                     .getBean("numberedString", FileBackedHTTPResource.class),
-                    new ClassPathResource("data/document.xml")));
+                    new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
             Assert.assertTrue(ResourceTestHelper.compare(context.getBean("numberedURL", FileBackedHTTPResource.class),
-                    new ClassPathResource("data/document.xml")));
+                    new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
 
         } finally {
             context.close();
@@ -141,18 +141,18 @@ public class FileBackedHTTPResourceTest {
 
     @Test public void testParsingNew() throws IOException {
 
-        final GenericApplicationContext context = getContext("data/newStyle.xml");
+        final GenericApplicationContext context = getContext("net/shibboleth/ext/spring/resource/newStyle.xml");
         try {
 
             Assert.assertTrue(ResourceTestHelper.compare(context.getBean("namedString", FileBackedHTTPResource.class),
-                    new ClassPathResource("data/document.xml")));
+                    new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
             Assert.assertTrue(ResourceTestHelper.compare(context.getBean("namedURL", FileBackedHTTPResource.class),
-                    new ClassPathResource("data/document.xml")));
+                    new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
             Assert.assertTrue(ResourceTestHelper.compare(context
                     .getBean("numberedString", FileBackedHTTPResource.class),
-                    new ClassPathResource("data/document.xml")));
+                    new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
             Assert.assertTrue(ResourceTestHelper.compare(context.getBean("numberedURL", FileBackedHTTPResource.class),
-                    new ClassPathResource("data/document.xml")));
+                    new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
         } finally {
             context.close();
         }
diff --git a/src/test/java/net/shibboleth/ext/spring/resource/HTTPResourceTest.java b/src/test/java/net/shibboleth/ext/spring/resource/HTTPResourceTest.java
index 72bd648..9a1e08e 100644
--- a/src/test/java/net/shibboleth/ext/spring/resource/HTTPResourceTest.java
+++ b/src/test/java/net/shibboleth/ext/spring/resource/HTTPResourceTest.java
@@ -66,7 +66,7 @@ public class HTTPResourceTest {
     @Test public void testCompare() throws IOException {
 
         Assert.assertTrue(ResourceTestHelper.compare(new HTTPResource(client, existsURL), new ClassPathResource(
-                "data/document.xml")));
+                "net/shibboleth/ext/spring/resource/document.xml")));
     }
 
     @Test public void testRelated() throws IOException {
@@ -90,7 +90,7 @@ public class HTTPResourceTest {
         final TestHTTPResource what = new TestHTTPResource(client, existsURL);
         Assert.assertTrue(what.exists());
         Assert.assertNull(what.getLasteCacheResponseStatus());
-        Assert.assertTrue(ResourceTestHelper.compare(what, new ClassPathResource("data/document.xml")));
+        Assert.assertTrue(ResourceTestHelper.compare(what, new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
         Assert.assertNull(what.getLasteCacheResponseStatus());
     }
 
@@ -101,7 +101,7 @@ public class HTTPResourceTest {
         final TestHTTPResource what = new TestHTTPResource(builder.buildClient(), existsURL);
         Assert.assertTrue(what.exists());
         Assert.assertNotNull(what.getLasteCacheResponseStatus());
-        Assert.assertTrue(ResourceTestHelper.compare(what, new ClassPathResource("data/document.xml")));
+        Assert.assertTrue(ResourceTestHelper.compare(what, new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
 
         Assert.assertEquals(what.getLasteCacheResponseStatus(), CacheResponseStatus.CACHE_HIT);
     }
@@ -122,7 +122,7 @@ public class HTTPResourceTest {
 
     @Test public void springLoadMemCache() throws IOException {
 
-        final GenericApplicationContext context = getContext("classpath:data/MemBackedHTTPBean.xml", null);
+        final GenericApplicationContext context = getContext("classpath:net/shibboleth/ext/spring/resource/MemBackedHTTPBean.xml", null);
         try {
 
             final Collection<TestHTTPResource> beans = context.getBeansOfType(TestHTTPResource.class).values();
@@ -132,7 +132,7 @@ public class HTTPResourceTest {
 
             Assert.assertTrue(what.exists());
             Assert.assertNotNull(what.getLasteCacheResponseStatus());
-            Assert.assertTrue(ResourceTestHelper.compare(what, new ClassPathResource("data/document.xml")));
+            Assert.assertTrue(ResourceTestHelper.compare(what, new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
 
             Assert.assertEquals(what.getLasteCacheResponseStatus(), CacheResponseStatus.CACHE_HIT);
         } finally {
@@ -157,7 +157,7 @@ public class HTTPResourceTest {
         GenericApplicationContext context = null;
         try {
             theDir = p.toFile();
-            context = getContext("classpath:data/MemBackedHTTPBean.xml", null);
+            context = getContext("classpath:net/shibboleth/ext/spring/resource/MemBackedHTTPBean.xml", null);
             final Collection<TestHTTPResource> beans = context.getBeansOfType(TestHTTPResource.class).values();
             Assert.assertEquals(beans.size(), 1);
 
@@ -165,7 +165,7 @@ public class HTTPResourceTest {
 
             Assert.assertTrue(what.exists());
             Assert.assertNotNull(what.getLasteCacheResponseStatus());
-            Assert.assertTrue(ResourceTestHelper.compare(what, new ClassPathResource("data/document.xml")));
+            Assert.assertTrue(ResourceTestHelper.compare(what, new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
 
             Assert.assertEquals(what.getLasteCacheResponseStatus(), CacheResponseStatus.CACHE_HIT);
         } finally {
diff --git a/src/test/java/net/shibboleth/ext/spring/resource/SVNResourceTest.java b/src/test/java/net/shibboleth/ext/spring/resource/SVNResourceTest.java
index 958b6c6..4ce54e1 100644
--- a/src/test/java/net/shibboleth/ext/spring/resource/SVNResourceTest.java
+++ b/src/test/java/net/shibboleth/ext/spring/resource/SVNResourceTest.java
@@ -53,7 +53,7 @@ public class SVNResourceTest {
 
     static private final int ORIGINAL_VERSION = 492;
 
-    static private final String PATH = "data/";
+    static private final String PATH = "net/shibboleth/ext/spring/resource/";
 
     static private final String SVN_PATH = "/utilities/spring-extensions/trunk/src/test/resources/" + PATH;
 
@@ -150,7 +150,7 @@ public class SVNResourceTest {
 
     @Test(enabled=false) public void testSpringLoad() {
 
-        final GenericApplicationContext context = getContext("classpath:data/SVNBean.xml");
+        final GenericApplicationContext context = getContext("classpath:"+PATH+"SVNBean.xml");
         try {
             final Collection<Resource> beans = context.getBeansOfType(Resource.class).values();
             Assert.assertEquals(beans.size(), 1);
diff --git a/src/test/resources/data/FileBackedHTTPBean.xml b/src/test/resources/net/shibboleth/ext/spring/resource/FileBackedHTTPBean.xml
similarity index 100%
rename from src/test/resources/data/FileBackedHTTPBean.xml
rename to src/test/resources/net/shibboleth/ext/spring/resource/FileBackedHTTPBean.xml
diff --git a/src/test/resources/data/MemBackedHTTPBean.xml b/src/test/resources/net/shibboleth/ext/spring/resource/MemBackedHTTPBean.xml
similarity index 100%
rename from src/test/resources/data/MemBackedHTTPBean.xml
rename to src/test/resources/net/shibboleth/ext/spring/resource/MemBackedHTTPBean.xml
diff --git a/src/test/resources/data/SVNBean.xml b/src/test/resources/net/shibboleth/ext/spring/resource/SVNBean.xml
similarity index 100%
rename from src/test/resources/data/SVNBean.xml
rename to src/test/resources/net/shibboleth/ext/spring/resource/SVNBean.xml
diff --git a/src/test/resources/data/TestResource.txt b/src/test/resources/net/shibboleth/ext/spring/resource/TestResource.txt
similarity index 100%
rename from src/test/resources/data/TestResource.txt
rename to src/test/resources/net/shibboleth/ext/spring/resource/TestResource.txt
diff --git a/src/test/resources/data/document.xml b/src/test/resources/net/shibboleth/ext/spring/resource/document.xml
similarity index 100%
rename from src/test/resources/data/document.xml
rename to src/test/resources/net/shibboleth/ext/spring/resource/document.xml
diff --git a/src/test/resources/data/newStyle.xml b/src/test/resources/net/shibboleth/ext/spring/resource/newStyle.xml
similarity index 100%
rename from src/test/resources/data/newStyle.xml
rename to src/test/resources/net/shibboleth/ext/spring/resource/newStyle.xml
diff --git a/src/test/resources/data/oldStyle.xml b/src/test/resources/net/shibboleth/ext/spring/resource/oldStyle.xml
similarity index 100%
rename from src/test/resources/data/oldStyle.xml
rename to src/test/resources/net/shibboleth/ext/spring/resource/oldStyle.xml

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list