Search in sources :

Example 1 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 2 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 3 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 4 with DefaultNamingStrategy

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

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

the class ConfigurationFacadeTest method testGetNamingStrategy.

@Test
public void testGetNamingStrategy() {
    INamingStrategy strategy = FACADE_FACTORY.createNamingStrategy(new DefaultNamingStrategy());
    ConfigurationFacadeImpl facade = (ConfigurationFacadeImpl) configurationFacade;
    Assert.assertNull(facade.getNamingStrategy());
    facade.namingStrategy = strategy;
    Assert.assertSame(strategy, facade.getNamingStrategy());
}
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