1717 * under the License.
1818 */
1919/**
20- *
20+ *
2121 */
2222package org .jasig .resource .aggr ;
2323
3838
3939/**
4040 * Test harness for {@link ResourcesAggregatorImpl}.
41- *
41+ *
4242 * @author Nicholas Blair, npblair@wisc.edu
4343 *
4444 */
@@ -61,9 +61,9 @@ public void testControl() throws Exception {
6161
6262 ResourcesAggregatorImpl impl = new ResourcesAggregatorImpl ();
6363 impl .aggregate (skinXml , outputDirectory );
64-
64+
6565 Diff d = new Diff (
66- new FileReader (new ClassPathResource ("skin-test1/skin.aggr.xml" ).getFile ()),
66+ new FileReader (new ClassPathResource ("skin-test1/skin.aggr.xml" ).getFile ()),
6767 new FileReader (new File (outputDirectory , "skin.aggr.xml" )));
6868 assertTrue (d .toString (), d .similar ());
6969 }
@@ -81,17 +81,17 @@ public void testAllAbsolute() throws Exception {
8181
8282 ResourcesAggregatorImpl impl = new ResourcesAggregatorImpl ();
8383 impl .aggregate (skinXml , outputDirectory );
84-
84+
8585 Diff d = new Diff (
86- new FileReader (new ClassPathResource ("skin-testAllAbsolute/skin.aggr.xml" ).getFile ()),
86+ new FileReader (new ClassPathResource ("skin-testAllAbsolute/skin.aggr.xml" ).getFile ()),
8787 new FileReader (new File (outputDirectory , "skin.aggr.xml" )));
8888 assertTrue (d .toString (), d .similar ());
8989 }
9090
9191 @ Test
9292 public void testComplex () throws Exception {
9393 String tempPath = getTestOutputRoot () + "/skin-complex/superskin" ;
94-
94+
9595 File outputDirectory = new File (tempPath );
9696 outputDirectory .mkdirs ();
9797 Assert .assertTrue (outputDirectory .exists ());
@@ -101,65 +101,21 @@ public void testComplex() throws Exception {
101101
102102 ResourcesAggregatorImpl impl = new ResourcesAggregatorImpl ();
103103 impl .aggregate (skinXml , outputDirectory );
104-
105- Diff d = new Diff (
106- new FileReader (new ClassPathResource ("skin-complex/superskin/skin.aggr.xml" ).getFile ()),
107- new FileReader (new File (outputDirectory , "skin.aggr.xml" )));
108- assertTrue (d .toString (), d .similar ());
109- }
110-
111- @ Test
112- public void testUniversalityCommonJavaScript () throws Exception {
113- final String testOutputRoot = getTestOutputRoot ();
114- String tempPath = testOutputRoot + "/skin-universality-commonjs/uportal3" ;
115-
116- File outputDirectory = new File (tempPath );
117- outputDirectory .mkdirs ();
118- Assert .assertTrue (outputDirectory .exists ());
119-
120- String jsPath = testOutputRoot + "/skin-universality-commonjs/common/javascript" ;
121- File jsOutputDirectory = new File (jsPath );
122-
123- File skinXml = new ClassPathResource ("skin-universality-commonjs/uportal3/skin.xml" ).getFile ();
124- Assert .assertTrue (skinXml .exists ());
125104
126- ResourcesAggregatorImpl impl = new ResourcesAggregatorImpl ();
127- impl .aggregate (skinXml , outputDirectory , jsOutputDirectory );
128-
129105 Diff d = new Diff (
130- new FileReader (new ClassPathResource ("skin-universality-commonjs/uportal3/skin.aggr.xml" ).getFile ()),
131- new FileReader (new File (outputDirectory , "skin.aggr.xml" )));
132- assertTrue (d .toString (), d .similar ());
133- }
134-
135- @ Test
136- public void testUniversality () throws Exception {
137- String tempPath = getTestOutputRoot () + "/skin-universality/uportal3" ;
138-
139- File outputDirectory = new File (tempPath );
140- outputDirectory .mkdirs ();
141- Assert .assertTrue (outputDirectory .exists ());
142-
143- File skinXml = new ClassPathResource ("skin-universality/uportal3/skin.xml" ).getFile ();
144- Assert .assertTrue (skinXml .exists ());
145-
146- ResourcesAggregatorImpl impl = new ResourcesAggregatorImpl ();
147- impl .aggregate (skinXml , outputDirectory );
148-
149- Diff d = new Diff (
150- new FileReader (new ClassPathResource ("skin-universality/uportal3/skin.aggr.xml" ).getFile ()),
106+ new FileReader (new ClassPathResource ("skin-complex/superskin/skin.aggr.xml" ).getFile ()),
151107 new FileReader (new File (outputDirectory , "skin.aggr.xml" )));
152108 assertTrue (d .toString (), d .similar ());
153109 }
154110
155111 @ Test
156112 public void testIncludeOverlay () throws Exception {
157113 String tempPath = getTestOutputRoot () + "/skin-test-incl-overlay" ;
158-
114+
159115 File outputDirectory = new File (tempPath );
160116 outputDirectory .mkdirs ();
161117 Assert .assertTrue (outputDirectory .exists ());
162-
118+
163119 FileUtils .copyFileToDirectory (new ClassPathResource ("skin-test-incl-overlay/overlay/overlay.css" ).getFile (), outputDirectory );
164120 FileUtils .copyFileToDirectory (new ClassPathResource ("skin-test-incl-overlay/overlay/overlay.js" ).getFile (), outputDirectory );
165121
@@ -171,21 +127,21 @@ public void testIncludeOverlay() throws Exception {
171127 .setResourcesXml (skinXml )
172128 .setOutputBaseDirectory (outputDirectory )
173129 .addAdditionalSourceDirectory (outputDirectory ));
174-
130+
175131 Diff d = new Diff (
176- new FileReader (new ClassPathResource ("skin-test-incl-overlay/skin.aggr.xml" ).getFile ()),
132+ new FileReader (new ClassPathResource ("skin-test-incl-overlay/skin.aggr.xml" ).getFile ()),
177133 new FileReader (new File (outputDirectory , "skin.aggr.xml" )));
178134 assertTrue (d .toString (), d .similar ());
179135 }
180136
181137 @ Test (expected =IOException .class )
182138 public void testMissingIncludeOverlay () throws Exception {
183139 String tempPath = getTestOutputRoot () + "/skin-test-incl-overlay" ;
184-
140+
185141 File outputDirectory = new File (tempPath );
186142 outputDirectory .mkdirs ();
187143 Assert .assertTrue (outputDirectory .exists ());
188-
144+
189145 File skinXml = new ClassPathResource ("skin-test-incl-overlay/skin.xml" ).getFile ();
190146 Assert .assertTrue (skinXml .exists ());
191147
@@ -196,26 +152,6 @@ public void testMissingIncludeOverlay() throws Exception {
196152 .addAdditionalSourceDirectory (outputDirectory ));
197153 }
198154
199- @ Test
200- public void testUniversalityImports () throws Exception {
201- String tempPath = getTestOutputRoot () + "/skin-universality-imports/uportal3" ;
202-
203- File outputDirectory = new File (tempPath );
204- outputDirectory .mkdirs ();
205- Assert .assertTrue (outputDirectory .exists ());
206-
207- File skinXml = new ClassPathResource ("skin-universality-imports/uportal3/skin.xml" ).getFile ();
208- Assert .assertTrue (skinXml .exists ());
209-
210- ResourcesAggregatorImpl impl = new ResourcesAggregatorImpl ();
211- impl .aggregate (skinXml , outputDirectory );
212-
213- Diff d = new Diff (
214- new FileReader (new ClassPathResource ("skin-universality-imports/uportal3/skin.aggr.xml" ).getFile ()),
215- new FileReader (new File (outputDirectory , "skin.aggr.xml" )));
216- assertTrue (d .toString (), d .similar ());
217- }
218-
219155 /**
220156 * Delete our temp directory after test execution.
221157 * @throws Exception
@@ -228,7 +164,7 @@ public void cleanupTempDir() throws Exception {
228164 FileUtils .cleanDirectory (testOutputDirectory );
229165 FileUtils .deleteDirectory (testOutputDirectory );
230166 }
231-
167+
232168 private final ThreadLocal <String > tempDirLocal = new ThreadLocal <String >();
233169
234170 /**
@@ -239,14 +175,14 @@ private String getTestOutputRoot() throws IOException {
239175 if (testOutputDirectoryName != null ) {
240176 return testOutputDirectoryName ;
241177 }
242-
178+
243179 final File tmpDir = File .createTempFile ("resources-aggregator-impl-" , "-test-output" );
244180 tmpDir .delete ();
245181 tmpDir .mkdirs ();
246182 tmpDir .deleteOnExit ();
247183 testOutputDirectoryName = tmpDir .getCanonicalPath ();
248184 tempDirLocal .set (testOutputDirectoryName );
249-
185+
250186 return testOutputDirectoryName ;
251187 }
252188}
0 commit comments