summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrismair <chrismair@531de8e6-9941-0410-b38b-9a92acbe0330>2014-05-04 18:58:43 +0000
committerchrismair <chrismair@531de8e6-9941-0410-b38b-9a92acbe0330>2014-05-04 18:58:43 +0000
commit9c22c3495fa468049fafeb69ff4f7a5b8c23fe45 (patch)
tree63b75ab7d4079582c5d2f0c5964d7088d27da12a
parent24c1abbc264b2f3a572e965653ed6afb57fe08df (diff)
downloadmockftpserver-9c22c3495fa468049fafeb69ff4f7a5b8c23fe45.tar.gz
Remove obsolete test suite infrastructure
git-svn-id: svn://svn.code.sf.net/p/mockftpserver/code@271 531de8e6-9941-0410-b38b-9a92acbe0330
-rw-r--r--MockFtpServer/.classpath2
-rw-r--r--MockFtpServer/MockFtpServer.eml4
-rw-r--r--MockFtpServer/MockFtpServer.ipr16
-rw-r--r--MockFtpServer/src/test/java/org/mockftpserver/test/AbstractDirectoryTestSuite.java133
-rw-r--r--MockFtpServer/src/test/java/org/mockftpserver/test/AbstractTestSuite.java57
-rw-r--r--MockFtpServer/src/test/java/org/mockftpserver/test/MockFtpServerTestSuite.java55
6 files changed, 15 insertions, 252 deletions
diff --git a/MockFtpServer/.classpath b/MockFtpServer/.classpath
index 0cf1090..61fc388 100644
--- a/MockFtpServer/.classpath
+++ b/MockFtpServer/.classpath
@@ -2,8 +2,8 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
- <classpathentry kind="src" path="src/test/groovy"/>
<classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="src" path="src/test/groovy"/>
<classpathentry excluding="**/*.java" kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/junit-addons/junit-addons/1.4/junit-addons-1.4.jar"/>
diff --git a/MockFtpServer/MockFtpServer.eml b/MockFtpServer/MockFtpServer.eml
index 791e958..762ff2c 100644
--- a/MockFtpServer/MockFtpServer.eml
+++ b/MockFtpServer/MockFtpServer.eml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<component LANGUAGE_LEVEL="JDK_1_4" jdk="$project_jdk_name$" jdk_type="JavaSDK">
+<component LANGUAGE_LEVEL="JDK_1_4" inheritJdk="true">
<output-test url="file://$MODULE_DIR$/target/test-classes"/>
<contentEntry url="file://$MODULE_DIR$">
- <testFolder url="file://$MODULE_DIR$/src/test/groovy"/>
<testFolder url="file://$MODULE_DIR$/src/test/java"/>
+ <testFolder url="file://$MODULE_DIR$/src/test/groovy"/>
<testFolder url="file://$MODULE_DIR$/src/test/resources"/>
<excludeFolder url="file://$MODULE_DIR$/target"/>
</contentEntry>
diff --git a/MockFtpServer/MockFtpServer.ipr b/MockFtpServer/MockFtpServer.ipr
index 4bee721..f3377e5 100644
--- a/MockFtpServer/MockFtpServer.ipr
+++ b/MockFtpServer/MockFtpServer.ipr
@@ -74,7 +74,17 @@
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
+ <profile default="false" name="Maven default annotation processors profile" enabled="true">
+ <sourceOutputDir name="target/generated-sources/annotations" />
+ <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+ <outputRelativeToContentRoot value="true" />
+ <processorPath useClasspath="true" />
+ <module name="MockFtpServer" />
+ </profile>
</annotationProcessing>
+ <bytecodeTargetLevel>
+ <module name="MockFtpServer" target="1.4" />
+ </bytecodeTargetLevel>
</component>
<component name="CopyrightManager" default="">
<module2copyright />
@@ -101,9 +111,6 @@
<entry_points version="2.0" />
</component>
<component name="IdProvider" IDEtalkID="8A6189ED5C30FC95107AD305B649986C" />
- <component name="JavacSettings">
- <option name="ADDITIONAL_OPTIONS_STRING" value="-target 1.4" />
- </component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
@@ -270,6 +277,7 @@
<dictionary name="Chris">
<words>
<w>inet</w>
+ <w>mockftpserver</w>
<w>pathname</w>
<w>programmatically</w>
<w>rnfr</w>
@@ -289,7 +297,7 @@
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_4" assert-keyword="true" jdk-15="false" project-jdk-name="1.5" project-jdk-type="JavaSDK">
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_4" assert-keyword="true" jdk-15="false" project-jdk-name="$project_jdk_name$" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="ResourceManagerContainer">
diff --git a/MockFtpServer/src/test/java/org/mockftpserver/test/AbstractDirectoryTestSuite.java b/MockFtpServer/src/test/java/org/mockftpserver/test/AbstractDirectoryTestSuite.java
deleted file mode 100644
index 04a22a4..0000000
--- a/MockFtpServer/src/test/java/org/mockftpserver/test/AbstractDirectoryTestSuite.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.mockftpserver.test;
-
-import junit.framework.Test;
-import junitx.util.DirectorySuiteBuilder;
-import junitx.util.SimpleTestFilter;
-
-/**
- * Abstract superclass for test suites that recursively process a directory of
- * Java class files and run all matching unit test classes. Subclasses must
- * implement the {@link #getTestClassesDirectory()} method to specify the root
- * directory for the Java class files. Only class names that end in 'Test' are
- * included. Furthermore, only concrete classes (non-abstract and non-interface)
- * classes are included. Subclasses can perform additional filtering by overriding
- * the {@link #isClassIncluded(Class)} method to filter based on the class.
- * <p>
- * A typical pattern is to define application-specific marker interfaces, such as
- * 'IntegrationTest' or 'LongRunningTest', and have test classes implement the
- * appropriate interface(s). A subclass that runs unit tests, for instance, can
- * then exclude such classes, while another subclass for integration tests can
- * include only those classes that implement 'IntegrationTest'.
- * <p>
- * Note: This class requires the JUnit-addons jar.
- *
- * @see http://junit-addons.sourceforge.net/
- *
- * @version $Revision$ - $Date$
- *
- * @author Chris Mair
- */
-public abstract class AbstractDirectoryTestSuite extends AbstractTestSuite {
-
- private static final String TEST_CLASSES_DIR_PROPERTY = "test.classes.dir";
-
- /**
- * Constructor
- */
- protected AbstractDirectoryTestSuite() {
-
- // Handle (wrap) any Exception to allow subclasses to use default constructor
- try {
- Test suite = buildAllTestsSuite();
- addTest(suite);
- }
- catch(Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- //-------------------------------------------------------------------------
- // Abstract and Overridable Methods
- //-------------------------------------------------------------------------
-
- /**
- * Return the path of the root class file directory
- */
- protected abstract String getTestClassesDirectory();
-
- /**
- * Return true if the specified class should be included in the test suite.
- * This method will only be invoked for concrete classes whose names end in 'Test'.
- * @param theClass - the class
- * @return true if the specified class should be included in the test suite
- */
- protected boolean isClassIncluded(Class theClass) {
- // Default to including all classes
- return true;
- }
-
- /**
- * Return true if all ignored tests should be listed to System.out. Subclasses
- * can override this and return true to list out all ignored test classes.
- * @return true if all ignored tests should be listed to System.out
- */
- protected boolean listIgnoredTests() {
- return false;
- }
-
- //-------------------------------------------------------------------------
- // Private Helper Methods
- //-------------------------------------------------------------------------
-
- /**
- * Build the TestSuite containing the tests to be run
- * @return the test suite as a Test
- */
- private Test buildAllTestsSuite() throws Exception {
-
- DirectorySuiteBuilder builder = new DirectorySuiteBuilder();
- builder.setFilter(new SimpleTestFilter() {
-
- public boolean include(Class theClass) {
- boolean superInclude = super.include(theClass);
- boolean include = isClassIncluded(theClass);
- if (superInclude && !include && listIgnoredTests()) {
- System.out.println("IGNORED [" + theClass.getName() + "]");
- }
- return superInclude && include;
- }
- });
-
- return builder.suite(getDirectory());
- }
-
-
- /**
- * Return the path of the root class file directory. Use the "test.classes.dir"
- * system property value if it has been set, otherwise use the value returned
- * from the getDefaultDirectory() method.
- *
- * @return the path of the root class file directory
- */
- private String getDirectory() {
-
- String sysProp = System.getProperty(TEST_CLASSES_DIR_PROPERTY);
- return (sysProp == null) ? getTestClassesDirectory() : sysProp;
- }
-
-}
diff --git a/MockFtpServer/src/test/java/org/mockftpserver/test/AbstractTestSuite.java b/MockFtpServer/src/test/java/org/mockftpserver/test/AbstractTestSuite.java
deleted file mode 100644
index 6a3af56..0000000
--- a/MockFtpServer/src/test/java/org/mockftpserver/test/AbstractTestSuite.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.mockftpserver.test;
-
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-/**
- * The absttract superclass for TestSuites that allow registering
- * TestSuiteListeners to add customized behavior before and after the
- * test suite is executed.
- *
- * @version $Revision$ - $Date$
- *
- * @author Chris Mair
- */
-public class AbstractTestSuite extends TestSuite {
-
- /**
- * Constructor that takes the test name
- * @param testName Name of test
- */
- public AbstractTestSuite() {}
-
- //-----------------------------------------------------------
- // Overridden TestSuite Methods
- //-----------------------------------------------------------
-
- /**
- * Override this method to insert hooks for before and after the test suite run
- * @see junit.framework.Test#run(junit.framework.TestResult)
- */
- public void run(TestResult arg0) {
-
- LoggingUtil loggingUtil = LoggingUtil.getTestSuiteLogger(this);
- loggingUtil.logStartOfTest();
-
- // Run this test suite
- super.run(arg0);
-
- loggingUtil.logEndOfTest();
- }
-
-}
diff --git a/MockFtpServer/src/test/java/org/mockftpserver/test/MockFtpServerTestSuite.java b/MockFtpServer/src/test/java/org/mockftpserver/test/MockFtpServerTestSuite.java
deleted file mode 100644
index 68864fe..0000000
--- a/MockFtpServer/src/test/java/org/mockftpserver/test/MockFtpServerTestSuite.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.mockftpserver.test;
-
-import junit.framework.Test;
-
-/**
- * Unit test suite for the StubFtpServer application
- *
- * @version $Revision$ - $Date$
- *
- * @author Chris Mair
- */
-public class MockFtpServerTestSuite extends AbstractDirectoryTestSuite {
-
- //private static final String CLASSES_DIR = "target/test-classes";
- private static final String CLASSES_DIR = "bin-groovy";
-
- /**
- * @see org.mockftpserver.test.AbstractDirectoryTestSuite#getTestClassesDirectory()
- */
- protected String getTestClassesDirectory() {
- return CLASSES_DIR;
- }
-
-
- /**
- * Return the TestSuite containing the tests to be run
- * @return the test suite as a Test
- */
- public static Test suite() {
- return new MockFtpServerTestSuite();
- }
-
- /**
- * Run the test suite
- */
- public static void main(String[] args) throws Exception {
- junit.textui.TestRunner.run(suite());
- }
-
-} \ No newline at end of file