Author: vyemialyanchyk
Date: 2009-04-10 06:55:27 -0400 (Fri, 10 Apr 2009)
New Revision: 14663
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.veditor.test/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/test/ExportImageActionTest.java
Log:
JBIDE-4148
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.veditor.test/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/test/ExportImageActionTest.java
===================================================================
---
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.veditor.test/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/test/ExportImageActionTest.java 2009-04-10
10:42:44 UTC (rev 14662)
+++
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.veditor.test/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/test/ExportImageActionTest.java 2009-04-10
10:55:27 UTC (rev 14663)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.veditor.editors.actions.test;
+import java.io.File;
+
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.SWTGraphics;
import org.eclipse.draw2d.geometry.Rectangle;
@@ -51,6 +53,7 @@
final Control control = context.mock(Control.class);;
final Display display = context.mock(Display.class);;
final Rectangle rectangle = new Rectangle(0, 0, 20, 10);
+ final String filePath = "test.jpg"; //$NON-NLS-1$
context.checking(new Expectations() {
{
@@ -58,7 +61,7 @@
allowing(saveDialog).setFilterNames(ExportImageAction.dialogFilterNames);
oneOf(saveDialog).open();
- will(returnValue("test.jpg")); //$NON-NLS-1$
+ will(returnValue(filePath));
allowing(editor).getEditPartViewer();
will(returnValue(graphicalViewer));
@@ -92,6 +95,12 @@
final ExportImageAction exportImageAction = new ExportImageAction(editor);
exportImageAction.setSaveDialog(saveDialog);
exportImageAction.run();
+ // test is the file created
+ File file = new File(filePath);
+ assertTrue(file.exists() && file.isFile());
+ //
+ boolean res = file.delete();
+ assertTrue(res);
// GENERAL TEST:
// check for all expectations
context.assertIsSatisfied();
Show replies by date