use of org.jboss.tools.hibernate.ui.view.OpenDiagramActionDelegate in project jbosstools-hibernate by jbosstools.
the class CoreMappingTestHelper method testOpenMappingDiagram.
public void testOpenMappingDiagram() {
final Object[] persClasses = getPersistenceClasses(true);
final ConsoleConfiguration consCFG = getConsoleConfig();
for (int i = 0; i < persClasses.length; i++) {
Assert.assertTrue(persClasses[i] instanceof IPersistentClass);
IPersistentClass persClass = (IPersistentClass) persClasses[i];
IEditorPart editor = null;
Throwable ex = null;
try {
editor = new OpenDiagramActionDelegate().openEditor(persClass, consCFG);
} catch (PartInitException e) {
ex = e;
}
if (ex == null) {
ex = Utils.getExceptionIfItOccured(editor);
}
if (ex != null) {
ex.printStackTrace();
String out = NLS.bind(TestConsoleMessages.OpenMappingDiagramTest_mapping_diagram_for_not_opened, new Object[] { persClass.getClassName(), ex.getMessage() });
Assert.fail(out);
}
}
}
use of org.jboss.tools.hibernate.ui.view.OpenDiagramActionDelegate in project jbosstools-hibernate by jbosstools.
the class OpenMappingDiagramTest method testOpenMappingDiagram.
public void testOpenMappingDiagram() {
final Object[] persClasses = getPersistenceClasses(false);
final ConsoleConfiguration consCFG = getConsoleConfig();
for (int i = 0; i < persClasses.length; i++) {
assertTrue(persClasses[i] instanceof IPersistentClass);
IPersistentClass persClass = (IPersistentClass) persClasses[i];
IEditorPart editor = null;
Throwable ex = null;
try {
editor = new OpenDiagramActionDelegate().openEditor(persClass, consCFG);
} catch (PartInitException e) {
ex = e;
}
if (ex == null) {
ex = Utils.getExceptionIfItOccured(editor);
}
if (ex != null) {
ex.printStackTrace();
String out = NLS.bind(ConsoleTestMessages.OpenMappingDiagramTest_mapping_diagram_for_not_opened, new Object[] { persClass.getClassName(), ex.getMessage() });
fail(out);
}
}
}
use of org.jboss.tools.hibernate.ui.view.OpenDiagramActionDelegate in project jbosstools-hibernate by jbosstools.
the class MappingTestHelper method testOpenMappingDiagram.
public void testOpenMappingDiagram() {
final Object[] persClasses = getPersistenceClasses(true);
final ConsoleConfiguration consCFG = getConsoleConfig();
for (int i = 0; i < persClasses.length; i++) {
Assert.assertTrue(persClasses[i] instanceof IPersistentClass);
IPersistentClass persClass = (IPersistentClass) persClasses[i];
IEditorPart editor = null;
Throwable ex = null;
try {
editor = new OpenDiagramActionDelegate().openEditor(persClass, consCFG);
} catch (PartInitException e) {
ex = e;
}
if (ex == null) {
ex = Utils.getExceptionIfItOccured(editor);
}
if (ex != null) {
ex.printStackTrace();
String out = NLS.bind(TestConsoleMessages.OpenMappingDiagramTest_mapping_diagram_for_not_opened, new Object[] { persClass.getClassName(), ex.getMessage() });
Assert.fail(out);
}
}
}
Aggregations