Search in sources :

Example 1 with OneParentConfigPropertyTester

use of org.jboss.tools.hibernate.search.property.testers.OneParentConfigPropertyTester in project jbosstools-hibernate by jbosstools.

the class OneParentConfigPropertyTesterTest method testSameConfig.

@Test
public void testSameConfig() {
    ConsoleConfiguration consoleConfiguration = mock(ConsoleConfiguration.class);
    TreePath treePath1 = new TreePath(new Object[] { consoleConfiguration });
    TreePath treePath2 = new TreePath(new Object[] { consoleConfiguration });
    ITreeSelection receiver = new TreeSelection(new TreePath[] { treePath1, treePath2 });
    OneParentConfigPropertyTester propertyTester = new OneParentConfigPropertyTester();
    assertTrue(propertyTester.test(receiver, "doesn't matter", null, null));
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) ITreeSelection(org.eclipse.jface.viewers.ITreeSelection) TreePath(org.eclipse.jface.viewers.TreePath) ITreeSelection(org.eclipse.jface.viewers.ITreeSelection) TreeSelection(org.eclipse.jface.viewers.TreeSelection) OneParentConfigPropertyTester(org.jboss.tools.hibernate.search.property.testers.OneParentConfigPropertyTester) Test(org.junit.Test)

Example 2 with OneParentConfigPropertyTester

use of org.jboss.tools.hibernate.search.property.testers.OneParentConfigPropertyTester in project jbosstools-hibernate by jbosstools.

the class OneParentConfigPropertyTesterTest method testDifferentConfigs.

@Test
public void testDifferentConfigs() {
    ConsoleConfiguration consoleConfiguration1 = mock(ConsoleConfiguration.class);
    ConsoleConfiguration consoleConfiguration2 = mock(ConsoleConfiguration.class);
    TreePath treePath1 = new TreePath(new Object[] { consoleConfiguration1 });
    TreePath treePath2 = new TreePath(new Object[] { consoleConfiguration2 });
    ITreeSelection receiver = new TreeSelection(new TreePath[] { treePath1, treePath2 });
    OneParentConfigPropertyTester propertyTester = new OneParentConfigPropertyTester();
    assertFalse(propertyTester.test(receiver, "doesn't matter", null, null));
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) ITreeSelection(org.eclipse.jface.viewers.ITreeSelection) TreePath(org.eclipse.jface.viewers.TreePath) ITreeSelection(org.eclipse.jface.viewers.ITreeSelection) TreeSelection(org.eclipse.jface.viewers.TreeSelection) OneParentConfigPropertyTester(org.jboss.tools.hibernate.search.property.testers.OneParentConfigPropertyTester) Test(org.junit.Test)

Aggregations

ITreeSelection (org.eclipse.jface.viewers.ITreeSelection)2 TreePath (org.eclipse.jface.viewers.TreePath)2 TreeSelection (org.eclipse.jface.viewers.TreeSelection)2 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)2 OneParentConfigPropertyTester (org.jboss.tools.hibernate.search.property.testers.OneParentConfigPropertyTester)2 Test (org.junit.Test)2