Author: dgolovin
Date: 2009-10-06 06:25:33 -0400 (Tue, 06 Oct 2009)
New Revision: 17911
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.classpath
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.project
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.settings/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/META-INF/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/SWTBot.properties
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/log4j.xml
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/test/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/test/TestProperties.class
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/Activator.class
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.class
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor$1.class
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.class
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTJBTBot.class
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/WidgetVariables.class
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/build.properties
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/log4j.xml
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/Activator.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.classpath
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.project
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.settings/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.settings/org.eclipse.jdt.core.prefs
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/META-INF/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/Activator.class
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.class
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/Messages.class
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/messages.properties
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/preferences/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/preferences/JBossRuntimePreferencesInitializer.class
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/runtimePaths.properties
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/build.properties
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.properties
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.xml
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/resources/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/resources/runtimePaths.properties
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Activator.java
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/preferences/
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/preferences/JBossRuntimePreferencesInitializer.java
Log:
share jst swtbot tests version from workspace into trunk with fixes to make it runnable
from tests builder
Added: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.classpath
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.classpath 2009-10-06 10:25:33 UTC
(rev 17911)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.project (rev
0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.project 2009-10-06 10:25:33 UTC (rev
17911)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jst.ui.bot.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>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.settings/org.eclipse.jdt.core.prefs 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,8 @@
+#Tue Jun 16 17:54:08 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
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/META-INF/MANIFEST.MF 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test
+Bundle-SymbolicName: org.jboss.tools.jst.ui.bot.test;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.ui.bot.test.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ 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.swt.finder;bundle-version="2.0.0",
+ org.apache.log4j;bundle-version="1.2.13",
+ org.hamcrest;bundle-version="1.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.eclipse.ui,
+ org.eclipse.ui.ide;bundle-version="3.5.0",
+ org.junit;bundle-version="3.8.2"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.jboss.tools.test,
+ org.jboss.tools.ui.bot.test
Property changes on: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/SWTBot.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/SWTBot.properties
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/SWTBot.properties 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,2 @@
+#SWTBotPreferences.PLAYBACK_DELAY=25
+#SWTBotPreferences.TIMEOUT=1
Added: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/log4j.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/log4j.xml
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/log4j.xml 2009-10-06 10:25:33 UTC
(rev 17911)
@@ -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:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/test/TestProperties.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/test/TestProperties.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/Activator.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor$1.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTJBTBot.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/SWTJBTBot.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/WidgetVariables.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/bin/org/jboss/tools/ui/bot/test/WidgetVariables.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/build.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/build.properties
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/build.properties 2009-10-06 10:25:33
UTC (rev 17911)
@@ -0,0 +1,5 @@
+source.. = src/,resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,2 @@
+#SWTBotPreferences.PLAYBACK_DELAY=25
+#SWTBotPreferences.TIMEOUT=1
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/resources/SWTBot.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/log4j.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/log4j.xml
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/log4j.xml 2009-10-06 10:25:33 UTC
(rev 17911)
@@ -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
Property changes on: trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/log4j.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,46 @@
+package org.jboss.tools.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Enumeration;
+import java.util.Properties;
+
+public class TestProperties extends Properties {
+
+ public TestProperties() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+
+ public TestProperties(Properties defaults) {
+ super(defaults);
+ // TODO Auto-generated constructor stub
+ }
+
+
+ @Override
+ public synchronized void load(InputStream inStream) throws IOException {
+ // TODO Auto-generated method stub
+ super.load(inStream);
+ substituteSystemProperties(this);
+ }
+
+
+ public static void substituteSystemProperties(Properties projectProperties2) {
+ for (Object opject : projectProperties2.keySet()) {
+ String propertyValue = projectProperties2.get(opject).toString();
+ if(propertyValue.matches("\\$\\{.*")) {
+ Enumeration<?> names = System.getProperties().propertyNames();
+
+ while(names.hasMoreElements()) {
+ String substitute = names.nextElement().toString();
+ String regexp = "\\$\\{" + substitute + "}";
+ if(propertyValue.matches(regexp)) {
+ projectProperties2.put(opject, propertyValue.replaceAll(regexp,
System.getProperty(substitute)));
+ }
+ }
+ }
+ }
+ }
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/test/TestProperties.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/Activator.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/Activator.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/Activator.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,55 @@
+package org.jboss.tools.ui.bot.test;
+
+import org.eclipse.core.runtime.ILog;
+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.ui.bot.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;
+ }
+
+ public static ILog getPluginLog() {
+ return plugin.getLog();
+ }
+
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/Activator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,258 @@
+package org.jboss.tools.ui.bot.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+
+public abstract class JBTSWTBotTestCase extends SWTBotTestCase implements
+ ILogListener{
+
+ protected static final String BUILDING_WS = "Building workspace";
+ protected static final String VISUAL_UPDATE = "Visual Editor View Update";
+ protected static final String VISUAL_REFRESH = "Visual Editor Refresh";
+ private volatile Throwable exception;
+ public static final String PATH_TO_SWT_BOT_PROPERTIES = "SWTBot.properties";
+ private static Properties SWT_BOT_PROPERTIES;
+ protected SWTJBTBot bot = new SWTJBTBot();
+ private int sleepTime = 5000;
+
+ /* (non-Javadoc)
+ * This static block read properties from
+ * org.jboss.tools.ui.bot.test/resources/SWTBot.properties file
+ * and set up parameters for SWTBot tests. You may change a number of parameters
+ * in static block and their values in property file.
+ */
+
+ static {
+// try {
+// InputStream swtPreferenceIS =
Platform.getBundle(Activator.PLUGIN_ID).getResource(PATH_TO_SWT_BOT_PROPERTIES)
+// .openStream();
+// SWT_BOT_PROPERTIES = new Properties();
+// SWT_BOT_PROPERTIES.load(swtPreferenceIS);
+// SWTBotPreferences.PLAYBACK_DELAY = Long
+// .parseLong(SWT_BOT_PROPERTIES
+// .getProperty("SWTBotPreferences.PLAYBACK_DELAY"));
+// SWTBotPreferences.TIMEOUT = Long.parseLong(SWT_BOT_PROPERTIES
+// .getProperty("SWTBotPreferences.TIMEOUT"));
+// swtPreferenceIS.close();
+// } catch (IOException e) {
+// fail("Can't load properties from " + PATH_TO_SWT_BOT_PROPERTIES +
" file");
+// } catch (IllegalStateException e) {
+// fail("Property file " + PATH_TO_SWT_BOT_PROPERTIES + " was not
found");
+// }
+ }
+
+ public void logging(IStatus status, String plugin) {
+ switch (status.getSeverity()) {
+ case IStatus.ERROR:
+ Throwable throwable = status.getException();
+ if (throwable == null) {
+ throwable = new Throwable(status.getMessage() + " in "
+ + status.getPlugin());
+ }
+ setException(throwable);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * Getter method for exception that may be thrown during test
+ * execution.<p>
+ * You can call this method from any place of your methods
+ * and verify if any exception was thrown during test executing
+ * including Error Log.
+ * @return exception
+ * @see Throwable
+ */
+
+ protected synchronized Throwable getException() {
+ return exception;
+ }
+
+ /**
+ * Setter method for exception.
+ * If param is not null test will fail and you will see stack trace in JUnit Error Log
+ * @param e - exception, that can be frown during test executing
+ * @see Throwable
+ */
+
+ protected synchronized void setException(Throwable e) {
+ this.exception = e;
+ }
+
+ /**
+ * Delete .log file from junit-workspace .metadata, if it hadn't been deleted
before<p>
+ * So we can catch exceptions and errors, which were thrown during current test.
+ */
+
+ private void deleteLog() {
+ try {
+ Platform.getLogFileLocation().toFile().delete();
+ } catch (Exception e) {
+ }
+ }
+
+ /**
+ * Make a default preconditions before test launch
+ * @see #activePerspective()
+ * @see #openErrorLog()
+ * @see #openPackageExplorer()
+ * @see #setException(Throwable)
+ * @see #deleteLog()
+ * @see #delay()
+ */
+
+ @Override
+ protected void setUp() throws Exception {
+ activePerspective();
+ try {
+ bot.viewByTitle(WidgetVariables.WELCOME).close();
+ } catch (WidgetNotFoundException e) {
+ }
+ openErrorLog();
+ openPackageExplorer();
+// openProgressStatus();
+ deleteLog();
+ setException(null);
+ Platform.addLogListener(this);
+// delay();
+ }
+
+ /**
+ * Tears down the fixture. Verify Error Log.
+ * @see #getException()
+ */
+
+ @Override
+ protected void tearDown() throws Exception {
+ Platform.removeLogListener(this);
+ deleteLog();
+ if (getException() != null) {
+ throw new Exception(getException());
+ }
+ }
+
+ /**
+ * A little delay between test's steps. Use it where necessary.
+ */
+
+ protected void delay() {
+ bot.sleep(sleepTime);
+ }
+
+ /** Defines which kind of perspective should be activated before tests' run.
+ */
+
+ abstract protected void activePerspective ();
+
+ /**
+ * Open and activate Error Log view if it hadn't been opened before
+ */
+
+ protected void openErrorLog() {
+ try {
+ bot.viewByTitle(WidgetVariables.ERROR_LOG);
+ } catch (WidgetNotFoundException e) {
+ bot.menu("Window").menu("Show
View").menu("Other...").click();
+ SWTBotTree viewTree = bot.tree();
+ viewTree.expandNode("General")
+ .expandNode(WidgetVariables.ERROR_LOG).select();
+ bot.button("OK").click();
+ }
+ }
+
+ /**
+ * Open and activate Package Explorer view if it hadn't been opened before
+ */
+
+ protected void openPackageExplorer() {
+ try {
+ bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).setFocus();
+ } catch (WidgetNotFoundException e) {
+ bot.menu("Window").menu("Show
View").menu("Other...").click();
+ SWTBotTree viewTree = bot.tree();
+ viewTree.expandNode("Java").expandNode(
+ WidgetVariables.PACKAGE_EXPLORER).select();
+ bot.button("OK").click();
+ }
+ }
+
+// protected void openProgressStatus() {
+// try {
+// bot.viewByTitle(WidgetVariables.PROGRESS_STATUS);
+// } catch (WidgetNotFoundException e) {
+// bot.menu("Window").menu("Show
View").menu("Other...").click();
+// SWTBotTree viewTree = bot.tree();
+// delay();
+// viewTree.expandNode("General").expandNode(WidgetVariables.PROGRESS_STATUS).select();
+// bot.button("OK").click();
+// }
+// }
+
+ /**
+ * Use delay() method instead
+ * @see #delay()
+ */
+ @Deprecated
+ protected final void waitForJobs(){
+ delay();
+ }
+
+ protected final void waitForBlockingJobsAcomplished(long timeOut, String... jobNames)
throws InterruptedException{
+ if (jobNames == null) {
+ delay();
+ } else {
+ boolean isProcessStarted = false;
+ long startTime = System.currentTimeMillis();
+ while (!isProcessStarted) {
+ Job[] jobs = Job.getJobManager().find(null);
+ for (Job job : jobs) {
+ for (String jobName : jobNames) {
+ if (jobName.equalsIgnoreCase(job.getName())) {
+ isProcessStarted = true;
+ }
+ }
+ }
+ long endTime = System.currentTimeMillis();
+ if (endTime-startTime>timeOut) {
+ throw new InterruptedException(stringArrayToString(jobNames) + "job(s) has
never appeared or already completed");
+ }
+ }
+ while (isProcessStarted) {
+ isProcessStarted = false;
+ Job[] jobs = Job.getJobManager().find(null);
+ for (Job job : jobs) {
+ for (String jobName : jobNames) {
+ if (jobName.equalsIgnoreCase(job.getName())) {
+ delay();
+ isProcessStarted = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ protected final void waitForBlockingJobsAcomplished(String... jobNames) throws
InterruptedException{
+ waitForBlockingJobsAcomplished(5*1000L, jobNames);
+ }
+
+ private String stringArrayToString (String... strings){
+ StringBuffer buffer = new StringBuffer("");
+ for (String string : strings) {
+ buffer.append(string+", ");
+ }
+ return buffer.toString();
+ }
+
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,103 @@
+package org.jboss.tools.ui.bot.test;
+
+import java.lang.reflect.Field;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.ui.IEditorReference;
+import org.hamcrest.SelfDescribing;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart;
+
+/**
+ * This represents Eclipse JSPMultiPageEditor part
+ * @author yzhishko
+ *
+ */
+
+public class SWTBotJSPMultiPageEditor extends SWTBotEditor{
+
+ /**
+ * Constructs an instance for the given editorReference.
+ * @param editorReference - the part reference.
+ * @param bot - the helper bot.
+ * @param description - the description of the editor part.
+ */
+
+ private JSPMultiPageEditor jspMultiPageEditor;
+ private SWTWorkbenchBot bot;
+
+
+ public SWTBotJSPMultiPageEditor(IEditorReference editorReference,
+ SWTWorkbenchBot bot, SelfDescribing description) {
+ super(editorReference, bot, description);
+ this.bot = bot;
+ if (partReference.getPart(true) instanceof JSPMultiPageEditor) {
+ jspMultiPageEditor = (JSPMultiPageEditor)partReference.getPart(true);
+ }
+ }
+
+ /**
+ * Constructs an instance for the given editorReference.
+ * @param editorReference - the editor reference
+ * @param bot - the instance of {@link SWTWorkbenchBot} which will be used to drive
operations on behalf of this object.
+ */
+
+ public SWTBotJSPMultiPageEditor(IEditorReference editorReference,
+ SWTWorkbenchBot bot) {
+ super(editorReference, bot);
+ this.bot = bot;
+ if (partReference.getPart(true) instanceof JSPMultiPageEditor) {
+ jspMultiPageEditor = (JSPMultiPageEditor)partReference.getPart(true);
+ }
+ }
+
+
+ /**
+ *
+ * @return <b>null</b> if current MultiPageEditor isn't instance of
{@link JSPMultiPageEditor}, <i>else</i> <p>
+ * An object that has {@link JSPMultiPageEditor} reference type
+ * @see JSPMultiPageEditor
+ */
+
+ public JSPMultiPageEditor getJspMultiPageEditor() {
+ return jspMultiPageEditor;
+ }
+
+ public void selectTab(final String tabLabel) throws WidgetNotFoundException{
+ bot.getDisplay().syncExec(new Runnable() {
+
+ public void run() {
+ Class<? extends JSPMultiPageEditorPart> cls = JSPMultiPageEditorPart.class;
+ try {
+ Field field = cls.getDeclaredField("container");
+ field.setAccessible(true);
+ CTabFolder tabFolder = (CTabFolder) field.get(jspMultiPageEditor);
+ CTabItem[] tabItems = tabFolder.getItems();
+ int pageIndex = 0;
+ boolean isHasItem = false;
+ for (int i = 0; i < tabItems.length; i++) {
+ if (tabLabel.equals(tabItems[i].getText())) {
+ pageIndex = i;
+ isHasItem = true;
+ }
+ }
+ if (!isHasItem) {
+ throw new WidgetNotFoundException("Can't find a tab item with "+
tabLabel + " label");
+ }
+ tabFolder.setSelection(tabItems[pageIndex]);
+ jspMultiPageEditor.pageChange(pageIndex);
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ }
+ catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ });
+ }
+
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTBotJSPMultiPageEditor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,61 @@
+package org.jboss.tools.ui.bot.test;
+
+import static
org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartId;
+import static
org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
+import static org.eclipse.swtbot.eclipse.finder.waits.Conditions.waitForEditor;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.waits.WaitForEditor;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.hamcrest.Matcher;
+
+/**
+ * SWTWorkbenchBot is a {@link SWTWorkbenchBot} with capabilities for
+ * testing Eclipse workbench item like MultiPageEditor
+ * @author yzhishko
+ *
+ */
+
+public class SWTJBTBot extends SWTWorkbenchBot{
+
+ /**
+ *
+ * @param matcher
+ * @return
+ */
+
+ public SWTBotJSPMultiPageEditor multiPageEditor(Matcher<IEditorReference> matcher)
{
+ WaitForEditor waitForEditor = waitForEditor(matcher);
+ waitUntilWidgetAppears(waitForEditor);
+ return new SWTBotJSPMultiPageEditor(waitForEditor.get(0), this);
+ }
+
+ /**
+ * Get editor by title
+ * @param fileName - the name of editor
+ * @return - object with {@link SWTBotJSPMultiPageEditor} reference type and current
name
+ */
+
+ public SWTBotJSPMultiPageEditor multiPageEditorByTitle (String fileName) {
+ return multiPageEditor(withFileName(fileName));
+ }
+
+ private Matcher<IEditorReference> withFileName(String fileName) {
+ return withPartName(fileName);
+ }
+
+ /**
+ * Get editor by id
+ * @param id - id of an editor
+ * @return - object with {@link SWTBotJSPMultiPageEditor} reference type and current id
+ */
+
+ public SWTBotJSPMultiPageEditor multiPageEditorById(String id){
+ return multiPageEditor(withId(id));
+ }
+
+ private Matcher<IEditorReference> withId(String id) {
+ return withPartName(id);
+ }
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/SWTJBTBot.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,17 @@
+package org.jboss.tools.ui.bot.test;
+
+/**
+ * Class defines constants with editors', shells', views' names.
+ * @author yzhishko
+ *
+ */
+
+
+public class WidgetVariables {
+
+ public static final String ERROR_LOG = "Error Log";
+ public static final String PACKAGE_EXPLORER = "Package Explorer";
+ public static final String WELCOME = "Welcome";
+ public static final String PROGRESS_STATUS = "Progress";
+ public static final String PALETTE = "JBoss Tools Palette";
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/WidgetVariables.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.classpath
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.classpath 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.project
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.project 2009-10-06 10:25:33
UTC (rev 17911)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jst.ui.firstrun.bot.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>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.settings/org.eclipse.jdt.core.prefs 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,7 @@
+#Thu Dec 04 23:27:23 CET 2008
+eclipse.preferences.version=1
+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
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/META-INF/MANIFEST.MF 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.jst.ui.firstrun.bot.test;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.ui.runtime.bot.test.Activator
+Bundle-Vendor: %BundleVendor
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.jboss.tools.seam.core,
+ org.eclipse.ui,
+ org.eclipse.wst.server.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.ui.workbench,
+ org.eclipse.datatools.connectivity;visibility:=reexport,
+ org.eclipse.datatools.connectivity.db.generic,
+ org.jboss.tools.common,
+ org.jboss.tools.jst.ui.bot.test;bundle-version="1.0.0",
+ org.jboss.tools.jst.firstrun;bundle-version="2.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.ui.runtime.bot.test,
+ org.jboss.tools.ui.runtime.bot.test.preferences
+
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/Activator.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/Messages.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/Messages.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/messages.properties
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/messages.properties
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/messages.properties 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,11 @@
+JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss
Server
+JBossRuntimeStartup_Cannot_create_new_DTP_Connection_Profile=Can''t create new
DTP Connection Profile for JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_Cannot_create_new_HSQL_DB_Driver=Can''t create new HSQL DB
Driver.
+JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
+JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
+JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
+JBossRuntimeStartup_JBoss_Application_Server_5_0=JBoss Application Server 5.0
+JBossRuntimeStartup_JBoss_Application_Server_5_1=JBoss Application Server 5.1
+JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
+JBossRuntimeStartup_Runtime=Runtime
+JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic
embedded database
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/preferences/JBossRuntimePreferencesInitializer.class
===================================================================
(Binary files differ)
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/org/jboss/tools/ui/runtime/bot/test/preferences/JBossRuntimePreferencesInitializer.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/runtimePaths.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/runtimePaths.properties
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/bin/runtimePaths.properties 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1 @@
+JBossEap4.3=${jbosstools.test.jboss.home}
\ No newline at end of file
Added: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/build.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/build.properties
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/build.properties 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,6 @@
+source.. = src/,resources/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.properties
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.properties 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime
+BundleVendor = JBoss, a divison of Red Hat
+BundleName = JBoss Runtime Initializer
\ No newline at end of file
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.xml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.xml
(rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.xml 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+
class="org.jboss.tools.ui.runtime.bot.test.JBossRuntimeStartup">
+ </startup>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
class="org.jboss.tools.ui.runtime.bot.test.preferences.JBossRuntimePreferencesInitializer"/>
+ </extension>
+
+</plugin>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/resources/runtimePaths.properties
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/resources/runtimePaths.properties
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/resources/runtimePaths.properties 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1 @@
+JBossEap4.3=${jbosstools.test.jboss.home}
\ No newline at end of file
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/resources/runtimePaths.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Activator.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Activator.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Activator.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,52 @@
+package org.jboss.tools.ui.runtime.bot.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.ui.runtime.bot.test";
//$NON-NLS-1$
+
+ public static final String FIRST_START = "firstStart"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#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;
+ }
+
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Activator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,318 @@
+package org.jboss.tools.ui.runtime.bot.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.ConnectionProfileException;
+import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
+import org.eclipse.datatools.connectivity.drivers.DriverInstance;
+import org.eclipse.datatools.connectivity.drivers.DriverManager;
+import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
+import org.eclipse.datatools.connectivity.drivers.IPropertySet;
+import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
+import org.eclipse.datatools.connectivity.drivers.models.TemplateDescriptor;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.ui.IStartup;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.tools.test.TestProperties;
+
+@SuppressWarnings("restriction")
+public class JBossRuntimeStartup implements IStartup {
+ private static Properties properties;
+ private static final String RUNTIME = Messages.JBossRuntimeStartup_Runtime;
+
+ private static final String RUNTIME_PROPERTIES = "runtimePaths.properties";
+
+ static{
+ try {
+ InputStream inputStream =
JBossRuntimeStartup.class.getResourceAsStream("/"+RUNTIME_PROPERTIES);
+ properties = new TestProperties();
+ properties.load(inputStream);
+ } catch (IOException e) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Can't load
properties from " + RUNTIME_PROPERTIES + " file", e);
+ Activator.getDefault().getLog().log(status);
+ e.printStackTrace();
+ } catch (IllegalStateException e) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Property file
" + RUNTIME_PROPERTIES + " was not found", e);
+ Activator.getDefault().getLog().log(status);
+ e.printStackTrace();
+ }
+ }
+
+ // This constants are made to avoid dependency with org.jboss.ide.eclipse.as.core
plugin
+ public static final String JBOSS_AS_RUNTIME_TYPE_ID[] = {
+ "org.jboss.ide.eclipse.as.runtime.32", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.40", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.42", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.runtime.eap.43" //$NON-NLS-1$
+ };
+
+ public static final String JBOSS_AS_TYPE_ID[] = {
+ "org.jboss.ide.eclipse.as.32", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.40", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.42", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.50", //$NON-NLS-1$
+ "org.jboss.ide.eclipse.as.eap.43" //$NON-NLS-1$
+ };
+
+ public static final String JBOSS_AS_NAME[] = {
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_3_2,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_4_0,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_4_2,
+ Messages.JBossRuntimeStartup_JBoss_Application_Server_5_0,
+ Messages.JBossRuntimeStartup_JBoss_EAP_Server_4_3
+ };
+
+ public static final String JBOSS_AS_HOST = "localhost"; //$NON-NLS-1$
+
+ public static final String JBOSS_AS_DEFAULT_CONFIGURATION_NAME = "default";
//$NON-NLS-1$
+
+ //public static final String FIRST_START_PREFERENCE_NAME = "FIRST_START";
+
+ public static final String HSQL_DRIVER_DEFINITION_ID
+ = "DriverDefn.Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String HSQL_DRIVER_NAME = "Hypersonic DB"; //$NON-NLS-1$
+
+ public static final String HSQL_DRIVER_TEMPLATE_ID
+ = "org.eclipse.datatools.enablement.hsqldb.1_8.driver"; //$NON-NLS-1$
+
+ public static final String DTP_DB_URL_PROPERTY_ID
+ = "org.eclipse.datatools.connectivity.db.URL"; //$NON-NLS-1$
+
+
+ public void earlyStartup() {
+ boolean firstStart =
Activator.getDefault().getPreferenceStore().getBoolean(Activator.FIRST_START);
+ if (!firstStart) {
+ return;
+ }
+ Activator.getDefault().getPreferenceStore().setValue(Activator.FIRST_START, false);
+ File jbossASDir = new File(properties.getProperty("JBossEap4.3"));
+ createJBossServer(jbossASDir,4, "jboss-eap", "jboss-eap " +
RUNTIME); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ private void createJBossServer(File asLocation, int index, String name, String
runtimeName) {
+ if (!asLocation.isDirectory()) {
+ return;
+ }
+ IPath jbossAsLocationPath = new Path(asLocation.getAbsolutePath());
+
+ IServer[] servers = ServerCore.getServers();
+ for (int i = 0; i < servers.length; i++) {
+ IRuntime runtime = servers[i].getRuntime();
+ if(runtime != null && runtime.getLocation().equals(jbossAsLocationPath)) {
+ return;
+ }
+ }
+
+ IRuntime runtime = null;
+ IRuntime[] runtimes = ServerCore.getRuntimes();
+ for (int i = 0; i < runtimes.length; i++) {
+ if (runtimes[0].getLocation().equals(jbossAsLocationPath)) {
+ runtime = runtimes[0].createWorkingCopy();
+ break;
+ }
+ }
+
+ IProgressMonitor progressMonitor = new NullProgressMonitor();
+ try {
+ if (runtime == null) {
+ runtime = createRuntime(runtimeName, asLocation.getAbsolutePath(), progressMonitor,
index);
+ }
+ if (runtime != null) {
+ createServer(progressMonitor, runtime, index, name);
+ }
+
+ createDriver(asLocation.getAbsolutePath());
+ } catch (CoreException e) {
+ log(e,Messages.JBossRuntimeStartup_Cannot_create_new_JBoss_Server);
+ } catch (ConnectionProfileException e) {
+ log(e,Messages.JBossRuntimeStartup_Cannot_create_new_DTP_Connection_Profile);
+ }
+ }
+
+ private static void log(Throwable e, String message) {
+ IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, message, e);
+ Activator.getDefault().getLog().log(status);
+ }
+
+ /**
+ * Creates new JBoss AS Runtime, Server and hsqldb driver
+ * @param jbossASLocation location of JBoss Server
+ * @param progressMonitor to report progress
+ * @return server working copy
+ * @throws CoreException
+ * @throws ConnectionProfileException
+ */
+ public static IServerWorkingCopy initJBossAS(String jbossASLocation, IProgressMonitor
progressMonitor) throws CoreException, ConnectionProfileException {
+ IRuntime runtime = createRuntime(null, jbossASLocation, progressMonitor, 2);
+ IServerWorkingCopy server = null;
+ if (runtime != null) {
+ server = createServer(progressMonitor, runtime, 2, null);
+ }
+ createDriver(jbossASLocation);
+ return server;
+ }
+
+ /**
+ * Creates new JBoss AS Runtime
+ * @param jbossASLocation location of JBoss AS
+ * @param progressMonitor
+ * @return runtime working copy
+ * @throws CoreException
+ */
+ private static IRuntime createRuntime(String runtimeName, String jbossASLocation,
IProgressMonitor progressMonitor, int index) throws CoreException {
+ IRuntimeWorkingCopy runtime = null;
+ String type = null;
+ String version = null;
+ String runtimeId = null;
+ IPath jbossAsLocationPath = new Path(jbossASLocation);
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(type, version,
JBOSS_AS_RUNTIME_TYPE_ID[index]);
+ if (runtimeTypes.length > 0) {
+ runtime = runtimeTypes[0].createRuntime(runtimeId, progressMonitor);
+ runtime.setLocation(jbossAsLocationPath);
+ if(runtimeName!=null) {
+ runtime.setName(runtimeName);
+ }
+ IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
+ // IJBossServerRuntime.PROPERTY_VM_ID
+ ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_ID",
defaultVM.getId()); //$NON-NLS-1$
+ // IJBossServerRuntime.PROPERTY_VM_TYPE_ID
+ ((RuntimeWorkingCopy) runtime).setAttribute("PROPERTY_VM_TYPE_ID",
defaultVM.getVMInstallType().getId()); //$NON-NLS-1$
+ // IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME
+ ((RuntimeWorkingCopy)
runtime).setAttribute("org.jboss.ide.eclipse.as.core.runtime.configurationName",
JBOSS_AS_DEFAULT_CONFIGURATION_NAME); //$NON-NLS-1$
+
+ return runtime.save(false, progressMonitor);
+ }
+ return runtime;
+ }
+
+ /**
+ * Creates new JBoss Server
+ * @param progressMonitor
+ * @param runtime parent JBoss AS Runtime
+ * @return server working copy
+ * @throws CoreException
+ */
+ private static IServerWorkingCopy createServer(IProgressMonitor progressMonitor,
IRuntime runtime, int index, String name) throws CoreException {
+ IServerType serverType = ServerCore.findServerType(JBOSS_AS_TYPE_ID[index]);
+ IServerWorkingCopy server = serverType.createServer(null, null, runtime,
progressMonitor);
+
+ server.setHost(JBOSS_AS_HOST);
+ if(name != null)
+ server.setName(name);
+ else
+ server.setName(JBOSS_AS_NAME[index]);
+
+ // JBossServer.DEPLOY_DIRECTORY
+ String deployVal =
runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("deploy").toOSString();
//$NON-NLS-1$ //$NON-NLS-2$
+ ((ServerWorkingCopy)
server).setAttribute("org.jboss.ide.eclipse.as.core.server.deployDirectory",
deployVal); //$NON-NLS-1$
+
+ // IDeployableServer.TEMP_DEPLOY_DIRECTORY
+ String deployTmpFolderVal =
runtime.getLocation().append("server").append(JBOSS_AS_DEFAULT_CONFIGURATION_NAME).append("tmp").append("jbosstoolsTemp").toOSString();
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ((ServerWorkingCopy)
server).setAttribute("org.jboss.ide.eclipse.as.core.server.tempDeployDirectory",
deployTmpFolderVal); //$NON-NLS-1$
+
+ // If we'd need to set up a username / pw for JMX, do it here.
+// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
+// ((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
+
+ server.save(false, progressMonitor);
+ return server;
+ }
+
+ private static boolean driverIsCreated = false;
+
+ /**
+ * Creates HSQL DB Driver
+ * @param jbossASLocation location of JBoss AS
+ * @throws ConnectionProfileException
+ * @return driver instance
+ */
+ private static void createDriver(String jbossASLocation) throws
ConnectionProfileException {
+ if(driverIsCreated) {
+ // Don't create the driver a few times
+ return;
+ }
+ String driverPath;
+ try {
+ driverPath = new File(jbossASLocation +
"/server/default/lib/hsqldb.jar").getCanonicalPath(); //$NON-NLS-1$
+ } catch (IOException e) {
+ Activator.getDefault().getLog().log(new Status(IStatus.ERROR,
+ Activator.PLUGIN_ID, Messages.JBossRuntimeStartup_Cannot_create_new_HSQL_DB_Driver,
e));
+ return;
+ }
+
+ DriverInstance driver =
DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ if (driver == null) {
+ TemplateDescriptor descr =
TemplateDescriptor.getDriverTemplateDescriptor(HSQL_DRIVER_TEMPLATE_ID);
+ IPropertySet instance = new PropertySetImpl(HSQL_DRIVER_NAME,
HSQL_DRIVER_DEFINITION_ID);
+ instance.setName(HSQL_DRIVER_NAME);
+ instance.setID(HSQL_DRIVER_DEFINITION_ID);
+ Properties props = new Properties();
+
+ IConfigurationElement[] template = descr.getProperties();
+ for (int i = 0; i < template.length; i++) {
+ IConfigurationElement prop = template[i];
+ String id = prop.getAttribute("id"); //$NON-NLS-1$
+
+ String value = prop.getAttribute("value"); //$NON-NLS-1$
+ props.setProperty(id, value == null ? "" : value); //$NON-NLS-1$
+ }
+ props.setProperty(DTP_DB_URL_PROPERTY_ID, "jdbc:hsqldb:."); //$NON-NLS-1$
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_TYPE, descr.getId());
+ props.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, driverPath);
+
+ instance.setBaseProperties(props);
+ DriverManager.getInstance().removeDriverInstance(instance.getID());
+ System.gc();
+ DriverManager.getInstance().addDriverInstance(instance);
+ }
+
+ driver = DriverManager.getInstance().getDriverInstanceByName(HSQL_DRIVER_NAME);
+ if (driver != null &&
ProfileManager.getInstance().getProfileByName("DefaultDS") == null) {
//$NON-NLS-1$
+ // create profile
+ Properties props = new Properties();
+ props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID,
HSQL_DRIVER_DEFINITION_ID);
+ props.setProperty(IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID,
""); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID,
driver.getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID,
driver.getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID,
"Default"); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, "");
//$NON-NLS-1$
+ props.setProperty(IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID,
"false"); //$NON-NLS-1$
+ props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID,
driver.getProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID));
+ props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID,
driver.getProperty(IDBDriverDefinitionConstants.URL_PROP_ID));
+
+ ProfileManager.getInstance().createProfile("DefaultDS", Messages.JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database,
IDBConnectionProfileConstants.CONNECTION_PROFILE_ID, props, "", false);
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ if(driver!=null) {
+ driverIsCreated = true;
+ }
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/JBossRuntimeStartup.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,25 @@
+package org.jboss.tools.ui.runtime.bot.test;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.ui.runtime.bot.test.messages"; //$NON-NLS-1$
+ public static String JBossRuntimeStartup_Cannot_create_new_JBoss_Server;
+ public static String JBossRuntimeStartup_Cannot_create_new_DTP_Connection_Profile;
+ public static String JBossRuntimeStartup_Cannot_create_new_HSQL_DB_Driver;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_3_2;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_4_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_4_2;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_5_0;
+ public static String JBossRuntimeStartup_JBoss_Application_Server_5_1;
+ public static String JBossRuntimeStartup_JBoss_EAP_Server_4_3;
+ public static String JBossRuntimeStartup_Runtime;
+ public static String JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,11 @@
+JBossRuntimeStartup_Cannot_create_new_JBoss_Server=Can''t create new JBoss
Server
+JBossRuntimeStartup_Cannot_create_new_DTP_Connection_Profile=Can''t create new
DTP Connection Profile for JBoss AS Hypersonic embedded database
+JBossRuntimeStartup_Cannot_create_new_HSQL_DB_Driver=Can''t create new HSQL DB
Driver.
+JBossRuntimeStartup_JBoss_Application_Server_3_2=JBoss Application Server 3.2
+JBossRuntimeStartup_JBoss_Application_Server_4_0=JBoss Application Server 4.0
+JBossRuntimeStartup_JBoss_Application_Server_4_2=JBoss Application Server 4.2
+JBossRuntimeStartup_JBoss_Application_Server_5_0=JBoss Application Server 5.0
+JBossRuntimeStartup_JBoss_Application_Server_5_1=JBoss Application Server 5.1
+JBossRuntimeStartup_JBoss_EAP_Server_4_3=JBoss EAP Server 4.3
+JBossRuntimeStartup_Runtime=Runtime
+JBossRuntimeStartup_The_JBoss_AS_Hypersonic_embedded_database=The JBoss AS Hypersonic
embedded database
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/preferences/JBossRuntimePreferencesInitializer.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/preferences/JBossRuntimePreferencesInitializer.java
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/preferences/JBossRuntimePreferencesInitializer.java 2009-10-06
10:25:33 UTC (rev 17911)
@@ -0,0 +1,19 @@
+package org.jboss.tools.ui.runtime.bot.test.preferences;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.jboss.tools.ui.runtime.bot.test.Activator;
+
+@SuppressWarnings("deprecation")
+public class JBossRuntimePreferencesInitializer extends
+ AbstractPreferenceInitializer {
+
+ @Override
+ public void initializeDefaultPreferences() {
+ Preferences preferences = Activator.getDefault().getPluginPreferences();
+ preferences.setDefault(
+ Activator.FIRST_START,
+ true);
+ }
+
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.ui.firstrun.bot.test/src/org/jboss/tools/ui/runtime/bot/test/preferences/JBossRuntimePreferencesInitializer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain