1   package org.codehaus.ivory.serialize;
2   
3   import java.lang.reflect.Method;
4   import java.util.Map;
5   
6   import javax.xml.namespace.QName;
7   
8   import org.apache.commons.attributes.Attributes;
9   import org.codehaus.ivory.attributes.NonWebMethod;
10  
11  import junit.framework.TestCase;
12  
13  /***
14   * 
15   * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
16   * @since May 22, 2003
17   */
18  public class MetaSerializerTest extends TestCase
19  {
20      public MetaSerializerTest( String name )
21      {
22          super(name);
23      }
24      
25      public void testSerializer() throws Exception
26      {
27          MetadataSerializer serializer = new MetadataSerializer( MetaBean.class,
28              new QName( MetaBean.class.getName() ) );
29      }
30      
31      public void testDeserializer() throws Exception
32      {
33          Map properties =
34              MetadataDeserializerFactory.getProperties(MetaBean.class, null);
35          
36          Method m = MetaBean.class.getMethod("getWorld", new Class[0] );
37          assertTrue( Attributes.hasAttributeType(m, NonWebMethod.class) );
38          
39          assertTrue( properties.containsKey("hello") );
40          assertTrue( !properties.containsKey("world") );
41      }
42  }