Search in sources :

Example 26 with INamingStrategy

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

the class ServiceImplTest method testNewNamingStrategy.

@Test
public void testNewNamingStrategy() {
    String strategyClassName = DefaultNamingStrategy.class.getName();
    INamingStrategy namingStrategy = service.newNamingStrategy(strategyClassName);
    Assert.assertNotNull(namingStrategy);
    Object target = ((IFacade) namingStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof DefaultNamingStrategy);
}
Also used : INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 27 with INamingStrategy

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

the class ConfigurationFacadeTest method testSetNamingStrategy.

@Test
public void testSetNamingStrategy() {
    INamingStrategy namingStrategy = FACADE_FACTORY.createNamingStrategy(new DefaultNamingStrategy());
    ConfigurationFacadeImpl facade = (ConfigurationFacadeImpl) configurationFacade;
    Assert.assertNotSame(namingStrategy, facade.namingStrategy);
    configurationFacade.setNamingStrategy(namingStrategy);
    Assert.assertSame(namingStrategy, facade.namingStrategy);
}
Also used : INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Example 28 with INamingStrategy

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

the class FacadeFactoryTest method testCreateNamingStrategy.

@Test
public void testCreateNamingStrategy() {
    DefaultNamingStrategy namingStrategy = new DefaultNamingStrategy();
    INamingStrategy facade = facadeFactory.createNamingStrategy(namingStrategy);
    Assert.assertSame(namingStrategy, ((IFacade) facade).getTarget());
}
Also used : INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Example 29 with INamingStrategy

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

the class ServiceImplTest method testNewNamingStrategy.

@Test
public void testNewNamingStrategy() {
    String strategyClassName = DefaultNamingStrategy.class.getName();
    INamingStrategy namingStrategy = service.newNamingStrategy(strategyClassName);
    Assert.assertNotNull(namingStrategy);
    Object target = ((IFacade) namingStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof DefaultNamingStrategy);
}
Also used : INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 30 with INamingStrategy

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

the class ServiceImplTest method testNewNamingStrategy.

@Test
public void testNewNamingStrategy() {
    String strategyClassName = DefaultNamingStrategy.class.getName();
    INamingStrategy namingStrategy = service.newNamingStrategy(strategyClassName);
    Assert.assertNotNull(namingStrategy);
    Object target = ((IFacade) namingStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof DefaultNamingStrategy);
}
Also used : INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Aggregations

INamingStrategy (org.jboss.tools.hibernate.runtime.spi.INamingStrategy)30 DefaultNamingStrategy (org.hibernate.cfg.DefaultNamingStrategy)28 Test (org.junit.Test)28 NamingStrategy (org.hibernate.cfg.NamingStrategy)9 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)4 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1 DocumentException (org.dom4j.DocumentException)1 Entity (org.eclipse.jpt.jpa.core.context.Entity)1 RelationshipMapping (org.eclipse.jpt.jpa.core.context.RelationshipMapping)1 IMessage (org.eclipse.wst.validation.internal.provisional.core.IMessage)1 DTDEntityResolver (org.hibernate.util.xpl.DTDEntityResolver)1 MappingException (org.jboss.tools.hibernate.exception.MappingException)1 HibernateException (org.jboss.tools.hibernate.runtime.spi.HibernateException)1 EntityResolver (org.xml.sax.EntityResolver)1 SAXParseException (org.xml.sax.SAXParseException)1