1   package org.apache.maven.plugin.war;
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 org.apache.maven.artifact.handler.ArtifactHandler;
23  import org.apache.maven.plugin.testing.stubs.ArtifactStub;
24  import org.apache.maven.plugin.war.stub.AarArtifactStub;
25  import org.apache.maven.plugin.war.stub.EJBArtifactStub;
26  import org.apache.maven.plugin.war.stub.EJBArtifactStubWithClassifier;
27  import org.apache.maven.plugin.war.stub.EJBClientArtifactStub;
28  import org.apache.maven.plugin.war.stub.IncludeExcludeWarArtifactStub;
29  import org.apache.maven.plugin.war.stub.JarArtifactStub;
30  import org.apache.maven.plugin.war.stub.MarArtifactStub;
31  import org.apache.maven.plugin.war.stub.MavenProjectArtifactsStub;
32  import org.apache.maven.plugin.war.stub.MavenProjectBasicStub;
33  import org.apache.maven.plugin.war.stub.PARArtifactStub;
34  import org.apache.maven.plugin.war.stub.ResourceStub;
35  import org.apache.maven.plugin.war.stub.TLDArtifactStub;
36  import org.apache.maven.plugin.war.stub.WarArtifactStub;
37  import org.codehaus.plexus.util.FileUtils;
38  
39  import java.io.BufferedReader;
40  import java.io.File;
41  import java.io.StringReader;
42  import java.text.SimpleDateFormat;
43  import java.util.LinkedList;
44  import java.util.List;
45  import java.util.Locale;
46  
47  public class WarExplodedMojoTest
48      extends AbstractWarExplodedMojoTest
49  {
50  
51      protected File getPomFile()
52      {
53          return new File( getBasedir(), "/target/test-classes/unit/warexplodedmojo/plugin-config.xml" );
54      }
55  
56      protected File getTestDirectory()
57      {
58          return new File( getBasedir(), "target/test-classes/unit/warexplodedmojo/test-dir" );
59      }
60  
61      /**
62       * @throws Exception
63       */
64      public void testSimpleExplodedWar()
65          throws Exception
66      {
67          // setup test data
68          String testId = "SimpleExplodedWar";
69          MavenProjectBasicStub project = new MavenProjectBasicStub();
70          File webAppSource = createWebAppSource( testId );
71          File classesDir = createClassesDir( testId, false );
72          File webAppResource = new File( getTestDirectory(), testId + "-resources" );
73          File webAppDirectory = new File( getTestDirectory(), testId );
74          File sampleResource = new File( webAppResource, "pix/panis_na.jpg" );
75          ResourceStub[] resources = new ResourceStub[]{new ResourceStub()};
76  
77          createFile( sampleResource );
78  
79          assertTrue( "sampeResource not found", sampleResource.exists() );
80  
81          // configure mojo
82          resources[0].setDirectory( webAppResource.getAbsolutePath() );
83          this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
84          setVariableValueToObject( mojo, "webResources", resources );
85          mojo.execute();
86  
87          // validate operation
88          File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
89          File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
90          File expectedWebResourceFile = new File( webAppDirectory, "pix/panis_na.jpg" );
91          File expectedWEBINFDir = new File( webAppDirectory, "WEB-INF" );
92          File expectedMETAINFDir = new File( webAppDirectory, "META-INF" );
93  
94          assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
95          assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
96          assertTrue( "resources doesn't exist: " + expectedWebResourceFile, expectedWebResourceFile.exists() );
97          assertTrue( "WEB-INF not found", expectedWEBINFDir.exists() );
98          assertTrue( "META-INF not found", expectedMETAINFDir.exists() );
99  
100         // house keeping
101         expectedWebSourceFile.delete();
102         expectedWebSource2File.delete();
103         expectedWebResourceFile.delete();
104     }
105 
106     /**
107      * @throws Exception
108      */
109     public void testSimpleExplodedWarWTargetPath()
110         throws Exception
111     {
112         // setup test data
113         String testId = "SimpleExplodedWar";
114         MavenProjectBasicStub project = new MavenProjectBasicStub();
115         File webAppSource = createWebAppSource( testId );
116         File classesDir = createClassesDir( testId, false );
117         File webAppResource = new File( getTestDirectory(), "resources" );
118         File webAppDirectory = new File( getTestDirectory(), testId );
119         File sampleResource = new File( webAppResource, "pix/panis_na.jpg" );
120         ResourceStub[] resources = new ResourceStub[]{new ResourceStub()};
121 
122         createFile( sampleResource );
123 
124         // configure mojo
125         resources[0].setDirectory( webAppResource.getAbsolutePath() );
126         resources[0].setTargetPath( "targetPath" );
127         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
128         setVariableValueToObject( mojo, "webResources", resources );
129         mojo.execute();
130 
131         // validate operation
132         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
133         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
134         File expectedWebResourceFile = new File( webAppDirectory, "targetPath/pix/panis_na.jpg" );
135         File expectedWEBINFDir = new File( webAppDirectory, "WEB-INF" );
136         File expectedMETAINFDir = new File( webAppDirectory, "META-INF" );
137 
138         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
139         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
140         assertTrue( "resources doesn't exist: " + expectedWebResourceFile, expectedWebResourceFile.exists() );
141         assertTrue( "WEB-INF not found", expectedWEBINFDir.exists() );
142         assertTrue( "META-INF not found", expectedMETAINFDir.exists() );
143 
144         // house keeping
145         expectedWebSourceFile.delete();
146         expectedWebSource2File.delete();
147         expectedWebResourceFile.delete();
148     }
149 
150     /**
151      * @throws Exception
152      */
153     public void testExplodedWar_WithCustomWebXML()
154         throws Exception
155     {
156         // setup test data
157         String testId = "ExplodedWar_WithCustomWebXML";
158         MavenProjectBasicStub project = new MavenProjectBasicStub();
159         File webAppSource = createWebAppSource( testId );
160         File classesDir = createClassesDir( testId, true );
161         File xmlSource = createXMLConfigDir( testId, new String[]{"web.xml"} );
162         File webAppDirectory = new File( getTestDirectory(), testId );
163 
164         // configure mojo
165         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
166         mojo.setWebXml( new File( xmlSource, "web.xml" ) );
167         mojo.execute();
168 
169         // validate operation
170         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
171         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
172         File expectedWEBXMLFile = new File( webAppDirectory, "WEB-INF/web.xml" );
173         File expectedMETAINFDir = new File( webAppDirectory, "META-INF" );
174 
175         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
176         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
177         assertTrue( "WEB XML not found: " + expectedWEBXMLFile.toString(), expectedWEBXMLFile.exists() );
178         assertTrue( "META-INF not found", expectedMETAINFDir.exists() );
179         assertEquals( "WEB XML not correct", mojo.getWebXml().toString(), FileUtils.fileRead( expectedWEBXMLFile ) );
180 
181         // house keeping
182         expectedWebSourceFile.delete();
183         expectedWebSource2File.delete();
184         expectedWEBXMLFile.delete();
185         expectedMETAINFDir.delete();
186     }
187 
188     /**
189      * @throws Exception
190      */
191     public void testExplodedWar_WithContainerConfigXML()
192         throws Exception
193     {
194         // setup test data
195         String testId = "ExplodedWar_WithContainerConfigXML";
196         MavenProjectBasicStub project = new MavenProjectBasicStub();
197         File classesDir = createClassesDir( testId, true );
198         File webAppSource = createWebAppSource( testId );
199         File xmlSource = createXMLConfigDir( testId, new String[]{"config.xml"} );
200         File webAppDirectory = new File( getTestDirectory(), testId );
201 
202         // configure mojo
203         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
204         mojo.setContainerConfigXML( new File( xmlSource, "config.xml" ) );
205         mojo.execute();
206 
207         // validate operation
208         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
209         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
210         File expectedContainerConfigXMLFile = new File( webAppDirectory, "META-INF/config.xml" );
211         File expectedWEBINFDir = new File( webAppDirectory, "WEB-INF" );
212 
213         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
214         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
215         assertTrue( "WEB-INF not found", expectedWEBINFDir.exists() );
216         assertTrue( "Container Config XML not found:" + expectedContainerConfigXMLFile.toString(),
217                     expectedContainerConfigXMLFile.exists() );
218 
219         // house keeping
220         expectedWebSourceFile.delete();
221         expectedWebSource2File.delete();
222         expectedContainerConfigXMLFile.delete();
223         expectedWEBINFDir.delete();
224     }
225 
226     /**
227      * @throws Exception
228      */
229     public void testExplodedWar_WithSimpleExternalWARFile()
230         throws Exception
231     {
232         // setup test data
233         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
234         WarArtifactStub warArtifact = new WarArtifactStub( getBasedir() );
235 
236         String testId = "ExplodedWar_WithSimpleExternalWARFile";
237         File webAppDirectory = new File( getTestDirectory(), testId );
238         File webAppSource = createWebAppSource( testId );
239         File classesDir = createClassesDir( testId, true );
240         File workDirectory = new File( getTestDirectory(), "/war/work-" + testId );
241         File simpleWarFile = warArtifact.getFile();
242 
243         assertTrue( "simple war not found: " + simpleWarFile.toString(), simpleWarFile.exists() );
244 
245         createDir( workDirectory );
246 
247         // configure mojo
248         project.addArtifact( warArtifact );
249         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
250         setVariableValueToObject( mojo, "workDirectory", workDirectory );
251         mojo.execute();
252 
253         // validate operation - META-INF is automatically excluded so remove the file from the list
254         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
255         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
256         File expectedWEBXMLFile = new File( webAppDirectory, "WEB-INF/web.xml" );
257         File expectedWARFile = new File( webAppDirectory, "/org/sample/company/test.jsp" );
258 
259         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
260         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
261         // check simple.war in the unit test dir under resources to verify the list of files
262         assertTrue( "web xml not found: " + expectedWEBXMLFile.toString(), expectedWEBXMLFile.exists() );
263         assertTrue( "war file not found: " + expectedWARFile.toString(), expectedWARFile.exists() );
264 
265         // house keeping
266         expectedWebSourceFile.delete();
267         expectedWebSource2File.delete();
268         expectedWEBXMLFile.delete();
269         expectedWARFile.delete();
270     }
271 
272     /**
273      * Merge a dependent WAR when a file in the war source directory overrides one found in the WAR.
274      */
275     public void testExplodedWarMergeWarLocalFileOverride()
276         throws Exception
277     {
278         // setup test data
279         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
280         WarArtifactStub warArtifact = new WarArtifactStub( getBasedir() );
281 
282         String testId = "testExplodedWarMergeWarLocalFileOverride";
283         File webAppDirectory = new File( getTestDirectory(), testId );
284         File webAppSource = getWebAppSource( testId );
285         File simpleJSP = new File( webAppSource, "org/sample/company/test.jsp" );
286         createFile( simpleJSP );
287 
288         File workDirectory = new File( getTestDirectory(), "/war/work-" + testId );
289         createDir( workDirectory );
290 
291         File classesDir = createClassesDir( testId, true );
292 
293         // configure mojo
294         project.addArtifact( warArtifact );
295         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
296         setVariableValueToObject( mojo, "workDirectory", workDirectory );
297         mojo.execute();
298 
299         // validate operation
300         File expectedFile = new File( webAppDirectory, "/org/sample/company/test.jsp" );
301 
302         assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() );
303         assertEquals( "file incorrect", simpleJSP.toString(), FileUtils.fileRead( expectedFile ) );
304 
305         // check when the merged war file is newer - so set an old time on the local file
306         long time = new SimpleDateFormat( "yyyy-MM-dd", Locale.US ).parse( "2005-1-1" ).getTime();
307         simpleJSP.setLastModified( time );
308         expectedFile.setLastModified( time );
309 
310         project.addArtifact( warArtifact );
311         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
312         setVariableValueToObject( mojo, "workDirectory", workDirectory );
313         mojo.execute();
314 
315         assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() );
316         assertEquals( "file incorrect", simpleJSP.toString(), FileUtils.fileRead( expectedFile ) );
317 
318         // house keeping
319         expectedFile.delete();
320     }
321 
322 //    The last modified thingy behavior is not applicable anymore. This is the only test that
323 //    has been removed.
324 //    /**
325 //     * Merge a dependent WAR that gets updated since the last run.
326 //     */
327 //    public void testExplodedWarMergeWarUpdated()
328 //        throws Exception
329 //    {
330 //        // setup test data
331 //        MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
332 //        WarArtifactStub warArtifact = new WarArtifactStub( getBasedir() );
333 //
334 //        String testId = "testExplodedWarMergeWarUpdated";
335 //        File webAppDirectory = new File( getTestDirectory(), testId );
336 //        FileUtils.deleteDirectory( webAppDirectory );
337 //
338 //        File webAppSource = getWebAppSource( testId );
339 //
340 //        File workDirectory = new File( getTestDirectory(), "/war/work-" + testId );
341 //        createDir( workDirectory );
342 //
343 //        File classesDir = createClassesDir( testId, true );
344 //
345 //        // configure mojo
346 //        project.addArtifact( warArtifact );
347 //        this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
348 //        setVariableValueToObject( mojo, "workDirectory", workDirectory );
349 //        mojo.execute();
350 //
351 //        // validate operation
352 //        File expectedFile = new File( webAppDirectory, "/org/sample/company/test.jsp" );
353 //
354 //        assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() );
355 //        assertEquals( "file incorrect", "", FileUtils.fileRead( expectedFile ) );
356 //
357 //        // update file, so the local one is older
358 //        warArtifact.setFile( new File( warArtifact.getFile().getParentFile(), "simple-updated.war" ) );
359 //
360 //        mojo.execute();
361 //
362 //        assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() );
363 //        assertEquals( "file incorrect", "updated\n", FileUtils.fileRead( expectedFile ) );
364 //
365 //        // update file, so the local one is newer
366 //        warArtifact.setFile( new File( warArtifact.getFile().getParentFile(), "simple.war" ) );
367 //
368 //        mojo.execute();
369 //
370 //        assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() );
371 //        assertEquals( "file incorrect", "updated\n", FileUtils.fileRead( expectedFile ) );
372 //
373 //        // house keeping
374 //        expectedFile.delete();
375 //    }
376 
377     /**
378      * @throws Exception
379      */
380     public void testExplodedWar_WithEJB()
381         throws Exception
382     {
383         // setup test data
384         String testId = "ExplodedWar_WithEJB";
385         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
386         File webAppDirectory = new File( getTestDirectory(), testId );
387         File webAppSource = createWebAppSource( testId );
388         File classesDir = createClassesDir( testId, true );
389         EJBArtifactStub ejbArtifact = new EJBArtifactStub( getBasedir() );
390         File ejbFile = ejbArtifact.getFile();
391 
392         assertTrue( "ejb jar not found: " + ejbFile.toString(), ejbFile.exists() );
393 
394         // configure mojo
395         project.addArtifact( ejbArtifact );
396         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
397         mojo.execute();
398 
399         // validate operation
400         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
401         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
402         // final name form is <artifactId>-<version>.<type>
403         File expectedEJBArtifact = new File( webAppDirectory, "WEB-INF/lib/ejbartifact-0.0-Test.jar" );
404         // File expectedEJBArtifact = new File( webAppDirectory, "WEB-INF/lib/ejbartifact-0.0-Test.jar" );
405 
406         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
407         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
408         assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() );
409 
410         // house keeping
411         expectedWebSourceFile.delete();
412         expectedWebSource2File.delete();
413         expectedEJBArtifact.delete();
414     }
415 
416     public void testExplodedWarWithJar()
417         throws Exception
418     {
419         // setup test data
420         String testId = "ExplodedWarWithJar";
421         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
422         File webAppDirectory = new File( getTestDirectory(), testId );
423         File webAppSource = createWebAppSource( testId );
424         File classesDir = createClassesDir( testId, true );
425         ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE, "jar" );
426         ArtifactStub jarArtifact = new JarArtifactStub( getBasedir(), artifactHandler );
427         File jarFile = jarArtifact.getFile();
428 
429         assertTrue( "jar not found: " + jarFile.toString(), jarFile.exists() );
430 
431         // configure mojo
432         project.addArtifact( jarArtifact );
433         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
434         mojo.execute();
435 
436         // validate operation
437         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
438         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
439         // final name form is <artifactId>-<version>.<type>
440         File expectedJarArtifact = new File( webAppDirectory, "WEB-INF/lib/jarartifact-0.0-Test.jar" );
441 
442         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
443         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
444         assertTrue( "jar artifact not found: " + expectedJarArtifact.toString(), expectedJarArtifact.exists() );
445 
446         // house keeping
447         expectedWebSourceFile.delete();
448         expectedWebSource2File.delete();
449         expectedJarArtifact.delete();
450     }
451 
452     /**
453      * @throws Exception
454      */
455     public void testExplodedWar_WithEJBClient()
456         throws Exception
457     {
458         // setup test data
459         String testId = "ExplodedWar_WithEJB";
460         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
461         File webAppDirectory = new File( getTestDirectory(), testId );
462         File webAppSource = createWebAppSource( testId );
463         File classesDir = createClassesDir( testId, true );
464         EJBClientArtifactStub ejbArtifact = new EJBClientArtifactStub( getBasedir() );
465         File ejbFile = ejbArtifact.getFile();
466 
467         assertTrue( "ejb jar not found: " + ejbFile.toString(), ejbFile.exists() );
468 
469         // configure mojo
470         project.addArtifact( ejbArtifact );
471         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
472         mojo.execute();
473 
474         // validate operation
475         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
476         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
477         // final name form is <artifactId>-<version>.<type>
478         File expectedEJBArtifact = new File( webAppDirectory, "WEB-INF/lib/ejbclientartifact-0.0-Test-client.jar" );
479 
480         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
481         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
482         assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() );
483 
484         // house keeping
485         expectedWebSourceFile.delete();
486         expectedWebSource2File.delete();
487         expectedEJBArtifact.delete();
488     }
489 
490     /**
491      * @throws Exception
492      */
493     public void testExplodedWar_WithTLD()
494         throws Exception
495     {
496         // setup test data
497         String testId = "ExplodedWar_WithTLD";
498         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
499         File webAppDirectory = new File( getTestDirectory(), testId );
500         File webAppSource = createWebAppSource( testId );
501         File classesDir = createClassesDir( testId, true );
502         TLDArtifactStub tldArtifact = new TLDArtifactStub( getBasedir() );
503         File tldFile = tldArtifact.getFile();
504 
505         assertTrue( "tld jar not found: " + tldFile.getAbsolutePath(), tldFile.exists() );
506 
507         // configure mojo
508         project.addArtifact( tldArtifact );
509         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
510         mojo.execute();
511 
512         // validate operation
513         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
514         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
515         // final name form is <artifactId>-<version>.<type>
516         File expectedTLDArtifact = new File( webAppDirectory, "WEB-INF/tld/tldartifact-0.0-Test.tld" );
517 
518         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
519         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
520         assertTrue( "tld artifact not found: " + expectedTLDArtifact.toString(), expectedTLDArtifact.exists() );
521 
522         // house keeping
523         expectedWebSourceFile.delete();
524         expectedWebSource2File.delete();
525         expectedTLDArtifact.delete();
526     }
527 
528     /**
529      * @throws Exception
530      */
531     public void testExplodedWar_WithPAR()
532         throws Exception
533     {
534         // setup test data
535         String testId = "ExplodedWar_WithPAR";
536         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
537         File webAppDirectory = new File( getTestDirectory(), testId );
538         File webAppSource = createWebAppSource( testId );
539         File classesDir = createClassesDir( testId, true );
540         PARArtifactStub parartifact = new PARArtifactStub( getBasedir() );
541         File parFile = parartifact.getFile();
542 
543         assertTrue( "par not found: " + parFile.getAbsolutePath(), parFile.exists() );
544 
545         // configure mojo
546         project.addArtifact( parartifact );
547         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
548         mojo.execute();
549 
550         // validate operation
551         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
552         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
553         // final name form is <artifactId>-<version>.<type>
554         File expectedPARArtifact = new File( webAppDirectory, "WEB-INF/lib/parartifact-0.0-Test.jar" );
555 
556         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
557         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
558         assertTrue( "par artifact not found: " + expectedPARArtifact.toString(), expectedPARArtifact.exists() );
559 
560         // house keeping
561         expectedWebSourceFile.delete();
562         expectedWebSource2File.delete();
563         expectedPARArtifact.delete();
564     }
565 
566     public void testExplodedWarWithAar()
567         throws Exception
568     {
569         // setup test data
570         String testId = "ExplodedWarWithAar";
571         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
572         File webAppDirectory = new File( getTestDirectory(), testId );
573         File webAppSource = createWebAppSource( testId );
574         File classesDir = createClassesDir( testId, true );
575         // Fake here since the aar artifact handler does not exist: no biggie
576         ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE, "jar" );
577         ArtifactStub aarArtifact = new AarArtifactStub( getBasedir(), artifactHandler );
578         File aarFile = aarArtifact.getFile();
579 
580         assertTrue( "jar not found: " + aarFile.toString(), aarFile.exists() );
581 
582         // configure mojo
583         project.addArtifact( aarArtifact );
584         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
585         mojo.execute();
586 
587         // validate operation
588         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
589         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
590         // final name form is <artifactId>-<version>.<type>
591         File expectedJarArtifact = new File( webAppDirectory, "WEB-INF/services/aarartifact-0.0-Test.jar" );
592 
593         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
594         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
595         assertTrue( "jar artifact not found: " + expectedJarArtifact.toString(), expectedJarArtifact.exists() );
596 
597         // house keeping
598         expectedWebSourceFile.delete();
599         expectedWebSource2File.delete();
600         expectedJarArtifact.delete();
601     }
602 
603     public void testExplodedWarWithMar()
604         throws Exception
605     {
606         // setup test data
607         String testId = "ExplodedWarWithMar";
608         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
609         File webAppDirectory = new File( getTestDirectory(), testId );
610         File webAppSource = createWebAppSource( testId );
611         File classesDir = createClassesDir( testId, true );
612         // Fake here since the mar artifact handler does not exist: no biggie
613         ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE, "jar" );
614         ArtifactStub marArtifact = new MarArtifactStub( getBasedir(), artifactHandler );
615         File marFile = marArtifact.getFile();
616 
617         assertTrue( "jar not found: " + marFile.toString(), marFile.exists() );
618 
619         // configure mojo
620         project.addArtifact( marArtifact );
621         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
622         mojo.execute();
623 
624         // validate operation
625         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
626         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
627         // final name form is <artifactId>-<version>.<type>
628         File expectedJarArtifact = new File( webAppDirectory, "WEB-INF/modules/marartifact-0.0-Test.jar" );
629 
630         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
631         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
632         assertTrue( "jar artifact not found: " + expectedJarArtifact.toString(), expectedJarArtifact.exists() );
633 
634         // house keeping
635         expectedWebSourceFile.delete();
636         expectedWebSource2File.delete();
637         expectedJarArtifact.delete();
638     }
639 
640     /**
641      * @throws Exception
642      */
643     public void testExplodedWar_WithDuplicateDependencies()
644         throws Exception
645     {
646         // setup test data
647         String testId = "ExplodedWar_WithDuplicateDependencies";
648         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
649         File webAppDirectory = new File( getTestDirectory(), testId );
650         File webAppSource = createWebAppSource( testId );
651         File classesDir = createClassesDir( testId, true );
652         EJBArtifactStub ejbArtifact = new EJBArtifactStub( getBasedir() );
653         EJBArtifactStub ejbArtifactDup = new EJBArtifactStub( getBasedir() );
654         File ejbFile = ejbArtifact.getFile();
655 
656         // ejbArtifact has a hard coded file, only one assert is needed
657         assertTrue( "ejb not found: " + ejbFile.getAbsolutePath(), ejbFile.exists() );
658 
659         // configure mojo
660         ejbArtifact.setGroupId( "org.sample.ejb" );
661         ejbArtifactDup.setGroupId( "org.dup.ejb" );
662         project.addArtifact( ejbArtifact );
663         project.addArtifact( ejbArtifactDup );
664         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
665         mojo.execute();
666 
667         // validate operation
668         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
669         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
670         // final name form is <artifactId>-<version>.<type>
671         File expectedEJBArtifact = new File( webAppDirectory, "WEB-INF/lib/org.sample.ejb-ejbartifact-0.0-Test.jar" );
672         File expectedEJBDupArtifact = new File( webAppDirectory, "WEB-INF/lib/org.dup.ejb-ejbartifact-0.0-Test.jar" );
673 
674         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
675         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
676         assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() );
677         assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(),
678                     expectedEJBDupArtifact.exists() );
679 
680         // house keeping
681         expectedWebSourceFile.delete();
682         expectedWebSource2File.delete();
683         expectedEJBArtifact.delete();
684         expectedEJBDupArtifact.delete();
685     }
686 
687     /**
688      * @throws Exception
689      */
690     public void testExplodedWar_DuplicateWithClassifier()
691         throws Exception
692     {
693         // setup test data
694         String testId = "ExplodedWar_DuplicateWithClassifier";
695         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
696         File webAppDirectory = new File( getTestDirectory(), testId );
697         File webAppSource = createWebAppSource( testId );
698         File classesDir = createClassesDir( testId, true );
699         EJBArtifactStub ejbArtifact = new EJBArtifactStub( getBasedir() );
700         EJBArtifactStubWithClassifier ejbArtifactDup = new EJBArtifactStubWithClassifier( getBasedir() );
701 
702         File ejbFile = ejbArtifact.getFile();
703 
704         // ejbArtifact has a hard coded file, only one assert is needed
705         assertTrue( "ejb not found: " + ejbFile.getAbsolutePath(), ejbFile.exists() );
706 
707         // configure mojo
708 
709         ejbArtifact.setGroupId( "org.sample.ejb" );
710         ejbArtifactDup.setGroupId( "org.sample.ejb" );
711 
712         ejbArtifactDup.setClassifier( "classifier" );
713 
714         project.addArtifact( ejbArtifact );
715         project.addArtifact( ejbArtifactDup );
716 
717         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
718         mojo.execute();
719 
720         // validate operation
721         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
722         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
723         // final name form is <artifactId>-<version>.<type>
724         File expectedEJBArtifact = new File( webAppDirectory, "WEB-INF/lib/ejbartifact-0.0-Test.jar" );
725         File expectedEJBDupArtifact = new File( webAppDirectory, "WEB-INF/lib/ejbartifact-0.0-Test-classifier.jar" );
726 
727         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
728         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
729         assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() );
730         assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(),
731                     expectedEJBDupArtifact.exists() );
732 
733         // house keeping
734         expectedWebSourceFile.delete();
735         expectedWebSource2File.delete();
736         expectedEJBArtifact.delete();
737         expectedEJBDupArtifact.delete();
738     }
739 
740     /**
741      * @throws Exception
742      */
743     public void testExplodedWar_WithClasses()
744         throws Exception
745     {
746         // setup test data
747         String testId = "ExplodedWar_WithClasses";
748         MavenProjectBasicStub project = new MavenProjectBasicStub();
749         File webAppDirectory = new File( getTestDirectory(), testId );
750         File webAppSource = createWebAppSource( testId );
751         File classesDir = createClassesDir( testId, false );
752 
753         // configure mojo
754         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
755         mojo.execute();
756 
757         // validate operation
758         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
759         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
760         // final name form is <artifactId>-<version>.<type>
761         File expectedClass = new File( webAppDirectory, "WEB-INF/classes/sample-servlet.class" );
762 
763         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
764         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
765         assertTrue( "classes not found: " + expectedClass.toString(), expectedClass.exists() );
766 
767         // house keeping
768         expectedWebSourceFile.delete();
769         expectedWebSource2File.delete();
770         expectedClass.delete();
771     }
772 
773     public void testExplodedWar_WithSourceIncludeExclude()
774         throws Exception
775     {
776         // setup test data
777         String testId = "ExplodedWar_WithSourceIncludeExclude";
778         MavenProjectBasicStub project = new MavenProjectBasicStub();
779         File webAppSource = createWebAppSource( testId );
780         File classesDir = createClassesDir( testId, true );
781         File webAppDirectory = new File( getTestDirectory(), testId );
782 
783         // configure mojo
784         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
785         setVariableValueToObject( mojo, "warSourceIncludes", "**/*sit.jsp" );
786         setVariableValueToObject( mojo, "warSourceExcludes", "**/last*.*" );
787         mojo.execute();
788 
789         // validate operation
790         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
791         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
792         File expectedWEBXMLDir = new File( webAppDirectory, "WEB-INF" );
793         File expectedMETAINFDir = new File( webAppDirectory, "META-INF" );
794 
795         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
796         assertFalse( "source files found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
797         assertTrue( "WEB XML not found: " + expectedWEBXMLDir.toString(), expectedWEBXMLDir.exists() );
798         assertTrue( "META-INF not found", expectedMETAINFDir.exists() );
799 
800         // house keeping
801         expectedWebSourceFile.delete();
802         expectedWebSource2File.delete();
803         expectedWEBXMLDir.delete();
804         expectedMETAINFDir.delete();
805     }
806 
807     public void testExplodedWar_WithWarDependencyIncludeExclude()
808         throws Exception
809     {
810         // setup test data
811         String testId = "ExplodedWar_WithWarDependencyIncludeExclude";
812         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
813         IncludeExcludeWarArtifactStub includeexcludeWarArtifact = new IncludeExcludeWarArtifactStub( getBasedir() );
814         File webAppDirectory = new File( getTestDirectory(), testId );
815         File webAppSource = createWebAppSource( testId );
816         File classesDir = createClassesDir( testId, true );
817         File workDirectory = new File( getTestDirectory(), "/war/work-" + testId );
818         File includeExcludeWarFile = includeexcludeWarArtifact.getFile();
819 
820         assertTrue( "war not found: " + includeExcludeWarFile.toString(), includeExcludeWarFile.exists() );
821 
822         createDir( workDirectory );
823 
824         // configure mojo
825         project.addArtifact( includeexcludeWarArtifact );
826         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
827         setVariableValueToObject( mojo, "dependentWarIncludes", "**/*Include.jsp,**/*.xml" );
828         setVariableValueToObject( mojo, "dependentWarExcludes", "**/*Exclude*,**/MANIFEST.MF" );
829         setVariableValueToObject( mojo, "workDirectory", workDirectory );
830         mojo.execute();
831 
832         // validate operation
833         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
834         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
835         File expectedManifestFile = new File( webAppDirectory, "META-INF/MANIFEST.MF" );
836         File expectedWEBXMLFile = new File( webAppDirectory, "WEB-INF/web.xml" );
837         File expectedIncludedWARFile = new File( webAppDirectory, "/org/sample/company/testInclude.jsp" );
838         File expectedExcludedWarfile = new File( webAppDirectory, "/org/sample/companyExclude/test.jsp" );
839 
840         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
841         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
842         // check include-exclude.war in the unit test dir under resources to verify the list of files
843         assertTrue( "web xml not found: " + expectedWEBXMLFile.toString(), expectedWEBXMLFile.exists() );
844         assertFalse( "manifest file found: " + expectedManifestFile.toString(), expectedManifestFile.exists() );
845         assertTrue( "war file not found: " + expectedIncludedWARFile.toString(), expectedIncludedWARFile.exists() );
846         assertFalse( "war file not found: " + expectedExcludedWarfile.toString(), expectedExcludedWarfile.exists() );
847 
848         // house keeping
849         expectedWebSourceFile.delete();
850         expectedWebSource2File.delete();
851         expectedManifestFile.delete();
852         expectedWEBXMLFile.delete();
853         expectedIncludedWARFile.delete();
854         expectedExcludedWarfile.delete();
855     }
856 
857     public void testExplodedWarWithSourceModificationCheck()
858         throws Exception
859     {
860         // setup test data
861         String testId = "ExplodedWarWithSourceModificationCheck";
862         MavenProjectBasicStub project = new MavenProjectBasicStub();
863         File webAppSource = createWebAppSource( testId );
864         File classesDir = createClassesDir( testId, false );
865         File webAppDirectory = new File( getTestDirectory(), testId );
866 
867         // configure mojo
868         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
869 
870         // destination file is already created manually containing an "error" string
871         // source is newer than the destination file
872         mojo.execute();
873 
874         // validate operation
875 
876         File expectedWEBINFDir = new File( webAppDirectory, "WEB-INF" );
877         File expectedMETAINFDir = new File( webAppDirectory, "META-INF" );
878         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
879         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
880 
881         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
882         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
883         assertTrue( "WEB-INF not found", expectedWEBINFDir.exists() );
884         assertTrue( "META-INF not found", expectedMETAINFDir.exists() );
885 
886         // 1st phase destination is older than source
887         // destination starts with a value of error replaced with a blank source
888         assertFalse( "source files not updated with new copy: " + expectedWebSourceFile.toString(),
889                      "error".equals( FileUtils.fileRead( expectedWebSourceFile ) ) );
890 
891         // TODO: uncomment when lastModified problem is resolved
892         // FileWriter writer = new FileWriter(expectedWebSourceFile);
893         //
894         // // 2nd phase destination is newer than source
895         // // destination should not be replaced with an blank source
896         // writer.write("newdata");
897         // mojo.execute();
898         // reader = new FileReader(expectedWebSourceFile);
899         // reader.read(data);
900         // assertTrue("source file updated with old copy: "
901         // +expectedWebSourceFile.toString(),String.valueOf(data).equals("newdata") ); }
902 
903         // house keeping
904         expectedWEBINFDir.delete();
905         expectedMETAINFDir.delete();
906         expectedWebSourceFile.delete();
907         expectedWebSource2File.delete();
908     }
909 
910     public void testExplodedWarWithOutputFileNameMapping()
911         throws Exception
912     {
913         // setup test data
914         String testId = "ExplodedWarWithFileNameMapping";
915         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
916         File webAppDirectory = new File( getTestDirectory(), testId );
917         File webAppSource = createWebAppSource( testId );
918         File classesDir = createClassesDir( testId, true );
919         ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE, "jar" );
920         ArtifactStub jarArtifact = new JarArtifactStub( getBasedir(), artifactHandler );
921         File jarFile = jarArtifact.getFile();
922 
923         assertTrue( "jar not found: " + jarFile.toString(), jarFile.exists() );
924 
925         // configure mojo
926         project.addArtifact( jarArtifact );
927         mojo.setOutputFileNameMapping( "@{artifactId}@.@{extension}@" );
928         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
929         mojo.execute();
930 
931         // validate operation
932         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
933         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
934         // final name form is <artifactId>-<version>.<type>
935         File expectedJarArtifact = new File( webAppDirectory, "WEB-INF/lib/jarartifact.jar" );
936 
937         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
938         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
939         assertTrue( "jar artifact not found: " + expectedJarArtifact.toString(), expectedJarArtifact.exists() );
940 
941         // house keeping
942         expectedWebSourceFile.delete();
943         expectedWebSource2File.delete();
944         expectedJarArtifact.delete();
945     }
946 
947     /**
948      * @throws Exception
949      */
950     public void testExplodedWarWithOutputFileNameMappingAndDuplicateDependencies()
951         throws Exception
952     {
953         // setup test data
954         String testId = "ExplodedWarWithFileNameMappingAndDuplicateDependencies";
955         MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
956         File webAppDirectory = new File( getTestDirectory(), testId );
957         File webAppSource = createWebAppSource( testId );
958         File classesDir = createClassesDir( testId, true );
959         EJBArtifactStub ejbArtifact = new EJBArtifactStub( getBasedir() );
960         EJBArtifactStub ejbArtifactDup = new EJBArtifactStub( getBasedir() );
961         File ejbFile = ejbArtifact.getFile();
962 
963         // ejbArtifact has a hard coded file, only one assert is needed
964         assertTrue( "ejb not found: " + ejbFile.getAbsolutePath(), ejbFile.exists() );
965 
966         // configure mojo
967         ejbArtifact.setGroupId( "org.sample.ejb" );
968         ejbArtifactDup.setGroupId( "org.dup.ejb" );
969         project.addArtifact( ejbArtifact );
970         project.addArtifact( ejbArtifactDup );
971         mojo.setOutputFileNameMapping( "@{artifactId}@.@{extension}@" );
972         this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project );
973         mojo.execute();
974 
975         // validate operation
976         File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" );
977         File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" );
978         // final name form is <artifactId>-<version>.<type>
979         File expectedEJBArtifact = new File( webAppDirectory, "WEB-INF/lib/org.sample.ejb-ejbartifact.jar" );
980         File expectedEJBDupArtifact = new File( webAppDirectory, "WEB-INF/lib/org.dup.ejb-ejbartifact.jar" );
981 
982         assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() );
983         assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() );
984         assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() );
985         assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(),
986                     expectedEJBDupArtifact.exists() );
987 
988         // house keeping
989         expectedWebSourceFile.delete();
990         expectedWebSource2File.delete();
991         expectedEJBArtifact.delete();
992         expectedEJBDupArtifact.delete();
993     }
994 
995     /* --------------------- 2.1 Overlay tests ----------------------------------- */
996 
997     /*---------------------------*/
998 
999 
1000 }