WUIC tests

Support for testing WUIC features

License

License

GroupId

GroupId

com.github.wuic
ArtifactId

ArtifactId

wuic-test
Last Version

Last Version

0.5.2
Release Date

Release Date

Type

Type

jar
Description

Description

WUIC tests
Support for testing WUIC features
Project URL

Project URL

http://wuic.github.io
Source Code Management

Source Code Management

http://github.com/wuic/wuic-test

Download wuic-test

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.wuic/wuic-test/ -->
<dependency>
    <groupId>com.github.wuic</groupId>
    <artifactId>wuic-test</artifactId>
    <version>0.5.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.wuic/wuic-test/
implementation 'com.github.wuic:wuic-test:0.5.2'
// https://jarcasting.com/artifacts/com.github.wuic/wuic-test/
implementation ("com.github.wuic:wuic-test:0.5.2")
'com.github.wuic:wuic-test:jar:0.5.2'
<dependency org="com.github.wuic" name="wuic-test" rev="0.5.2">
  <artifact name="wuic-test" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.wuic', module='wuic-test', version='0.5.2')
)
libraryDependencies += "com.github.wuic" % "wuic-test" % "0.5.2"
[com.github.wuic/wuic-test "0.5.2"]

Dependencies

compile (8)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.5
junit : junit jar 4.11
io.undertow : undertow-servlet jar 1.0.0.Final
io.undertow.jastow : jastow jar 1.0.0.Final
org.apache.httpcomponents : httpclient jar 4.3.4
org.mockito : mockito-core jar 1.9.5
org.eclipse.jdt.core.compiler : ecj jar 4.3.1
org.glassfish : javax.el jar 3.0-b01

provided (1)

Group / Artifact Type Version
javax.servlet.jsp : jsp-api jar 2.2

Project Modules

There are no modules declared in this project.

Web UI Compressor - tests support

This projects provides helpers based on JUnit to ease WUIC features test. Just add the following dependency:

<dependency>
    <groupId>com.github.wuic</groupId>
	<artifactId>wuic-test</artifactId>
	<version>${wuic.version}</version>
    <scope>test</scope>
</dependency>

Integration test

You can write an integration test that runs a webapp deployed in the undertow servlet container.

@RunWith(JUnit4.class)
@WuicRunnerConfiguration(webApplicationPath = "/myCustomPath")
public class ServletContainerTest {

    @ClassRule
    public static Server server = new Server();

    @Test
    public void basicHttpGetTest() throws IOException {
        // Assume you have an index.html page in your classpath that contains "Hello World" string
        final String content = IOUtils.readString(new InputStreamReader(server.get("/index.html").getEntity().getContent()));
        Assert.assertTrue(content, content.contains("Hello World"));
    }
}

See the own unit tests of the project to get full samples.

com.github.wuic

Versions

Version
0.5.2
0.5.2.RC6
0.5.2.RC5
0.5.2.RC4
0.5.2.RC3
0.5.2.RC2
0.5.2.RC1
0.5.1
0.5.1.RC2
0.5.1.RC1
0.5.0
0.5.0.RC7
0.5.0.RC6
0.5.0.RC5
0.5.0.RC4
0.5.0.RC3
0.5.0.RC2
0.5.0.RC1