1 package org.apache.maven.usability.plugin; 2 3 import junit.framework.TestCase; 4 5 import org.apache.maven.usability.plugin.io.xpp3.ParamdocXpp3Reader; 6 import org.codehaus.plexus.util.xml.pull.XmlPullParserException; 7 8 import java.io.IOException ; 9 import java.io.InputStream ; 10 import java.io.InputStreamReader ; 11 import java.util.Map ; 12 import java.util.Properties ; 13 14 public class Xpp3ParseTest 15 extends TestCase 16 { 17 18 public void testParse() throws IOException , XmlPullParserException 19 { 20 InputStream testDocStream = getClass().getClassLoader().getResourceAsStream( "test.paramdoc.xml" ); 21 ParamdocXpp3Reader reader = new ParamdocXpp3Reader(); 22 23 ExpressionDocumentation documentation = reader.read(new InputStreamReader ( testDocStream ) ); 24 25 Map exprs = documentation.getExpressionsBySyntax(); 26 27 Expression expr = (Expression) exprs.get( "localRepository" ); 28 29 assertNotNull( expr ); 30 31 Properties p = expr.getCliOptions(); 32 33 assertNotNull( p ); 34 35 assertEquals( 1, p.size() ); 36 37 assertEquals( "Override the local repository location on a per-build basis.", p.getProperty( "-Dmaven.repo.local=/path/to/local/repo" ) ); 38 39 } 40 41 } 42 | Popular Tags |