Skip to content

Instantly share code, notes, and snippets.

@nhojpatrick
Last active August 29, 2015 13:56
Show Gist options
  • Save nhojpatrick/9174445 to your computer and use it in GitHub Desktop.
Save nhojpatrick/9174445 to your computer and use it in GitHub Desktop.
struts2 issue
<html>
<body>
Hello world!
</body>
</html>
package tld.example;
import org.apache.struts2.StrutsTestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
@RunWith(BlockJUnit4ClassRunner.class)
public class HelloWorldTest extends StrutsTestCase {
@After
public void after() throws Exception {
super.tearDown();
}
@Before
public void before() throws Exception {
super.setUp();
}
@Test
public void testHelloWorld() throws Exception {
final String actual = executeAction("/hello-world");
assertEquals("<html>\n<body>\nHello world!\n</body>\n</html>", actual, "expected jsp not returned");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<!--parent / -->
<!--modelVersion / -->
<modelVersion>4.0.0</modelVersion>
<!--groupId / -->
<groupId>tld.example</groupId>
<!--artifactId / -->
<artifactId>simple-convention-test-failing</artifactId>
<!--packaging / -->
<packaging>war</packaging>
<!--name / -->
<!--version / -->
<version>0.0.1-SNAPSHOT</version>
<!--description / -->
<!--url / -->
<!--prerequisites / -->
<!--issueManagement / -->
<!--ciManagement / -->
<!--inceptionYear / -->
<!--mailingLists / -->
<!--developers / -->
<!--contributors / -->
<!--licenses / -->
<!--scm / -->
<!--organization / -->
<!--build / -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${project.custom.jetty.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<reload>manual</reload>
<scanIntervalSeconds>-1</scanIntervalSeconds>
<useProvidedScope>true</useProvidedScope>
<webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
<webAppConfig>
<resourceBases>
<resourceBase>${basedir}/src/main/webapp</resourceBase>
</resourceBases>
</webAppConfig>
<systemProperties>
<systemProperty>
<!-- This is for convenience so that the src/etc/login.conf file can stay unmodified when copied to $jetty.home/etc directory -->
<name>jetty.home</name>
<value>./src/test/jetty</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<!--profiles / -->
<!--modules / -->
<!--repositories / -->
<!--pluginRepositories / -->
<!--dependencies / -->
<dependencies>
<dependency>
<groupId>javax.api</groupId>
<artifactId>api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!--reports / (Deprecated. Now ignored by Maven. ) -->
<!--reporting / -->
<!--dependencyManagement / -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.api</groupId>
<artifactId>api</artifactId>
<version>5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${verion.dep_org.apache.struts_struts2-convention-plugin}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${verion.dep_org.apache.struts_struts2-junit-plugin}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!--distributionManagement / -->
<!--properties / -->
<properties>
<!--default properties -->
<default.encoding>UTF-8</default.encoding>
<default.java.version>1.6</default.java.version>
<!-- override maven properties -->
<maven.test.failure.ignore>false</maven.test.failure.ignore>
<maven.compiler.source>${default.java.version}</maven.compiler.source>
<maven.compiler.target>${default.java.version}</maven.compiler.target>
<project.build.sourceEncoding>${default.encoding}</project.build.sourceEncoding>
<project.build.outputEncoding>${default.encoding}</project.build.outputEncoding>
<project.reporting.outputEncoding>${default.encoding}</project.reporting.outputEncoding>
<!-- -->
<verion.dep_org.apache.struts_struts2-convention-plugin>${verion.dep_org.apache.struts_struts2-core}</verion.dep_org.apache.struts_struts2-convention-plugin>
<verion.dep_org.apache.struts_struts2-core>2.3.16</verion.dep_org.apache.struts_struts2-core>
<verion.dep_org.apache.struts_struts2-junit-plugin>${verion.dep_org.apache.struts_struts2-core}</verion.dep_org.apache.struts_struts2-junit-plugin>
<project.custom.jetty.version>9.1.2.v20140210</project.custom.jetty.version>
</properties>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<!--parent / -->
<!--modelVersion / -->
<modelVersion>4.0.0</modelVersion>
<!--groupId / -->
<groupId>tld.example</groupId>
<!--artifactId / -->
<artifactId>simple-convention-test-failing</artifactId>
<!--packaging / -->
<packaging>war</packaging>
<!--name / -->
<!--version / -->
<version>0.0.1-SNAPSHOT</version>
<!--description / -->
<!--url / -->
<!--prerequisites / -->
<!--issueManagement / -->
<!--ciManagement / -->
<!--inceptionYear / -->
<!--mailingLists / -->
<!--developers / -->
<!--contributors / -->
<!--licenses / -->
<!--scm / -->
<!--organization / -->
<!--build / -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${project.custom.jetty.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<reload>manual</reload>
<scanIntervalSeconds>-1</scanIntervalSeconds>
<useProvidedScope>true</useProvidedScope>
<webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
<webAppConfig>
<resourceBases>
<resourceBase>${basedir}/src/main/webapp</resourceBase>
</resourceBases>
</webAppConfig>
<systemProperties>
<systemProperty>
<!-- This is for convenience so that the src/etc/login.conf file can stay unmodified when copied to $jetty.home/etc directory -->
<name>jetty.home</name>
<value>./src/test/jetty</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<!--profiles / -->
<!--modules / -->
<!--repositories / -->
<!--pluginRepositories / -->
<!--dependencies / -->
<dependencies>
<dependency>
<groupId>javax.api</groupId>
<artifactId>api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!--reports / (Deprecated. Now ignored by Maven. ) -->
<!--reporting / -->
<!--dependencyManagement / -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.api</groupId>
<artifactId>api</artifactId>
<version>5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${verion.dep_org.apache.struts_struts2-convention-plugin}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${verion.dep_org.apache.struts_struts2-junit-plugin}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!--distributionManagement / -->
<!--properties / -->
<properties>
<!--default properties -->
<default.encoding>UTF-8</default.encoding>
<default.java.version>1.6</default.java.version>
<!-- override maven properties -->
<maven.test.failure.ignore>false</maven.test.failure.ignore>
<maven.compiler.source>${default.java.version}</maven.compiler.source>
<maven.compiler.target>${default.java.version}</maven.compiler.target>
<project.build.sourceEncoding>${default.encoding}</project.build.sourceEncoding>
<project.build.outputEncoding>${default.encoding}</project.build.outputEncoding>
<project.reporting.outputEncoding>${default.encoding}</project.reporting.outputEncoding>
<!-- -->
<verion.dep_org.apache.struts_struts2-convention-plugin>${verion.dep_org.apache.struts_struts2-core}</verion.dep_org.apache.struts_struts2-convention-plugin>
<verion.dep_org.apache.struts_struts2-core>2.3.16</verion.dep_org.apache.struts_struts2-core>
<verion.dep_org.apache.struts_struts2-junit-plugin>${verion.dep_org.apache.struts_struts2-core}</verion.dep_org.apache.struts_struts2-junit-plugin>
<project.custom.jetty.version>9.1.2.v20140210</project.custom.jetty.version>
</properties>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment