Author: dmaliarevich
Date: 2012-02-15 09:28:43 -0500 (Wed, 15 Feb 2012)
New Revision: 38753
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/TestNPEinHugeFile.java
Removed:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide9827_TestNPEinHugeFile.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
Log:
https://issues.jboss.org/browse/JBIDE-9997 - SWTBotTest was added.
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2012-02-15
14:02:32 UTC (rev 38752)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2012-02-15
14:28:43 UTC (rev 38753)
@@ -81,7 +81,7 @@
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4556Test;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE9445Test_DuplicateSourceMenu;
import org.jboss.tools.vpe.ui.bot.test.jbide.Jbide10020_TestHotKeyForVpeRefresh;
-import org.jboss.tools.vpe.ui.bot.test.jbide.Jbide9827_TestNPEinHugeFile;
+import org.jboss.tools.vpe.ui.bot.test.jbide.TestNPEinHugeFile;
import org.jboss.tools.vpe.ui.bot.test.palette.CancelTagLibDefenitionTest;
import org.jboss.tools.vpe.ui.bot.test.palette.ImportTagsFromTLDFileTest;
import org.jboss.tools.vpe.ui.bot.test.palette.ManagePaletteGroupsTest;
@@ -189,7 +189,7 @@
XhtmlFilePerformanceTest.class,
MarkersTest.class,
JBIDE9445Test_DuplicateSourceMenu.class,
- Jbide9827_TestNPEinHugeFile.class,
+ TestNPEinHugeFile.class,
Jbide10020_TestHotKeyForVpeRefresh.class
})
public class VPEAllBotTests extends SWTBotTestCase{
Deleted:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide9827_TestNPEinHugeFile.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide9827_TestNPEinHugeFile.java 2012-02-15
14:02:32 UTC (rev 38752)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide9827_TestNPEinHugeFile.java 2012-02-15
14:28:43 UTC (rev 38753)
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * 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.bot.test.jbide;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.Writer;
-
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.jboss.tools.ui.bot.ext.Timing;
-import org.jboss.tools.ui.bot.ext.helper.FileHelper;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-
-public class Jbide9827_TestNPEinHugeFile extends VPEAutoTestCase {
-
- private static final String TEST_PAGE_NAME = "employee.xhtml"; //$NON-NLS-1$
-
- public Jbide9827_TestNPEinHugeFile() {
- super();
- }
-
- @Override
- protected void closeUnuseDialogs() { }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- return false;
- }
-
- public void testNPEwhenTypingTagName() {
- /*
- * copy big XHTML page from resources folder
- */
- try {
- String resourceWebContentLocation = getPathToResources("WebContent");
//$NON-NLS-1$
- FileHelper.copyFilesBinaryRecursively(
- new File(resourceWebContentLocation),
- new File(FileHelper.getProjectLocation(
- JBT_TEST_PROJECT_NAME, bot),
- IDELabel.JsfProjectTree.WEB_CONTENT), null);
- } catch (IOException ioe) {
- throw new RuntimeException(
- "Unable to copy necessary files from plugin's resources directory",
//$NON-NLS-1$
- ioe);
- }
- bot.menu(IDELabel.Menu.FILE).menu(IDELabel.Menu.REFRESH).click();
- bot.sleep(Timing.time1S());
- /*
- * open main page
- */
- packageExplorer.openFile(JBT_TEST_PROJECT_NAME,
- IDELabel.JsfProjectTree.WEB_CONTENT, TEST_PAGE_NAME);
- final SWTBotEclipseEditor xhtmlTextEditor =
bot.editorByTitle(TEST_PAGE_NAME).toTextEditor();
- xhtmlTextEditor.typeText(18, 9,
- "veryLongNewTagNameIsTypingAndTypingUntilWeWillGetNPEExceptionWhileRefreshingDOMTree");
//$NON-NLS-1$
- /*
- * Sleep for 20sec, wait for refresh.
- * 10sec could be enough also.
- */
- bot.sleep(Timing.time20S());
- Throwable e = getException();
- if (e != null) {
- /*
- * Show internal stack trace
- */
- Writer result = new StringWriter();
- PrintWriter printWriter = new PrintWriter(result);
- e.printStackTrace(printWriter);
- fail("Internal Error: " + result.toString()); //$NON-NLS-1$
- }
- }
-}
Copied:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/TestNPEinHugeFile.java
(from rev 38738,
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/Jbide9827_TestNPEinHugeFile.java)
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/TestNPEinHugeFile.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/jbide/TestNPEinHugeFile.java 2012-02-15
14:28:43 UTC (rev 38753)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * 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.bot.test.jbide;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.FileHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+public class TestNPEinHugeFile extends VPEAutoTestCase {
+
+ private static final String TEST_PAGE_NAME = "employee.xhtml"; //$NON-NLS-1$
+ private static final String TEXT =
"veryLongNewTagNameIsTypingOrAttributeValueIsTypingUntilWeWillGetNPEExceptionOrEclipseCrashWhileRefreshingDOMTree";
//$NON-NLS-1$
+
+ public TestNPEinHugeFile() {
+ super();
+ }
+
+ @Override
+ protected void closeUnuseDialogs() { }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+
+ public void testNPEinHugeFile_Jbide9827() {
+ openFileAndType(18, 9);
+ }
+
+ public void testCrashInAttribute_Jbide9997() {
+ openFileAndType(18, 27);
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ /*
+ * copy big XHTML page from resources folder
+ */
+ try {
+ String resourceWebContentLocation = getPathToResources("WebContent");
//$NON-NLS-1$
+ FileHelper.copyFilesBinaryRecursively(
+ new File(resourceWebContentLocation),
+ new File(FileHelper.getProjectLocation(
+ JBT_TEST_PROJECT_NAME, bot),
+ IDELabel.JsfProjectTree.WEB_CONTENT), null);
+ } catch (IOException ioe) {
+ throw new RuntimeException(
+ "Unable to copy necessary files from plugin's resources directory",
//$NON-NLS-1$
+ ioe);
+ }
+ bot.menu(IDELabel.Menu.FILE).menu(IDELabel.Menu.REFRESH).click();
+ bot.sleep(Timing.time1S());
+ }
+
+ private void openFileAndType(int line, int col) {
+ /*
+ * File employee.xhtml should already be copied to WebContent,
+ * open it.
+ */
+ packageExplorer.openFile(JBT_TEST_PROJECT_NAME,
+ IDELabel.JsfProjectTree.WEB_CONTENT, TEST_PAGE_NAME);
+ final SWTBotEclipseEditor xhtmlTextEditor =
bot.editorByTitle(TEST_PAGE_NAME).toTextEditor();
+ xhtmlTextEditor.typeText(line, col, TEXT);
+ /*
+ * Sleep for 20sec, wait for refresh.
+ * 10sec could be enough also.
+ */
+ bot.sleep(Timing.time20S());
+ Throwable e = getException();
+ if (e != null) {
+ /*
+ * Show internal stack trace
+ */
+ Writer result = new StringWriter();
+ PrintWriter printWriter = new PrintWriter(result);
+ e.printStackTrace(printWriter);
+ fail("Internal Error: " + result.toString()); //$NON-NLS-1$
+ }
+ /*
+ * Close the editor
+ */
+ xhtmlTextEditor.close();
+ bot.sleep(Timing.time1S());
+ }
+}