Search in sources :

Example 56 with ITableFilter

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

the class TableFilterFacadeTest method testSetMatchName.

@Test
public void testSetMatchName() {
    TableFilter tableFilter = new TableFilter();
    ITableFilter tableFilterFacade = FACADE_FACTORY.createTableFilter(tableFilter);
    Assert.assertNotEquals("foo", tableFilter.getMatchName());
    tableFilterFacade.setMatchName("foo");
    Assert.assertEquals("foo", tableFilter.getMatchName());
}
Also used : ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) TableFilter(org.hibernate.cfg.reveng.TableFilter) ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) Test(org.junit.Test)

Example 57 with ITableFilter

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

the class TableFilterFacadeTest method testGetMatchSchema.

@Test
public void testGetMatchSchema() {
    TableFilter tableFilter = new TableFilter();
    ITableFilter tableFilterFacade = FACADE_FACTORY.createTableFilter(tableFilter);
    Assert.assertNotEquals("foo", tableFilterFacade.getMatchSchema());
    tableFilter.setMatchSchema("foo");
    Assert.assertEquals("foo", tableFilterFacade.getMatchSchema());
}
Also used : ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) TableFilter(org.hibernate.cfg.reveng.TableFilter) ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) Test(org.junit.Test)

Example 58 with ITableFilter

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

the class OverrideRepositoryFacadeTest method testAddTableFilter.

@Test
public void testAddTableFilter() throws Exception {
    TableFilter tableFilter = new TableFilter();
    ITableFilter tableFilterFacade = FACADE_FACTORY.createTableFilter(tableFilter);
    Field tableFiltersField = OverrideRepository.class.getDeclaredField("tableFilters");
    tableFiltersField.setAccessible(true);
    List<?> tableFilters = (List<?>) tableFiltersField.get(overrideRepository);
    Assert.assertTrue(tableFilters.isEmpty());
    overrideRepositoryFacade.addTableFilter(tableFilterFacade);
    tableFilters = (List<?>) tableFiltersField.get(overrideRepository);
    Assert.assertSame(tableFilter, tableFilters.get(0));
}
Also used : Field(java.lang.reflect.Field) ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) TableFilter(org.hibernate.cfg.reveng.TableFilter) ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) List(java.util.List) Test(org.junit.Test)

Example 59 with ITableFilter

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

the class FacadeFactoryTest method testCreateTableFilter.

@Test
public void testCreateTableFilter() {
    TableFilter tableFilter = new TableFilter();
    ITableFilter facade = facadeFactory.createTableFilter(tableFilter);
    Assert.assertSame(tableFilter, ((IFacade) facade).getTarget());
}
Also used : ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) TableFilter(org.hibernate.cfg.reveng.TableFilter) ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) Test(org.junit.Test)

Example 60 with ITableFilter

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

the class OverrideRepositoryFacadeTest method testAddTableFilter.

@Test
public void testAddTableFilter() throws Exception {
    TableFilter tableFilter = new TableFilter();
    ITableFilter tableFilterFacade = FACADE_FACTORY.createTableFilter(tableFilter);
    Field tableFiltersField = OverrideRepository.class.getDeclaredField("tableFilters");
    tableFiltersField.setAccessible(true);
    List<?> tableFilters = (List<?>) tableFiltersField.get(overrideRepository);
    Assert.assertTrue(tableFilters.isEmpty());
    overrideRepositoryFacade.addTableFilter(tableFilterFacade);
    tableFilters = (List<?>) tableFiltersField.get(overrideRepository);
    Assert.assertSame(tableFilter, tableFilters.get(0));
}
Also used : Field(java.lang.reflect.Field) ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) TableFilter(org.hibernate.cfg.reveng.TableFilter) ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) List(java.util.List) Test(org.junit.Test)

Aggregations

ITableFilter (org.jboss.tools.hibernate.runtime.spi.ITableFilter)85 TableFilter (org.hibernate.cfg.reveng.TableFilter)84 Test (org.junit.Test)84 Field (java.lang.reflect.Field)8 List (java.util.List)8 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)4 CoreException (org.eclipse.core.runtime.CoreException)1 PartInitException (org.eclipse.ui.PartInitException)1 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)1 LazyDatabaseSchema (org.hibernate.eclipse.console.workbench.LazyDatabaseSchema)1 IOverrideRepository (org.jboss.tools.hibernate.runtime.spi.IOverrideRepository)1 IService (org.jboss.tools.hibernate.runtime.spi.IService)1