1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.eclipse.it;
20
21 import java.io.BufferedReader;
22 import java.io.File;
23 import java.io.FileReader;
24 import java.io.IOException;
25 import java.io.StringReader;
26 import java.net.MalformedURLException;
27 import java.util.ArrayList;
28 import java.util.Arrays;
29 import java.util.HashMap;
30 import java.util.Iterator;
31 import java.util.List;
32 import java.util.Map;
33 import java.util.Properties;
34 import java.util.Map.Entry;
35
36 import junit.framework.AssertionFailedError;
37
38 import org.apache.maven.artifact.Artifact;
39 import org.apache.maven.artifact.factory.ArtifactFactory;
40 import org.apache.maven.artifact.factory.DefaultArtifactFactory;
41 import org.apache.maven.artifact.handler.DefaultArtifactHandler;
42 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
43 import org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager;
44 import org.apache.maven.artifact.repository.ArtifactRepository;
45 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
46 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
47 import org.apache.maven.plugin.MojoExecutionException;
48 import org.apache.maven.plugin.eclipse.ExecutionFailedException;
49 import org.apache.maven.plugin.eclipse.Messages;
50 import org.apache.maven.plugin.ide.IdeUtils;
51 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
52 import org.apache.maven.project.MavenProject;
53 import org.apache.maven.shared.invoker.InvocationRequest;
54 import org.apache.maven.shared.invoker.InvocationResult;
55 import org.apache.maven.shared.test.plugin.BuildTool;
56 import org.apache.maven.shared.test.plugin.PluginTestTool;
57 import org.apache.maven.shared.test.plugin.ProjectTool;
58 import org.apache.maven.shared.test.plugin.RepositoryTool;
59 import org.apache.maven.shared.test.plugin.TestToolsException;
60 import org.codehaus.classworlds.ClassRealm;
61 import org.codehaus.plexus.PlexusContainer;
62 import org.codehaus.plexus.util.FileUtils;
63 import org.codehaus.plexus.util.IOUtil;
64 import org.codehaus.plexus.util.StringUtils;
65 import org.custommonkey.xmlunit.XMLAssert;
66 import org.custommonkey.xmlunit.XMLUnit;
67 import org.xml.sax.EntityResolver;
68 import org.xml.sax.InputSource;
69 import org.xml.sax.SAXException;
70
71
72
73
74
75
76 public abstract class AbstractEclipsePluginIT
77 extends AbstractMojoTestCase
78 {
79
80 private BuildTool buildTool;
81
82 private ProjectTool projectTool;
83
84 private RepositoryTool repositoryTool;
85
86
87
88
89 protected static File localRepositoryDirectory = getTestFile( "target/test-classes/m2repo" );
90
91
92
93
94 protected static File PomFile = new File( getBasedir(), "pom.xml" );
95
96
97
98
99 protected static final String GROUP_ID = "org.apache.maven.plugins";
100
101
102
103
104 protected static final String ARTIFACT_ID = "maven-eclipse-plugin";
105
106
107
108
109 protected static final String VERSION = "test";
110
111 private static final String BUILD_OUTPUT_DIRECTORY = "target/surefire-reports/build-output";
112
113 private static boolean installed = false;
114
115
116
117
118 private static final String EXPECTED_DIRECTORY_NAME = "expected";
119
120
121
122
123 private static final String XML_HEADER = "<?xml";
124
125
126
127
128 protected void setUp()
129 throws Exception
130 {
131 if ( !installed )
132 {
133 System.out.println( "*** Running test builds; output will be directed to: " + BUILD_OUTPUT_DIRECTORY + "\n" );
134 }
135
136 super.setUp();
137
138 buildTool = (BuildTool) lookup( BuildTool.ROLE, "default" );
139
140 projectTool = (ProjectTool) lookup( ProjectTool.ROLE, "default" );
141
142 repositoryTool = (RepositoryTool) lookup( RepositoryTool.ROLE, "default" );
143
144 String mavenHome = System.getProperty( "maven.home" );
145
146
147
148 if ( mavenHome == null )
149 {
150 String path = System.getProperty( "java.library.path" );
151 String[] paths = StringUtils.split( path, System.getProperty( "path.separator" ) );
152 for ( int j = 0; j < paths.length; j++ )
153 {
154 String pt = paths[j];
155 if ( new File( pt, "mvn" ).exists() )
156 {
157 System.setProperty( "maven.home", new File( pt ).getAbsoluteFile().getParent() );
158 break;
159 }
160
161 }
162 }
163
164 System.setProperty( "MAVEN_TERMINATE_CMD", "on" );
165
166 synchronized ( AbstractEclipsePluginIT.class )
167 {
168 if ( !installed )
169 {
170 PluginTestTool pluginTestTool = (PluginTestTool) lookup( PluginTestTool.ROLE, "default" );
171
172 localRepositoryDirectory =
173 pluginTestTool.preparePluginForUnitTestingWithMavenBuilds( PomFile, "test",
174 localRepositoryDirectory );
175
176 System.out.println( "*** Installed test-version of the Eclipse plugin to: " + localRepositoryDirectory
177 + "\n" );
178
179
180 EntityResolver ignoreDtds = new EntityResolver()
181 {
182
183 public InputSource resolveEntity( String publicId, String systemId )
184 throws SAXException, IOException
185 {
186 return new InputSource( new StringReader( "<!ELEMENT ignored (#PCDATA)>" ) );
187 }
188
189 };
190 XMLUnit.setTestEntityResolver( ignoreDtds );
191 XMLUnit.setControlEntityResolver( ignoreDtds );
192
193 installed = true;
194 }
195 }
196
197 }
198
199
200
201
202 protected void tearDown()
203 throws Exception
204 {
205 super.tearDown();
206
207 List containers = new ArrayList();
208
209 containers.add( getContainer() );
210
211 for ( Iterator iter = containers.iterator(); iter.hasNext(); )
212 {
213 PlexusContainer container = (PlexusContainer) iter.next();
214
215 if ( container != null )
216 {
217 container.dispose();
218
219 ClassRealm realm = container.getContainerRealm();
220
221 if ( realm != null )
222 {
223 realm.getWorld().disposeRealm( realm.getId() );
224 }
225 }
226 }
227 }
228
229
230
231
232
233
234
235 protected void testProject( String projectName )
236 throws Exception
237 {
238 testProject( projectName, new Properties(), "clean", "eclipse" );
239 }
240
241
242
243
244
245
246
247 protected void testProject( File basedir )
248 throws Exception
249 {
250 testProject( basedir, new Properties(), "clean", "eclipse" );
251 }
252
253
254
255
256
257
258
259
260
261
262 protected void testProject( String projectName, Properties properties, String cleanGoal, String genGoal )
263 throws Exception
264 {
265 File basedir = getTestFile( "target/test-classes/projects/" + projectName );
266 testProject( basedir, properties, cleanGoal, genGoal );
267 }
268
269
270
271
272
273
274
275
276
277
278 protected void testProject( File basedir, Properties properties, String cleanGoal, String genGoal )
279 throws Exception
280 {
281 File pom = new File( basedir, "pom.xml" );
282
283 String pluginSpec = getPluginCLISpecification();
284
285 List goals = new ArrayList();
286
287 goals.add( pluginSpec + cleanGoal );
288 goals.add( pluginSpec + genGoal );
289
290 executeMaven( pom, properties, goals );
291
292 MavenProject project = readProject( pom );
293
294 String outputDirPath =
295 IdeUtils.getPluginSetting( project, "org.apache.maven.plugins:maven-eclipse-plugin", "outputDir", null );
296 File projectOutputDir = basedir;
297
298 if ( outputDirPath != null )
299 {
300 File outputDir = new File( basedir, outputDirPath );
301 outputDir.mkdirs();
302 projectOutputDir = new File( outputDir, project.getArtifactId() );
303 }
304
305 compareDirectoryContent( basedir, projectOutputDir );
306 }
307
308
309
310
311
312
313
314 protected void testWorkspace( String projectName )
315 throws Exception
316 {
317 testWorkspace( projectName, new Properties(), "configure-workspace" );
318 }
319
320
321
322
323
324
325
326 protected void testWorkspace( String projectName, String goal )
327 throws Exception
328 {
329 testWorkspace( projectName, new Properties(), goal );
330 }
331
332
333
334
335
336
337
338
339
340
341 protected void testWorkspace( String projectName, Properties properties, String genGoal )
342 throws Exception
343 {
344 File basedir = getOutputDirectory( projectName );
345
346 File pom = new File( basedir, "pom.xml" );
347
348 String pluginSpec = getPluginCLISpecification();
349
350 List goals = new ArrayList();
351
352 goals.add( pluginSpec + genGoal );
353
354 executeMaven( pom, properties, goals );
355
356 MavenProject project = readProject( pom );
357
358 String outputDirPath =
359 IdeUtils.getPluginSetting( project, "org.apache.maven.plugins:maven-eclipse-plugin", "outputDir", null );
360 File outputDir;
361 File projectOutputDir = basedir;
362
363 if ( outputDirPath == null )
364 {
365 outputDir = basedir;
366 }
367 else
368 {
369 outputDir = new File( basedir, outputDirPath );
370 outputDir.mkdirs();
371 projectOutputDir = new File( outputDir, project.getArtifactId() );
372 }
373
374 compareDirectoryContent( basedir, projectOutputDir );
375
376 }
377
378 protected File getOutputDirectory( String projectName )
379 {
380 return getTestFile( "target/test-classes/projects/" + projectName );
381 }
382
383 protected File getTestWorkspaceWorkDirectory( String projectName )
384 {
385 return new File( this.getOutputDirectory( projectName ), ".metadata" );
386 }
387
388 protected void executeMaven( File pom, Properties properties, List goals )
389 throws TestToolsException, ExecutionFailedException
390 {
391 executeMaven( pom, properties, goals, true );
392 }
393
394 protected void executeMaven( File pom, Properties properties, List goals, boolean switchLocalRepo )
395 throws TestToolsException, ExecutionFailedException
396 {
397 System.out.println( " Building " + pom.getParentFile().getName() );
398
399 new File( BUILD_OUTPUT_DIRECTORY ).mkdirs();
400
401 NullPointerException npe = new NullPointerException();
402 StackTraceElement[] trace = npe.getStackTrace();
403
404 File buildLog = null;
405
406 for ( int i = 0; i < trace.length; i++ )
407 {
408 StackTraceElement element = trace[i];
409
410 String methodName = element.getMethodName();
411
412 if ( methodName.startsWith( "test" ) && !methodName.equals( "testProject" ) )
413 {
414 String classname = element.getClassName();
415
416 buildLog = new File( BUILD_OUTPUT_DIRECTORY, classname + "_" + element.getMethodName() + ".build.log" );
417
418 break;
419 }
420 }
421
422 if ( buildLog == null )
423 {
424 buildLog = new File( BUILD_OUTPUT_DIRECTORY, "unknown.build.log" );
425 }
426
427 InvocationRequest request = buildTool.createBasicInvocationRequest( pom, properties, goals, buildLog );
428 request.setUpdateSnapshots( false );
429 request.setShowErrors( true );
430
431 request.setDebug( true );
432
433 if ( switchLocalRepo )
434 {
435 request.setLocalRepositoryDirectory( localRepositoryDirectory );
436 }
437
438 InvocationResult result = buildTool.executeMaven( request );
439
440 if ( result.getExitCode() != 0 )
441 {
442 String buildLogUrl = buildLog.getAbsolutePath();
443
444 try
445 {
446 buildLogUrl = buildLog.toURL().toExternalForm();
447 }
448 catch ( MalformedURLException e )
449 {
450 }
451
452 throw new ExecutionFailedException( "Failed to execute build.\nPOM: " + pom + "\nGoals: "
453 + StringUtils.join( goals.iterator(), ", " ) + "\nExit Code: " + result.getExitCode() + "\nError: "
454 + result.getExecutionException() + "\nBuild Log: " + buildLogUrl + "\n", result );
455 }
456 }
457
458 protected MavenProject readProject( File pom )
459 throws TestToolsException
460 {
461 return projectTool.readProject( pom, localRepositoryDirectory );
462 }
463
464 protected String getPluginCLISpecification()
465 {
466 String pluginSpec = GROUP_ID + ":" + ARTIFACT_ID + ":";
467
468
469
470
471
472
473
474
475
476
477
478 pluginSpec += VERSION + ":";
479
480 return pluginSpec;
481 }
482
483
484
485
486
487
488 protected void compareDirectoryContent( File basedir, File projectOutputDir )
489 throws MojoExecutionException
490 {
491 File[] expectedDirectories = getExpectedDirectories( basedir );
492
493 for ( int i = 0; i < expectedDirectories.length; i++ )
494 {
495 File expectedDirectory = expectedDirectories[i];
496 File[] expectedFilesToCompare = getExpectedFilesToCompare( expectedDirectory );
497
498 for ( int j = 0; j < expectedFilesToCompare.length; j++ )
499 {
500 File expectedFile = expectedFilesToCompare[j];
501 File actualFile = getActualFile( projectOutputDir, basedir, expectedFile );
502
503 if ( !actualFile.exists() )
504 {
505 throw new AssertionFailedError( "Expected file not found: " + actualFile.getAbsolutePath() );
506 }
507
508 assertFileEquals( expectedFile, actualFile );
509
510 }
511 }
512 }
513
514 protected void assertFileEquals( File expectedFile, File actualFile )
515 throws MojoExecutionException
516 {
517 if ( !actualFile.exists() )
518 {
519 throw new AssertionFailedError( "Expected file not found: " + actualFile.getAbsolutePath() );
520 }
521
522 HashMap variableReplacement = new HashMap();
523 variableReplacement.put( "${basedir}",
524 IdeUtils.fixSeparator( IdeUtils.getCanonicalPath( new File( getBasedir() ) ) ) );
525 variableReplacement.put( "${M2_REPO}",
526 IdeUtils.fixSeparator( IdeUtils.getCanonicalPath( localRepositoryDirectory ) ) );
527
528 String expectedFileContents = preprocess( expectedFile, variableReplacement );
529 String actualFileContents = preprocess( actualFile, null );
530
531 if ( isXml( expectedFile ) )
532 {
533 assertXmlFileEquals( expectedFile, expectedFileContents, actualFile, actualFileContents );
534 }
535 else
536 {
537 assertTextFileEquals( expectedFile, expectedFileContents, actualFile, actualFileContents );
538 }
539 }
540
541
542
543
544
545
546
547
548
549
550 private void assertXmlFileEquals( File expectedFile, String expectedFileContents, File actualFile,
551 String actualFileContents )
552 throws MojoExecutionException
553 {
554 try
555 {
556 XMLAssert.assertXMLEqual( "Comparing '" + IdeUtils.getCanonicalPath( actualFile ) + "' against '"
557 + IdeUtils.getCanonicalPath( expectedFile ), expectedFileContents, actualFileContents );
558 }
559 catch ( IOException e )
560 {
561 throw new MojoExecutionException( IdeUtils.getCanonicalPath( expectedFile )
562 + "assertXmlFileEquals failure: IO " + e.getMessage(), e );
563 }
564 catch ( SAXException e )
565 {
566 throw new MojoExecutionException( "assertXmlFileEquals failure: SAX " + e.getMessage(), e );
567 }
568 }
569
570
571
572
573
574
575
576
577
578
579 private void assertTextFileEquals( File expectedFile, String expectedFileContents, File actualFile,
580 String actualFileContents )
581 throws MojoExecutionException
582 {
583 List expectedLines = getLines( expectedFileContents );
584 List actualLines = getLines( actualFileContents );
585 for ( int i = 0; i < expectedLines.size(); i++ )
586 {
587 String expected = expectedLines.get( i ).toString();
588 if ( actualLines.size() <= i )
589 {
590 fail( "Too few lines in the actual file. Was " + actualLines.size() + ", expected: "
591 + expectedLines.size() );
592 }
593 String actual = actualLines.get( i ).toString();
594 if ( expected.startsWith( "#" ) && actual.startsWith( "#" ) )
595 {
596
597 continue;
598 }
599 assertEquals( "Comparing '" + IdeUtils.getCanonicalPath( actualFile ) + "' against '"
600 + IdeUtils.getCanonicalPath( expectedFile ) + "' at line #" + ( i + 1 ), expected, actual );
601 }
602 assertTrue( "Unequal number of lines.", expectedLines.size() == actualLines.size() );
603 }
604
605
606
607
608
609
610
611
612
613 private String preprocess( File file, Map variables )
614 throws MojoExecutionException
615 {
616 String result = null;
617 try
618 {
619 result = FileUtils.fileRead( file, "UTF-8" );
620 }
621 catch ( IOException ex )
622 {
623 throw new MojoExecutionException( "Unable to read file", ex );
624 }
625 result = replaceVariables( result, variables );
626 result = IdeUtils.fixWindowsDriveURI( result );
627
628
629
630
631
632
633
634 if ( file.getName().endsWith( ".prefs" ) )
635 {
636 result = normalizeNewlineTerminators( result );
637 }
638
639
640
641
642
643
644
645 if ( file.getName().equals( "org.eclipse.wst.common.component" ) || file.getName().equals( ".modulemaps" )
646 || file.getName().equals( "application.xml" ) )
647 {
648 result = result.replaceAll( "_\\d+", "" );
649 }
650 return result;
651 }
652
653
654
655
656
657
658
659 private String normalizeNewlineTerminators( String input )
660 {
661 return input.replaceAll( "(\\\\r\\\\n)|(\\\\n)|(\\\\r)", "\\n" );
662 }
663
664
665
666
667
668
669 private String replaceVariables( String str, Map variables )
670 {
671 String result = str;
672 if ( variables != null && !variables.isEmpty() )
673 {
674 Iterator iter = variables.entrySet().iterator();
675 while ( iter.hasNext() )
676 {
677 Map.Entry entry = (Entry) iter.next();
678 String variable = (String) entry.getKey();
679 String replacement = (String) entry.getValue();
680 result = StringUtils.replace( result, variable, replacement );
681 }
682 }
683
684 return result;
685 }
686
687 protected void assertContains( String message, String full, String substring )
688 {
689 if ( full == null || full.indexOf( substring ) == -1 )
690 {
691 StringBuffer buf = new StringBuffer();
692 if ( message != null )
693 {
694 buf.append( message );
695 }
696 buf.append( ". " );
697 buf.append( "Expected \"" );
698 buf.append( substring );
699 buf.append( "\" not found" );
700 fail( buf.toString() );
701 }
702 }
703
704 protected void assertDoesNotContain( String message, String full, String substring )
705 {
706 if ( full == null || full.indexOf( substring ) != -1 )
707 {
708 StringBuffer buf = new StringBuffer();
709 if ( message != null )
710 {
711 buf.append( message );
712 }
713 buf.append( ". " );
714 buf.append( "Unexpected \"" );
715 buf.append( substring );
716 buf.append( "\" found" );
717 fail( buf.toString() );
718 }
719 }
720
721 private List getLines( String input )
722 throws MojoExecutionException
723 {
724 try
725
726 {
727 List lines = new ArrayList();
728
729 BufferedReader reader = new BufferedReader( new StringReader( input ) );
730
731 String line;
732
733 while ( ( line = reader.readLine() ) != null )
734 {
735 lines.add( line );
736 }
737
738 IOUtil.close( reader );
739
740 return lines;
741 }
742 catch ( IOException e )
743 {
744 throw new MojoExecutionException( "failed to getLines", e );
745 }
746 }
747
748
749
750
751
752 private File[] getExpectedDirectories( File basedir )
753 {
754 List expectedDirectories = new ArrayList();
755 List subdirectories = new ArrayList();
756
757 File[] allFiles = basedir.listFiles();
758 if ( allFiles != null )
759 {
760 for ( int i = 0; i < allFiles.length; i++ )
761 {
762 File currentFile = allFiles[i];
763 if ( currentFile.isDirectory() )
764 {
765 if ( currentFile.getName().equals( EXPECTED_DIRECTORY_NAME ) )
766 {
767 expectedDirectories.add( currentFile );
768 }
769 else
770 {
771 subdirectories.add( currentFile );
772 }
773 }
774 }
775 }
776 if ( !subdirectories.isEmpty() )
777 {
778 for ( Iterator iter = subdirectories.iterator(); iter.hasNext(); )
779 {
780 File subdirectory = (File) iter.next();
781 File[] subdirectoryFiles = getExpectedDirectories( subdirectory );
782 expectedDirectories.addAll( Arrays.asList( subdirectoryFiles ) );
783 }
784 }
785 return (File[]) expectedDirectories.toArray( new File[expectedDirectories.size()] );
786 }
787
788
789
790
791
792 private File[] getExpectedFilesToCompare( File expectedDirectory )
793 {
794 List expectedFiles = new ArrayList();
795 List subdirectories = new ArrayList();
796
797 File[] allFiles = expectedDirectory.listFiles();
798 if ( allFiles != null )
799 {
800 for ( int i = 0; i < allFiles.length; i++ )
801 {
802 File currentFile = allFiles[i];
803 if ( currentFile.isDirectory() )
804 {
805 subdirectories.add( currentFile );
806 }
807 else
808 {
809 expectedFiles.add( currentFile );
810 }
811 }
812 }
813 if ( !subdirectories.isEmpty() )
814 {
815 for ( Iterator iter = subdirectories.iterator(); iter.hasNext(); )
816 {
817 File subdirectory = (File) iter.next();
818 File[] subdirectoryFiles = getExpectedFilesToCompare( subdirectory );
819 expectedFiles.addAll( Arrays.asList( subdirectoryFiles ) );
820 }
821 }
822
823 return (File[]) expectedFiles.toArray( new File[expectedFiles.size()] );
824 }
825
826
827
828
829
830
831
832
833
834
835
836 private File getActualFile( File projectOutputDir, File basedir, File expectedFile )
837 throws MojoExecutionException
838 {
839 String relativePath = IdeUtils.toRelativeAndFixSeparator( basedir, expectedFile, false );
840 relativePath = relativePath.replaceFirst( EXPECTED_DIRECTORY_NAME, "" );
841 File actualFile = new File( projectOutputDir, relativePath );
842 try
843 {
844 return actualFile.getCanonicalFile();
845 }
846 catch ( IOException e )
847 {
848 throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantcanonicalize", actualFile.getAbsolutePath() ), e );
849 }
850 }
851
852
853
854
855
856
857
858 private boolean isXml( File f )
859 {
860 FileReader reader = null;
861 try
862 {
863 reader = new FileReader( f );
864 char[] header = new char[XML_HEADER.length()];
865 reader.read( header );
866 return XML_HEADER.equals( new String( header ) );
867 }
868 catch ( Exception e )
869 {
870 return false;
871 }
872 finally
873 {
874 IOUtil.close( reader );
875 }
876 }
877
878
879
880
881
882
883
884
885
886
887
888
889
890 protected File getNotAvailableMarkerFile( String groupId, String artifactId, String version,
891 String classifier, String inClassifier )
892 throws Exception
893 {
894
895
896 String url = "file://" + localRepositoryDirectory;
897 ArtifactRepository localRepository =
898 new DefaultArtifactRepository( "local", url, new DefaultRepositoryLayout() );
899
900 ArtifactFactory artifactFactory = new DefaultArtifactFactory();
901
902 DefaultArtifactHandler javaSourceArtifactHandler = new DefaultArtifactHandler( "java-source" );
903 setVariableValueToObject( javaSourceArtifactHandler, "extension", "jar");
904
905 DefaultArtifactHandler javadocArtifactHandler = new DefaultArtifactHandler( "javadoc" );
906 setVariableValueToObject( javadocArtifactHandler, "extension", "jar");
907
908 Map artifactHandlers = new HashMap();
909 artifactHandlers.put( "java-source", javaSourceArtifactHandler );
910 artifactHandlers.put( "javadoc", javadocArtifactHandler );
911
912 ArtifactHandlerManager artifactHandlerManager = new DefaultArtifactHandlerManager();
913 setVariableValueToObject( artifactHandlerManager, "artifactHandlers", artifactHandlers);
914 setVariableValueToObject( artifactFactory, "artifactHandlerManager", artifactHandlerManager);
915
916
917 Artifact artifact =
918 IdeUtils.createArtifactWithClassifier( groupId, artifactId, version, classifier, inClassifier,
919 artifactFactory);
920 return IdeUtils.getNotAvailableMarkerFile( localRepository, artifact );
921 }
922
923
924
925
926
927
928
929
930
931
932
933 protected void assertNotAvailableMarkerFileExists( String groupId, String artifactId, String version,
934 String classifier, String inClassifier ) throws Exception
935 {
936 File markerFile = getNotAvailableMarkerFile( groupId, artifactId, version, classifier, inClassifier );
937 assertTrue( "The \"Not Available\" marker file does not exist: " + markerFile, markerFile.exists() );
938 }
939
940
941
942
943
944
945
946
947
948
949
950 protected void assertNotAvailableMarkerFileDoesNotExist( String groupId, String artifactId, String version,
951 String classifier, String inClassifier ) throws Exception
952 {
953 File markerFile = getNotAvailableMarkerFile( groupId, artifactId, version, classifier, inClassifier );
954 assertTrue( "The \"Not Available\" marker file incorrectly exists: " + markerFile, !markerFile.exists() );
955 }
956
957 }