public void testGroupMetadata()
throws XMLException
{
File metadataFile = new File( defaultRepoDir, "org/apache/maven/plugins/maven-metadata.xml" );
ArchivaRepositoryMetadata metadata = MavenMetadataReader.read( metadataFile );
assertNotNull( metadata );
assertEquals( "org.apache.maven.plugins", metadata.getGroupId() );
assertNull( metadata.getArtifactId() );
assertNull( metadata.getReleasedVersion() );
assertNull( metadata.getLatestVersion() );
assertTrue( metadata.getAvailableVersions().isEmpty() );
assertNull( metadata.getSnapshotVersion() );
assertNull( metadata.getLastUpdated() );
Plugin cleanPlugin = new Plugin();
cleanPlugin.setPrefix( "clean" );
cleanPlugin.setArtifactId( "maven-clean-plugin" );
cleanPlugin.setName( "Maven Clean Plugin" );
Plugin compilerPlugin = new Plugin();
compilerPlugin.setPrefix( "compiler" );
compilerPlugin.setArtifactId( "maven-compiler-plugin" );
compilerPlugin.setName( "Maven Compiler Plugin" );
Plugin surefirePlugin = new Plugin();
surefirePlugin.setPrefix( "surefire" );
surefirePlugin.setArtifactId( "maven-surefire-plugin" );
surefirePlugin.setName( "Maven Surefire Plugin" );
assertEquals( Arrays.asList( cleanPlugin, compilerPlugin, surefirePlugin ), metadata.getPlugins() );
}