1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.juneau.examples.rest;
18
19 import static org.apache.juneau.commons.utils.CollectionUtils.*;
20
21 import java.util.*;
22
23 import org.apache.juneau.*;
24 import org.junit.runner.*;
25 import org.junit.runners.*;
26
27 @RunWith(Parameterized.class)
28 public class RootContentTest extends ContentComboTestBase {
29
30 @Parameterized.Parameters
31 public static Collection<Object[]> getParameters() {
32
33 return l(new Object[][] {
34 {
35 new ComboInput("HTML-stylesheet", "/", MediaType.HTML,
36 "@import '/htdocs/themes/dark.css';",
37 ".menu-item {"
38 )
39 },
40 {
41 new ComboInput("HTML-stylesheet-contnt", "/htdocs/themes/devops.css", MediaType.PLAIN,
42 "/** DevOps look-and-feel */"
43 )
44 },
45 {
46 new ComboInput("HTML-header", "/", MediaType.HTML,
47 "<head>",
48 "<h1>Root resources</h1>",
49 "<h2>Navigation page</h2>",
50 "<img src='/htdocs/images/juneau.png' style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/>"
51 )
52 },
53 {
54 new ComboInput("HTML-nav", "/", MediaType.HTML,
55 "<nav>",
56 "<a href='/api'>api</a>",
57 "<a onclick='menuClick(this);'>content-type</a>",
58 "<a href='https://github.com/apache/juneau/blob/master/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RootResources.java'>source</a>"
59 )
60 },
61 {
62 new ComboInput("HTML-nav-popup-contentType", "/", MediaType.HTML,
63 "<div class='popup-content'>",
64 "/?plainText=true&Accept=application%2Fjson"
65 )
66 },
67 {
68 new ComboInput("HTML-aside", "/", MediaType.HTML,
69 "<aside>",
70 "<p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>",
71 "<p>Other features (such as this aside) are added through annotations.</p>"
72 )
73 },
74 {
75 new ComboInput("HTML-footer", "/", MediaType.HTML,
76 "<footer>",
77 "<img style='float:right;padding-right:20px;height:32px' src='/htdocs/images/asf.png'>"
78 )
79 },
80 {
81 new ComboInput("HTML-content-text/html", "/", MediaType.HTML,
82 "<a href='/helloWorld'>helloWorld</a>",
83 "<td>Hello World</td>"
84 )
85 },
86 {
87 new ComboInput("HTML-content-application/json", "/", MediaType.JSON,
88 "'name':'helloWorld',",
89 "'description':'Hello World'"
90 )
91 },
92 {
93 new ComboInput("HTML-content-octal/msgpack", "/", MediaType.MSGPACK,
94 "82 A4 6E"
95 )
96 },
97 {
98 new ComboInput("HTML-content-text/plain", "/", MediaType.PLAIN,
99 "Hello World"
100 )
101 },
102 {
103 new ComboInput("HTML-content-text/uon", "/", MediaType.UON,
104 "(name=helloWorld,description='Hello World')"
105 )
106 },
107 {
108 new ComboInput("HTML-content-application/x-www-form-urlencoded", "/", MediaType.URLENCODING,
109 "0=(name=helloWorld,description='Hello+World')"
110 )
111 },
112 {
113 new ComboInput("HTML-content-text/xml", "/", MediaType.XML,
114 "<name>helloWorld</name><description>Hello World</description>"
115 )
116 }
117 });
118
119 }
120
121 public RootContentTest(ComboInput comboInput) {
122 super(comboInput);
123 }
124 }