View Javadoc

1   package org.codehaus.modello.generator.xml.stax;
2   
3   import org.codehaus.modello.model.Model;
4   import org.codehaus.modello.model.ModelClass;
5   import org.codehaus.modello.model.Version;
6   import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
7   
8   import java.util.List;
9   
10  /**
11   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
12   * @author <a href="mailto:evenisse@codehaus.org">Emmanuel Venisse</a>
13   */
14  public class StaxGeneratorWrongVersionTest
15      extends AbstractStaxGeneratorTestCase
16  {
17      public StaxGeneratorWrongVersionTest()
18          throws ComponentLookupException
19      {
20          super( "stax-wrong-version" );
21      }
22  
23      public void testStaxReaderVersionInField()
24          throws Throwable
25      {
26          Model model = modello.loadModel( getXmlResourceReader( "/version-in-field.mdo" ) );
27  
28          List<ModelClass> classesList = model.getClasses( new Version( "4.0.0" ) );
29  
30          assertEquals( 1, classesList.size() );
31  
32          ModelClass clazz = (ModelClass) classesList.get( 0 );
33  
34          assertEquals( "Model", clazz.getName() );
35  
36          verifyModel( model, "org.codehaus.modello.generator.xml.stax.StaxVerifierWrongVersion" );
37      }
38  
39  }