accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlmar...@apache.org
Subject accumulo git commit: ACCUMULO-3470: Removed unneccesary test
Date Mon, 23 May 2016 18:18:03 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.7 46e3a4252 -> 0978c7e65


ACCUMULO-3470: Removed unneccesary test


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0978c7e6
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0978c7e6
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0978c7e6

Branch: refs/heads/1.7
Commit: 0978c7e65d5f662d1fc4387ed83fe053482d098e
Parents: 46e3a42
Author: Dave Marion <dlmarion@apache.org>
Authored: Mon May 23 14:16:24 2016 -0400
Committer: Dave Marion <dlmarion@apache.org>
Committed: Mon May 23 14:16:24 2016 -0400

----------------------------------------------------------------------
 .../providers/ReadOnlyHdfsFileProviderTest.java | 248 -------------------
 1 file changed, 248 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0978c7e6/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java
----------------------------------------------------------------------
diff --git a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java
b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java
deleted file mode 100644
index 5b69df9..0000000
--- a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/providers/ReadOnlyHdfsFileProviderTest.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * 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.accumulo.start.classloader.vfs.providers;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.apache.accumulo.test.AccumuloDFSBase;
-import org.apache.commons.vfs2.FileObject;
-import org.apache.commons.vfs2.FileSystemException;
-import org.apache.commons.vfs2.FileType;
-import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
-import org.apache.commons.vfs2.provider.hdfs.HdfsFileAttributes;
-import org.apache.commons.vfs2.provider.hdfs.HdfsFileProvider;
-import org.apache.commons.vfs2.util.RandomAccessMode;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ReadOnlyHdfsFileProviderTest extends AccumuloDFSBase {
-
-  private static final String TEST_DIR1 = getHdfsUri() + "/test-dir";
-  private static final Path DIR1_PATH = new Path("/test-dir");
-  private static final String TEST_FILE1 = TEST_DIR1 + "/accumulo-test-1.jar";
-  private static final Path FILE1_PATH = new Path(DIR1_PATH, "accumulo-test-1.jar");
-
-  private DefaultFileSystemManager manager = null;
-  private FileSystem hdfs = null;
-
-  @Before
-  public void setup() throws Exception {
-    manager = new DefaultFileSystemManager();
-    manager.addProvider("hdfs", new HdfsFileProvider());
-    manager.init();
-    this.hdfs = cluster.getFileSystem();
-  }
-
-  private FileObject createTestFile(FileSystem hdfs) throws IOException {
-    // Create the directory
-    hdfs.mkdirs(DIR1_PATH);
-    FileObject dir = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(dir);
-    Assert.assertTrue(dir.exists());
-    Assert.assertTrue(dir.getType().equals(FileType.FOLDER));
-
-    // Create the file in the directory
-    hdfs.create(FILE1_PATH).close();
-    FileObject f = manager.resolveFile(TEST_FILE1);
-    Assert.assertNotNull(f);
-    Assert.assertTrue(f.exists());
-    Assert.assertTrue(f.getType().equals(FileType.FILE));
-    return f;
-  }
-
-  @Test
-  public void testInit() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_FILE1);
-    Assert.assertNotNull(fo);
-  }
-
-  @Test
-  public void testExistsFails() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_FILE1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-  }
-
-  @Test
-  public void testExistsSucceeds() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_FILE1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the file
-    @SuppressWarnings("unused")
-    FileObject f = createTestFile(hdfs);
-
-  }
-
-  @Test(expected = UnsupportedOperationException.class)
-  public void testCanRenameTo() throws Exception {
-    FileObject fo = createTestFile(this.hdfs);
-    Assert.assertNotNull(fo);
-    fo.canRenameTo(fo);
-  }
-
-  @Test
-  public void testDoListChildren() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    FileObject dir = file.getParent();
-
-    FileObject[] children = dir.getChildren();
-    Assert.assertTrue(children.length == 1);
-    Assert.assertTrue(children[0].getName().equals(file.getName()));
-
-  }
-
-  @Test
-  public void testGetContentSize() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    Assert.assertEquals(0, file.getContent().getSize());
-  }
-
-  @Test
-  public void testGetInputStream() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    file.getContent().getInputStream().close();
-  }
-
-  @Test
-  public void testIsHidden() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    Assert.assertFalse(file.isHidden());
-  }
-
-  @Test
-  public void testIsReadable() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    Assert.assertTrue(file.isReadable());
-  }
-
-  @Test
-  public void testIsWritable() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    Assert.assertFalse(file.isWriteable());
-  }
-
-  @Test
-  public void testLastModificationTime() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    Assert.assertFalse(-1 == file.getContent().getLastModifiedTime());
-  }
-
-  @Test
-  public void testGetAttributes() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    Map<String,Object> attributes = file.getContent().getAttributes();
-    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.BLOCK_SIZE.toString()));
-    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.GROUP.toString()));
-    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.LAST_ACCESS_TIME.toString()));
-    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.LENGTH.toString()));
-    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.MODIFICATION_TIME.toString()));
-    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.OWNER.toString()));
-    Assert.assertTrue(attributes.containsKey(HdfsFileAttributes.PERMISSIONS.toString()));
-  }
-
-  @Test(expected = FileSystemException.class)
-  public void testRandomAccessContent() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    file.getContent().getRandomAccessContent(RandomAccessMode.READWRITE).close();
-  }
-
-  @Test
-  public void testRandomAccessContent2() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    file.getContent().getRandomAccessContent(RandomAccessMode.READ).close();
-  }
-
-  @Test
-  public void testEquals() throws Exception {
-    FileObject fo = manager.resolveFile(TEST_DIR1);
-    Assert.assertNotNull(fo);
-    Assert.assertFalse(fo.exists());
-
-    // Create the test file
-    FileObject file = createTestFile(hdfs);
-    // Get a handle to the same file
-    FileObject file2 = manager.resolveFile(TEST_FILE1);
-    Assert.assertEquals(file, file2);
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    if (null != hdfs) {
-      hdfs.delete(DIR1_PATH, true);
-      hdfs.close();
-    }
-    manager.close();
-  }
-
-}


Mime
View raw message