Author: vyemialyanchyk
Date: 2009-09-04 10:21:08 -0400 (Fri, 04 Sep 2009)
New Revision: 17462
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java
Log:
try to fix junit test on hudson
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java 2009-09-04
14:20:37 UTC (rev 17461)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ExportImageAction.java 2009-09-04
14:21:08 UTC (rev 17462)
@@ -29,6 +29,7 @@
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.widgets.FileDialog;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
@@ -40,6 +41,7 @@
DiagramViewerMessages.ExportImageAction_jpg_format,
DiagramViewerMessages.ExportImageAction_bmp_format };
private FileDialog saveDialog = null;
+ private boolean showErrDialog = true;
public static final ImageDescriptor img =
ImageDescriptor.createFromFile(DiagramViewer.class, "icons/export.png");
//$NON-NLS-1$
@@ -60,6 +62,10 @@
this.saveDialog = saveDialog;
}
+ public void setShowErrDialog(boolean showErrDialog) {
+ this.showErrDialog = showErrDialog;
+ }
+
public void run() {
if (saveDialog == null) {
@@ -91,9 +97,11 @@
outStream.write(imageData);
outStream.flush();
} catch (Exception e) {
- MessageDialog.openInformation(getDiagramViewer().getSite().getShell(),
+ HibernateConsolePlugin.getDefault().logErrorMessage("ExportImageAction", e);
//$NON-NLS-1$
+ if (showErrDialog) {
+ MessageDialog.openInformation(getDiagramViewer().getSite().getShell(),
DiagramViewerMessages.ExportImageAction_error,
DiagramViewerMessages.ExportImageAction_failed_to_export_image + e.getMessage());
- return;
+ }
}
finally {
if (outStream != null) {
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java 2009-09-04
14:20:37 UTC (rev 17461)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/test/ExportImageActionTest.java 2009-09-04
14:21:08 UTC (rev 17462)
@@ -96,6 +96,7 @@
});
final ExportImageAction exportImageAction = new ExportImageAction(editor);
exportImageAction.setSaveDialog(saveDialog);
+ exportImageAction.setShowErrDialog(false);
exportImageAction.run();
// test is the file created
File file = new File(filePath);
Show replies by date