1   package org.riverock.dbrevision;
2   
3   import java.io.InputStream;
4   
5   import junit.framework.TestCase;
6   
7   import org.riverock.dbrevision.annotation.schema.db.DbSchema;
8   import org.riverock.dbrevision.utils.Utils;
9   
10  /**
11   * User: SMaslyukov
12   * Date: 30.07.2007
13   * Time: 13:30:46
14   */
15  public class TestInitStructureUnmarshalling extends TestCase {
16  
17      public void testUnmarshalling() throws Exception {
18          InputStream inputStream = TestInitStructureUnmarshalling.class.getResourceAsStream("/xml/init-structure/init-structure.xml"); 
19          DbSchema schema = Utils.getObjectFromXml(DbSchema.class, inputStream);
20          assertNotNull(schema);
21          assertNotNull(schema.getTables());
22          assertEquals(2, schema.getTables().size());
23          assertEquals("WM_PORTAL_IDS", schema.getTables().get(0).getName());
24          assertEquals("WM_AUTH_ACCESS_GROUP", schema.getTables().get(1).getName());
25  
26  
27          assertEquals(1, schema.getSequences().size());
28          assertEquals("SEQ_WM_PRICE_QUERY_TABLE", schema.getSequences().get(0).getName());
29  
30      }
31  }