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 package info.magnolia.templating.jsp.cms;
35
36
37 import static org.hamcrest.CoreMatchers.containsString;
38 import static org.junit.Assert.assertThat;
39
40 import info.magnolia.rendering.template.configured.ConfiguredTemplateAvailability;
41 import info.magnolia.rendering.template.configured.ConfiguredTemplateDefinition;
42 import info.magnolia.templating.jsp.AbstractTagTestCase;
43
44 import org.junit.Before;
45 import org.junit.Test;
46
47 import com.meterware.httpunit.GetMethodWebRequest;
48 import com.meterware.httpunit.WebRequest;
49 import com.meterware.httpunit.WebResponse;
50
51
52
53
54 public class InitBarTagTest extends AbstractTagTestCase {
55 private String jspUrl;
56
57 @Override
58 @Before
59 public void setUp() throws Exception {
60 super.setUp();
61 String jspPath = getClass().getName().replace('.', '/') + ".jsp";
62 jspUrl = "http://localhost" + CONTEXT + "/" + jspPath;
63
64 ConfiguredTemplateDefinition renderableDefinition = new ConfiguredTemplateDefinition(new ConfiguredTemplateAvailability());
65
66 setRenderableDefinition(renderableDefinition);
67 }
68
69 @Test
70 public void testOutput() throws Exception {
71
72 final WebRequest request = new GetMethodWebRequest(jspUrl);
73 final WebResponse response = runner.getResponse(request);
74
75
76 final String responseStr = response.getText();
77
78
79 assertThat(responseStr, containsString("<!-- cms:page content=\"website:/foo/bar/paragraphs/1\" -->"));
80 }
81 }