Search in sources :

Example 1 with OpenDiagramActionDelegate

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);
        }
    }
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) IEditorPart(org.eclipse.ui.IEditorPart) OpenDiagramActionDelegate(org.jboss.tools.hibernate.ui.view.OpenDiagramActionDelegate) PartInitException(org.eclipse.ui.PartInitException) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Example 2 with OpenDiagramActionDelegate

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);
        }
    }
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) IEditorPart(org.eclipse.ui.IEditorPart) OpenDiagramActionDelegate(org.jboss.tools.hibernate.ui.view.OpenDiagramActionDelegate) PartInitException(org.eclipse.ui.PartInitException) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Example 3 with OpenDiagramActionDelegate

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);
        }
    }
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) IEditorPart(org.eclipse.ui.IEditorPart) OpenDiagramActionDelegate(org.jboss.tools.hibernate.ui.view.OpenDiagramActionDelegate) PartInitException(org.eclipse.ui.PartInitException) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Aggregations

IEditorPart (org.eclipse.ui.IEditorPart)3 PartInitException (org.eclipse.ui.PartInitException)3 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)3 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)3 OpenDiagramActionDelegate (org.jboss.tools.hibernate.ui.view.OpenDiagramActionDelegate)3