Author: ggregory
Date: Wed Nov 2 01:10:45 2011
New Revision: 1196419
URL: http://svn.apache.org/viewvc?rev=1196419&view=rev
Log:
Convert to JUnit 4.
Modified:
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java
Modified:
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java?rev=1196419&r1=1196418&r2=1196419&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java
(original)
+++
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ram/test/CustomRamProviderTest.java
Wed Nov 2 01:10:45 2011
@@ -16,9 +16,10 @@
*/
package org.apache.commons.vfs2.provider.ram.test;
-import java.io.OutputStream;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
-import junit.framework.TestCase;
+import java.io.OutputStream;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
@@ -26,6 +27,9 @@ import org.apache.commons.vfs2.FileSyste
import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
import org.apache.commons.vfs2.provider.ram.RamFileProvider;
import org.apache.commons.vfs2.provider.ram.RamFileSystemConfigBuilder;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
/**
* Custom tests
@@ -33,7 +37,7 @@ import org.apache.commons.vfs2.provider.
* @author edgar poce
*
*/
-public class CustomRamProviderTest extends TestCase
+public class CustomRamProviderTest
{
DefaultFileSystemManager manager;
@@ -43,11 +47,9 @@ public class CustomRamProviderTest exten
FileSystemOptions defaultRamFs = new FileSystemOptions();
- @Override
- protected void setUp() throws Exception
+ @Before
+ public void setUp() throws Exception
{
- super.setUp();
-
manager = new DefaultFileSystemManager();
manager.addProvider("ram", new RamFileProvider());
manager.init();
@@ -57,13 +59,13 @@ public class CustomRamProviderTest exten
RamFileSystemConfigBuilder.getInstance().setMaxSize(smallSized, 10);
}
- @Override
- protected void tearDown() throws Exception
+ @After
+ public void tearDown() throws Exception
{
- super.tearDown();
manager.close();
}
+ @Test
public void testSmallFS() throws Exception
{
@@ -113,6 +115,7 @@ public class CustomRamProviderTest exten
*
* @throws FileSystemException
*/
+ @Test
public void testRootFolderExists() throws FileSystemException {
FileObject root = manager.resolveFile("ram:///", defaultRamFs);
assertTrue(root.getType().hasChildren());