Revision: 6202
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6202&view=rev
Author: manningr
Date: 2011-03-19 17:35:17 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
Relocated uitests profile to root so that it can be used by the plugin projects as well. Moved the surefire-plugin configuration out of the plugin parent pom so that the common configuration in the root can be inherited. Relocated the derby plugin preferences UI test to the derby project.
Modified Paths:
--------------
trunk/sql12/app/pom.xml
trunk/sql12/plugins/derby/pom.xml
trunk/sql12/plugins/squirrelsql-plugins-parent-pom/pom.xml
trunk/sql12/pom.xml
Added Paths:
-----------
trunk/sql12/app/src/test/java/net/sourceforge/squirrel_sql/client/plugin/gui/
trunk/sql12/app/src/test/java/net/sourceforge/squirrel_sql/client/plugin/gui/AbstractPluginPreferencesUITest.java
trunk/sql12/plugins/derby/src/test/java/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java
Removed Paths:
-------------
trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/plugin/gui/AbstractPluginPreferencesUITest.java
trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java
Modified: trunk/sql12/app/pom.xml
===================================================================
--- trunk/sql12/app/pom.xml 2011-03-19 13:40:08 UTC (rev 6201)
+++ trunk/sql12/app/pom.xml 2011-03-19 17:35:17 UTC (rev 6202)
@@ -99,7 +99,7 @@
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-swing-junit-4.5</artifactId>
- <version>1.2.1</version>
+ <version>${fest-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -223,40 +223,43 @@
</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>
+<!-- <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>-->
+<!-- <excludes>-->
+<!-- <exclude>**/Abstract*UITest.java</exclude>-->
+<!-- </excludes>-->
+<!-- <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/plugin/gui/AbstractPluginPreferencesUITest.java (from rev 6191, trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/plugin/gui/AbstractPluginPreferencesUITest.java)
===================================================================
--- trunk/sql12/app/src/test/java/net/sourceforge/squirrel_sql/client/plugin/gui/AbstractPluginPreferencesUITest.java (rev 0)
+++ trunk/sql12/app/src/test/java/net/sourceforge/squirrel_sql/client/plugin/gui/AbstractPluginPreferencesUITest.java 2011-03-19 17:35:17 UTC (rev 6202)
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2009 Rob Manning
+ * man...@us...
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package net.sourceforge.squirrel_sql.client.plugin.gui;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import net.sourceforge.squirrel_sql.BaseSQuirreLJUnit4TestCase;
+import net.sourceforge.squirrel_sql.client.plugin.IPlugin;
+import net.sourceforge.squirrel_sql.client.plugin.PluginException;
+import net.sourceforge.squirrel_sql.client.plugin.PluginQueryTokenizerPreferencesManager;
+import net.sourceforge.squirrel_sql.fw.preferences.IQueryTokenizerPreferenceBean;
+
+import org.fest.swing.annotation.GUITest;
+import org.fest.swing.fixture.FrameFixture;
+import org.fest.swing.fixture.JCheckBoxFixture;
+import org.fest.swing.fixture.JTextComponentFixture;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+/**
+ * Test base class for UI tests on database-specific plugin preferences panels.
+ */
+@GUITest
+public abstract class AbstractPluginPreferencesUITest extends BaseSQuirreLJUnit4TestCase
+{
+
+ protected JFrame frame = null;
+ protected FrameFixture fixture = null;
+ protected PluginQueryTokenizerPreferencesPanel classUnderTest = null;
+ protected PluginQueryTokenizerPreferencesManager prefsManager =
+ new PluginQueryTokenizerPreferencesManager();
+ protected JCheckBoxFixture useCustomQTCheckBox = null;
+
+ protected IPlugin mockPlugin = Mockito.mock(IPlugin.class);
+
+ @Before
+ public void setUp() throws Exception
+ {
+ if (frame == null) {
+ frame = constructTestFrame();
+ }
+ fixture = new FrameFixture(frame);
+ fixture.show();
+ useCustomQTCheckBox = fixture.checkBox("useCustomQTCheckBox");
+ }
+
+ @After
+ public void tearDown()
+ {
+ if (fixture != null) {
+ fixture.cleanUp();
+ }
+ }
+
+ @Test
+ public void testCustomQTCheckbox() {
+ JTextComponentFixture lineCommentTextField = fixture.textBox("lineCommentTextField");
+ JTextComponentFixture statementSeparatorTextField = fixture.textBox("statementSeparatorTextField");
+
+ useCustomQTCheckBox.uncheck();
+ useCustomQTCheckBox.check();
+ useCustomQTCheckBox.uncheck();
+
+ lineCommentTextField.requireDisabled();
+ statementSeparatorTextField.requireDisabled();
+
+ useCustomQTCheckBox.check();
+ lineCommentTextField.requireEnabled();
+ statementSeparatorTextField.requireEnabled();
+ }
+
+ /**
+ * Builds the frame that will be used to display the panel.
+ *
+ * @return
+ * @throws Exception
+ */
+ protected JFrame constructTestFrame() throws Exception
+ {
+ JFrame f = new JFrame();
+ f.getContentPane().setLayout(new BorderLayout());
+ File prefsFile = new File("prefs.xml");
+ prefsFile.delete();
+ prefsManager.initialize(mockPlugin, getPreferenceBean());
+ classUnderTest = getPrefsPanelToTest();
+ JScrollPane sp = new JScrollPane(classUnderTest);
+ f.getContentPane().add(sp, BorderLayout.CENTER);
+ JButton button = new JButton("Save");
+ button.setName("saveButton");
+ button.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ classUnderTest.applyChanges();
+ prefsManager.unload();
+ }
+ });
+ JButton exitButton = new JButton("Exit");
+ exitButton.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ System.exit(0);
+ }
+ });
+ JPanel buttonPanel = new JPanel();
+ buttonPanel.add(button);
+ buttonPanel.add(exitButton);
+ f.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
+ f.setBounds(200, 50, 700, 700);
+ return f;
+ }
+
+ protected abstract PluginQueryTokenizerPreferencesPanel getPrefsPanelToTest() throws PluginException;
+
+ protected abstract IQueryTokenizerPreferenceBean getPreferenceBean();
+}
\ No newline at end of file
Modified: trunk/sql12/plugins/derby/pom.xml
===================================================================
--- trunk/sql12/plugins/derby/pom.xml 2011-03-19 13:40:08 UTC (rev 6201)
+++ trunk/sql12/plugins/derby/pom.xml 2011-03-19 17:35:17 UTC (rev 6202)
@@ -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.plugins</groupId>
@@ -83,6 +84,10 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-swing-junit-4.5</artifactId>
+ </dependency>
</dependencies>
<properties>
<pluginClassName>net.sourceforge.squirrel_sql.plugins.derby.DerbyPlugin</pluginClassName>
@@ -92,7 +97,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
- </plugin>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Copied: trunk/sql12/plugins/derby/src/test/java/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java (from rev 6191, trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java)
===================================================================
--- trunk/sql12/plugins/derby/src/test/java/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java (rev 0)
+++ trunk/sql12/plugins/derby/src/test/java/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java 2011-03-19 17:35:17 UTC (rev 6202)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2009 Rob Manning
+ * man...@us...
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package net.sourceforge.squirrel_sql.plugins.derby.prefs;
+
+
+import net.sourceforge.squirrel_sql.client.plugin.PluginException;
+import net.sourceforge.squirrel_sql.client.plugin.gui.AbstractPluginPreferencesUITest;
+import net.sourceforge.squirrel_sql.client.plugin.gui.PluginQueryTokenizerPreferencesPanel;
+import net.sourceforge.squirrel_sql.fw.preferences.BaseQueryTokenizerPreferenceBean;
+
+import org.fest.swing.annotation.GUITest;
+
+@GUITest
+public class DerbyPluginPreferencesPanelUITest extends AbstractPluginPreferencesUITest
+{
+
+ /**
+ * 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) throws Exception
+ {
+ new DerbyPluginPreferencesPanelUITest().constructTestFrame().setVisible(true);
+ }
+
+ @Override
+ protected PluginQueryTokenizerPreferencesPanel getPrefsPanelToTest() throws PluginException
+ {
+ return new DerbyPluginPreferencesPanel(prefsManager);
+ }
+
+ @Override
+ protected BaseQueryTokenizerPreferenceBean getPreferenceBean()
+ {
+ return new DerbyPreferenceBean();
+ }
+
+
+}
Modified: trunk/sql12/plugins/squirrelsql-plugins-parent-pom/pom.xml
===================================================================
--- trunk/sql12/plugins/squirrelsql-plugins-parent-pom/pom.xml 2011-03-19 13:40:08 UTC (rev 6201)
+++ trunk/sql12/plugins/squirrelsql-plugins-parent-pom/pom.xml 2011-03-19 17:35:17 UTC (rev 6202)
@@ -115,6 +115,12 @@
<version>${mockito-version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-swing-junit-4.5</artifactId>
+ <version>${fest-version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>
@@ -131,16 +137,6 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire-plugin-version}</version>
- <configuration>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <parallel>${surefire-parallel-type}</parallel>
- <threadCount>${surefire-thread-count}</threadCount>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${source-plugin-version}</version>
<configuration>
Modified: trunk/sql12/pom.xml
===================================================================
--- trunk/sql12/pom.xml 2011-03-19 13:40:08 UTC (rev 6201)
+++ trunk/sql12/pom.xml 2011-03-19 17:35:17 UTC (rev 6202)
@@ -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>
<groupId>net.sf.squirrel-sql</groupId>
<artifactId>squirrel-root-pom</artifactId>
@@ -84,6 +85,7 @@
<clover-version>3.0.2</clover-version>
<easymock-version>2.4</easymock-version>
<easymockclassextension-version>2.4</easymockclassextension-version>
+ <fest-version>1.2.1</fest-version>
<gsbase-version>2.0.1</gsbase-version>
<hibernate-annotations-version>3.3.0.ga</hibernate-annotations-version>
<izpack-standalone.version>4.3.1</izpack-standalone.version>
@@ -92,12 +94,12 @@
<jgoodies-forms-version>1.0.5</jgoodies-forms-version>
<mockito-version>1.8.5</mockito-version>
<spring-framework-version>2.5.2</spring-framework-version>
-
+
<!-- Other -->
<surefire-parallel-type>classes</surefire-parallel-type>
<surefire-thread-count>4</surefire-thread-count>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-
+
</properties>
<modules>
<module>fw</module>
@@ -141,6 +143,12 @@
<version>${mockito-version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-swing-junit-4.5</artifactId>
+ <version>${fest-version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>
@@ -190,6 +198,19 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin-version}</version>
<configuration>
+ <excludes>
+ <!--
+ Until ApplicationArguments can be isolated from being accessed statically by
+ all code that currently relies on it, we exclude ApplicationArgumentsTest it here
+ so that it doesn't poison other tests that happen to run after it in the same
+ JVM. This is only technically required by the "app" project, but at the moment
+ we wish to share the commonly needed additional exclusion for UI Test classes.
+ -->
+ <exclude>**/ApplicationArgumentsTest.java</exclude>
+ <exclude>**/*UITest.java</exclude>
+ </excludes>
+ <parallel>${surefire-parallel-type}</parallel>
+ <threadCount>${surefire-thread-count}</threadCount>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
@@ -203,11 +224,11 @@
<artifactId>maven-release-plugin</artifactId>
<version>${release-plugin-version}</version>
</plugin>
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- <version>${clover-version}</version>
- </plugin>
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover2-plugin</artifactId>
+ <version>${clover-version}</version>
+ </plugin>
</plugins>
</pluginManagement>
</build>
@@ -276,5 +297,42 @@
</plugins>
</build>
</profile>
+ <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>
+ <excludes>
+ <exclude>**/Abstract*UITest.java</exclude>
+ </excludes>
+ <parallel>${surefire-parallel-type}</parallel>
+ <threadCount>${surefire-thread-count}</threadCount>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Deleted: trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/plugin/gui/AbstractPluginPreferencesUITest.java
===================================================================
--- trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/plugin/gui/AbstractPluginPreferencesUITest.java 2011-03-19 13:40:08 UTC (rev 6201)
+++ trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/client/plugin/gui/AbstractPluginPreferencesUITest.java 2011-03-19 17:35:17 UTC (rev 6202)
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2009 Rob Manning
- * man...@us...
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package net.sourceforge.squirrel_sql.client.plugin.gui;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-
-import net.sourceforge.squirrel_sql.BaseSQuirreLJUnit4TestCase;
-import net.sourceforge.squirrel_sql.client.plugin.PluginException;
-import net.sourceforge.squirrel_sql.client.plugin.PluginQueryTokenizerPreferencesManager;
-import net.sourceforge.squirrel_sql.fw.preferences.IQueryTokenizerPreferenceBean;
-
-import org.fest.swing.annotation.GUITest;
-import org.fest.swing.fixture.FrameFixture;
-import org.fest.swing.fixture.JCheckBoxFixture;
-import org.fest.swing.fixture.JTextComponentFixture;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test base class for UI tests on database-specific plugin preferences panels.
- */
-@GUITest
-public abstract class AbstractPluginPreferencesUITest extends BaseSQuirreLJUnit4TestCase
-{
-
- protected JFrame frame = null;
- protected FrameFixture fixture = null;
- protected PluginQueryTokenizerPreferencesPanel classUnderTest = null;
- protected PluginQueryTokenizerPreferencesManager prefsManager =
- new PluginQueryTokenizerPreferencesManager();
- protected JCheckBoxFixture useCustomQTCheckBox = null;
-
- @Before
- public void setUp() throws Exception
- {
- if (frame == null) {
- frame = constructTestFrame();
- }
- fixture = new FrameFixture(frame);
- fixture.show();
- useCustomQTCheckBox = fixture.checkBox("useCustomQTCheckBox");
- }
-
- @After
- public void tearDown()
- {
- if (fixture != null) {
- fixture.cleanUp();
- }
- }
-
- @Test
- public void testCustomQTCheckbox() {
- JTextComponentFixture lineCommentTextField = fixture.textBox("lineCommentTextField");
- JTextComponentFixture statementSeparatorTextField = fixture.textBox("statementSeparatorTextField");
-
- useCustomQTCheckBox.uncheck();
- useCustomQTCheckBox.check();
- useCustomQTCheckBox.uncheck();
-
- lineCommentTextField.requireDisabled();
- statementSeparatorTextField.requireDisabled();
-
- useCustomQTCheckBox.check();
- lineCommentTextField.requireEnabled();
- statementSeparatorTextField.requireEnabled();
- }
-
- /**
- * Builds the frame that will be used to display the panel.
- *
- * @return
- * @throws Exception
- */
- protected JFrame constructTestFrame() throws Exception
- {
- JFrame f = new JFrame();
- f.getContentPane().setLayout(new BorderLayout());
- File prefsFile = new File("prefs.xml");
- prefsFile.delete();
- prefsManager.initialize(new DummyPlugin(), getPreferenceBean());
- classUnderTest = getPrefsPanelToTest();
- JScrollPane sp = new JScrollPane(classUnderTest);
- f.getContentPane().add(sp, BorderLayout.CENTER);
- JButton button = new JButton("Save");
- button.setName("saveButton");
- button.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- classUnderTest.applyChanges();
- prefsManager.unload();
- }
- });
- JButton exitButton = new JButton("Exit");
- exitButton.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- System.exit(0);
- }
- });
- JPanel buttonPanel = new JPanel();
- buttonPanel.add(button);
- buttonPanel.add(exitButton);
- f.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
- f.setBounds(200, 50, 700, 700);
- return f;
- }
-
- protected abstract PluginQueryTokenizerPreferencesPanel getPrefsPanelToTest() throws PluginException;
-
- protected abstract IQueryTokenizerPreferenceBean getPreferenceBean();
-}
\ No newline at end of file
Deleted: trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java
===================================================================
--- trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java 2011-03-19 13:40:08 UTC (rev 6201)
+++ trunk/sql12/test/jfctests/net/sourceforge/squirrel_sql/plugins/derby/prefs/DerbyPluginPreferencesPanelUITest.java 2011-03-19 17:35:17 UTC (rev 6202)
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Rob Manning
- * man...@us...
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package net.sourceforge.squirrel_sql.plugins.derby.prefs;
-
-
-import net.sourceforge.squirrel_sql.client.plugin.PluginException;
-import net.sourceforge.squirrel_sql.client.plugin.gui.AbstractPluginPreferencesUITest;
-import net.sourceforge.squirrel_sql.client.plugin.gui.PluginQueryTokenizerPreferencesPanel;
-import net.sourceforge.squirrel_sql.fw.preferences.BaseQueryTokenizerPreferenceBean;
-
-import org.fest.swing.annotation.GUITest;
-
-@GUITest
-public class DerbyPluginPreferencesPanelUITest extends AbstractPluginPreferencesUITest
-{
-
- /**
- * 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) throws Exception
- {
- new DerbyPluginPreferencesPanelUITest().constructTestFrame().setVisible(true);
- }
-
- @Override
- protected PluginQueryTokenizerPreferencesPanel getPrefsPanelToTest() throws PluginException
- {
- return new DerbyPluginPreferencesPanel(prefsManager);
- }
-
- @Override
- protected BaseQueryTokenizerPreferenceBean getPreferenceBean()
- {
- return new DerbyPreferenceBean();
- }
-
-
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|