]> source.dussan.org Git - archiva.git/blob
38403d28ccaba9994609dd1653a7857a9d4f58a6
[archiva.git] /
1 package org.apache.archiva.webdav;
2
3 /*
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements.  See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership.  The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License.  You may obtain a copy of the License at
11  *
12  *  http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied.  See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  */
21
22 import com.meterware.httpunit.GetMethodWebRequest;
23 import com.meterware.httpunit.WebRequest;
24 import com.meterware.httpunit.WebResponse;
25 import org.apache.commons.io.FileUtils;
26 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
27 import org.junit.Before;
28 import org.junit.Test;
29
30 import java.io.File;
31 import java.nio.charset.Charset;
32 import java.util.ArrayList;
33
34 /**
35  * RepositoryServletTest
36  *
37  *
38  */
39 public class RepositoryServletNoProxyTest
40     extends AbstractRepositoryServletTestCase
41 {
42
43     @Before
44     public void setUp()
45         throws Exception
46     {
47         super.setUp();
48         archivaConfiguration.getConfiguration().setProxyConnectors( new ArrayList<ProxyConnectorConfiguration>() );
49     }
50
51     @Test
52     public void testLastModifiedHeaderExists()
53         throws Exception
54     {
55         String commonsLangSha1 = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1";
56
57         File checksumFile = new File( repoRootInternal, commonsLangSha1 );
58         checksumFile.getParentFile().mkdirs();
59
60         FileUtils.writeStringToFile( checksumFile, "dummy-checksum", Charset.defaultCharset()  );
61
62         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangSha1 );
63         WebResponse response = getServletUnitClient().getResponse( request );
64
65         assertNotNull( response.getHeaderField( "last-modified" ) );
66     }
67
68     @Test
69     public void testGetNoProxyChecksumDefaultLayout()
70         throws Exception
71     {
72         String commonsLangSha1 = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1";
73
74         File checksumFile = new File( repoRootInternal, commonsLangSha1 );
75         checksumFile.getParentFile().mkdirs();
76
77         FileUtils.writeStringToFile( checksumFile, "dummy-checksum", Charset.defaultCharset()  );
78
79         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangSha1 );
80         WebResponse response = getServletUnitClient().getResponse( request );
81         assertResponseOK( response );
82
83         assertEquals( "Expected file contents", "dummy-checksum", response.getText() );
84     }
85
86     @Test
87     public void testGetNoProxyChecksumLegacyLayout()
88         throws Exception
89     {
90         String commonsLangSha1 = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1";
91
92         File checksumFile = new File( repoRootInternal, commonsLangSha1 );
93         checksumFile.getParentFile().mkdirs();
94
95         FileUtils.writeStringToFile( checksumFile, "dummy-checksum", Charset.defaultCharset()  );
96
97         WebRequest request = new GetMethodWebRequest(
98             "http://machine.com/repository/internal/" + "commons-lang/jars/commons-lang-2.1.jar.sha1" );
99         WebResponse response = getServletUnitClient().getResponse( request );
100         assertResponseOK( response );
101
102         assertEquals( "Expected file contents", "dummy-checksum", response.getText() );
103     }
104
105     @Test
106     public void testGetNoProxyVersionedMetadataDefaultLayout()
107         throws Exception
108     {
109         String commonsLangMetadata = "commons-lang/commons-lang/2.1/maven-metadata.xml";
110         String expectedMetadataContents = "dummy-versioned-metadata";
111
112         File metadataFile = new File( repoRootInternal, commonsLangMetadata );
113         metadataFile.getParentFile().mkdirs();
114
115         FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );
116
117         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata );
118         WebResponse response = getServletUnitClient().getResponse( request );
119         assertResponseOK( response );
120
121         assertEquals( "Expected file contents", expectedMetadataContents, response.getText() );
122     }
123
124     @Test
125     public void testGetNoProxyProjectMetadataDefaultLayout()
126         throws Exception
127     {
128         String commonsLangMetadata = "commons-lang/commons-lang/maven-metadata.xml";
129         String expectedMetadataContents = "dummy-project-metadata";
130
131         File metadataFile = new File( repoRootInternal, commonsLangMetadata );
132         metadataFile.getParentFile().mkdirs();
133
134         FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );
135
136         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata );
137         WebResponse response = getServletUnitClient().getResponse( request );
138         assertResponseOK( response );
139
140         assertEquals( "Expected file contents", expectedMetadataContents, response.getText() );
141     }
142
143     @Test
144     public void testGetNoProxyGroupMetadataDefaultLayout()
145         throws Exception
146     {
147         String commonsLangMetadata = "commons-lang/maven-metadata.xml";
148         String expectedMetadataContents = "dummy-group-metadata";
149
150         File metadataFile = new File( repoRootInternal, commonsLangMetadata );
151         metadataFile.getParentFile().mkdirs();
152
153         FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );
154
155         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata );
156         WebResponse response = getServletUnitClient().getResponse( request );
157         assertResponseOK( response );
158
159         assertEquals( "Expected file contents", expectedMetadataContents, response.getText() );
160     }
161
162     @Test
163     public void testGetNoProxyArtifactDefaultLayout()
164         throws Exception
165     {
166         String commonsLangJar = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar";
167         String expectedArtifactContents = "dummy-commons-lang-artifact";
168
169         File artifactFile = new File( repoRootInternal, commonsLangJar );
170         artifactFile.getParentFile().mkdirs();
171
172         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
173
174         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangJar );
175         WebResponse response = getServletUnitClient().getResponse( request );
176         assertResponseOK( response );
177
178         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
179     }
180
181     @Test
182     public void testGetNoProxyArtifactLegacyLayout()
183         throws Exception
184     {
185         String commonsLangJar = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar";
186         String expectedArtifactContents = "dummy-commons-lang-artifact";
187
188         File artifactFile = new File( repoRootInternal, commonsLangJar );
189         artifactFile.getParentFile().mkdirs();
190
191         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
192
193         WebRequest request = new GetMethodWebRequest(
194             "http://machine.com/repository/internal/" + "commons-lang/jars/commons-lang-2.1.jar" );
195         WebResponse response = getServletUnitClient().getResponse( request );
196         assertResponseOK( response );
197
198         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
199     }
200
201     @Test
202     public void testGetNoProxySnapshotArtifactDefaultLayout()
203         throws Exception
204     {
205         String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-SNAPSHOT.jar";
206         String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
207
208         File artifactFile = new File( repoRootInternal, commonsLangJar );
209         artifactFile.getParentFile().mkdirs();
210
211         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
212
213         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangJar );
214         WebResponse response = getServletUnitClient().getResponse( request );
215         assertResponseOK( response );
216
217         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
218     }
219
220     @Test
221     public void testGetNoProxySnapshotArtifactLegacyLayout()
222         throws Exception
223     {
224         String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-SNAPSHOT.jar";
225         String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
226
227         File artifactFile = new File( repoRootInternal, commonsLangJar );
228         artifactFile.getParentFile().mkdirs();
229
230         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
231
232         WebRequest request = new GetMethodWebRequest(
233             "http://machine.com/repository/internal/" + "commons-lang/jars/commons-lang-2.1-SNAPSHOT.jar" );
234         WebResponse response = getServletUnitClient().getResponse( request );
235         assertResponseOK( response );
236
237         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
238     }
239
240     @Test
241     public void testGetNoProxyTimestampedSnapshotArtifactDefaultLayout()
242         throws Exception
243     {
244         String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-20050821.023400-1.jar";
245         String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
246
247         File artifactFile = new File( repoRootInternal, commonsLangJar );
248         artifactFile.getParentFile().mkdirs();
249
250         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
251
252         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangJar );
253         WebResponse response = getServletUnitClient().getResponse( request );
254         assertResponseOK( response );
255
256         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
257     }
258
259     @Test
260     public void testGetNoProxyTimestampedSnapshotArtifactLegacyLayout()
261         throws Exception
262     {
263         String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-20050821.023400-1.jar";
264         String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
265
266         File artifactFile = new File( repoRootInternal, commonsLangJar );
267         artifactFile.getParentFile().mkdirs();
268
269         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
270
271         WebRequest request = new GetMethodWebRequest(
272             "http://machine.com/repository/internal/" + "commons-lang/jars/commons-lang-2.1-20050821.023400-1.jar" );
273         WebResponse response = getServletUnitClient().getResponse( request );
274         assertResponseOK( response );
275
276         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
277     }
278
279     /**
280      * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error
281      */
282     @Test
283     public void testGetNoProxyDualExtensionDefaultLayout()
284         throws Exception
285     {
286         String expectedContents = "the-contents-of-the-dual-extension";
287         String dualExtensionPath = "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip";
288
289         File checksumFile = new File( repoRootInternal, dualExtensionPath );
290         checksumFile.getParentFile().mkdirs();
291
292         FileUtils.writeStringToFile( checksumFile, expectedContents, Charset.defaultCharset()  );
293
294         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + dualExtensionPath );
295         WebResponse response = getServletUnitClient().getResponse( request );
296         assertResponseOK( response );
297
298         assertEquals( "Expected file contents", expectedContents, response.getText() );
299     }
300
301     @Test
302     public void testGetNoProxyDistributionLegacyLayout()
303         throws Exception
304     {
305         String expectedContents = "the-contents-of-the-dual-extension";
306         String dualExtensionPath = "org/project/example-presentation/3.2/example-presentation-3.2.zip";
307
308         File checksumFile = new File( repoRootInternal, dualExtensionPath );
309         checksumFile.getParentFile().mkdirs();
310
311         FileUtils.writeStringToFile( checksumFile, expectedContents, Charset.defaultCharset()  );
312
313         WebRequest request = new GetMethodWebRequest(
314             "http://machine.com/repository/internal/" + "org.project/distributions/example-presentation-3.2.zip" );
315         WebResponse response = getServletUnitClient().getResponse( request );
316         assertResponseOK( response );
317
318         assertEquals( "Expected file contents", expectedContents, response.getText() );
319     }
320
321     @Test
322     public void testGetNoProxyChecksumDefaultLayoutManagedLegacy()
323         throws Exception
324     {
325         String commonsLangSha1 = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1";
326
327         File checksumFile = new File( repoRootLegacy, "commons-lang/jars/commons-lang-2.1.jar.sha1" );
328         checksumFile.getParentFile().mkdirs();
329
330         FileUtils.writeStringToFile( checksumFile, "dummy-checksum", Charset.defaultCharset()  );
331
332         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangSha1 );
333         WebResponse response = getServletUnitClient().getResponse( request );
334         assertResponseOK( response );
335
336         assertEquals( "Expected file contents", "dummy-checksum", response.getText() );
337     }
338
339     @Test
340     public void testGetNoProxyChecksumLegacyLayoutManagedLegacy()
341         throws Exception
342     {
343         String commonsLangSha1 = "commons-lang/jars/commons-lang-2.1.jar.sha1";
344         File checksumFile = new File( repoRootLegacy, commonsLangSha1 );
345         checksumFile.getParentFile().mkdirs();
346
347         FileUtils.writeStringToFile( checksumFile, "dummy-checksum", Charset.defaultCharset()  );
348
349         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangSha1 );
350         WebResponse response = getServletUnitClient().getResponse( request );
351         assertResponseOK( response );
352
353         assertEquals( "Expected file contents", "dummy-checksum", response.getText() );
354     }
355
356     @Test
357     public void testGetNoProxyVersionedMetadataDefaultLayoutManagedLegacy()
358         throws Exception
359     {
360         String commonsLangMetadata = "commons-lang/commons-lang/2.1/maven-metadata.xml";
361         String expectedMetadataContents = "dummy-versioned-metadata";
362
363         // TODO: find out what this should be from maven-artifact
364         File metadataFile = new File( repoRootLegacy, commonsLangMetadata );
365         metadataFile.getParentFile().mkdirs();
366
367         FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );
368
369         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangMetadata );
370         WebResponse response = getServletUnitClient().getResponse( request );
371         assertResponseOK( response );
372
373         assertEquals( "Expected file contents", expectedMetadataContents, response.getText() );
374     }
375
376     @Test
377     public void testGetNoProxyProjectMetadataDefaultLayoutManagedLegacy()
378         throws Exception
379     {
380         // TODO: find out what it is meant to be from maven-artifact
381         String commonsLangMetadata = "commons-lang/commons-lang/maven-metadata.xml";
382         String expectedMetadataContents = "dummy-project-metadata";
383
384         File metadataFile = new File( repoRootLegacy, commonsLangMetadata );
385         metadataFile.getParentFile().mkdirs();
386
387         FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );
388
389         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangMetadata );
390         WebResponse response = getServletUnitClient().getResponse( request );
391         assertResponseOK( response );
392
393         assertEquals( "Expected file contents", expectedMetadataContents, response.getText() );
394     }
395
396     @Test
397     public void testGetNoProxyGroupMetadataDefaultLayoutManagedLegacy()
398         throws Exception
399     {
400         String commonsLangMetadata = "commons-lang/maven-metadata.xml";
401         String expectedMetadataContents = "dummy-group-metadata";
402
403         File metadataFile = new File( repoRootLegacy, commonsLangMetadata );
404         metadataFile.getParentFile().mkdirs();
405
406         FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, Charset.defaultCharset()  );
407
408         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangMetadata );
409         WebResponse response = getServletUnitClient().getResponse( request );
410         assertResponseOK( response );
411
412         assertEquals( "Expected file contents", expectedMetadataContents, response.getText() );
413     }
414
415     @Test
416     public void testGetNoProxyArtifactDefaultLayoutManagedLegacy()
417         throws Exception
418     {
419         String commonsLangJar = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar";
420         String expectedArtifactContents = "dummy-commons-lang-artifact";
421
422         File artifactFile = new File( repoRootLegacy, "commons-lang/jars/commons-lang-2.1.jar" );
423         artifactFile.getParentFile().mkdirs();
424
425         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
426
427         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangJar );
428         WebResponse response = getServletUnitClient().getResponse( request );
429         assertResponseOK( response );
430
431         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
432     }
433
434     @Test
435     public void testGetNoProxyArtifactLegacyLayoutManagedLegacy()
436         throws Exception
437     {
438         String commonsLangJar = "commons-lang/jars/commons-lang-2.1.jar";
439         String expectedArtifactContents = "dummy-commons-lang-artifact";
440
441         File artifactFile = new File( repoRootLegacy, commonsLangJar );
442         artifactFile.getParentFile().mkdirs();
443
444         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
445
446         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangJar );
447         WebResponse response = getServletUnitClient().getResponse( request );
448         assertResponseOK( response );
449
450         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
451     }
452
453     @Test
454     public void testGetNoProxySnapshotArtifactDefaultLayoutManagedLegacy()
455         throws Exception
456     {
457         String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-SNAPSHOT.jar";
458         String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
459
460         File artifactFile = new File( repoRootLegacy, "commons-lang/jars/commons-lang-2.1-SNAPSHOT.jar" );
461         artifactFile.getParentFile().mkdirs();
462
463         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
464
465         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangJar );
466         WebResponse response = getServletUnitClient().getResponse( request );
467         assertResponseOK( response );
468
469         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
470     }
471
472     @Test
473     public void testGetNoProxySnapshotArtifactLegacyLayoutManagedLegacy()
474         throws Exception
475     {
476         String commonsLangJar = "commons-lang/jars/commons-lang-2.1-SNAPSHOT.jar";
477         String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
478
479         File artifactFile = new File( repoRootLegacy, commonsLangJar );
480         artifactFile.getParentFile().mkdirs();
481
482         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
483
484         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangJar );
485         WebResponse response = getServletUnitClient().getResponse( request );
486         assertResponseOK( response );
487
488         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
489     }
490
491     @Test
492     public void testGetNoProxyTimestampedSnapshotArtifactDefaultLayoutManagedLegacy()
493         throws Exception
494     {
495         String filename = "commons-lang-2.1-20050821.023400-1.jar";
496         String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/" + filename;
497         String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
498
499         File artifactFile = new File( repoRootLegacy, "commons-lang/jars/" + filename );
500         artifactFile.getParentFile().mkdirs();
501
502         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
503
504         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangJar );
505         WebResponse response = getServletUnitClient().getResponse( request );
506         assertResponseOK( response );
507
508         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
509     }
510
511     @Test
512     public void testGetNoProxyTimestampedSnapshotArtifactLegacyLayoutManagedLegacy()
513         throws Exception
514     {
515         String commonsLangJar = "commons-lang/jars/commons-lang-2.1-20050821.023400-1.jar";
516         String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact";
517
518         File artifactFile = new File( repoRootLegacy, commonsLangJar );
519         artifactFile.getParentFile().mkdirs();
520
521         FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, Charset.defaultCharset()  );
522
523         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + commonsLangJar );
524         WebResponse response = getServletUnitClient().getResponse( request );
525         assertResponseOK( response );
526
527         assertEquals( "Expected file contents", expectedArtifactContents, response.getText() );
528     }
529
530     /**
531      * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error
532      */
533     @Test
534     public void testGetNoProxyDualExtensionDefaultLayoutManagedLegacy()
535         throws Exception
536     {
537         String expectedContents = "the-contents-of-the-dual-extension";
538         String dualExtensionPath = "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip";
539
540         File checksumFile = new File( repoRootLegacy, "org.project/distributions/example-presentation-3.2.xml.zip" );
541         checksumFile.getParentFile().mkdirs();
542
543         FileUtils.writeStringToFile( checksumFile, expectedContents, Charset.defaultCharset()  );
544
545         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + dualExtensionPath );
546         WebResponse response = getServletUnitClient().getResponse( request );
547         assertResponseOK( response );
548
549         assertEquals( "Expected file contents", expectedContents, response.getText() );
550     }
551
552     @Test
553     public void testGetNoProxyDistributionLegacyLayoutManagedLegacy()
554         throws Exception
555     {
556         String expectedContents = "the-contents-of-the-dual-extension";
557         String dualExtensionPath = "org.project/distributions/example-presentation-3.2.zip";
558
559         File checksumFile = new File( repoRootLegacy, dualExtensionPath );
560         checksumFile.getParentFile().mkdirs();
561
562         FileUtils.writeStringToFile( checksumFile, expectedContents, Charset.defaultCharset()  );
563
564         WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/legacy/" + dualExtensionPath );
565         WebResponse response = getServletUnitClient().getResponse( request );
566         assertResponseOK( response );
567
568         assertEquals( "Expected file contents", expectedContents, response.getText() );
569     }
570
571 }