Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update test and expected output to work with latest Wicket

Addresses #35
  • Loading branch information...
commit 58e2151a834277db47e4cefdb3ec9fa8368586bc 1 parent 78e2553
Matt Brictson mbrictson authored
24 README.md
Source Rendered
@@ -53,7 +53,7 @@ powerful tools like variables and mixins, and improves browser performance by me
53 53 files into a single response.
54 54
55 55 We've integrated Compass with the Maven build process, meaning `mvn compile` also compiles SCSS
56   -to CSS, and `mvn clean` also deletes the compiled CSS. We recommend stylesheet authors run
  56 +to CSS, and `mvn clean` also deletes the compiled CSS. We recommend stylesheet authors run
57 57 `compass watch` as part of their workflow so that CSS files are automatically regenerated the instant you save an SCSS file.
58 58
59 59 Read more about how we use Compass by visiting our [css3-foundation project][cssf].
@@ -120,16 +120,16 @@ making Wicket development much easier. Here are some examples:
120 120 * [CountLabel][countl] helps you pluralize labels for numeric data
121 121 * [TruncatedLabel][trunc] intelligently abbreviates long text data with an ellipsis
122 122 * [RadioChoicesListView][choices] is a more flexible way to build radio groups with custom markup
123   -* [Prompt][prompt] lets you build nice forms by automatically wrapping form fields in appropriate
  123 +* [Prompt][prompt] lets you build nice forms by automatically wrapping form fields in appropriate
124 124 CSS classes with inline feedback messages when validation fails
125 125
126 126
127 127 ## Testing tools
128 128
129   -The [fiftyfive-wicket-test][ffwtest] library contains extra tools for writing good unit tests for
  129 +The [fiftyfive-wicket-test][ffwtest] library contains extra tools for writing good unit tests for
130 130 Wicket pages and components. Here are some highlights:
131 131
132   -* [assertValidMarkup][avalid] auto-detects XHTML and HTML5 flavors of markup and asserts the markup
  132 +* [assertValidMarkup][avalid] auto-detects XHTML and HTML5 flavors of markup and asserts the markup
133 133 is valid
134 134 * [startComponentWithHtml][startc] runs a Wicket component in isolation so that you don't have
135 135 to create an entire page class and HTML file just to write unit tests
@@ -152,8 +152,8 @@ Projects generated by the fiftyfive-wicket archetype include:
152 152 * Plaintext user accounts defined in `src/main/resources/shiro.ini`
153 153 * Login/logout link at the top of every page, added in `BasePage.java`
154 154 * An example of how to restrict a page to authenticated admin users in `AdminstrationPage.java`
155   -* `BaseWicketUnitTest.java`, which extends [AbstractShiroJUnit4Tests][shirotests] to allow Shiro
156   - security state (logged in, logged out, current roles, permissions) to be mocked during testing of
  155 +* `BaseWicketUnitTest.java`, which extends [AbstractShiroJUnit4Tests][shirotests] to allow Shiro
  156 + security state (logged in, logged out, current roles, permissions) to be mocked during testing of
157 157 your secured Wicket pages and components
158 158
159 159 Refer to the [fiftyfive-wicket-shiro documentation][ffshiro] for more information.
@@ -167,10 +167,10 @@ library. This library focuses on solving three big problems that Wicket develope
167 167 1. **Components:** Wicket components that use JavaScript need an elegant way to glue the Java and
168 168 JavaScript sides together. How do we accomplish this without mixing JavaScript strings into
169 169 our Java code?
170   -2. **Dependencies:** Components will often require a JavaScript library be present on the page. That
171   - library in turn may require other JavaScript libraries, and so on. How do we keep track of these
  170 +2. **Dependencies:** Components will often require a JavaScript library be present on the page. That
  171 + library in turn may require other JavaScript libraries, and so on. How do we keep track of these
172 172 dependencies and ensure the right files are included on the page in the correct order?
173   -3. **Merging:** Now assuming we've got all the right JavaScript references on the page, how do we
  173 +3. **Merging:** Now assuming we've got all the right JavaScript references on the page, how do we
174 174 deliver them efficiently to the browser as a single merged file?
175 175
176 176 Here are the solutions we offer:
@@ -197,7 +197,7 @@ the project with a simple `mvn jetty:run`. Plus:
197 197 ## Spring Framework
198 198
199 199 The dependency injection pattern is a key part of making Wicket applications easy to test and
200   -maintain. [Spring][spring] is well supported by Wicket and is our framework of choice for this
  200 +maintain. [Spring][spring] is well supported by Wicket and is our framework of choice for this
201 201 purpose. You'll find the following Spring integration in the fiftyfive-wicket archetype:
202 202
203 203 * By extending [FoundationSpringApplication][ffspring], `WicketApplication.java` initializes
@@ -235,7 +235,7 @@ Stable releases follow the [semantic versioning][semver] pattern and are made av
235 235 ## Maven Dependencies
236 236
237 237 If you aren't using the fiftyfive-wicket archetype (as described in the quick start section above),
238   -you can add the core 55 Minutes Wicket library to an existing project using the following maven
  238 +you can add the core 55 Minutes Wicket library to an existing project using the following maven
239 239 dependency:
240 240
241 241 ```xml
@@ -252,7 +252,7 @@ Repeat for the other artifacts of fiftyfive-wicket you wish to use:
252 252 * fiftyfive-wicket-shiro
253 253 * fiftyfive-wicket-test
254 254
255   -Note that since our artifacts aren't in the central maven repository, you'll need to include the
  255 +Note that since our artifacts aren't in the central maven repository, you'll need to include the
256 256 following snippet:
257 257
258 258 ```xml
16 fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/SimpleCDNTest.java
@@ -32,8 +32,8 @@
32 32
33 33 public class SimpleCDNTest
34 34 {
35   - static final String HOST = "//abc.cloudfront.net";
36   -
  35 + static final String HOST = "http://abc.cloudfront.net";
  36 +
37 37 @Test
38 38 public void testCDN() throws Exception
39 39 {
@@ -41,7 +41,7 @@ public void testCDN() throws Exception
41 41 assertRendered(tester);
42 42 assertResourcesDownload(tester);
43 43 }
44   -
  44 +
45 45 @Test
46 46 public void testCDN_trailing_slash() throws Exception
47 47 {
@@ -49,7 +49,7 @@ public void testCDN_trailing_slash() throws Exception
49 49 assertRendered(tester);
50 50 assertResourcesDownload(tester);
51 51 }
52   -
  52 +
53 53 /**
54 54 * Verify that the SimpleCDNTestPage renders and rewrites the resource URLs
55 55 * as expected.
@@ -61,7 +61,7 @@ void assertRendered(WicketTester tester) throws Exception
61 61 WicketTestUtils.assertValidMarkup(tester);
62 62 tester.assertResultPage(SimpleCDNTestPage.class, "SimpleCDNTestPage-expected.html");
63 63 }
64   -
  64 +
65 65 /**
66 66 * Verify that the rewritten resource URLs still work and download the expected binary data
67 67 * once the CDN host is stripped off (as a reverse-proxy CDN would do).
@@ -84,16 +84,16 @@ void assertResourcesDownload(WicketTester tester) throws Exception
84 84 }
85 85 }
86 86 }
87   -
  87 +
88 88 class CDNApp extends WebApplication
89 89 {
90 90 final String host;
91   -
  91 +
92 92 CDNApp(String host)
93 93 {
94 94 this.host = host;
95 95 }
96   -
  96 +
97 97 @Override
98 98 public Class<? extends WebPage> getHomePage()
99 99 {
6 fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/SimpleCDNTestPage-expected.html
@@ -2,10 +2,10 @@
2 2 <html>
3 3 <head>
4 4 <title>untitled</title>
5   -<link rel="stylesheet" type="text/css" href="//abc.cloudfront.net/wicket/resource/fiftyfive.wicket.resource.SimpleCDNTestPage/test.css" />
6   -<script type="text/javascript" src="//abc.cloudfront.net/wicket/resource/fiftyfive.wicket.resource.SimpleCDNTestPage/test.js"></script>
  5 +<link rel="stylesheet" type="text/css" href="http://abc.cloudfront.net/wicket/resource/fiftyfive.wicket.resource.SimpleCDNTestPage/test.css" />
  6 +<script type="text/javascript" src="http://abc.cloudfront.net/wicket/resource/fiftyfive.wicket.resource.SimpleCDNTestPage/test.js"></script>
7 7 </head>
8 8 <body>
9   - <img src="//abc.cloudfront.net/wicket/resource/fiftyfive.wicket.resource.SimpleCDNTestPage/test.gif"/>
  9 + <img src="http://abc.cloudfront.net/wicket/resource/fiftyfive.wicket.resource.SimpleCDNTestPage/test.gif"/>
10 10 </body>
11 11 </html>

0 comments on commit 58e2151

Please sign in to comment.
Something went wrong with that request. Please try again.