Package org.hibernate.tool.hbm2x.hbm2hbmxml

Source Code of org.hibernate.tool.hbm2x.hbm2hbmxml.Cfg2HbmToolTest

package org.hibernate.tool.hbm2x.hbm2hbmxml;

import org.hibernate.mapping.JoinedSubclass;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.UnionSubclass;
import org.hibernate.tool.hbm2x.Cfg2HbmTool;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
* @author Dmitry Geraskov
*
*/
public class Cfg2HbmToolTest extends TestCase {
 
  public void testNeedsTable(){
    Cfg2HbmTool c2h = new Cfg2HbmTool();
    PersistentClass pc = new RootClass();
    assertTrue(c2h.needsTable(pc));
    assertTrue(c2h.needsTable(new JoinedSubclass(pc)));
    assertTrue(c2h.needsTable(new UnionSubclass(pc)));
    assertFalse(c2h.needsTable(new SingleTableSubclass(pc)));
    assertFalse(c2h.needsTable(new Subclass(pc)));
       
  }
 
  public static Test suite() {
    return new TestSuite(Cfg2HbmToolTest.class);
  }
 
}
TOP

Related Classes of org.hibernate.tool.hbm2x.hbm2hbmxml.Cfg2HbmToolTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.