-
Notifications
You must be signed in to change notification settings - Fork 13
/
VelocityTest.java
38 lines (32 loc) · 1.5 KB
/
VelocityTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.jboss.seam.rest.test.templating;
import static org.jboss.seam.rest.test.Dependencies.addJBossLoggingDependencyToManifest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.seam.rest.test.Dependencies;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Ignore;
import org.junit.Test;
public class VelocityTest extends AbstractTemplatingTest {
@Deployment(testable = false)
public static WebArchive createDeployment() {
WebArchive war = createTestApplication();
war.addAsLibraries(Dependencies.VELOCITY);
war.addAsLibraries(Dependencies.VELOCITY_TOOLS);
war.addAsLibrary(getSeamRest());
addJBossLoggingDependencyToManifest(war); // SOLDER-119
return war;
}
@Test
public void testTemplate() throws Exception {
test("http://localhost:8080/test/velocity/hello", 200, "Hello Jozef Hartinger", "text/student");
}
@Test
@Ignore
public void testString() throws Exception {
test("http://localhost:8080/test/velocity/string", 200, "Hello Jozef!", "text/plain");
}
@Test
public void testExpressionLanguage() throws Exception {
String expectedResponse = "<university name=\"Masaryk University\"><students count=\"3\"><student>A</student><student>B</student><student>C</student><student>Jozef Hartinger</student></students></university>";
test("http://localhost:8080/test/velocity/students", 200, expectedResponse, "application/university+xml");
}
}