Search in sources :

Example 1 with AbstractClassMetadataFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade in project jbosstools-hibernate by jbosstools.

the class ClassMetadataFacadeTest method testGetEntityMetaModel.

@Test
public void testGetEntityMetaModel() {
    Assert.assertNull(classMetadata.getEntityMetamodel());
    Assert.assertNull(methodName);
    TestEntityPersister entityPersister = createSampleEntityPersister();
    classMetadata = new AbstractClassMetadataFacade(FACADE_FACTORY, entityPersister) {
    };
    Assert.assertNull(classMetadata.getEntityMetamodel());
    Assert.assertEquals("getEntityMetamodel", methodName);
    entityPersister.initializeEntityMetamodel();
    methodName = null;
    Assert.assertNotNull(classMetadata.getEntityMetamodel());
    Assert.assertEquals("getEntityMetamodel", methodName);
}
Also used : AbstractClassMetadataFacade(org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade) Test(org.junit.Test)

Example 2 with AbstractClassMetadataFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade in project jbosstools-hibernate by jbosstools.

the class ClassMetadataFacadeTest method setUp.

@Before
public void setUp() {
    ClassMetadata target = (ClassMetadata) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { ClassMetadata.class }, new TestInvocationHandler());
    classMetadata = new AbstractClassMetadataFacade(FACADE_FACTORY, target) {
    };
}
Also used : ClassMetadata(org.hibernate.metadata.ClassMetadata) IClassMetadata(org.jboss.tools.hibernate.runtime.spi.IClassMetadata) AbstractClassMetadataFacade(org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade) RootClass(org.hibernate.mapping.RootClass) PersistentClass(org.hibernate.mapping.PersistentClass) Before(org.junit.Before)

Example 3 with AbstractClassMetadataFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade in project jbosstools-hibernate by jbosstools.

the class ClassMetadataFacadeTest method testGetEntityMetaModel.

@Test
public void testGetEntityMetaModel() {
    Assert.assertNull(classMetadata.getEntityMetamodel());
    Assert.assertNull(methodName);
    TestEntityPersister entityPersister = createSampleEntityPersister();
    classMetadata = new AbstractClassMetadataFacade(FACADE_FACTORY, entityPersister) {
    };
    methodName = null;
    Assert.assertNotNull(classMetadata.getEntityMetamodel());
    Assert.assertEquals("getEntityMetamodel", methodName);
}
Also used : AbstractClassMetadataFacade(org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade) Test(org.junit.Test)

Example 4 with AbstractClassMetadataFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade in project jbosstools-hibernate by jbosstools.

the class ClassMetadataFacadeTest method setUp.

@Before
public void setUp() {
    ClassMetadata target = (ClassMetadata) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { ClassMetadata.class }, new TestInvocationHandler());
    classMetadata = new AbstractClassMetadataFacade(FACADE_FACTORY, target) {
    };
}
Also used : ClassMetadata(org.hibernate.metadata.ClassMetadata) IClassMetadata(org.jboss.tools.hibernate.runtime.spi.IClassMetadata) AbstractClassMetadataFacade(org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade) RootClass(org.hibernate.mapping.RootClass) PersistentClass(org.hibernate.mapping.PersistentClass) Before(org.junit.Before)

Example 5 with AbstractClassMetadataFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade in project jbosstools-hibernate by jbosstools.

the class ClassMetadataFacadeTest method testGetEntityMetaModel.

@Test
public void testGetEntityMetaModel() {
    Assert.assertNull(classMetadata.getEntityMetamodel());
    Assert.assertNull(methodName);
    TestEntityPersister entityPersister = createSampleEntityPersister();
    classMetadata = new AbstractClassMetadataFacade(FACADE_FACTORY, entityPersister) {
    };
    Assert.assertNull(classMetadata.getEntityMetamodel());
    Assert.assertEquals("getEntityMetamodel", methodName);
    entityPersister.initializeEntityMetamodel();
    methodName = null;
    Assert.assertNotNull(classMetadata.getEntityMetamodel());
    Assert.assertEquals("getEntityMetamodel", methodName);
}
Also used : AbstractClassMetadataFacade(org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade) Test(org.junit.Test)

Aggregations

AbstractClassMetadataFacade (org.jboss.tools.hibernate.runtime.common.AbstractClassMetadataFacade)19 Test (org.junit.Test)6 InvocationHandler (java.lang.reflect.InvocationHandler)5 Method (java.lang.reflect.Method)5 Test (org.junit.jupiter.api.Test)5 PersistentClass (org.hibernate.mapping.PersistentClass)4 RootClass (org.hibernate.mapping.RootClass)4 ClassMetadata (org.hibernate.metadata.ClassMetadata)4 IClassMetadata (org.jboss.tools.hibernate.runtime.spi.IClassMetadata)4 Before (org.junit.Before)4 BeforeEach (org.junit.jupiter.api.BeforeEach)4