Permalink
Browse files

Put integration test in a profile to avoid stupid error (classpath mi…

…xup?) when running oauth and oauth2 tests in same mvn execution
  • Loading branch information...
1 parent 4eab1b7 commit e5f4db3580adabda2fe2d3498fdc05700ab9c483 @dsyer dsyer committed Nov 29, 2011
Showing with 98 additions and 76 deletions.
  1. +6 −6 samples/README.md
  2. +45 −34 samples/oauth2/sparklr/pom.xml
  3. +47 −36 samples/oauth2/tonr/pom.xml
View
12 samples/README.md
@@ -23,7 +23,7 @@ artifacts using `mvn install` and then go to the `tonr` directory (in
command line to build war files with `mvn package` and drop them in
your favourite server, or you can run them directly from an IDE.
-Visit the `http://localhost:8080/tonr` app in a browser and go to the
+Visit `http://localhost:8080/tonr2` in a browser and go to the
`sparklr` tab. The result should be:
* You are prompted to authenticate with `tonr` (the login screen tells
@@ -49,9 +49,9 @@ Use Maven (2.2.1 works) and, from this directory do
$ mvn package
and then look in `*/{sparklr,tonr}/target` for the war files. Deploy
-them with context roots `/sparklr` and `/tonr` respectively in your
-favourite web container, and fire up the `tonr` app to see the two
-working together.
+them with context roots `{/sparklr,/tonr}` (for OAuth 1) and
+`{/sparklr2,/tonr2}` (for OAuth 2) respectively in your favourite web
+container, and fire up the `tonr` app to see the two working together.
## How to deploy in Eclipse (e.g. STS)
@@ -83,5 +83,5 @@ the command line before importing the samples (using `mvn install`).
apps to a server instance (e.g. tcServer or Tomcat) in the `Servers`
View.
-* Visit the `/tonr` app in a browser
- (e.g. [http://localhost:8080/tonr](http://localhost:8080/tonr)).
+* Visit the `tonr` app in a browser
+ (e.g. [http://localhost:8080/tonr2](http://localhost:8080/tonr2)).
View
79 samples/oauth2/sparklr/pom.xml
@@ -13,50 +13,61 @@
<packaging>war</packaging>
<name>OAuth for Spring Security - Sparklr2 (OAuth 2 Provider Example)</name>
+ <profiles>
+ <profile>
+ <id>integration</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.7.1</version>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${skipTests}</skip>
+ <testFailureIgnore>true</testFailureIgnore>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <id>start-tomcat</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.7.1</version>
- <executions>
- <execution>
- <id>surefire-it</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${skipTests}</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<!--skip deploy (this is just a test module) -->
<artifactId>maven-deploy-plugin</artifactId>
<version>2.6</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>tomcat-maven-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <id>start-tomcat</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <fork>true</fork>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
<pluginManagement>
<plugins>
View
83 samples/oauth2/tonr/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -12,51 +13,61 @@
<packaging>war</packaging>
<name>OAuth for Spring Security - Tonr2 (OAuth 2 Client Example)</name>
+ <profiles>
+ <profile>
+ <id>integration</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.7.1</version>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${skipTests}</skip>
+ <testFailureIgnore>true</testFailureIgnore>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <id>start-tomcat</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.7.1</version>
- <executions>
- <execution>
- <id>surefire-it</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${skipTests}</skip>
- <testFailureIgnore>true</testFailureIgnore>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<!--skip deploy (this is just a test module) -->
<artifactId>maven-deploy-plugin</artifactId>
<version>2.6</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>tomcat-maven-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <id>start-tomcat</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <fork>true</fork>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
<pluginManagement>
<plugins>

0 comments on commit e5f4db3

Please sign in to comment.