Author: dmaliarevich
Date: 2009-12-23 10:54:11 -0500 (Wed, 23 Dec 2009)
New Revision: 19559
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeEditAnyDialogTest.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5470, JUnit test for VpeEditAnyDialog was added,
not finished yet.
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2009-12-23
15:19:18 UTC (rev 19558)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2009-12-23
15:54:11 UTC (rev 19559)
@@ -15,6 +15,7 @@
import org.jboss.tools.tests.ImportBean;
import org.jboss.tools.vpe.editor.menu.VpePopupMenuTest;
+import org.jboss.tools.vpe.ui.test.dialog.VpeEditAnyDialogTest;
import org.jboss.tools.vpe.ui.test.dialog.VpeResourcesDialogTest;
import org.jboss.tools.vpe.ui.test.editor.CustomSashFormTest;
import org.jboss.tools.vpe.ui.test.preferences.VpeEditorPreferencesPageTest;
@@ -34,6 +35,7 @@
suite.addTestSuite(VpeEditorPreferencesPageTest.class);
suite.addTestSuite(CustomSashFormTest.class);
suite.addTestSuite(VpePopupMenuTest.class);
+ suite.addTestSuite(VpeEditAnyDialogTest.class);
/*
* Add projects that will be used in junit tests.
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeEditAnyDialogTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeEditAnyDialogTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeEditAnyDialogTest.java 2009-12-23
15:54:11 UTC (rev 19559)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test.dialog;
+
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.vpe.editor.template.VpeAnyData;
+import org.jboss.tools.vpe.editor.template.VpeEditAnyDialog;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+public class VpeEditAnyDialogTest extends VpeTest {
+
+ public VpeEditAnyDialogTest(String name) {
+ super(name);
+ }
+
+ public void testVpeEditAnyDialogOpen() throws Throwable {
+ /*
+ * Create empty data
+ */
+ VpeAnyData data = new VpeAnyData(Constants.EMPTY, Constants.EMPTY, Constants.EMPTY);
+ VpeEditAnyDialog dialog = new VpeEditAnyDialog(PlatformUI
+ .getWorkbench().getDisplay().getActiveShell(), data);
+ dialog.setBlockOnOpen(false);
+ int code = dialog.open();
+ /*
+ * Assert that window has been created.
+ */
+ assertEquals(0, code);
+
+ dialog.close();
+
+ /*
+ * Check that the dialog's fields are empty.
+ */
+
+ /*
+ * Check the dialog with filled in data.
+ * Dialog should display all the fields correctly.
+ */
+
+ /*
+ * Test the editing in the dialog if possible.
+ */
+
+ /*
+ * Test dialog validation.
+ */
+
+ }
+
+}