Revision: 6201
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6201&view=rev
Author: manningr
Date: 2011-03-19 13:40:08 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
New profile (only available in app module at present) allows tests that end with *UITest.java to be run in addition to the normal tests by using a new profile called 'uitests' (for example, 'mvn clean install -P uitests', will run all of the normal tests, afterwards, all UI tests will be run)
Modified Paths:
--------------
trunk/sql12/app/pom.xml
Added Paths:
-----------
trunk/sql12/app/src/test/java/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java
trunk/sql12/app/src/test/resources/net/
trunk/sql12/app/src/test/resources/net/sourceforge/
trunk/sql12/app/src/test/resources/net/sourceforge/squirrel_sql/
trunk/sql12/app/src/test/resources/net/sourceforge/squirrel_sql/client/
trunk/sql12/app/src/test/resources/net/sourceforge/squirrel_sql/client/Version.properties
Removed Paths:
-------------
trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java
Modified: trunk/sql12/app/pom.xml
===================================================================
--- trunk/sql12/app/pom.xml 2011-03-19 13:17:42 UTC (rev 6200)
+++ trunk/sql12/app/pom.xml 2011-03-19 13:40:08 UTC (rev 6201)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.sf.squirrel-sql</groupId>
@@ -95,11 +96,17 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-swing-junit-4.5</artifactId>
+ <version>1.2.1</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<!--
- Filter in the version from the version-plugin below, into Version.properties. Turn off filtering
- for all other files here
+ Filter in the version from the version-plugin below, into
+ Version.properties. Turn off filtering for all other files here
-->
<resources>
<resource>
@@ -154,14 +161,24 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin-version}</version>
- <configuration>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <excludes>
- <exclude>**/ApplicationArgumentsTest.java</exclude>
- </excludes>
- <parallel>${surefire-parallel-type}</parallel>
- <threadCount>${surefire-thread-count}</threadCount>
- </configuration>
+ <executions>
+ <execution>
+ <id>default-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <excludes>
+ <exclude>**/ApplicationArgumentsTest.java</exclude>
+ <exclude>**/*UITest.java</exclude>
+ </excludes>
+ <parallel>${surefire-parallel-type}</parallel>
+ <threadCount>${surefire-thread-count}</threadCount>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -206,4 +223,40 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>uitests</id>
+ <activation>
+ <property>
+ <name>uitests</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire-plugin-version}</version>
+ <executions>
+ <execution>
+ <id>uitests</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <includes>
+ <include>**/*UITest.java</include>
+ </includes>
+ <parallel>${surefire-parallel-type}</parallel>
+ <threadCount>${surefire-thread-count}</threadCount>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Copied: trunk/sql12/app/src/test/java/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java (from rev 5908, trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java)
===================================================================
--- trunk/sql12/app/src/test/java/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java (rev 0)
+++ trunk/sql12/app/src/test/java/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java 2011-03-19 13:40:08 UTC (rev 6201)
@@ -0,0 +1,90 @@
+package net.sourceforge.squirrel_sql.client.preferences;
+
+import static org.easymock.EasyMock.expect;
+
+import javax.swing.JFrame;
+
+import net.sourceforge.squirrel_sql.BaseSQuirreLJUnit4TestCase;
+import net.sourceforge.squirrel_sql.client.IApplication;
+
+import org.fest.swing.annotation.GUITest;
+import org.fest.swing.fixture.FrameFixture;
+import org.fest.swing.fixture.JCheckBoxFixture;
+import org.fest.swing.fixture.JRadioButtonFixture;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This is a FEST UI test for GeneralPreferencesPanel
+ */
+@GUITest
+public class GeneralPreferencesPanelUITest extends BaseSQuirreLJUnit4TestCase {
+
+ JFrame frame = null;
+ FrameFixture fixture = null;
+
+ @Before
+ public void setUp() throws Exception
+ {
+ if (frame == null) {
+ frame = constructTestFrame();
+ }
+ fixture = new FrameFixture(frame);
+ fixture.show();
+
+ }
+
+ @After
+ public void tearDown()
+ {
+ if (fixture != null) {
+ fixture.cleanUp();
+ }
+ }
+
+ @Test
+ public void testSomething() {
+ JRadioButtonFixture tabbedStyleRadioButton = fixture.radioButton("tabbedStyleRadioButton");
+ JRadioButtonFixture internalFrameStyleRadioButton = fixture.radioButton("internalFrameStyleRadioButton");
+ JCheckBoxFixture showContentsCheckBox = fixture.checkBox("showContentsCheckBox");
+ JCheckBoxFixture maximizeSessionSheetCheckBox = fixture.checkBox("maximizeSessionSheetCheckBox");
+ JCheckBoxFixture showTabbedStyleHintCheckBox = fixture.checkBox("showTabbedStyleHintCheckBox");
+
+ tabbedStyleRadioButton.click();
+
+ showContentsCheckBox.requireDisabled();
+ maximizeSessionSheetCheckBox.requireDisabled();
+ showTabbedStyleHintCheckBox.requireDisabled();
+
+ internalFrameStyleRadioButton.click();
+
+ showContentsCheckBox.requireEnabled();
+ maximizeSessionSheetCheckBox.requireEnabled();
+ showTabbedStyleHintCheckBox.requireEnabled();
+ }
+
+ /**
+ * The main method is not used at all in the test - it is just here to allow for user interaction testing
+ * with the graphical component, which doesn't require launching SQuirreL.
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ new GeneralPreferencesPanelUITest().constructTestFrame().setVisible(true);
+ }
+
+ private JFrame constructTestFrame() {
+ IApplication mockApplication = mockHelper.createMock("mockApplication", IApplication.class);
+ SquirrelPreferences prefs = new SquirrelPreferences();
+ expect(mockApplication.getSquirrelPreferences()).andStubReturn(prefs);
+ mockHelper.replayAll();
+ final JFrame frame = new JFrame("Test UpdatePreferencesPanel");
+ GeneralPreferencesPanel panel = new GeneralPreferencesPanel();
+ panel.initialize(mockApplication);
+ frame.getContentPane().add(panel.getPanelComponent());
+ frame.setSize(700,600);
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ return frame;
+ }
+}
Added: trunk/sql12/app/src/test/resources/net/sourceforge/squirrel_sql/client/Version.properties
===================================================================
--- trunk/sql12/app/src/test/resources/net/sourceforge/squirrel_sql/client/Version.properties (rev 0)
+++ trunk/sql12/app/src/test/resources/net/sourceforge/squirrel_sql/client/Version.properties 2011-03-19 13:40:08 UTC (rev 6201)
@@ -0,0 +1 @@
+squirrelsql.version=${squirrelsql.version}
\ No newline at end of file
Deleted: trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java
===================================================================
--- trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java 2011-03-19 13:17:42 UTC (rev 6200)
+++ trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/preferences/GeneralPreferencesPanelUITest.java 2011-03-19 13:40:08 UTC (rev 6201)
@@ -1,90 +0,0 @@
-package net.sourceforge.squirrel_sql.client.preferences;
-
-import static org.easymock.EasyMock.expect;
-
-import javax.swing.JFrame;
-
-import net.sourceforge.squirrel_sql.BaseSQuirreLJUnit4TestCase;
-import net.sourceforge.squirrel_sql.client.IApplication;
-
-import org.fest.swing.annotation.GUITest;
-import org.fest.swing.fixture.FrameFixture;
-import org.fest.swing.fixture.JCheckBoxFixture;
-import org.fest.swing.fixture.JRadioButtonFixture;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * This is a FEST UI test for GeneralPreferencesPanel
- */
-@GUITest
-public class GeneralPreferencesPanelUITest extends BaseSQuirreLJUnit4TestCase {
-
- JFrame frame = null;
- FrameFixture fixture = null;
-
- @Before
- public void setUp() throws Exception
- {
- if (frame == null) {
- frame = constructTestFrame();
- }
- fixture = new FrameFixture(frame);
- fixture.show();
-
- }
-
- @After
- public void tearDown()
- {
- if (fixture != null) {
- fixture.cleanUp();
- }
- }
-
- @Test
- public void testSomething() {
- JRadioButtonFixture tabbedStyleRadioButton = fixture.radioButton("tabbedStyleRadioButton");
- JRadioButtonFixture internalFrameStyleRadioButton = fixture.radioButton("internalFrameStyleRadioButton");
- JCheckBoxFixture showContentsCheckBox = fixture.checkBox("showContentsCheckBox");
- JCheckBoxFixture maximizeSessionSheetCheckBox = fixture.checkBox("maximizeSessionSheetCheckBox");
- JCheckBoxFixture showTabbedStyleHintCheckBox = fixture.checkBox("showTabbedStyleHintCheckBox");
-
- tabbedStyleRadioButton.click();
-
- showContentsCheckBox.requireDisabled();
- maximizeSessionSheetCheckBox.requireDisabled();
- showTabbedStyleHintCheckBox.requireDisabled();
-
- internalFrameStyleRadioButton.click();
-
- showContentsCheckBox.requireEnabled();
- maximizeSessionSheetCheckBox.requireEnabled();
- showTabbedStyleHintCheckBox.requireEnabled();
- }
-
- /**
- * The main method is not used at all in the test - it is just here to allow for user interaction testing
- * with the graphical component, which doesn't require launching SQuirreL.
- *
- * @param args
- */
- public static void main(String[] args) {
- new GeneralPreferencesPanelUITest().constructTestFrame().setVisible(true);
- }
-
- private JFrame constructTestFrame() {
- IApplication mockApplication = mockHelper.createMock("mockApplication", IApplication.class);
- SquirrelPreferences prefs = new SquirrelPreferences();
- expect(mockApplication.getSquirrelPreferences()).andStubReturn(prefs);
- mockHelper.replayAll();
- final JFrame frame = new JFrame("Test UpdatePreferencesPanel");
- GeneralPreferencesPanel panel = new GeneralPreferencesPanel();
- panel.initialize(mockApplication);
- frame.getContentPane().add(panel.getPanelComponent());
- frame.setSize(700,600);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- return frame;
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|