jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r804208 - in /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs: AbstractFileSystemTest.java TestAll.java db/DerbyFileSystemTest.java local/LocalFileSystemTest.java mem/MemoryFileSystemTest.java
Date Fri, 14 Aug 2009 13:15:00 GMT
Author: thomasm
Date: Fri Aug 14 13:15:00 2009
New Revision: 804208

URL: http://svn.apache.org/viewvc?rev=804208&view=rev
Log:
JCR-2261 Enable FileSystem unit tests

Added:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/TestAll.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystemTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/local/LocalFileSystemTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystemTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java?rev=804208&r1=804207&r2=804208&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java
Fri Aug 14 13:15:00 2009
@@ -74,6 +74,7 @@
 
         // Create a subfolder
         fs.createFolder("/folder2/subfolder");
+        createFile("/folder2/file2", sampleBytes);
         assertTrue(fs.exists("/folder2/subfolder"));
         assertTrue(fs.isFolder("/folder2/subfolder"));
         assertFalse(fs.isFile("/folder2/subfolder"));
@@ -112,6 +113,7 @@
         assertEquals(0, fs.listFolders("/folder2").length);
 
         // Delete the folder
+        fs.deleteFolder("/folder");
         fs.deleteFolder("/folder2");
         assertFalse(fs.exists("/folder2"));
         assertFalse(fs.isFolder("/folder2"));

Added: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/TestAll.java?rev=804208&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/TestAll.java
(added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/TestAll.java
Fri Aug 14 13:15:00 2009
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.jackrabbit.core.fs;
+
+import org.apache.jackrabbit.core.fs.db.DerbyFileSystemTest;
+import org.apache.jackrabbit.core.fs.local.LocalFileSystemTest;
+import org.apache.jackrabbit.core.fs.mem.MemoryFileSystemTest;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite that includes all test cases for this module.
+ */
+public class TestAll extends TestCase {
+
+    /**
+     * Returns a test suite that executes all tests inside this package.
+     *
+     * @return a test suite that executes all tests inside this package
+     */
+    public static Test suite() {
+        TestSuite suite = new TestSuite("FileSystem tests");
+        suite.addTestSuite(DerbyFileSystemTest.class);
+        suite.addTestSuite(LocalFileSystemTest.class);
+        suite.addTestSuite(MemoryFileSystemTest.class);
+        return suite;
+    }
+}

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystemTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystemTest.java?rev=804208&r1=804207&r2=804208&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystemTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/db/DerbyFileSystemTest.java
Fri Aug 14 13:15:00 2009
@@ -22,6 +22,9 @@
 import org.apache.jackrabbit.core.fs.AbstractFileSystemTest;
 import org.apache.jackrabbit.core.fs.FileSystem;
 
+/**
+ * Tests the Apache Derby file system.
+ */
 public class DerbyFileSystemTest extends AbstractFileSystemTest {
 
     private File file;

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/local/LocalFileSystemTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/local/LocalFileSystemTest.java?rev=804208&r1=804207&r2=804208&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/local/LocalFileSystemTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/local/LocalFileSystemTest.java
Fri Aug 14 13:15:00 2009
@@ -22,25 +22,29 @@
 import org.apache.jackrabbit.core.fs.AbstractFileSystemTest;
 import org.apache.jackrabbit.core.fs.FileSystem;
 
+/**
+ * Tests the local file system.
+ */
 public class LocalFileSystemTest extends AbstractFileSystemTest {
 
-    private File file;
+    private String tempDirectory;
 
     protected FileSystem getFileSystem() {
         LocalFileSystem filesystem = new LocalFileSystem();
-        filesystem.setPath(file.getPath());
+        filesystem.setPath(tempDirectory);
         return filesystem;
     }
 
     protected void setUp() throws Exception {
-        file = File.createTempFile("jackrabbit", "localfs");
+        File file = File.createTempFile("jackrabbit", "localfs");
+        tempDirectory = file.getPath();
         file.delete();
         super.setUp();
     }
 
     protected void tearDown() throws Exception {
         super.tearDown();
-        delete(file);
+        delete(new File(tempDirectory));
     }
 
     private void delete(File file) throws IOException {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystemTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystemTest.java?rev=804208&r1=804207&r2=804208&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystemTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystemTest.java
Fri Aug 14 13:15:00 2009
@@ -19,6 +19,9 @@
 import org.apache.jackrabbit.core.fs.AbstractFileSystemTest;
 import org.apache.jackrabbit.core.fs.FileSystem;
 
+/**
+ * Tests the in-memory file system.
+ */
 public class MemoryFileSystemTest extends AbstractFileSystemTest {
 
     protected FileSystem getFileSystem() {



Mime
View raw message