[spring-extensions] branch master updated: Remove deprecated code.
Scott Cantor
cantor.2 at osu.edu
Wed Aug 28 16:47:22 EDT 2019
This is an automated email from the git hooks/post-receive script.
scantor 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=764ba5c191cbdebc26341f8b0b74ee38b238245b
The following commit(s) were added to refs/heads/master by this push:
new 764ba5c Remove deprecated code.
764ba5c is described below
commit 764ba5c191cbdebc26341f8b0b74ee38b238245b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Aug 28 16:47:02 2019 -0400
Remove deprecated code.
---
.../spring/resource/FileBackedHTTPResource.java | 47 -------------------
.../resource/FileBackedHTTPResourceTest.java | 31 ++-----------
.../shibboleth/ext/spring/resource/oldStyle.xml | 53 ----------------------
3 files changed, 5 insertions(+), 126 deletions(-)
diff --git a/src/main/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResource.java b/src/main/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResource.java
index 3c1dfb7..cc862dd 100644
--- a/src/main/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResource.java
+++ b/src/main/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResource.java
@@ -29,8 +29,6 @@ import javax.annotation.Nonnull;
import net.shibboleth.utilities.java.support.annotation.ParameterName;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
@@ -59,51 +57,6 @@ public class FileBackedHTTPResource extends HTTPResource {
/**
* Constructor.
*
- * @param client the client we use to connect with.
- * @param url URL to the remote data
- * @param resource the file to use as backing store
- * @throws IOException if the URL was badly formed
- * @deprecated use {@link #FileBackedHTTPResource(String, HttpClient, String)}
- */
- @Deprecated public FileBackedHTTPResource(@Nonnull @ParameterName(name="client") final HttpClient client,
- @NotEmpty @Nonnull @ParameterName(name="url") final String url,
- @Nonnull @ParameterName(name="resource") final Resource resource) throws IOException {
- super(client, url);
- backingResource = Constraint.isNotNull(resource, "Backing resource must not be null");
- if (null == resource.getFile()) {
- throw new IOException("Backing resource has to be file backed");
- }
-
- DeprecationSupport.warn(ObjectType.METHOD, "FileBackedHTTPResource constructor with resource argument", null,
- "FileBackedHTTPResource constructor with backingFile argument");
- }
-
- /**
- * Constructor.
- *
- * @param client the client we use to connect with.
- * @param url URL to the remote data
- * @param resource the file to use as backing store
- * @throws IOException if the URL was badly formed
- * @deprecated use {@link #FileBackedHTTPResource(String, HttpClient, URL)}
- */
- @Deprecated public FileBackedHTTPResource(@Nonnull @ParameterName(name="client") final HttpClient client,
- @Nonnull @NotEmpty @ParameterName(name="url") final URL url,
- @Nonnull @ParameterName(name="resource") final Resource resource)
- throws IOException {
- super(client, url);
- backingResource = Constraint.isNotNull(resource, "Backing resource must not be null");
- if (null == resource.getFile()) {
- throw new IOException("Backing resource has to be file backed");
- }
-
- DeprecationSupport.warn(ObjectType.METHOD, "FileBackedHTTPResource constructor with resource argument", null,
- "FileBackedHTTPResource constructor with backingFile argument");
- }
-
- /**
- * Constructor.
- *
* @param backingFile the file to use as backing store
* @param client the client we use to connect with.
* @param url URL to the remote data
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 6b57d45..2a176e2 100644
--- a/src/test/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResourceTest.java
+++ b/src/test/java/net/shibboleth/ext/spring/resource/FileBackedHTTPResourceTest.java
@@ -30,7 +30,6 @@ import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.mock.env.MockPropertySource;
import org.testng.Assert;
@@ -66,19 +65,18 @@ public class FileBackedHTTPResourceTest {
}
}
- @SuppressWarnings("deprecation") @Test public void existsTest() throws IOException {
+ @Test public void existsTest() throws IOException {
final Resource existsResource = new FileBackedHTTPResource(existsFile, client, existsURL);
final Resource notExistsResource =
- new FileBackedHTTPResource(client, nonExistsURL, new FileSystemResource(existsFile + "ZZZ"));
+ new FileBackedHTTPResource(existsFile + "ZZZ", client, nonExistsURL);
Assert.assertTrue(existsResource.exists());
Assert.assertFalse(notExistsResource.exists());
}
- @SuppressWarnings("deprecation") @Test public void testCompare() throws IOException {
-
- Assert.assertTrue(ResourceTestHelper.compare(new FileBackedHTTPResource(client, existsURL,
- new FileSystemResource(existsFile)), new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
+ @Test public void testCompare() throws IOException {
+ Assert.assertTrue(ResourceTestHelper.compare(new FileBackedHTTPResource(existsFile, client, existsURL),
+ 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("net/shibboleth/ext/spring/resource/document.xml")));
@@ -116,25 +114,6 @@ public class FileBackedHTTPResourceTest {
}
- @Test public void testParsingOld() throws IOException {
-
- try (final GenericApplicationContext context = getContext("net/shibboleth/ext/spring/resource/oldStyle.xml")) {
-
- Assert.assertTrue(ResourceTestHelper.compare(context.getBean("namedString", FileBackedHTTPResource.class),
- new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
- Assert.assertTrue(ResourceTestHelper.compare(context.getBean("namedFileString",
- FileBackedHTTPResource.class), new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
- Assert.assertTrue(ResourceTestHelper.compare(context.getBean("namedURL", FileBackedHTTPResource.class),
- new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
- Assert.assertTrue(ResourceTestHelper.compare(context
- .getBean("numberedString", FileBackedHTTPResource.class),
- new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
- Assert.assertTrue(ResourceTestHelper.compare(context.getBean("numberedURL", FileBackedHTTPResource.class),
- new ClassPathResource("net/shibboleth/ext/spring/resource/document.xml")));
-
- }
- }
-
@Test public void testParsingNew() throws IOException {
try (final GenericApplicationContext context = getContext("net/shibboleth/ext/spring/resource/newStyle.xml")) {
diff --git a/src/test/resources/net/shibboleth/ext/spring/resource/oldStyle.xml b/src/test/resources/net/shibboleth/ext/spring/resource/oldStyle.xml
deleted file mode 100644
index 11f3158..0000000
--- a/src/test/resources/net/shibboleth/ext/spring/resource/oldStyle.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p"
- xmlns:c="http://www.springframework.org/schema/c" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
-
- <!-- This bean MUST be called "conversionService" to work properly. -->
- <bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean">
- <property name="converters">
- <set>
- <bean class="net.shibboleth.ext.spring.config.StringToDurationConverter" />
- </set>
- </property>
- </bean>
-
- <bean id="shibboleth.NonCachingHttpClient"
- lazy-init="true"
- class="net.shibboleth.ext.spring.factory.HttpClientFactoryBean"
- p:tLSSocketFactory="#{ %{idp.httpclient.useTrustEngineTLSSocketFactory:false} ? @'shibboleth.TrustEngineTLSSocketFactory' : null }"
- p:connectionDisregardTLSCertificate="%{idp.httpclient.connectionDisregardTLSCertificate:false}"
- p:connectionTimeout="%{idp.httpclient.connectionTimeout:-1}" />
-
- <bean id="urlBean" class="java.net.URL" c:_0="%{the.url}"/>
-
- <bean id="namedString" class="net.shibboleth.ext.spring.resource.FileBackedHTTPResource"
- c:client-ref="shibboleth.NonCachingHttpClient"
- c:url="%{the.url}"
- c:resource="%{file.name}"/>
-
- <bean id="namedURL" class="net.shibboleth.ext.spring.resource.FileBackedHTTPResource"
- c:client-ref="shibboleth.NonCachingHttpClient"
- c:url-ref="urlBean"
- c:resource="%{file.name}"/>
-
- <bean id="namedFileString" class="net.shibboleth.ext.spring.resource.FileBackedHTTPResource"
- c:client-ref="shibboleth.NonCachingHttpClient"
- c:url="%{the.url}"
- c:resource="file://%{file.name}"/>
-
- <bean id="numberedString" class="net.shibboleth.ext.spring.resource.FileBackedHTTPResource"
- c:_0-ref="shibboleth.NonCachingHttpClient"
- c:_1="%{the.url}"
- c:_2="%{file.name}"/>
-
- <bean id="numberedURL" class="net.shibboleth.ext.spring.resource.FileBackedHTTPResource"
- c:_0-ref="shibboleth.NonCachingHttpClient"
- c:_1-ref="urlBean"
- c:_2="%{file.name}"/>
-</beans>
-
-
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list