Author: sdzmitrovich
Date: 2009-06-29 02:55:55 -0400 (Mon, 29 Jun 2009)
New Revision: 16240
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.classpath
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.project
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/MANIFEST.MF
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/log4j.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/Activator.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/ComparisonException.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestUtil.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/editor/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.class
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/projectProperties.properties
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/build.properties
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/projectProperties.properties
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/log4j.xml
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/Activator.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/ComparisonException.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestUtil.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/editor/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.java
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.java
Log:
VPE UI tests. Some of this tests are only experimental and can work not fine. It'll be
fixed soon.
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.classpath
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.classpath
(rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.classpath 2009-06-29 06:55:55 UTC
(rev 16240)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry exported="true" kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.project
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.project
(rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.project 2009-06-29 06:55:55 UTC
(rev 16240)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.vpe.ui.auto.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/.settings/org.eclipse.jdt.core.prefs 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,8 @@
+#Fri Jun 12 15:16:42 EEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/MANIFEST.MF
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/MANIFEST.MF
(rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/META-INF/MANIFEST.MF 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,34 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SWTBotTests
+Bundle-SymbolicName: org.jboss.tools.vpe.ui.auto.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.vpe.ui.auto.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.ui.auto.test;bundle-version="1.0.0",
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.spy;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
+ org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.junit4;bundle-version="4.5.0",
+ org.apache.log4j;bundle-version="1.2.13",
+ org.eclipse.core.resources;bundle-version="3.5.0",
+ org.eclipse.ui.ide;bundle-version="3.5.0",
+ org.jboss.tools.vpe;bundle-version="2.1.0",
+ org.jboss.tools.jst.jsp;bundle-version="2.0.0",
+ org.jboss.tools.common.text.ext;bundle-version="2.0.0",
+ org.jboss.tools.jst.web;bundle-version="2.0.0",
+ org.hamcrest;bundle-version="1.1.0",
+ org.mozilla.xpcom;bundle-version="1.8.1",
+ org.jboss.tools.vpe.xulrunner;bundle-version="2.1.0",
+ org.eclipse.jface.text;bundle-version="3.5.0"
+Eclipse-RegisterBuddy: org.apache.log4j
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: junit.framework
+Export-Package: org.jboss.tools.vpe.ui.auto.test,
+ org.jboss.tools.vpe.ui.auto.test.jbide
+
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/log4j.xml
(rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/log4j.xml 2009-06-29 06:55:55
UTC (rev 16240)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender"
class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender"
class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender"
class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/Activator.class
===================================================================
(Binary files differ)
Property changes on:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/ComparisonException.class
===================================================================
(Binary files differ)
Property changes on:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/ComparisonException.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.class
===================================================================
(Binary files differ)
Property changes on:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestUtil.class
===================================================================
(Binary files differ)
Property changes on:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/TestUtil.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.class
===================================================================
(Binary files differ)
Property changes on:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.class
===================================================================
(Binary files differ)
Property changes on:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.class
===================================================================
(Binary files differ)
Property changes on:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/projectProperties.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/projectProperties.properties
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/bin/projectProperties.properties 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,3 @@
+JSFProjectName=JBIDETestProject
+Apachev6.0=D\:/Java/apache-tomcat-6.0.18
+JBossEap4.3=C\:/jbdevstudioRelease/jboss-eap/jboss-as
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/build.properties
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/build.properties
(rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/build.properties 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,5 @@
+source.. = src/,\
+ resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/projectProperties.properties
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/projectProperties.properties
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/resources/projectProperties.properties 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,3 @@
+JSFProjectName=JBIDETestProject
+Apachev6.0=D\:/Java/apache-tomcat-6.0.18
+JBossEap4.3=C\:/jbdevstudioRelease/jboss-eap/jboss-as
\ No newline at end of file
Added: workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/log4j.xml
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/log4j.xml
(rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/log4j.xml 2009-06-29 06:55:55
UTC (rev 16240)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/"
+ debug="false">
+
+ <appender name="consoleAppender"
class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender"
class="org.apache.log4j.FileAppender">
+ <param name="File" value="/tmp/debug.log" />
+ <param name="Append" value="false" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{dd MMM yyyy HH:mm:ss.SSS} - %25t - %-5p - %30c{1} - (%C{1}.java:%L) -
%m%n" />
+ </layout>
+ </appender>
+
+ <appender name="asyncAppender"
class="org.apache.log4j.AsyncAppender">
+ <!-- appender-ref ref="consoleAppender" / -->
+ <appender-ref ref="fileAppender" />
+ </appender>
+
+ <!-- don't log matchers, this is very high amount of chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.matchers">
+ <priority value="OFF" />
+ </category>
+
+ <!--
+ don't log widget notification events, this is moderately high chatter
+ -->
+ <category name="org.eclipse.swtbot.swt.finder.widgets">
+ <priority value="OFF" />
+ </category>
+
+ <!-- don't log finders, this is moderate chatter -->
+ <category name="org.eclipse.swtbot.swt.finder.finders">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot.swt.finder.keyboard">
+ <!-- set to a value higher than debug to turn on. -->
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.eclipse.swtbot">
+ <priority value="ALL" />
+ </category>
+
+ <root>
+ <priority value="INFO" />
+ <appender-ref ref="consoleAppender" />
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/Activator.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/Activator.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/Activator.java 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,50 @@
+package org.jboss.tools.vpe.ui.auto.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.vpe.ui.auto.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/ComparisonException.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/ComparisonException.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/ComparisonException.java 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.auto.test;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class ComparisonException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7127064462771778364L;
+
+ public ComparisonException() {
+ super();
+ }
+
+ public ComparisonException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ComparisonException(String message) {
+ super(message);
+ }
+
+ public ComparisonException(Throwable cause) {
+ super(cause);
+ }
+
+}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestDomUtil.java 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,279 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.auto.test;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.jboss.tools.common.model.util.XMLUtil;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.mozilla.interfaces.nsIDOMAttr;
+import org.mozilla.interfaces.nsIDOMNamedNodeMap;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class TestDomUtil {
+ /**
+ * Attributes names that will be skipped in attribute comparison.
+ */
+ public static final Set<String> skippedAtributes = new HashSet<String>();
+ static {
+ // Add here all attributes names to be skipped (IN UPPER CASE!)
+ skippedAtributes.addAll(Arrays.asList("DIR"));//$NON-NLS-1$
+ }
+
+ final public static String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
+
+ final public static String ILLEGAL_ATTRIBUTES = "illegalAttributes";
//$NON-NLS-1$
+
+ final public static String ILLEGAL_ATTRIBUTES_SEPARATOR = Constants.COMMA;
+
+ final public static String START_REGEX = "/"; //$NON-NLS-1$
+
+ final public static String END_REGEX = "/"; //$NON-NLS-1$
+
+ public static Document getDocument(File file) throws FileNotFoundException {
+ // create reader
+ FileReader reader = new FileReader(file);
+
+ // return document
+ return XMLUtil.getDocument(reader);
+ }
+
+ public static Document getDocument(String content)
+ throws FileNotFoundException {
+ // create reader
+ StringReader reader = new StringReader(content);
+
+ // return document
+ return XMLUtil.getDocument(reader);
+ }
+
+ /**
+ *
+ * @param document
+ * @param elementId
+ * @return
+ */
+ public static Element getElemenById(Document document, String elementId) {
+
+ Element element = document.getDocumentElement();
+
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if ((child.getNodeType() == Node.ELEMENT_NODE)
+ && elementId.equals(((Element) child)
+ .getAttribute(ID_ATTRIBUTE)))
+ return (Element) child;
+
+ }
+
+ return null;
+
+ }
+
+ /**
+ *
+ * @param element
+ * @return
+ */
+ public static Element getFirstChildElement(Element element) {
+
+ if (element != null) {
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ return (Element) child;
+
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ *
+ * @param vpeNode
+ * @param schemeNode
+ * @return
+ * @throws ComparisonException
+ */
+ public static void compareNodes(nsIDOMNode vpeNode, Node modelNode)
+ throws ComparisonException {
+
+ if (!modelNode.getNodeName().equalsIgnoreCase(vpeNode.getNodeName())) {
+ throw new ComparisonException("name of tag is \"" //$NON-NLS-1$
+ + vpeNode.getNodeName() + "\"but must be \"" //$NON-NLS-1$
+ + modelNode.getNodeName() + "\""); //$NON-NLS-1$
+ }
+ if ((modelNode.getNodeValue() != null)
+ && (!modelNode.getNodeValue().trim().equalsIgnoreCase(
+ vpeNode.getNodeValue().trim()))) {
+ throw new ComparisonException("value of " + vpeNode.getNodeName()
//$NON-NLS-1$
+ + " is \"" + vpeNode.getNodeValue().trim() //$NON-NLS-1$
+ + "\" but must be \"" + modelNode.getNodeValue().trim()
//$NON-NLS-1$
+ + "\""); //$NON-NLS-1$
+ }
+ // compare node's attributes
+ if (modelNode.getNodeType() == Node.ELEMENT_NODE) {
+
+ compareAttributes(modelNode.getAttributes(), vpeNode
+ .getAttributes());
+ }
+
+ // compare children
+ nsIDOMNodeList vpeChildren = vpeNode.getChildNodes();
+ NodeList schemeChildren = modelNode.getChildNodes();
+ int realCount = 0;
+ for (int i = 0; i < schemeChildren.getLength(); i++) {
+
+ Node schemeChild = schemeChildren.item(i);
+
+ // leave out empty text nodes in test dom model
+ if ((schemeChild.getNodeType() == Node.TEXT_NODE)
+ && ((schemeChild.getNodeValue() == null) || (schemeChild
+ .getNodeValue().trim().length() == 0)))
+ continue;
+
+ nsIDOMNode vpeChild = vpeChildren.item(realCount++);
+
+ if (null == vpeChild) {
+ throw new ComparisonException(
+ "Child of node \"" //$NON-NLS-1$
+ + vpeNode.getNodeName()
+ + "\" is \"null\", but should be \"" +
schemeChild.getNodeName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // leave out empty text nodes in vpe dom model
+ while (((vpeChild.getNodeType() == Node.TEXT_NODE) && ((vpeChild
+ .getNodeValue() == null) || (vpeChild.getNodeValue().trim()
+ .length() == 0)))) {
+ vpeChild = vpeChildren.item(realCount++);
+ if (null == vpeChild) {
+ throw new ComparisonException(
+ "Child of node \"" //$NON-NLS-1$
+ + vpeNode.getNodeName()
+ + "\" is \"null\", but should be \"" +
schemeChild.getNodeName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ compareNodes(vpeChild, schemeChild);
+
+ }
+
+ }
+
+ /**
+ * get ids of tests
+ *
+ * @param testDocument
+ * @return
+ */
+ public static List<String> getTestIds(Document testDocument) {
+ Element rootElement = testDocument.getDocumentElement();
+ List<String> ids = new ArrayList<String>();
+ NodeList children = rootElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ ids.add(((Element) child).getAttribute(ID_ATTRIBUTE));
+
+ }
+ return ids;
+ }
+
+ private static void compareAttributes(NamedNodeMap modelAttributes,
+ nsIDOMNamedNodeMap vpeAttributes) throws ComparisonException {
+
+ for (int i = 0; i < modelAttributes.getLength(); i++) {
+ Attr modelAttr = (Attr) modelAttributes.item(i);
+ String name = modelAttr.getName();
+
+ // if the attribute has to be skipped, then do it
+ if ( name != null
+ && skippedAtributes.contains(name.toUpperCase()) ) {
+ continue;
+ }
+
+ // if there are limitation of attributes
+ if (ILLEGAL_ATTRIBUTES.equals(name)) {
+
+ String[] illegalAttributes = modelAttr.getNodeValue().split(
+ ILLEGAL_ATTRIBUTES_SEPARATOR);
+
+ for (String illegalAttributeName : illegalAttributes) {
+ if (vpeAttributes.getNamedItem(illegalAttributeName.trim()) != null)
+ throw new ComparisonException("illegal attribute :" //$NON-NLS-1$
+ + illegalAttributeName);
+ }
+
+ } else {
+
+
+ if (vpeAttributes.getNamedItem(
+ name) == null)
+ throw new ComparisonException("there is not : \"" + name
//$NON-NLS-1$
+ + "\" attribute"); //$NON-NLS-1$
+
+ nsIDOMAttr vpeAttr = (nsIDOMAttr) vpeAttributes.getNamedItem(
+ name).queryInterface(nsIDOMAttr.NS_IDOMATTR_IID);
+
+ compareComplexStrings(modelAttr.getNodeValue().trim(),
+ vpeAttr.getNodeValue().trim());
+
+ }
+ }
+ }
+
+ static private void compareComplexStrings(String modelString,
+ String vpeString) throws ComparisonException {
+
+ if (modelString.startsWith(START_REGEX)
+ && modelString.endsWith(END_REGEX)) {
+
+ String regex = modelString.substring(START_REGEX.length(),
+ modelString.length() - END_REGEX.length());
+
+ Matcher matcher = Pattern.compile(regex).matcher(vpeString);
+ if (!matcher.find()) {
+ throw new ComparisonException("string is\"" + vpeString //$NON-NLS-1$
+ + "\" but pattern is \"" + regex + "\"");
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ } else if (!modelString.equals(vpeString)) {
+ throw new ComparisonException("string is\"" + vpeString //$NON-NLS-1$
+ + "\" but must be \"" + modelString + "\"");
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ }
+
+}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestUtil.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestUtil.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/TestUtil.java 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.auto.test;
+
+import junit.framework.Assert;
+import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.VpeEditorPart;
+
+/**
+ * Class for importing project from jar file.
+ *
+ * @author sdzmitrovich
+ */
+public class TestUtil {
+
+ /**
+ * Gets visual page editor controller.
+ *
+ * @param part the part
+ *
+ * @return {@link VpeController}
+ */
+ public static VpeController getVpeController(JSPMultiPageEditor part) {
+
+ VpeEditorPart visualEditor = (VpeEditorPart) part.getVisualEditor();
+ while(visualEditor.getController()==null) {
+ if (!Display.getCurrent().readAndDispatch()) {
+ Display.getCurrent().sleep();
+ }
+ }
+ return visualEditor.getController();
+ }
+
+ /**
+ * Fail.
+ *
+ * @param t the t
+ */
+ public static void fail(Throwable t){
+ Assert.fail("Test case was fail "+t.getMessage()+":"+t);
+ }
+}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/VPEAutoTestCase.java 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,176 @@
+package org.jboss.tools.vpe.ui.auto.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Properties;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.ui.auto.test.JBTSWTBotTestCase;
+import org.jboss.tools.ui.auto.test.SWTBotMultiPageEditor;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public abstract class VPEAutoTestCase extends JBTSWTBotTestCase{
+
+ protected static Properties projectProperties;
+ public static String PROJECT_PROPERTIES = "projectProperties.properties";
+ public static String JBOSS_EAP_HOME;
+ static {
+ try {
+ InputStream is =
Platform.getBundle(Activator.PLUGIN_ID).getResource(PROJECT_PROPERTIES).openStream();
+ projectProperties = new Properties();
+ projectProperties.load(is);
+ } catch (IOException e) {
+ fail("Can't load properties from " + PROJECT_PROPERTIES + "
file");
+ } catch (IllegalStateException e) {
+ fail("Property file " + PROJECT_PROPERTIES + " was not found");
+ }
+ JBOSS_EAP_HOME =
System.getProperty("jbosstools.test.jboss.home.eap",projectProperties.getProperty("JBossEap4.3"));
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.getTreeItem(projectProperties.getProperty("JSFProjectName"));
+ } catch (WidgetNotFoundException e) {
+ createJSFProject(projectProperties.getProperty("JSFProjectName"));
+ }
+ }
+
+ protected void createJSFProject(String jsfProjectName){
+ bot.menu("File").menu("New").menu("Other...").click();
+ bot.tree().expandNode("JBoss Tools
Web").expandNode("JSF").select("JSF Project");
+ bot.button("Next >").click();
+ bot.textWithLabel("Project Name*").setText(jsfProjectName);
+ bot.comboBoxWithLabel("Template*").setSelection("JSFKickStartWithoutLibs");
+ bot.button("Next >").click();
+ try {
+ bot.comboBoxWithLabel("Runtime*").setSelection("jboss-eap
Runtime");
+ delay();
+ bot.button("Finish").click();
+ try {
+ bot.button("Yes").click();
+ openErrorLog();
+ openPackageExplorer();
+ openProgressStatus();
+ } catch (Exception e) {
+ }
+ } catch (Exception e) {
+ bot.button(0).click();
+ SWTBotTree tree = bot.tree();
+ tree.expandNode("JBoss Enterprise Middleware").select("JBoss Enterprise
Application Platform 4.3 Runtime");
+ bot.button("Next >").click();
+ bot.textWithLabel("Home Directory").setText(JBOSS_EAP_HOME);
+ bot.button("Finish").click();
+ delay();
+ bot.button("Finish").click();
+ try {
+ bot.button("Yes").click();
+ openErrorLog();
+ openPackageExplorer();
+ openProgressStatus();
+ } catch (Exception e2) {
+ }
+ }
+
+ }
+
+ protected void performContentTest(String expectedVPEContent, SWTBotMultiPageEditor
editor) throws Throwable{
+
+ JSPMultiPageEditor multiPageEditor = editor.getJSPMultiPageEditor();
+ assertNotNull(multiPageEditor);
+
+ VpeController controller = TestUtil.getVpeController(multiPageEditor);
+
+ String expectedVPEContentFilePath = getPathToResources()+expectedVPEContent;
+ expectedVPEContentFilePath = expectedVPEContentFilePath.substring(16);
+
+ File xmlTestFile = new File (expectedVPEContentFilePath);
+
+ Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
+ assertNotNull("Can't get test file, possibly file not exists
"+xmlTestFile,xmlTestDocument); //$NON-NLS-1$
+
+ List<String> ids = TestDomUtil.getTestIds(xmlTestDocument);
+
+ for (String id : ids) {
+
+ compareElements(controller, xmlTestDocument, id, id);
+ }
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ private void compareElements(VpeController controller,
+ Document xmlTestDocument, String elementId, String xmlTestId)
+ throws ComparisonException {
+
+ // get element by id
+ nsIDOMElement vpeElement = findElementById(controller, elementId);
+ assertNotNull("Cann't find element with id="+elementId,vpeElement);
//$NON-NLS-1$
+
+ // get test element by id - get <test id="..." > element and get his
+ // first child
+ Element xmlModelElement = TestDomUtil.getFirstChildElement(TestDomUtil
+ .getElemenById(xmlTestDocument, xmlTestId));
+
+ assertNotNull(xmlModelElement);
+
+ // compare DOMs
+ try {
+ TestDomUtil.compareNodes(vpeElement, xmlModelElement);
+ } catch (ComparisonException e) {
+ fail(e.getMessage());
+ }
+
+ }
+
+ private nsIDOMElement findElementById(VpeController controller,
+ String elementId) {
+
+ Element sourceElement = findSourceElementById(controller, elementId);
+
+ VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(
+ sourceElement);
+
+ if (nodeMapping == null)
+ return null;
+
+ return (nsIDOMElement) nodeMapping.getVisualNode();
+ }
+
+ private Element findSourceElementById(VpeController controller,
+ String elementId) {
+
+ return getSourceDocument(controller).getElementById(elementId);
+ }
+
+ private Document getSourceDocument(VpeController controller) {
+ return controller.getSourceBuilder().getSourceDocument();
+ }
+
+ protected String getPathToResources() {
+ return Platform.getBundle(Activator.PLUGIN_ID).getLocation()+"resources/";
+ }
+
+ @Override
+ protected void activePerspective() {
+ if (!bot.perspectiveByLabel("Web Development").isActive()) {
+ bot.perspectiveByLabel("Web Development").activate();
+ }
+ }
+
+}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE3197Test.java 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,34 @@
+package org.jboss.tools.vpe.ui.auto.test.jbide;
+
+import java.util.List;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+import org.jboss.tools.vpe.ui.auto.test.VPEAutoTestCase;
+
+public class JBIDE3197Test extends VPEAutoTestCase {
+
+ public void testOpenPage(){
+
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ List<? extends SWTBotEditor> editors = bot.editors();
+ for (int i = 0; i < editors.size(); i++) {
+ editors.get(i).close();
+ }
+
+ } catch (Exception e) {
+ }
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("inputUserName.jsp").doubleClick();
+ } catch (Exception e) {
+ }
+
+
+ }
+
+}
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.java
(rev 0)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.auto.test/src/org/jboss/tools/vpe/ui/auto/test/jbide/JBIDE4306Test.java 2009-06-29
06:55:55 UTC (rev 16240)
@@ -0,0 +1,53 @@
+package org.jboss.tools.vpe.ui.auto.test.jbide;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.auto.test.WidgetVariables;
+import org.jboss.tools.vpe.ui.auto.test.VPEAutoTestCase;
+
+public class JBIDE4306Test extends VPEAutoTestCase{
+
+ public void testOpenPageOnVisualSourceTab(){
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("inputUserName.jsp").doubleClick();
+ } catch (Exception e) {
+ }
+ }
+
+ public void testSetDefaultTabSource(){
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ bot.comboBoxWithLabel("Default Editor
Tab:").setSelection("Source");
+ bot.button("OK").click();
+ try {
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode("hello.jsp").doubleClick();
+ } catch (Exception e) {
+ }
+ WidgetNotFoundException exception = null;
+ try {
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ } catch (WidgetNotFoundException e) {
+ exception = e;
+ }
+ assertNotNull(exception);
+ bot.editorByTitle("hello.jsp").close();
+ }
+
+ public void testSetDefaultTabVisualSource(){
+ bot.editorByTitle("inputUserName.jsp").setFocus();
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ bot.comboBoxWithLabel("Default Editor
Tab:").setSelection("Visual/Source");
+ bot.button("OK").click();
+ bot.editorByTitle("inputUserName.jsp").close();
+ }
+
+}