Search in sources :

Example 16 with DefaultNamingStrategy

use of org.hibernate.cfg.DefaultNamingStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testSetNamingStrategy.

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

Example 17 with DefaultNamingStrategy

use of org.hibernate.cfg.DefaultNamingStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testGetNamingStrategy.

@Test
public void testGetNamingStrategy() {
    NamingStrategy firstStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(firstStrategy);
    INamingStrategy firstStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertSame(firstStrategy, ((IFacade) firstStrategyFacade).getTarget());
    NamingStrategy secondStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(secondStrategy);
    INamingStrategy secondStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertNotSame(secondStrategy, ((IFacade) secondStrategyFacade).getTarget());
}
Also used : NamingStrategy(org.hibernate.cfg.NamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Example 18 with DefaultNamingStrategy

use of org.hibernate.cfg.DefaultNamingStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testGetNamingStrategy.

@Test
public void testGetNamingStrategy() {
    NamingStrategy firstStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(firstStrategy);
    INamingStrategy firstStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertSame(firstStrategy, ((IFacade) firstStrategyFacade).getTarget());
    NamingStrategy secondStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(secondStrategy);
    INamingStrategy secondStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertNotSame(secondStrategy, ((IFacade) secondStrategyFacade).getTarget());
}
Also used : NamingStrategy(org.hibernate.cfg.NamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Example 19 with DefaultNamingStrategy

use of org.hibernate.cfg.DefaultNamingStrategy 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 20 with DefaultNamingStrategy

use of org.hibernate.cfg.DefaultNamingStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testGetNamingStrategy.

@Test
public void testGetNamingStrategy() {
    DefaultNamingStrategy firstStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(firstStrategy);
    INamingStrategy firstStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertSame(firstStrategy, ((IFacade) firstStrategyFacade).getTarget());
    DefaultNamingStrategy secondStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(secondStrategy);
    INamingStrategy secondStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertNotSame(secondStrategy, ((IFacade) secondStrategyFacade).getTarget());
}
Also used : INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Aggregations

DefaultNamingStrategy (org.hibernate.cfg.DefaultNamingStrategy)28 INamingStrategy (org.jboss.tools.hibernate.runtime.spi.INamingStrategy)28 Test (org.junit.Test)28 NamingStrategy (org.hibernate.cfg.NamingStrategy)9 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)4