Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 4153f09

Browse files
committed
Add project for SRP-7985
1 parent a1584d7 commit 4153f09

File tree

5 files changed

+126
-0
lines changed

5 files changed

+126
-0
lines changed

SPR-7985/pom.xml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>org.springframework.issues</groupId>
5+
<artifactId>SPR-7985</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<packaging>jar</packaging>
8+
<dependencies>
9+
<dependency>
10+
<groupId>org.springframework</groupId>
11+
<artifactId>spring-context</artifactId>
12+
<version>3.2.0.BUILD-SNAPSHOT</version>
13+
</dependency>
14+
<dependency>
15+
<groupId>org.springframework</groupId>
16+
<artifactId>spring-web</artifactId>
17+
<version>3.2.0.BUILD-SNAPSHOT</version>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.apache.httpcomponents</groupId>
21+
<artifactId>httpclient</artifactId>
22+
<version>4.1.3</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.codehaus.jackson</groupId>
26+
<artifactId>jackson-mapper-asl</artifactId>
27+
<version>1.9.7</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>log4j</groupId>
31+
<artifactId>log4j</artifactId>
32+
<version>1.2.16</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>junit</groupId>
36+
<artifactId>junit</artifactId>
37+
<version>4.8</version>
38+
<scope>test</scope>
39+
</dependency>
40+
</dependencies>
41+
<repositories>
42+
<repository>
43+
<id>spring-maven-snapshot</id>
44+
<name>Springframework Maven Snapshot Repository</name>
45+
<url>http://repo.springsource.org/snapshot</url>
46+
<snapshots><enabled>true</enabled></snapshots>
47+
</repository>
48+
</repositories>
49+
<properties>
50+
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
51+
</properties>
52+
<build>
53+
<plugins>
54+
<plugin>
55+
<artifactId>maven-compiler-plugin</artifactId>
56+
<version>2.3.2</version>
57+
<configuration>
58+
<source>1.6</source>
59+
<target>1.6</target>
60+
</configuration>
61+
</plugin>
62+
<plugin>
63+
<artifactId>maven-surefire-plugin</artifactId>
64+
<version>2.7.2</version>
65+
<configuration>
66+
<includes>
67+
<include>**/*Tests.java</include>
68+
</includes>
69+
<excludes>
70+
<exclude>**/*Abstract*.java</exclude>
71+
</excludes>
72+
</configuration>
73+
</plugin>
74+
</plugins>
75+
</build>
76+
</project>
77+

SPR-7985/src/main/resources/.gitignore

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.springframework.issues;
2+
3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.fail;
5+
6+
import org.junit.Test;
7+
import org.springframework.http.HttpMethod;
8+
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
9+
import org.springframework.web.client.RestTemplate;
10+
11+
public class HttpPatchMethodTests {
12+
13+
// With Apache HttpComponents HttpClient 4.1.3 (i.e. lower than 4.2) on the classpath,
14+
// use of HTTP PATCH should result in exception with helpful message.
15+
16+
@Test
17+
public void test() {
18+
RestTemplate restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory());
19+
try {
20+
restTemplate.exchange("/someUrl", HttpMethod.PATCH, null, null);
21+
fail("Expected exception");
22+
}
23+
catch (IllegalArgumentException ex) {
24+
assertEquals("HTTP method PATCH not available before Apache HttpComponents HttpClient 4.2", ex.getMessage());
25+
}
26+
}
27+
28+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
log4j.rootCategory=ERROR, stdout
2+
3+
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
4+
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
5+
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
6+
7+
log4j.category.org.springframework=WARN
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:context="http://www.springframework.org/schema/context"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.springframework.org/schema/beans
6+
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
7+
8+
<bean id="foo" class="org.springframework.issues.Foo">
9+
<constructor-arg ref="bar"/>
10+
</bean>
11+
12+
<bean id="bar" class="org.springframework.issues.Bar"/>
13+
14+
</beans>

0 commit comments

Comments
 (0)