use of org.hibernate.tool.internal.reveng.strategy.DefaultStrategy in project jbosstools-hibernate by jbosstools.
the class JdbcMetadataConfigurationTest method testSetReverseEngineeringStrategy.
@Test
public void testSetReverseEngineeringStrategy() {
RevengStrategy strategy = new DefaultStrategy();
assertNull(jdbcMetadataConfiguration.revengStrategy);
jdbcMetadataConfiguration.setReverseEngineeringStrategy(strategy);
assertSame(strategy, jdbcMetadataConfiguration.revengStrategy);
}
use of org.hibernate.tool.internal.reveng.strategy.DefaultStrategy in project jbosstools-hibernate by jbosstools.
the class JdbcMetadataConfigurationTest method testGetReverseEngineeringStrategy.
@Test
public void testGetReverseEngineeringStrategy() {
RevengStrategy strategy = new DefaultStrategy();
assertNull(jdbcMetadataConfiguration.getReverseEngineeringStrategy());
jdbcMetadataConfiguration.revengStrategy = strategy;
assertSame(strategy, jdbcMetadataConfiguration.getReverseEngineeringStrategy());
}
use of org.hibernate.tool.internal.reveng.strategy.DefaultStrategy in project jbosstools-hibernate by jbosstools.
the class JdbcMetadataConfigurationTest method testReadFromJdbc.
@Test
public void testReadFromJdbc() throws Exception {
Connection connection = DriverManager.getConnection("jdbc:h2:mem:test");
Statement statement = connection.createStatement();
statement.execute("CREATE TABLE FOO(id int primary key, bar varchar(255))");
jdbcMetadataConfiguration.properties.put("hibernate.connection.url", "jdbc:h2:mem:test");
jdbcMetadataConfiguration.revengStrategy = new DefaultStrategy();
assertNull(jdbcMetadataConfiguration.metadata);
jdbcMetadataConfiguration.readFromJdbc();
assertNotNull(jdbcMetadataConfiguration.metadata);
statement.execute("DROP TABLE FOO");
statement.close();
connection.close();
}
use of org.hibernate.tool.internal.reveng.strategy.DefaultStrategy in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testSetReverseEngineeringStrategy.
@Test
public void testSetReverseEngineeringStrategy() {
JdbcMetadataConfiguration configuration = new JdbcMetadataConfiguration();
configurationFacade = new ConfigurationFacadeImpl(FACADE_FACTORY, configuration);
RevengStrategy reverseEngineeringStrategy = new DefaultStrategy();
IReverseEngineeringStrategy strategyFacade = FACADE_FACTORY.createReverseEngineeringStrategy(reverseEngineeringStrategy);
assertNotSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
configurationFacade.setReverseEngineeringStrategy(strategyFacade);
assertSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
}
Aggregations