[MRM-1152]

o merge -r756559 from trunk (fix for MRM-1136)


git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.1.x@760853 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maria Odea B. Ching 2009-04-01 11:00:37 +00:00
parent f5ba79dd88
commit 6b47cf58de
3 changed files with 30 additions and 1 deletions

View File

@ -51,7 +51,9 @@ public class RepositoryMetadataReader
try
{
XMLReader xml = new XMLReader( "metadata", metadataFile );
// invoke this to remove namespaces, see MRM-1136
xml.removeNamespaces();
ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
metadata.setGroupId( xml.getElementText( "//metadata/groupId" ) );

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata xsi:schemaLocation="http://maven.apache.org/METADATA/1.0.0 http://maven.apache.org/xsd/metadata-1.0.0.xsd" xmlns="http://maven.apache.org/METADATA/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<groupId>org.codehaus.mojo</groupId>
<artifactId>idlj-maven-plugin</artifactId>
<version>1.1-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20090312.163710</timestamp>
<buildNumber>16</buildNumber>
</snapshot>
<lastUpdated>20090312163712</lastUpdated>
</versioning>
</metadata>

View File

@ -92,5 +92,18 @@ public class XMLReaderTest
List names = reader.getElementList( "//basic/names/name" );
assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } );
}
// MRM-1136 or MRM-1152
public void testProxiedMetadataRead()
throws XMLException
{
File xmlFile = getExampleXml( "maven-metadata-codehaus-snapshots.xml" );
XMLReader reader = new XMLReader( "metadata", xmlFile );
reader.removeNamespaces();
Element groupId = reader.getElement( "//metadata/groupId" );
assertNotNull( groupId );
assertEquals( "org.codehaus.mojo", groupId.getTextTrim() );
}
}