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.common.utils.Utils.*;
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 return alist(new Object[][] {
33 {
34 new ComboInput("HTML-stylesheet", "/", MediaType.HTML,
35 "@import '/htdocs/themes/dark.css';",
36 ".menu-item {"
37 )
38 },
39 {
40 new ComboInput("HTML-stylesheet-contnt", "/htdocs/themes/devops.css", MediaType.PLAIN,
41 "/** DevOps look-and-feel */"
42 )
43 },
44 {
45 new ComboInput("HTML-header", "/", MediaType.HTML,
46 "<head>",
47 "<h1>Root resources</h1>",
48 "<h2>Navigation page</h2>",
49 "<img src='/htdocs/images/juneau.png' style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/>"
50 )
51 },
52 {
53 new ComboInput("HTML-nav", "/", MediaType.HTML,
54 "<nav>",
55 "<a href='/api'>api</a>",
56 "<a onclick='menuClick(this);'>content-type</a>",
57 "<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>"
58 )
59 },
60 {
61 new ComboInput("HTML-nav-popup-contentType", "/", MediaType.HTML,
62 "<div class='popup-content'>",
63 "/?plainText=true&Accept=application%2Fjson"
64 )
65 },
66 {
67 new ComboInput("HTML-aside", "/", MediaType.HTML,
68 "<aside>",
69 "<p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>",
70 "<p>Other features (such as this aside) are added through annotations.</p>"
71 )
72 },
73 {
74 new ComboInput("HTML-footer", "/", MediaType.HTML,
75 "<footer>",
76 "<img style='float:right;padding-right:20px;height:32px' src='/htdocs/images/asf.png'>"
77 )
78 },
79 {
80 new ComboInput("HTML-content-text/html", "/", MediaType.HTML,
81 "<a href='/helloWorld'>helloWorld</a>",
82 "<td>Hello World</td>"
83 )
84 },
85 {
86 new ComboInput("HTML-content-application/json", "/", MediaType.JSON,
87 "'name':'helloWorld',",
88 "'description':'Hello World'"
89 )
90 },
91 {
92 new ComboInput("HTML-content-octal/msgpack", "/", MediaType.MSGPACK,
93 "82 A4 6E"
94 )
95 },
96 {
97 new ComboInput("HTML-content-text/plain", "/", MediaType.PLAIN,
98 "Hello World"
99 )
100 },
101 {
102 new ComboInput("HTML-content-text/uon", "/", MediaType.UON,
103 "(name=helloWorld,description='Hello World')"
104 )
105 },
106 {
107 new ComboInput("HTML-content-application/x-www-form-urlencoded", "/", MediaType.URLENCODING,
108 "0=(name=helloWorld,description='Hello+World')"
109 )
110 },
111 {
112 new ComboInput("HTML-content-text/xml", "/", MediaType.XML,
113 "<name>helloWorld</name><description>Hello World</description>"
114 )
115 }
116 });
117 }
118
119
120 public RootContentTest(ComboInput comboInput) {
121 super(comboInput);
122 }
123 }