Search in sources :

Example 76 with IProperty

use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateSpecialRootClass.

@Test
public void testCreateSpecialRootClass() {
    Property target = new Property();
    PersistentClass pc = new RootClass(null);
    target.setPersistentClass(pc);
    IProperty property = facadeFactory.createProperty(target);
    IPersistentClass specialRootClass = facadeFactory.createSpecialRootClass(property);
    Assert.assertNotNull(specialRootClass);
    Object object = ((IFacade) specialRootClass).getTarget();
    Assert.assertNotNull(object);
    Assert.assertTrue(object instanceof RootClass);
    Assert.assertSame(property, specialRootClass.getProperty());
}
Also used : RootClass(org.hibernate.mapping.RootClass) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Property(org.hibernate.mapping.Property) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 77 with IProperty

use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateSpecialRootClass.

@Test
public void testCreateSpecialRootClass() {
    Property target = new Property();
    PersistentClass pc = new RootClass(null);
    target.setPersistentClass(pc);
    IProperty property = facadeFactory.createProperty(target);
    IPersistentClass specialRootClass = facadeFactory.createSpecialRootClass(property);
    Assert.assertNotNull(specialRootClass);
    Object object = ((IFacade) specialRootClass).getTarget();
    Assert.assertNotNull(object);
    Assert.assertTrue(object instanceof RootClass);
    Assert.assertSame(property, specialRootClass.getProperty());
}
Also used : RootClass(org.hibernate.mapping.RootClass) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Property(org.hibernate.mapping.Property) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 78 with IProperty

use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewProperty.

@Test
public void testNewProperty() {
    IProperty property = service.newProperty();
    Assert.assertNotNull(property);
    Object target = ((IFacade) property).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof Property);
}
Also used : IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Property(org.hibernate.mapping.Property) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) Test(org.junit.Test)

Example 79 with IProperty

use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateSpecialRootClass.

@Test
public void testCreateSpecialRootClass() {
    Property target = new Property();
    PersistentClass pc = new RootClass(null);
    target.setPersistentClass(pc);
    IProperty property = facadeFactory.createProperty(target);
    IPersistentClass specialRootClass = facadeFactory.createSpecialRootClass(property);
    Assert.assertNotNull(specialRootClass);
    Object object = ((IFacade) specialRootClass).getTarget();
    Assert.assertTrue(specialRootClass instanceof SpecialRootClassFacadeImpl);
    Assert.assertTrue(object instanceof RootClass);
    Assert.assertSame(property, specialRootClass.getProperty());
}
Also used : RootClass(org.hibernate.mapping.RootClass) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Property(org.hibernate.mapping.Property) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 80 with IProperty

use of org.jboss.tools.hibernate.runtime.spi.IProperty in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewProperty.

@Test
public void testNewProperty() {
    IProperty property = service.newProperty();
    Assert.assertNotNull(property);
    Object target = ((IFacade) property).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof Property);
}
Also used : IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Property(org.hibernate.mapping.Property) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) Test(org.junit.Test)

Aggregations

IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)93 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)53 Property (org.hibernate.mapping.Property)40 Test (org.junit.Test)33 RootClass (org.hibernate.mapping.RootClass)27 IValue (org.jboss.tools.hibernate.runtime.spi.IValue)20 PersistentClass (org.hibernate.mapping.PersistentClass)18 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)12 SimpleValue (org.hibernate.mapping.SimpleValue)12 AbstractPropertyFacade (org.jboss.tools.hibernate.runtime.common.AbstractPropertyFacade)12 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)12 FileNotFoundException (java.io.FileNotFoundException)9 IColumn (org.jboss.tools.hibernate.runtime.spi.IColumn)9 Component (org.hibernate.mapping.Component)8 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)8 IEditorPart (org.eclipse.ui.IEditorPart)7 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)7 JavaModelException (org.eclipse.jdt.core.JavaModelException)6 Mappings (org.hibernate.cfg.Mappings)6 PartInitException (org.eclipse.ui.PartInitException)5