|
From: <ls...@us...> - 2009-04-05 10:52:43
|
Revision: 5215
http://jnode.svn.sourceforge.net/jnode/?rev=5215&view=rev
Author: lsantha
Date: 2009-04-05 10:52:24 +0000 (Sun, 05 Apr 2009)
Log Message:
-----------
Progress with fs tests: migrating to junit-4.5 - by Stefan Anzinger
Modified Paths:
--------------
trunk/all/build.xml
trunk/all/conf/tests-plugin-list.xml
trunk/core/.classpath
trunk/core/build.xml
trunk/core/core.iml
trunk/core/src/test/org/jnode/test/framework/TestManager.java
trunk/distr/.classpath
trunk/distr/build.xml
trunk/fs/.classpath
trunk/fs/descriptors/org.jnode.test.fs.xml
trunk/fs/fs.iml
trunk/fs/src/test/org/jnode/test/fs/filesystem/AbstractFSTest.java
trunk/fs/src/test/org/jnode/test/fs/filesystem/FSTestSuite.java
trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/BasicFSTest.java
trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/ConcurrentAccessFSTest.java
trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/FileFSTest.java
trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/TreeFSTest.java
Removed Paths:
-------------
trunk/core/descriptors/jcfe.xml
trunk/core/descriptors/jfunc.xml
trunk/core/lib/jcfe.jar
trunk/core/lib/jfunc.jar
trunk/core/lib/junit.jar
Modified: trunk/all/build.xml
===================================================================
--- trunk/all/build.xml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/all/build.xml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -50,7 +50,7 @@
<property name="commons-net.jar" value="${root.dir}/core/lib/commons-net-1.1.0.jar"/>
<property name="dnsjava.jar" value="${root.dir}/net/lib/dnsjava-1.6.6.jar"/>
<property name="jsch.jar" value="${root.dir}/net/lib/jsch-0.1.24.jar"/>
- <property name="junit.jar" value="${root.dir}/core/lib/junit.jar"/>
+ <property name="junit.jar" value="${root.dir}/core/lib/junit-4.5.jar"/>
<property name="mmtk.jar" value="${root.dir}/core/lib/mmtk/mmtk.jar"/>
<property name="mauve.jar" value="${root.dir}/core/lib/mauve.jar"/>
<property name="edtftpj.jar" value="${root.dir}/fs/lib/edtftpj-1.5.2.jar"/>
@@ -79,9 +79,6 @@
<property name="asm.jar" value="${root.dir}/core/lib/asm-1.5.3.jar"/>
<property name="asm-attrs.jar" value="${root.dir}/core/lib/asm-attrs-1.5.3.jar"/>
<property name="asm-util.jar" value="${root.dir}/core/lib/asm-util-1.5.3.jar"/>
- <property name="jcfe.jar" value="${root.dir}/core/lib/jcfe.jar"/>
- <property name="jfunc.jar" value="${root.dir}/core/lib/jfunc.jar"/>
- <property name="junit4.jar" value="${root.dir}/distr/lib/junit-4.1.jar"/>
<property name="log4j.jar" value="${root.dir}/core/lib/log4j-1.2.8.jar"/>
<property name="beanshell.jar" value="${root.dir}/shell/lib/bsh-2.0b5.jar"/>
@@ -121,8 +118,6 @@
<pathelement location="${basedir}/conf"/>
<pathelement location="${beanshell.jar}"/>
<pathelement location="${js.jar}"/>
- <pathelement location="${jcfe.jar}"/>
- <pathelement location="${jfunc.jar}"/>
<pathelement location="${oncrpc.jar}"/>
<pathelement location="${edtftpj.jar}"/>
<pathelement location="${jcifs.jar}"/>
@@ -249,8 +244,6 @@
<libalias name="asm-util.jar" alias="${asm-util.jar}"/>
<libalias name="cglib.jar" alias="${cglib.jar}"/>
<libalias name="mauve.jar" alias="${mauve.jar}"/>
- <libalias name="jcfe.jar" alias="${jcfe.jar}"/>
- <libalias name="jfunc.jar" alias="${jfunc.jar}"/>
<libalias name="ant.jar" alias="${ant.jar}"/>
<libalias name="ant-launcher.jar" alias="${ant-launcher.jar}"/>
Modified: trunk/all/conf/tests-plugin-list.xml
===================================================================
--- trunk/all/conf/tests-plugin-list.xml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/all/conf/tests-plugin-list.xml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -23,10 +23,6 @@
<plugin id="org.jnode.test.net"/>
<plugin id="org.jnode.test.shell"/>
<plugin id="org.jnode.shell.command.test"/>
-
- <!-- JUnit extensions -->
- <plugin id="jcfe"/> <!-- not a JUnit extension, but needed by jfunc -->
- <plugin id="jfunc"/>
<plugin id="org.jnode.testrunner"/>
</plugin-list>
\ No newline at end of file
Modified: trunk/core/.classpath
===================================================================
--- trunk/core/.classpath 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/core/.classpath 2009-04-05 10:52:24 UTC (rev 5215)
@@ -30,6 +30,5 @@
<classpathentry exported="true" kind="lib" path="lib/asm-attrs-1.5.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/asm-util-1.5.3.jar"/>
<classpathentry kind="lib" path="lib/mauve.jar" sourcepath="lib/mauve-src.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/core/build.xml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -13,7 +13,7 @@
<!-- Subproject specific classpath -->
<path id="my-cp">
<path refid="cp"/>
- <pathelement location="${junit4.jar}"/>
+ <pathelement location="${junit.jar}"/>
<pathelement location="${mmtk.jar}"/>
<pathelement location="${mauve.jar}"/>
</path>
Modified: trunk/core/core.iml
===================================================================
--- trunk/core/core.iml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/core/core.iml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -75,7 +75,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/lib/junit-4.5.jar!/" />
+ <root url="jar://$MODULE_DIR$/lib/jmock-1.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -84,7 +84,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/lib/jcfe.jar!/" />
+ <root url="jar://$MODULE_DIR$/lib/jmock-cglib-1.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -93,7 +93,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/lib/jfunc.jar!/" />
+ <root url="jar://$MODULE_DIR$/lib/cglib-2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -102,30 +102,12 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/lib/jmock-1.0.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/lib/junit-4.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/lib/jmock-cglib-1.0.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/lib/cglib-2.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
</component>
</module>
Deleted: trunk/core/descriptors/jcfe.xml
===================================================================
--- trunk/core/descriptors/jcfe.xml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/core/descriptors/jcfe.xml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plugin SYSTEM "jnode.dtd">
-
-<plugin id="jcfe"
- name="jcfe classes"
- version="1"
- provider-name="jcfe"
- provider-url="http://www.gnufoo.org/jcfe/"
- license-name="cpl">
-
- <runtime>
- <library name="jcfe.jar">
- <export name="*"/>
- </library>
- </runtime>
-</plugin>
\ No newline at end of file
Deleted: trunk/core/descriptors/jfunc.xml
===================================================================
--- trunk/core/descriptors/jfunc.xml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/core/descriptors/jfunc.xml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plugin SYSTEM "jnode.dtd">
-
-<plugin id="jfunc"
- name="JFunc classes"
- version="1.1"
- provider-name="JFunc"
- provider-url="http://jfunc.sourceforge.net/"
- license-name="cpl">
-
- <requires>
- <import plugin="org.junit" version="3.8"/>
- <import plugin="jcfe" version="1"/>
- </requires>
-
- <runtime>
- <library name="jfunc.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <extension point="org.jnode.security.permissions">
- <permission class="java.util.PropertyPermission" name="user.home" actions="read"/>
-
- <permission class="java.io.FilePermission" name="/jnode/home/junit.properties" actions="read"/>
- <permission class="java.lang.RuntimePermission" name="exitVM" actions="*" />
- </extension>
-</plugin>
\ No newline at end of file
Deleted: trunk/core/lib/jcfe.jar
===================================================================
(Binary files differ)
Deleted: trunk/core/lib/jfunc.jar
===================================================================
(Binary files differ)
Deleted: trunk/core/lib/junit.jar
===================================================================
(Binary files differ)
Modified: trunk/core/src/test/org/jnode/test/framework/TestManager.java
===================================================================
--- trunk/core/src/test/org/jnode/test/framework/TestManager.java 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/core/src/test/org/jnode/test/framework/TestManager.java 2009-04-05 10:52:24 UTC (rev 5215)
@@ -29,6 +29,8 @@
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;
+
+import junit.framework.JUnit4TestAdapter;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.log4j.Logger;
@@ -158,7 +160,7 @@
for (Class<? extends TestSuite> suiteClass : suites) {
if (!matchCategory(wantedCategories, categories.get(suiteClass))) continue;
- suite.addTestSuite(suiteClass);
+ suite.addTest(new JUnit4TestAdapter(suiteClass));
log.debug("added TestSuite " + suiteClass.getName());
}
Modified: trunk/distr/.classpath
===================================================================
--- trunk/distr/.classpath 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/distr/.classpath 2009-04-05 10:52:24 UTC (rev 5215)
@@ -16,10 +16,10 @@
<classpathentry kind="src" path="/textui"/>
<classpathentry combineaccessrules="false" kind="src" path="/fs"/>
<classpathentry kind="lib" path="/shell/lib/bsh-2.0b5.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/commons-logging.jar"/>
<classpathentry kind="lib" path="lib/derby.jar"/>
<classpathentry kind="lib" path="lib/derbynet.jar"/>
<classpathentry kind="lib" path="/core/lib/log4j-1.2.8.jar"/>
+ <classpathentry kind="lib" path="/core/lib/junit.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
Modified: trunk/distr/build.xml
===================================================================
--- trunk/distr/build.xml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/distr/build.xml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -15,7 +15,7 @@
<pathelement location="${jnode-shell.jar}"/>
<pathelement location="${jnode-fs.jar}"/>
- <pathelement location="${junit4.jar}"/>
+ <pathelement location="${junit.jar}"/>
<pathelement location="${telnetd.jar}"/>
<pathelement location="${jetty.jar}"/>
Modified: trunk/fs/.classpath
===================================================================
--- trunk/fs/.classpath 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/.classpath 2009-04-05 10:52:24 UTC (rev 5215)
@@ -12,8 +12,6 @@
<classpathentry kind="lib" path="/core/lib/ant.jar"/>
<classpathentry kind="lib" path="/core/lib/cglib-2.1.jar"/>
<classpathentry kind="lib" path="/core/lib/commons-net-1.1.0.jar"/>
- <classpathentry kind="lib" path="/core/lib/jcfe.jar"/>
- <classpathentry kind="lib" path="/core/lib/jfunc.jar"/>
<classpathentry kind="lib" path="/core/lib/jmock-1.0.1.jar"/>
<classpathentry kind="lib" path="/core/lib/jmock-cglib-1.0.1.jar"/>
<classpathentry kind="lib" path="/core/lib/junit.jar"/>
Modified: trunk/fs/descriptors/org.jnode.test.fs.xml
===================================================================
--- trunk/fs/descriptors/org.jnode.test.fs.xml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/descriptors/org.jnode.test.fs.xml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -25,8 +25,6 @@
<import plugin="net.sf.cglib" version="2.1"/>
<import plugin="org.jmock" version="1.0.1"/>
<import plugin="org.jmock.cglib" version="1.0.1"/>
- <import plugin="jcfe" version="1"/>
- <import plugin="jfunc" version="1.1"/>
<import plugin="org.jnode.driver.block"/>
<import plugin="org.jnode.driver.block.ramdisk"/>
Modified: trunk/fs/fs.iml
===================================================================
--- trunk/fs/fs.iml 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/fs.iml 2009-04-05 10:52:24 UTC (rev 5215)
@@ -48,21 +48,12 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/../core/lib/junit.jar!/" />
+ <root url="jar://$MODULE_DIR$/../core/lib/junit-4.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../core/lib/jfunc.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
</component>
</module>
Modified: trunk/fs/src/test/org/jnode/test/fs/filesystem/AbstractFSTest.java
===================================================================
--- trunk/fs/src/test/org/jnode/test/fs/filesystem/AbstractFSTest.java 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/src/test/org/jnode/test/fs/filesystem/AbstractFSTest.java 2009-04-05 10:52:24 UTC (rev 5215)
@@ -33,19 +33,36 @@
import org.apache.log4j.Logger;
import org.jnode.driver.Device;
+import org.jnode.emu.naming.BasicNameSpace;
+import org.jnode.emu.plugin.model.DummyConfigurationElement;
+import org.jnode.emu.plugin.model.DummyExtension;
+import org.jnode.emu.plugin.model.DummyExtensionPoint;
+import org.jnode.emu.plugin.model.DummyPluginDescriptor;
import org.jnode.fs.FSDirectory;
import org.jnode.fs.FSEntry;
import org.jnode.fs.FSFile;
import org.jnode.fs.FileSystem;
import org.jnode.fs.FileSystemException;
+import org.jnode.fs.service.FileSystemService;
+import org.jnode.fs.service.def.FileSystemPlugin;
+import org.jnode.naming.InitialNaming;
import org.jnode.test.fs.filesystem.config.FSTestConfig;
+import org.jnode.test.fs.filesystem.config.FSType;
import org.jnode.test.support.TestUtils;
+import org.jnode.util.OsUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
/**
* @author Fabien DUMINY
*/
+@RunWith(Parameterized.class)
public abstract class AbstractFSTest extends TestCase {
protected final Logger log = Logger.getLogger(getClass());
+ private static boolean setup = false;
//public static final int FILE_SIZE_IN_WORDS = 256 * 1024; // 512 Ko = 256 K Words
public static final int FILE_SIZE_IN_WORDS = 128; // 512 Ko = 128 K Words
@@ -59,6 +76,15 @@
this.config = config;
}
+ @Parameters
+ public static List<FSTestConfig[]> getData() {
+ List<FSTestConfig[]> config = new ArrayList<FSTestConfig[]>();
+ for (FSTestConfig cfg : new FSConfigurations()) {
+ config.add(new FSTestConfig[] {cfg});
+ }
+ return config;
+ }
+
/**
*
*/
@@ -66,14 +92,38 @@
super(name);
}
+ @Before
public final void setUp() throws NameNotFoundException, FileSystemException, IOException,
InstantiationException, IllegalAccessException, Exception {
super.setUp();
+ if (!setup && !OsUtils.isJNode()) {
+ // We are not running in JNode, emulate a JNode environment.
+
+ InitialNaming.setNameSpace(new BasicNameSpace());
+
+ // Build a plugin descriptor that is sufficient for the FileSystemPlugin to
+ // configure file system types for testing.
+ DummyPluginDescriptor desc = new DummyPluginDescriptor(true);
+ DummyExtensionPoint ep = new DummyExtensionPoint("types", "org.jnode.fs.types", "types");
+ desc.addExtensionPoint(ep);
+ for (FSType fsType : FSType.values()) {
+ DummyExtension extension = new DummyExtension();
+ DummyConfigurationElement element = new DummyConfigurationElement();
+ element.addAttribute("class", fsType.getFsTypeClass().getName());
+ extension.addElement(element);
+ ep.addExtension(extension);
+ }
+
+ FileSystemService fss = new FileSystemPlugin(desc);
+ InitialNaming.bind(FileSystemService.class, fss);
+ }
+ setup = true;
this.device = config.getDeviceParam().createDevice();
this.fs = config.getFileSystem().format(this.device);
this.fs = config.getFileSystem().mount(this.device);
}
+ @After
public final void tearDown() throws Exception {
// Some tests don't call setup(config), which means that config will be null when teardown is called.
if (config != null) {
Modified: trunk/fs/src/test/org/jnode/test/fs/filesystem/FSTestSuite.java
===================================================================
--- trunk/fs/src/test/org/jnode/test/fs/filesystem/FSTestSuite.java 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/src/test/org/jnode/test/fs/filesystem/FSTestSuite.java 2009-04-05 10:52:24 UTC (rev 5215)
@@ -20,28 +20,13 @@
package org.jnode.test.fs.filesystem;
-import javax.naming.NamingException;
-
-import junit.extensions.jfunc.JFuncSuite;
-import junit.extensions.jfunc.textui.JFuncRunner;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.jnode.emu.naming.BasicNameSpace;
-import org.jnode.emu.plugin.model.DummyConfigurationElement;
-import org.jnode.emu.plugin.model.DummyExtension;
-import org.jnode.emu.plugin.model.DummyExtensionPoint;
-import org.jnode.emu.plugin.model.DummyPluginDescriptor;
-import org.jnode.fs.service.FileSystemService;
-import org.jnode.fs.service.def.FileSystemPlugin;
-import org.jnode.naming.InitialNaming;
-import org.jnode.test.fs.filesystem.config.FSTestConfig;
-import org.jnode.test.fs.filesystem.config.FSType;
import org.jnode.test.fs.filesystem.tests.BasicFSTest;
import org.jnode.test.fs.filesystem.tests.ConcurrentAccessFSTest;
import org.jnode.test.fs.filesystem.tests.FileFSTest;
import org.jnode.test.fs.filesystem.tests.TreeFSTest;
-import org.jnode.util.OsUtils;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
/**
* This class runs a suite of functional tests on the JNode file system
@@ -52,75 +37,15 @@
* @author Fabien DUMINY
* @author cr...@jn...
*/
-public class FSTestSuite extends JFuncSuite {
- private static boolean setup = false;
- public static void main(String[] args) throws Throwable {
- setUp();
-
- JFuncRunner.run(FSTestSuite.suite());
- //JFuncRunner.main(new String[]{"-v", "--color", FSTestSuite.class.getName()});
- //JFuncRunner.main(new String[]{"-v", FSTestSuite.class.getName()});
+@RunWith(Suite.class)
+@SuiteClasses({
+ BasicFSTest.class,
+ ConcurrentAccessFSTest.class,
+ FileFSTest.class,
+ TreeFSTest.class
}
-
- private static void setUp() throws NamingException {
- if (!setup && !OsUtils.isJNode()) {
- // We are not running in JNode, emulate a JNode environment.
-
- InitialNaming.setNameSpace(new BasicNameSpace());
-
- // Build a plugin descriptor that is sufficient for the FileSystemPlugin to
- // configure file system types for testing.
- DummyPluginDescriptor desc = new DummyPluginDescriptor(true);
- DummyExtensionPoint ep = new DummyExtensionPoint("types", "org.jnode.fs.types", "types");
- desc.addExtensionPoint(ep);
- for (FSType fsType : FSType.values()) {
- DummyExtension extension = new DummyExtension();
- DummyConfigurationElement element = new DummyConfigurationElement();
- element.addAttribute("class", fsType.getFsTypeClass().getName());
- extension.addElement(element);
- ep.addExtension(extension);
- }
-
- FileSystemService fss = new FileSystemPlugin(desc);
- InitialNaming.bind(FileSystemService.class, fss);
- }
- setup = true;
- }
-
- public static TestSuite suite() throws Throwable {
- setUp();
- TestSuite allTestsSuite = new TestSuite("All FS Tests");
-
- for (FSTestConfig config : new FSConfigurations()) {
- TestSuite tests = new TestSuite();
- tests.setName(config.getFileSystem().toString());
- addTest(tests, new BasicFSTest(config), "testAddDirectory");
- addTest(tests, new BasicFSTest(config), "testAddFile");
- addTest(tests, new BasicFSTest(config), "testAddFileThenRemountFSAndGetFile");
- addTest(tests, new BasicFSTest(config), "testGetRootEntry");
- addTest(tests, new BasicFSTest(config), "testListRootEntries");
- addTest(tests, new BasicFSTest(config), "testRemoveThenRemountFSAndGetEntry");
-
- addTest(tests, new FileFSTest(config), "testSetLength");
- addTest(tests, new FileFSTest(config), "testWriteFileInReadOnlyMode");
- addTest(tests, new FileFSTest(config), "testWriteFileThenRemountFSAndRead");
-
- addTest(tests, new TreeFSTest(config), "testFSTree");
- addTest(tests, new TreeFSTest(config), "testFSTreeWithRemountAndLongName");
- addTest(tests, new TreeFSTest(config), "testFSTreeWithRemountAndShortName");
-
- addTest(tests, new ConcurrentAccessFSTest(config), "testRead");
- addTest(tests, new ConcurrentAccessFSTest(config), "testWrite");
- addTest(tests, new ConcurrentAccessFSTest(config), "testReadWrite");
-
- allTestsSuite.addTest(tests);
- }
-
- return allTestsSuite;
- }
+)
+public class FSTestSuite {
- private static void addTest(TestSuite suite, TestCase test, String name) {
- test.setName(name);
- suite.addTest(test);
- }
-}
+}
+
Modified: trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/BasicFSTest.java
===================================================================
--- trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/BasicFSTest.java 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/BasicFSTest.java 2009-04-05 10:52:24 UTC (rev 5215)
@@ -29,6 +29,7 @@
import org.jnode.test.fs.filesystem.AbstractFSTest;
import org.jnode.test.fs.filesystem.config.FSTestConfig;
import org.jnode.test.support.TestUtils;
+import org.junit.Test;
/**
* @author Fabien DUMINY
@@ -37,17 +38,15 @@
public BasicFSTest(FSTestConfig config) {
super(config);
}
-
- public BasicFSTest(String name) {
- super(name);
- }
+ @Test
public void testGetRootEntry() throws Exception {
setUp();
FSEntry rootEntry = getFs().getRootEntry();
log.debug(FSUtils.toString(rootEntry, false));
}
+ @Test
public void testListRootEntries() throws Exception {
setUp();
@@ -55,6 +54,7 @@
TestUtils.listEntries(iterator);
}
+ @Test
public void testAddDirectory() throws Exception {
setUp();
@@ -89,6 +89,7 @@
TestUtils.listEntries(rootDir.iterator());
}
+ @Test
public void testAddFile() throws Exception {
setUp();
@@ -124,6 +125,7 @@
TestUtils.listEntries(rootDir.iterator());
}
+ @Test
public void testAddFileThenRemountFSAndGetFile() throws Exception {
if (!config.isReadOnly()) {
setUp();
@@ -149,6 +151,7 @@
}
}
+ @Test
public void testRemoveThenRemountFSAndGetEntry() throws Exception {
if (!config.isReadOnly()) {
Modified: trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/ConcurrentAccessFSTest.java
===================================================================
--- trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/ConcurrentAccessFSTest.java 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/ConcurrentAccessFSTest.java 2009-04-05 10:52:24 UTC (rev 5215)
@@ -28,6 +28,7 @@
import org.jnode.test.fs.filesystem.AbstractFSTest;
import org.jnode.test.fs.filesystem.config.FSTestConfig;
import org.jnode.test.support.TestUtils;
+import org.junit.Test;
/**
* @author Fabien DUMINY
@@ -45,10 +46,7 @@
super(config);
}
- public ConcurrentAccessFSTest(String name) {
- super(name);
- }
-
+ @Test
public void testRead() throws Throwable {
setUp();
@@ -61,6 +59,7 @@
monitor.waitAll();
}
+ @Test
public void testWrite() throws Throwable {
if (!config.isReadOnly()) {
setUp();
@@ -73,6 +72,7 @@
}
}
+ @Test
public void testReadWrite() throws Throwable {
setUp();
Modified: trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/FileFSTest.java
===================================================================
--- trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/FileFSTest.java 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/FileFSTest.java 2009-04-05 10:52:24 UTC (rev 5215)
@@ -28,6 +28,7 @@
import org.jnode.test.fs.filesystem.AbstractFSTest;
import org.jnode.test.fs.filesystem.config.FSTestConfig;
import org.jnode.test.support.TestUtils;
+import org.junit.Test;
/**
* @author Fabien DUMINY
@@ -37,10 +38,7 @@
super(config);
}
- public FileFSTest(String name) {
- super(name);
- }
-
+ @Test
public void testWriteFileThenRemountFSAndRead() throws Exception {
setUp();
@@ -82,6 +80,7 @@
}
}
+ @Test
public void testWriteFileInReadOnlyMode() throws Exception {
if (config.isReadOnly()) {
setUp();
@@ -104,6 +103,7 @@
}
}
+ @Test
public void testSetLength() throws Exception {
setUp();
Modified: trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/TreeFSTest.java
===================================================================
--- trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/TreeFSTest.java 2009-04-05 05:50:44 UTC (rev 5214)
+++ trunk/fs/src/test/org/jnode/test/fs/filesystem/tests/TreeFSTest.java 2009-04-05 10:52:24 UTC (rev 5215)
@@ -26,6 +26,7 @@
import org.jnode.fs.util.FSUtils;
import org.jnode.test.fs.filesystem.AbstractFSTest;
import org.jnode.test.fs.filesystem.config.FSTestConfig;
+import org.junit.Test;
/**
* @author Fabien DUMINY
@@ -35,10 +36,7 @@
super(config);
}
- public TreeFSTest(String name) {
- super(name);
- }
-
+ @Test
public void testFSTree() throws IOException, Exception {
if (!config.isReadOnly()) {
setUp();
@@ -62,10 +60,12 @@
}
}
+ @Test
public void testFSTreeWithRemountAndShortName() throws Exception {
doTestFSTreeWithRemount(config, "dir1");
}
+ @Test
public void testFSTreeWithRemountAndLongName() throws Exception {
doTestFSTreeWithRemount(config, "This is a Long FileName.extension");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|