Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[swtbot-dev] Impressions and questions from a first time user

Hi

Programming Java & eclipse is new territory for me. But with some decades of 
experience in SW it was time to discover a few new places. I am working on my 
GNU/Debian Linux x86 system, using the testing distribution.

I am interested in contributing to a free SW project elexis  
(http://www.elexis.ch/). It aims at helping general practitioners to keep all 
their records about patients, bills, drugs, etc in electronic form. It is 
written by by Swiss general practitioner Gerry Weill who took a long time to 
decide whether he wanted to study medicine or computer science and is used by 
50 or more medical doctors in Switzerland.

As I love to use Ruby and test driven development I naturally started looking 
at the tests and there were just a few JUnit tests. No GUI tests. This is bad, 
as there are people working on a french translation, which will need some 
minor code changes and a lot of new (French instead of German) screenshots.

I took a closer look at SWTBot and liked quite a few things. I think it could 
provide me with a good abstraction level to write tests.

Therefore I started coding in Java a little, which made the following hurdles 
appear:

a) As elexis has overridden WorkbenchAdvisor, a login dialog for the DB comes 
up first. One has to manually enter a username/password before SWTBot gets 
control. Does anybody has a hint where I have to patch SWTBot/elexis in order 
to pass control to SWTBot first?

b) The application takes about 15 seconds on my MacMini to startup/setup the 
DB. It took me a while to install/grasp the main ideas for JRuby, eclipse-
shell, glimmer. But this allowed me to test interactively the 
glimmer/samples/login.rb. I definitively love the idea of using an interpreted 
language to develop the test cases.

c) As there are quite a few perspectives, dialogues, windows, etc to test I 
(as a newcomer to the elexis source code) find it a daunting task to discover 
how all these GUI elements are grouped, named and accessible via SWTBot.

Does anybody now of a utility or SWTBot functions about how to dump the GUI 
elements? I see that there is a "SWTBot EclipseSpy view". Should I add it to 
elexis? 

I would find it handy if I could enter in my jirb windows a command like:
include_class Java::org.eclipse.swtbot.swt.finder.SWTBotFactory
SWTBotFactory.active_shell.dump_gui_elements

d) Trying to understand/modify SWTBot I tried to install it from source and 
failed miserably. See the attached log files. The problem I did run into is:
>      [java] BUILD FAILED
>      [java]
> /home/src/swtbot/eclipse/plugins/org.eclipse.pde.build_3.5.0.v20090527-1800
>/scripts/build.xml:35: The following error occurred while executing this
> line: [java]
> /home/src/swtbot/eclipse/plugins/org.eclipse.pde.build_3.5.0.v20090527-1800
>/scripts/build.xml:91: The following error occurred while executing this
> line: [java]
> /home/src/swtbot/org.eclipse.swtbot.releng/customTargets.xml:11: The
> following error occurred while executing this line: [java]
> /home/src/swtbot/org.eclipse.swtbot.releng/allElements.xml:12: The
> following error occurred while executing this line: [java]
> /home/src/swtbot/eclipse/plugins/org.eclipse.pde.build_3.5.0.v20090527-1800
>/scripts/genericTargets.xml:106: A cycle was detected when generating the
> classpath org.eclipse.swtbot.junit4_x_2.0.0.201001052001,
> org.eclipse.swtbot.swt.finder.test_2.0.0.201001052001,
> org.eclipse.swtbot.junit4_x_2.0.0.201001052001. [java]
>      [java] Total time: 1 second
>
> BUILD FAILED
> /home/src/swtbot/org.eclipse.swtbot.releng/build.xml:192: Java returned: 13
Any help would be appreciated.

If it is considered a good idea I would not hesitate to invest a few hours in 
order to documents my experiences and publish an example on how to test a 
simple SWT application and/or glimmer/samples/login.rb using SWTBot, eclipse-
shell and JRuby. What do think about it?

Best regards

-- 
Niklaus Giger
Wieshoschet 6
CH-8753 Mollis
+41  (0)55 612 20 54 P
+41  (0)55 618 64 68 G
Buildfile: build.xml
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties

check-dependencies:
    [mkdir] Created dir: /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs

download-eclipse-sdk:

download-gef-sdk:
      [get] Getting: http://eclipse.ialto.org/tools/gef/downloads/drops/3.4.2/R200902171642//GEF-runtime-3.4.2.zip
      [get] To: /home/src/swtbot/org.eclipse.swtbot.releng/externals/GEF-runtime-3.4.2.zip
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................
      [get] last modified = Wed Feb 18 19:55:32 CET 2009

download-purge-task:
      [get] Getting: http://www.dallaway.com/ant/purge.jar
      [get] To: /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs/purge.jar
      [get] ...................
      [get] last modified = Sun Feb 04 20:15:46 CET 2007

download-ant-contrib-task:
      [get] Getting: http://downloads.sourceforge.net/sourceforge/ant-contrib/ant-contrib-1.0b3-bin.tar.gz
      [get] To: /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs/ant-contrib-1.0b3-bin.tar.gz
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ...................
      [get] last modified = Thu Nov 02 17:52:21 CET 2006
    [untar] Expanding: /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs/ant-contrib-1.0b3-bin.tar.gz into /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs
     [move] Moving 1 file to /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs/ant-contrib-1.0b3-bin.tar.gz
   [delete] Deleting directory /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs/ant-contrib

download-ant-cobertura-task:
      [get] Getting: http://downloads.sourceforge.net/sourceforge/cobertura/cobertura-1.9-bin.tar.gz
      [get] To: /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs/cobertura-1.9-bin.tar.gz
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ....................................................
      [get] ...............................................
      [get] last modified = Tue Jun 05 20:51:50 CEST 2007
    [untar] Expanding: /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs/cobertura-1.9-bin.tar.gz into /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/externals/libs/cobertura-1.9-bin.tar.gz

download-ant-libs:

download-dependencies:

materialize-workspace:
    [mkdir] Created dir: /home/src/swtbot/eclipse
     [copy] Copying 13 files to /home/src/swtbot/eclipse/plugins
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties

extract-eclipse:
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties

setup-tar.gz:
     [exec] The command attribute is deprecated.
     [exec] Please use the executable attribute and nested arg elements.
    [unzip] Expanding: /home/src/swtbot/org.eclipse.swtbot.releng/externals/GEF-runtime-3.4.2.zip into /home/src/swtbot/eclipse
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties

guess-junit-version:
     [echo] Guessing plugin version of org.junit4.
     [echo] Plugin version of org.junit is "4.5.0.v20090423"
     [echo] isJunit4.5: true

guess-pde-build-version:
     [echo] Guessing plugin version of org.eclipse.pde.build.
     [echo] Plugin version of org.eclipse.pde.build is "3.5.0.v20090527-1800"

create-build-properties-from-template:
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.releng

initialize-environment:
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties

guess-junit-version:
     [echo] Guessing plugin version of org.junit4.
     [echo] Plugin version of org.junit is "4.5.0.v20090423"
     [echo] isJunit4.5: true

make-substitutions-4.5:
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.eclipse.ui
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.eclipse.ui/META-INF
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.eclipse.ui
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.junit4_x/META-INF
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.junit4_x
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.junit4_x

make-substitutions-4.3:

make-substitutions:

BUILD SUCCESSFUL
Total time: 36 seconds
Buildfile: build.xml
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.git.svn.properties
   [delete] Deleting: /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties
    [touch] Creating /home/src/swtbot/org.eclipse.swtbot.releng/.svn.properties

check-dependencies:

download-eclipse-sdk:

download-gef-sdk:

download-purge-task:

download-ant-contrib-task:

download-ant-cobertura-task:

download-ant-libs:

download-dependencies:

check-windows-preconditions:

check-other-preconditions:
     [echo] Checking for tar on path.
     [echo] Found tar on path.

check-conditions:
     [echo] Checking for svn on path.
     [echo] Found svn on path.

guess-junit-version:
     [echo] Guessing plugin version of org.junit4.
     [echo] Plugin version of org.junit is "4.5.0.v20090423"
     [echo] isJunit4.5: true

guess-pde-build-version:
     [echo] Guessing plugin version of org.eclipse.pde.build.
     [echo] Plugin version of org.eclipse.pde.build is "3.5.0.v20090527-1800"

create-build-properties-from-template:
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.releng

initialize-environment:

printjvm:
     [exec] The command attribute is deprecated.
     [exec] Please use the executable attribute and nested arg elements.
     [exec] java version "1.6.0_16"
     [exec] Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
     [exec] Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)
[echoproperties] #Ant properties
[echoproperties] #Tue Jan 05 20:01:35 CET 2010
[echoproperties] java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
[echoproperties] java.awt.printerjob=sun.print.PSPrinterJob
[echoproperties] java.class.path=/usr/share/ant/lib/ant-launcher.jar\:/usr/share/java/xmlParserAPIs.jar\:/usr/share/java/xercesImpl.jar\:/usr/share/ant/lib/ant-apache-log4j.jar\:/usr/share/ant/lib/ant.jar\:/usr/share/ant/lib/ant-commons-net.jar\:/usr/share/ant/lib/ant-nodeps.jar\:/usr/share/ant/lib/ant-apache-bcel.jar\:/usr/share/ant/lib/ant-apache-bsf.jar\:/usr/share/ant/lib/ant-javamail.jar\:/usr/share/ant/lib/ant-junit.jar\:/usr/share/ant/lib/ant-antlr.jar\:/usr/share/ant/lib/ant-jdepend.jar\:/usr/share/ant/lib/catalina5.5-ant-jmx.jar\:/usr/share/ant/lib/ant-apache-resolver.jar\:/usr/share/ant/lib/ant-commons-logging.jar\:/usr/share/ant/lib/ant-launcher.jar\:/usr/share/ant/lib/tomcat5.5-jkstatus-ant.jar\:/usr/share/ant/lib/ant-jsch.jar\:/usr/share/ant/lib/ant-apache-regexp.jar\:/usr/share/ant/lib/catalina5.5-ant.jar\:/usr/share/ant/lib/junit.jar\:/usr/share/ant/lib/ant-apache-oro.jar\:/usr/share/ant/lib/bcel.jar\:/usr/share/ant/lib/ant-jmf.jar\:/usr/share/ant/lib/ant-trax.jar\:/usr/share/ant/lib/ant-swing.jar\:/usr/lib/jvm/java-6-sun-1.6.0.16/lib/tools.jar
[echoproperties] java.class.version=50.0
[echoproperties] java.endorsed.dirs=/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/endorsed
[echoproperties] java.ext.dirs=/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/ext\:/usr/java/packages/lib/ext
[echoproperties] java.home=/usr/lib/jvm/java-6-sun-1.6.0.16/jre
[echoproperties] java.io.tmpdir=/tmp
[echoproperties] java.library.path=/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/server\:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386\:/usr/lib/jvm/java-6-sun-1.6.0.16/jre/../lib/i386\:/usr/java/packages/lib/i386\:/lib\:/usr/lib
[echoproperties] java.runtime.name=Java(TM) SE Runtime Environment
[echoproperties] java.runtime.version=1.6.0_16-b01
[echoproperties] java.specification.name=Java Platform API Specification
[echoproperties] java.specification.vendor=Sun Microsystems Inc.
[echoproperties] java.specification.version=1.6
[echoproperties] java.vendor=Sun Microsystems Inc.
[echoproperties] java.vendor.url=http\://java.sun.com/
[echoproperties] java.vendor.url.bug=http\://java.sun.com/cgi-bin/bugreport.cgi
[echoproperties] java.version=1.6.0_16
[echoproperties] java.vm.info=mixed mode
[echoproperties] java.vm.name=Java HotSpot(TM) Server VM
[echoproperties] java.vm.specification.name=Java Virtual Machine Specification
[echoproperties] java.vm.specification.vendor=Sun Microsystems Inc.
[echoproperties] java.vm.specification.version=1.0
[echoproperties] java.vm.vendor=Sun Microsystems Inc.
[echoproperties] java.vm.version=14.2-b01

clean:
     [echo] Cleaning all in /home/src/swtbot/org.eclipse.swtbot.releng/target

init:
    [mkdir] Created dir: /home/src/swtbot/org.eclipse.swtbot.releng/target
    [mkdir] Created dir: /home/src/swtbot/org.eclipse.swtbot.releng/artifacts
    [mkdir] Created dir: /home/src/swtbot/org.eclipse.swtbot.releng/target/plugins
    [mkdir] Created dir: /home/src/swtbot/org.eclipse.swtbot.releng/target/features

copy-features:
     [sync] Copying 31 files to /home/src/swtbot/org.eclipse.swtbot.releng/target/features

copy-plugins:
     [sync] Copying 821 files to /home/src/swtbot/org.eclipse.swtbot.releng/target/plugins

create-version-files:
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.releng/target/plugins/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder
     [copy] Copying 1 file to /home/src/swtbot/org.eclipse.swtbot.releng/target/plugins/org.eclipse.swtbot.eclipse.finder/src/org/eclipse/swtbot/eclipse/finder

copy-sources:

copy-all:

pde-build:
     [java] Buildfile: /home/src/swtbot/org.eclipse.swtbot.releng/../eclipse/plugins/org.eclipse.pde.build_3.5.0.v20090527-1800/scripts/build.xml
     [java] 
     [java] main:
     [java] 
     [java] preBuild:
     [java] 
     [java] preSetup:
     [java] 
     [java] checkLocalMaps:
     [java] 
     [java] getMapFiles:
     [java] 
     [java] postSetup:
     [java] 
     [java] checkLocalBase:
     [java] 
     [java] getBaseComponents:
     [java] 
     [java] processRepos:
     [java] 
     [java] fetch:
     [java] 
     [java] generate:
     [java] 
     [java] preGenerate:
     [java] 
     [java] allElements:
     [java] 
     [java] allElementsDelegator:
     [java] 
     [java] init:
     [java] 
     [java] generateScript:
     [java] 
     [java] BUILD FAILED
     [java] /home/src/swtbot/eclipse/plugins/org.eclipse.pde.build_3.5.0.v20090527-1800/scripts/build.xml:35: The following error occurred while executing this line:
     [java] /home/src/swtbot/eclipse/plugins/org.eclipse.pde.build_3.5.0.v20090527-1800/scripts/build.xml:91: The following error occurred while executing this line:
     [java] /home/src/swtbot/org.eclipse.swtbot.releng/customTargets.xml:11: The following error occurred while executing this line:
     [java] /home/src/swtbot/org.eclipse.swtbot.releng/allElements.xml:12: The following error occurred while executing this line:
     [java] /home/src/swtbot/eclipse/plugins/org.eclipse.pde.build_3.5.0.v20090527-1800/scripts/genericTargets.xml:106: A cycle was detected when generating the classpath org.eclipse.swtbot.junit4_x_2.0.0.201001052001, org.eclipse.swtbot.swt.finder.test_2.0.0.201001052001, org.eclipse.swtbot.junit4_x_2.0.0.201001052001.
     [java] 
     [java] Total time: 1 second

Back to the top