You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2012/12/03 14:37:52 UTC
svn commit: r1416507 [7/8] - in /commons/proper/vfs/trunk/core/src:
main/java/org/apache/commons/vfs2/ main/java/org/apache/commons/vfs2/auth/
main/java/org/apache/commons/vfs2/cache/
main/java/org/apache/commons/vfs2/impl/ main/java/org/apache/commons...
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java Mon Dec 3 13:37:12 2012
@@ -102,7 +102,7 @@ public class SftpProviderTestCase extend
* Accepts only the known test user.
*/
@Override
- public FileSystemView createFileSystemView(Session session) throws IOException
+ public FileSystemView createFileSystemView(final Session session) throws IOException
{
final String userName = session.getUsername();
if (!DEFAULT_USER.equals(userName))
@@ -124,14 +124,14 @@ public class SftpProviderTestCase extend
// private boolean caseInsensitive;
- public TestFileSystemView(String homeDirStr, String userName)
+ public TestFileSystemView(final String homeDirStr, final String userName)
{
this.homeDirStr = new File(homeDirStr).getAbsolutePath();
this.userName = userName;
}
@Override
- public SshFile getFile(SshFile baseDir, String file)
+ public SshFile getFile(final SshFile baseDir, final String file)
{
return this.getFile(baseDir.getAbsolutePath(), file);
}
@@ -168,7 +168,7 @@ public class SftpProviderTestCase extend
*/
static class TestNativeSshFile extends NativeSshFile
{
- TestNativeSshFile(String fileName, File file, String userName)
+ TestNativeSshFile(final String fileName, final File file, final String userName)
{
super(fileName, file, userName);
}
@@ -187,7 +187,7 @@ public class SftpProviderTestCase extend
private static final String TEST_URI = "test.sftp.uri";
/** True if we are testing the SFTP stream proxy */
- private boolean streamProxyMode;
+ private final boolean streamProxyMode;
private static String getSystemTestUriOverride()
{
@@ -211,7 +211,7 @@ public class SftpProviderTestCase extend
return;
}
// System.setProperty("vfs.sftp.sshdir", getTestDirectory() + "/../vfs.sftp.sshdir");
- String tmpDir = System.getProperty("java.io.tmpdir");
+ final String tmpDir = System.getProperty("java.io.tmpdir");
Server = SshServer.setUpDefaultServer();
Server.setPort(SocketPort);
if (SecurityUtils.isBouncyCastleRegistered())
@@ -228,7 +228,7 @@ public class SftpProviderTestCase extend
{
Server.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(tmpDir + "/key.ser"));
}
- List<NamedFactory<Command>> list = new ArrayList<NamedFactory<Command>>(1);
+ final List<NamedFactory<Command>> list = new ArrayList<NamedFactory<Command>>(1);
list.add(new NamedFactory<Command>()
{
@@ -248,7 +248,7 @@ public class SftpProviderTestCase extend
Server.setPasswordAuthenticator(new PasswordAuthenticator()
{
@Override
- public boolean authenticate(String username, String password, ServerSession session)
+ public boolean authenticate(final String username, final String password, final ServerSession session)
{
return username != null && username.equals(password);
}
@@ -256,7 +256,7 @@ public class SftpProviderTestCase extend
Server.setPublickeyAuthenticator(new PublickeyAuthenticator()
{
@Override
- public boolean authenticate(String username, PublicKey key, ServerSession session)
+ public boolean authenticate(final String username, final PublicKey key, final ServerSession session)
{
// File f = new File("/Users/" + username + "/.ssh/authorized_keys");
return true;
@@ -265,25 +265,25 @@ public class SftpProviderTestCase extend
Server.setForwardingFilter(new ForwardingFilter()
{
@Override
- public boolean canConnect(InetSocketAddress address, ServerSession session)
+ public boolean canConnect(final InetSocketAddress address, final ServerSession session)
{
return true;
}
@Override
- public boolean canForwardAgent(ServerSession session)
+ public boolean canForwardAgent(final ServerSession session)
{
return true;
}
@Override
- public boolean canForwardX11(ServerSession session)
+ public boolean canForwardX11(final ServerSession session)
{
return true;
}
@Override
- public boolean canListen(InetSocketAddress address, ServerSession session)
+ public boolean canListen(final InetSocketAddress address, final ServerSession session)
{
return true;
}
@@ -305,7 +305,7 @@ public class SftpProviderTestCase extend
static private class BaseTest extends ProviderTestSuite {
- public BaseTest(ProviderTestConfig providerConfig) throws Exception
+ public BaseTest(final ProviderTestConfig providerConfig) throws Exception
{
super(providerConfig);
}
@@ -316,7 +316,7 @@ public class SftpProviderTestCase extend
// Close all active sessions
// Note that it should be done by super.tearDown()
// while closing
- for (AbstractSession session : Server.getActiveSessions()) {
+ for (final AbstractSession session : Server.getActiveSessions()) {
session.close(true);
}
super.tearDown();
@@ -330,7 +330,7 @@ public class SftpProviderTestCase extend
public static Test suite() throws Exception
{
// The test suite to be returned
- TestSuite suite = new TestSuite();
+ final TestSuite suite = new TestSuite();
// --- Standard VFS test suite
final SftpProviderTestCase standardTestCase = new SftpProviderTestCase(false);
@@ -398,7 +398,7 @@ public class SftpProviderTestCase extend
}
}
- public SftpProviderTestCase(boolean streamProxyMode) throws IOException
+ public SftpProviderTestCase(final boolean streamProxyMode) throws IOException
{
this.streamProxyMode = streamProxyMode;
}
@@ -415,7 +415,7 @@ public class SftpProviderTestCase extend
uri = ConnectionUri;
}
- FileSystemOptions fileSystemOptions = new FileSystemOptions();
+ final FileSystemOptions fileSystemOptions = new FileSystemOptions();
final SftpFileSystemConfigBuilder builder = SftpFileSystemConfigBuilder.getInstance();
builder.setStrictHostKeyChecking(fileSystemOptions, "no");
builder.setUserInfo(fileSystemOptions, new TrustEveryoneUserInfo());
@@ -425,7 +425,7 @@ public class SftpProviderTestCase extend
{
final FileSystemOptions proxyOptions = (FileSystemOptions) fileSystemOptions.clone();
- URI parsedURI = new URI(uri);
+ final URI parsedURI = new URI(uri);
final String userInfo = parsedURI.getUserInfo();
final String[] userFields = userInfo.split(":", 2);
@@ -485,32 +485,32 @@ public class SftpProviderTestCase extend
public InputStream in = null;
@Override
- public void setInputStream(InputStream in)
+ public void setInputStream(final InputStream in)
{
this.in = in;
}
@Override
- public void setOutputStream(OutputStream out)
+ public void setOutputStream(final OutputStream out)
{
this.out = out;
}
@Override
- public void setErrorStream(OutputStream err)
+ public void setErrorStream(final OutputStream err)
{
this.err = err;
}
@Override
- public void setExitCallback(ExitCallback callback)
+ public void setExitCallback(final ExitCallback callback)
{
this.callback = callback;
}
@Override
- public void start(Environment env) throws IOException
+ public void start(final Environment env) throws IOException
{
int code = 0;
if (command.equals("id -G") || command.equals("id -u"))
@@ -522,7 +522,7 @@ public class SftpProviderTestCase extend
matcher.matches();
final int port = Integer.parseInt(matcher.group(1));
- Socket socket = new Socket((String) null, port);
+ final Socket socket = new Socket((String) null, port);
if (out != null)
{
@@ -575,7 +575,7 @@ public class SftpProviderTestCase extend
*/
private static void connect(final String name, final InputStream in, final OutputStream out, final ExitCallback callback)
{
- Thread thread = new Thread(new Runnable()
+ final Thread thread = new Thread(new Runnable()
{
@Override
public void run()
@@ -583,7 +583,7 @@ public class SftpProviderTestCase extend
int code = 0;
try
{
- byte buffer[] = new byte[1024];
+ final byte buffer[] = new byte[1024];
int len;
while ((len = in.read(buffer, 0, buffer.length)) != -1)
{
@@ -591,12 +591,12 @@ public class SftpProviderTestCase extend
out.flush();
}
}
- catch (SshException ex)
+ catch (final SshException ex)
{
// Nothing to do, this occurs when the connection
// is closed on the remote side
}
- catch (IOException ex)
+ catch (final IOException ex)
{
if (!ex.getMessage().equals("Pipe closed"))
{
@@ -625,7 +625,7 @@ public class SftpProviderTestCase extend
private int mtime;
private String[] extended;
- private SftpAttrs(Buffer buf)
+ private SftpAttrs(final Buffer buf)
{
int flags = 0;
flags = buf.getInt();
@@ -661,12 +661,12 @@ public class SftpProviderTestCase extend
private int _version;
@Override
- protected void process(Buffer buffer) throws IOException
+ protected void process(final Buffer buffer) throws IOException
{
- int rpos = buffer.rpos();
- int length = buffer.getInt();
- int type = buffer.getByte();
- int id = buffer.getInt();
+ final int rpos = buffer.rpos();
+ final int length = buffer.getInt();
+ final int type = buffer.getByte();
+ final int id = buffer.getInt();
switch (type)
{
@@ -674,9 +674,9 @@ public class SftpProviderTestCase extend
case SSH_FXP_FSETSTAT:
{
// Get the path
- String path = buffer.getString();
+ final String path = buffer.getString();
// Get the permission
- SftpAttrs attrs = new SftpAttrs(buffer);
+ final SftpAttrs attrs = new SftpAttrs(buffer);
permissions.put(path, attrs.permissions);
// System.err.format("Setting [%s] permission to %o%n", path, attrs.permissions);
break;
@@ -685,7 +685,7 @@ public class SftpProviderTestCase extend
case SSH_FXP_REMOVE:
{
// Remove cached attributes
- String path = buffer.getString();
+ final String path = buffer.getString();
permissions.remove(path);
// System.err.format("Removing [%s] permission cache%n", path);
break;
@@ -705,7 +705,7 @@ public class SftpProviderTestCase extend
}
@Override
- protected void writeAttrs(Buffer buffer, SshFile file, int flags) throws IOException
+ protected void writeAttrs(final Buffer buffer, final SshFile file, final int flags) throws IOException
{
if (!file.doesExist()) {
throw new FileNotFoundException(file.getAbsolutePath());
@@ -739,9 +739,9 @@ public class SftpProviderTestCase extend
if (_version >= 4)
{
- long size = file.getSize();
+ final long size = file.getSize();
// String username = session.getUsername();
- long lastModif = file.getLastModified();
+ final long lastModif = file.getLastModified();
if (file.isFile())
{
buffer.putInt(SSH_FILEXFER_ATTR_PERMISSIONS);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/LargeTarTestCase.java Mon Dec 3 13:37:12 2012
@@ -69,16 +69,16 @@ public void setUp() throws Exception {
@Test
public void testLargeFile() throws Exception {
- File realFile = new File(largeFilePath + largeFileName + ".tar.gz");
+ final File realFile = new File(largeFilePath + largeFileName + ".tar.gz");
- FileObject file = manager.resolveFile("tgz:file://" + realFile.getCanonicalPath() + "!/");
+ final FileObject file = manager.resolveFile("tgz:file://" + realFile.getCanonicalPath() + "!/");
assertNotNull(file);
- List<FileObject> files = Arrays.asList(file.getChildren());
+ final List<FileObject> files = Arrays.asList(file.getChildren());
assertNotNull(files);
assertEquals(1, files.size());
- FileObject f = files.get(0);
+ final FileObject f = files.get(0);
assertTrue("Expected file not found: " + largeFileName + ".txt",
f.getName().getBaseName().equals(largeFileName + ".txt"));
@@ -104,15 +104,15 @@ public void setUp() throws Exception {
fileCheck(expectedFiles, "tar:file://c:/temp/data/data/data-small.tar");
} */
- protected void fileCheck(String[] expectedFiles, String tarFile) throws Exception {
+ protected void fileCheck(final String[] expectedFiles, final String tarFile) throws Exception {
assertNotNull(manager);
- FileObject file = manager.resolveFile(tarFile);
+ final FileObject file = manager.resolveFile(tarFile);
assertNotNull(file);
- List<FileObject> files = Arrays.asList(file.getChildren());
+ final List<FileObject> files = Arrays.asList(file.getChildren());
assertNotNull(files);
- for (String expectedFile : expectedFiles)
+ for (final String expectedFile : expectedFiles)
{
assertTrue("Expected file not found: " + expectedFile, fileExists(expectedFile, files));
}
@@ -125,9 +125,9 @@ public void setUp() throws Exception {
* @param files a list of files to search.
* @return {@code true} if {@code expectedFile} is in {@code files}.
*/
- protected boolean fileExists(String expectedFile, List<FileObject> files)
+ protected boolean fileExists(final String expectedFile, final List<FileObject> files)
{
- for (FileObject file : files)
+ for (final FileObject file : files)
{
if (file.getName().getBaseName().equals(expectedFile))
{
@@ -137,9 +137,9 @@ public void setUp() throws Exception {
return false;
}
- protected boolean endsWith(String testString, String[] testList)
+ protected boolean endsWith(final String testString, final String[] testList)
{
- for (String string : testList)
+ for (final String string : testList)
{
if (testString.endsWith(string))
{
@@ -150,7 +150,7 @@ public void setUp() throws Exception {
}
//@SuppressWarnings("unused")
- protected void createLargeFile(String path, final String name) throws Exception {
+ protected void createLargeFile(final String path, final String name) throws Exception {
final long _1K = 1024;
final long _1M = 1024 * _1K;
// long _256M = 256 * _1M;
@@ -160,28 +160,28 @@ public void setUp() throws Exception {
// File size of 3 GB
final long fileSize = 3 * _1G;
- File tarGzFile = new File(path + name + ".tar.gz");
+ final File tarGzFile = new File(path + name + ".tar.gz");
if(!tarGzFile.exists()) {
System.out.println("This test is a bit slow. It needs to write 3GB of data as a compressed file (approx. 3MB) to your hard drive");
final PipedOutputStream outTarFileStream = new PipedOutputStream();
- PipedInputStream inTarFileStream = new PipedInputStream(outTarFileStream);
+ final PipedInputStream inTarFileStream = new PipedInputStream(outTarFileStream);
- Thread source = new Thread(){
+ final Thread source = new Thread(){
@Override
public void run() {
- byte ba_1k[] = new byte[(int) _1K];
+ final byte ba_1k[] = new byte[(int) _1K];
for(int i=0; i < ba_1k.length; i++){
ba_1k[i]='a';
}
try {
- TarArchiveOutputStream outTarStream =
+ final TarArchiveOutputStream outTarStream =
(TarArchiveOutputStream)new ArchiveStreamFactory()
.createArchiveOutputStream(ArchiveStreamFactory.TAR, outTarFileStream);
// Create archive contents
- TarArchiveEntry tarArchiveEntry = new TarArchiveEntry(name + ".txt");
+ final TarArchiveEntry tarArchiveEntry = new TarArchiveEntry(name + ".txt");
tarArchiveEntry.setSize(fileSize);
outTarStream.putArchiveEntry(tarArchiveEntry);
@@ -191,7 +191,7 @@ public void setUp() throws Exception {
outTarStream.closeArchiveEntry();
outTarStream.close();
outTarFileStream.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -200,9 +200,9 @@ public void setUp() throws Exception {
source.start();
// Create compressed archive
- OutputStream outGzipFileStream = new FileOutputStream(path + name + ".tar.gz");
+ final OutputStream outGzipFileStream = new FileOutputStream(path + name + ".tar.gz");
- GzipCompressorOutputStream outGzipStream = (GzipCompressorOutputStream)new CompressorStreamFactory()
+ final GzipCompressorOutputStream outGzipStream = (GzipCompressorOutputStream)new CompressorStreamFactory()
.createCompressorOutputStream(CompressorStreamFactory.GZIP, outGzipFileStream);
IOUtils.copy(inTarFileStream, outGzipStream);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTarTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTarTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTarTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTarTestCase.java Mon Dec 3 13:37:12 2012
@@ -62,7 +62,7 @@ public class NestedTarTestCase
{
// Locate the base Tar file
final String tarFilePath = AbstractVfsTestCase.getTestResourceFile("nested.tar").getAbsolutePath();
- String uri = "tar:file:" + tarFilePath + "!/test.tar";
+ final String uri = "tar:file:" + tarFilePath + "!/test.tar";
final FileObject tarFile = manager.resolveFile(uri);
// Now build the nested file system
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTbz2TestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTbz2TestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTbz2TestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTbz2TestCase.java Mon Dec 3 13:37:12 2012
@@ -62,7 +62,7 @@ public class NestedTbz2TestCase
{
// Locate the base Tar file
final String tarFilePath = AbstractVfsTestCase.getTestResourceFile("nested.tbz2").getAbsolutePath();
- String uri = "tbz2:file:" + tarFilePath + "!/test.tbz2";
+ final String uri = "tbz2:file:" + tarFilePath + "!/test.tbz2";
final FileObject tarFile = manager.resolveFile(uri);
// Now build the nested file system
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTgzTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTgzTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTgzTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/tar/test/NestedTgzTestCase.java Mon Dec 3 13:37:12 2012
@@ -62,7 +62,7 @@ public class NestedTgzTestCase
{
// Locate the base Tar file
final String tarFilePath = AbstractVfsTestCase.getTestResourceFile("nested.tgz").getAbsolutePath();
- String uri = "tgz:file:" + tarFilePath + "!/test.tgz";
+ final String uri = "tgz:file:" + tarFilePath + "!/test.tgz";
final FileObject tarFile = manager.resolveFile(uri);
// Now build the nested file system
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/test/FileObjectSortTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/test/FileObjectSortTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/test/FileObjectSortTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/test/FileObjectSortTestCase.java Mon Dec 3 13:37:12 2012
@@ -49,7 +49,7 @@ public class FileObjectSortTestCase {
// Consider @Immutable
private static FileObject[] UnSortedArray;
- private static FileObject resolveFile(final FileSystem fs, int i) throws FileSystemException {
+ private static FileObject resolveFile(final FileSystem fs, final int i) throws FileSystemException {
return fs.resolveFile(String.format("%010d", i));
}
@@ -76,8 +76,8 @@ public class FileObjectSortTestCase {
final FileObject file1 = VfsFileSystem.resolveFile("A1");
final FileObject file2 = VfsFileSystem.resolveFile("a2");
final FileObject file3 = VfsFileSystem.resolveFile("A3");
- FileObject[] actualArray = { file3, file1, file2, file1, file2 };
- FileObject[] expectedArray = { file1, file1, file2, file2, file3 };
+ final FileObject[] actualArray = { file3, file1, file2, file1, file2 };
+ final FileObject[] expectedArray = { file1, file1, file2, file2, file3 };
Arrays.sort(actualArray);
Assert.assertArrayEquals(expectedArray, actualArray);
}
@@ -89,7 +89,7 @@ public class FileObjectSortTestCase {
*/
@Test
public void testSortArrayMoveAll() throws FileSystemException {
- FileObject[] actualArray = UnSortedArray.clone();
+ final FileObject[] actualArray = UnSortedArray.clone();
Assert.assertFalse(Arrays.equals(UnSortedArray, SortedArray));
Arrays.sort(actualArray);
Assert.assertArrayEquals(SortedArray, actualArray);
@@ -102,7 +102,7 @@ public class FileObjectSortTestCase {
*/
@Test
public void testSortArrayMoveNone() throws FileSystemException {
- FileObject[] actualArray = SortedArray.clone();
+ final FileObject[] actualArray = SortedArray.clone();
Arrays.sort(actualArray);
Assert.assertArrayEquals(SortedArray, actualArray);
}
@@ -114,8 +114,8 @@ public class FileObjectSortTestCase {
*/
@Test
public void testSortListMoveAll() throws FileSystemException {
- List<FileObject> actualList = Arrays.asList(UnSortedArray);
- List<FileObject> expectedSortedList = Arrays.asList(SortedArray);
+ final List<FileObject> actualList = Arrays.asList(UnSortedArray);
+ final List<FileObject> expectedSortedList = Arrays.asList(SortedArray);
Assert.assertFalse(actualList.equals(expectedSortedList));
Collections.sort(actualList);
Assert.assertTrue(actualList.equals(expectedSortedList));
@@ -128,8 +128,8 @@ public class FileObjectSortTestCase {
*/
@Test
public void testSortListMoveNone() throws FileSystemException {
- List<FileObject> actualList = Arrays.asList(SortedArray);
- List<FileObject> expectedSortedList = Arrays.asList(SortedArray);
+ final List<FileObject> actualList = Arrays.asList(SortedArray);
+ final List<FileObject> expectedSortedList = Arrays.asList(SortedArray);
Collections.sort(actualList);
Assert.assertTrue(actualList.equals(expectedSortedList));
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/test/GenericFileNameTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/test/GenericFileNameTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/test/GenericFileNameTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/test/GenericFileNameTestCase.java Mon Dec 3 13:37:12 2012
@@ -32,7 +32,7 @@ public class GenericFileNameTestCase
*/
public void testParseUri() throws Exception
{
- URLFileNameParser urlParser = new URLFileNameParser(21);
+ final URLFileNameParser urlParser = new URLFileNameParser(21);
// Simple name
GenericFileName name = (GenericFileName) urlParser.parseUri(null, null, "ftp://hostname/file");
assertEquals("ftp", name.getScheme());
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/JackrabbitMain.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/JackrabbitMain.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/JackrabbitMain.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/JackrabbitMain.java Mon Dec 3 13:37:12 2012
@@ -55,7 +55,7 @@ class JackrabbitMain
/**
* @param args
*/
- public static void main(String[] args) throws Exception
+ public static void main(final String[] args) throws Exception
{
new JackrabbitMain(args).run();
}
@@ -72,7 +72,7 @@ class JackrabbitMain
private final Server server = new Server();
- public JackrabbitMain(String[] args) throws ParseException
+ public JackrabbitMain(final String[] args) throws ParseException
{
options.addOption("?", "help", false, "print this message");
options.addOption("n", "notice", false, "print copyright notices");
@@ -90,9 +90,9 @@ class JackrabbitMain
command = new GnuParser().parse(options, args);
}
- private void copyToOutput(String resource) throws IOException
+ private void copyToOutput(final String resource) throws IOException
{
- InputStream stream = JackrabbitMain.class.getResourceAsStream(resource);
+ final InputStream stream = JackrabbitMain.class.getResourceAsStream(resource);
try
{
IOUtils.copy(stream, System.out);
@@ -102,7 +102,7 @@ class JackrabbitMain
}
}
- private void message(String message)
+ private void message(final String message)
{
if (!command.hasOption("quiet"))
{
@@ -110,32 +110,32 @@ class JackrabbitMain
}
}
- private void prepareAccessLog(File log)
+ private void prepareAccessLog(final File log)
{
- NCSARequestLog ncsa = new NCSARequestLog(new File(log, "access.log.yyyy_mm_dd").getPath());
+ final NCSARequestLog ncsa = new NCSARequestLog(new File(log, "access.log.yyyy_mm_dd").getPath());
ncsa.setFilenameDateFormat("yyyy-MM-dd");
accessLog.setRequestLog(ncsa);
}
private void prepareConnector()
{
- String port = command.getOptionValue("port", "8080");
+ final String port = command.getOptionValue("port", "8080");
connector.setPort(Integer.parseInt(port));
- String host = command.getOptionValue("host");
+ final String host = command.getOptionValue("host");
if (host != null)
{
connector.setHost(host);
}
}
- private void prepareServerLog(File log) throws IOException
+ private void prepareServerLog(final File log) throws IOException
{
- Layout layout = new PatternLayout("%d{dd.MM.yyyy HH:mm:ss} *%-5p* %c{1}: %m%n");
+ final Layout layout = new PatternLayout("%d{dd.MM.yyyy HH:mm:ss} *%-5p* %c{1}: %m%n");
- Logger jackrabbitLog = Logger.getRootLogger();
+ final Logger jackrabbitLog = Logger.getRootLogger();
jackrabbitLog.addAppender(new FileAppender(layout, new File(log, "jackrabbit.log").getPath()));
- Logger jettyLog = Logger.getLogger("org.mortbay.log");
+ final Logger jettyLog = Logger.getLogger("org.mortbay.log");
jettyLog.addAppender(new FileAppender(layout, new File(log, "jetty.log").getPath()));
jettyLog.setAdditivity(false);
@@ -162,7 +162,7 @@ class JackrabbitMain
try
{
shutdown();
- } catch (Exception e)
+ } catch (final Exception e)
{
e.printStackTrace();
}
@@ -171,17 +171,17 @@ class JackrabbitMain
});
}
- private void prepareWebapp(File file, File repository, File tmp)
+ private void prepareWebapp(final File file, final File repository, final File tmp)
{
webapp.setContextPath("/");
webapp.setWar(file.getPath());
webapp.setExtractWAR(false);
webapp.setTempDirectory(tmp);
- ServletHolder servlet = new ServletHolder(JackrabbitRepositoryServlet.class);
+ final ServletHolder servlet = new ServletHolder(JackrabbitRepositoryServlet.class);
servlet.setInitOrder(1);
servlet.setInitParameter("repository.home", repository.getPath());
- String conf = command.getOptionValue("conf");
+ final String conf = command.getOptionValue("conf");
if (conf != null)
{
servlet.setInitParameter("repository.config", conf);
@@ -192,20 +192,20 @@ class JackrabbitMain
public void run() throws Exception
{
String defaultFile = "jackrabbit-standalone.jar";
- URL location = Main.class.getProtectionDomain().getCodeSource().getLocation();
+ final URL location = Main.class.getProtectionDomain().getCodeSource().getLocation();
if (location != null && "file".equals(location.getProtocol()))
{
- File file = new File(location.getPath());
+ final File file = new File(location.getPath());
if (file.isFile())
{
defaultFile = location.getPath();
}
}
- File file = new File(command.getOptionValue("file", defaultFile));
+ final File file = new File(command.getOptionValue("file", defaultFile));
if (command.hasOption("help"))
{
- HelpFormatter formatter = new HelpFormatter();
+ final HelpFormatter formatter = new HelpFormatter();
formatter.printHelp("java -jar " + file.getName(), options, true);
} else if (command.hasOption("notice"))
{
@@ -218,12 +218,12 @@ class JackrabbitMain
message("Welcome to Apache Jackrabbit!");
message("-------------------------------");
- File repository = new File(command.getOptionValue("repo", "jackrabbit"));
+ final File repository = new File(command.getOptionValue("repo", "jackrabbit"));
message("Using repository directory " + repository);
repository.mkdirs();
- File tmp = new File(repository, "tmp");
+ final File tmp = new File(repository, "tmp");
tmp.mkdir();
- File log = new File(repository, "log");
+ final File log = new File(repository, "log");
log.mkdir();
message("Writing log messages to " + log);
@@ -248,7 +248,7 @@ class JackrabbitMain
host = "localhost";
}
message("Apache Jackrabbit is now running at " + "http://" + host + ":" + connector.getPort() + "/");
- } catch (Throwable t)
+ } catch (final Throwable t)
{
System.err.println("Unable to start the server: " + t.getMessage());
System.exit(1);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/JcrUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/JcrUtils.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/JcrUtils.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/JcrUtils.java Mon Dec 3 13:37:12 2012
@@ -68,7 +68,7 @@ class JcrUtils
* @throws RepositoryException
* if the child node can not be accessed or created
*/
- public static Node getOrAddFolder(Node parent, String name) throws RepositoryException
+ public static Node getOrAddFolder(final Node parent, final String name) throws RepositoryException
{
return getOrAddNode(parent, name, NodeType_NT_FOLDER);
}
@@ -90,7 +90,7 @@ class JcrUtils
* @throws RepositoryException
* if the child node can not be accessed or created
*/
- public static Node getOrAddNode(Node parent, String name, String type) throws RepositoryException
+ public static Node getOrAddNode(final Node parent, final String name, final String type) throws RepositoryException
{
if (parent.hasNode(name))
{
@@ -136,7 +136,7 @@ class JcrUtils
* @throws RepositoryException
* if the child node can not be created or updated
*/
- public static Node putFile(Node parent, String name, String mime, InputStream data) throws RepositoryException
+ public static Node putFile(final Node parent, final String name, final String mime, final InputStream data) throws RepositoryException
{
return putFile(parent, name, mime, data, Calendar.getInstance());
}
@@ -178,23 +178,23 @@ class JcrUtils
* @throws RepositoryException
* if the child node can not be created or updated
*/
- public static Node putFile(Node parent, String name, String mime, InputStream data, Calendar date)
+ public static Node putFile(final Node parent, final String name, final String mime, final InputStream data, final Calendar date)
throws RepositoryException
{
- Value binary = parent.getSession().getValueFactory().createValue(data);
+ final Value binary = parent.getSession().getValueFactory().createValue(data);
try
{
- Node file = getOrAddNode(parent, name, NodeType_NT_FILE);
- Node content = getOrAddNode(file, Node_JCR_CONTENT, NodeType_NT_RESOURCE);
+ final Node file = getOrAddNode(parent, name, NodeType_NT_FILE);
+ final Node content = getOrAddNode(file, Node_JCR_CONTENT, NodeType_NT_RESOURCE);
content.setProperty(Property_JCR_MIMETYPE, mime);
- String[] parameters = mime.split(";");
+ final String[] parameters = mime.split(";");
for (int i = 1; i < parameters.length; i++)
{
- int equals = parameters[i].indexOf('=');
+ final int equals = parameters[i].indexOf('=');
if (equals != -1)
{
- String parameter = parameters[i].substring(0, equals);
+ final String parameter = parameters[i].substring(0, equals);
if ("charset".equalsIgnoreCase(parameter.trim()))
{
content.setProperty(Property_JCR_ENCODING, parameters[i].substring(equals + 1).trim());
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavProviderTestCase.java Mon Dec 3 13:37:12 2012
@@ -92,9 +92,9 @@ public class WebdavProviderTestCase exte
return tempFile;
}
- private static void dump(File repoDirectory) throws Exception
+ private static void dump(final File repoDirectory) throws Exception
{
- TransientRepository repository = getTransientRepository(repoDirectory);
+ final TransientRepository repository = getTransientRepository(repoDirectory);
try
{
final Session session = getSession(repository);
@@ -108,7 +108,7 @@ public class WebdavProviderTestCase exte
}
/** Recursively outputs the contents of the given node. */
- private static void dump(Node node) throws RepositoryException
+ private static void dump(final Node node) throws RepositoryException
{
// First output the node path
message(node.getPath());
@@ -124,15 +124,15 @@ public class WebdavProviderTestCase exte
}
// Then output the properties
- PropertyIterator properties = node.getProperties();
+ final PropertyIterator properties = node.getProperties();
while (properties.hasNext())
{
- Property property = properties.nextProperty();
+ final Property property = properties.nextProperty();
if (property.getDefinition().isMultiple())
{
// A multi-valued property, print all values
- Value[] values = property.getValues();
- for (Value value : values)
+ final Value[] values = property.getValues();
+ for (final Value value : values)
{
message(property.getPath() + " = " + value.getString());
}
@@ -144,14 +144,14 @@ public class WebdavProviderTestCase exte
}
// Finally output all the child nodes recursively
- NodeIterator nodes = node.getNodes();
+ final NodeIterator nodes = node.getNodes();
while (nodes.hasNext())
{
dump(nodes.nextNode());
}
}
- private static Session getSession(TransientRepository repository) throws RepositoryException
+ private static Session getSession(final TransientRepository repository) throws RepositoryException
{
return repository.login(new SimpleCredentials(USER_ID, PASSWORD));
}
@@ -161,7 +161,7 @@ public class WebdavProviderTestCase exte
return System.getProperty(TEST_URI);
}
- private static TransientRepository getTransientRepository(File repoDirectory) throws IOException
+ private static TransientRepository getTransientRepository(final File repoDirectory) throws IOException
{
// Jackrabbit 1.6:
// TransientRepository repository = new TransientRepository(repoDirectory);
@@ -169,9 +169,9 @@ public class WebdavProviderTestCase exte
return new TransientRepository(new File(repoDirectory, "repository.xml").toString(), repoDirectory.toString());
}
- private static void importFiles(File repoDirectory, File sourceDir) throws Exception
+ private static void importFiles(final File repoDirectory, final File sourceDir) throws Exception
{
- TransientRepository repository = getTransientRepository(repoDirectory);
+ final TransientRepository repository = getTransientRepository(repoDirectory);
try
{
final Session session = getSession(repository);
@@ -187,7 +187,7 @@ public class WebdavProviderTestCase exte
private static void importFiles(final Node parent, final File sourceDir) throws RepositoryException, IOException
{
final File[] files = sourceDir.listFiles();
- for (File file : files)
+ for (final File file : files)
{
if (file.isFile())
{
@@ -209,7 +209,7 @@ public class WebdavProviderTestCase exte
}
}
- private static void message(IOException e)
+ private static void message(final IOException e)
{
if (DEBUG)
{
@@ -217,7 +217,7 @@ public class WebdavProviderTestCase exte
}
}
- private static void message(String string)
+ private static void message(final String string)
{
if (DEBUG)
{
@@ -249,7 +249,7 @@ public class WebdavProviderTestCase exte
* @param repoDirectory
* @throws Exception
*/
- private static void startJackrabbit(File repoDirectory) throws Exception
+ private static void startJackrabbit(final File repoDirectory) throws Exception
{
boolean quiet = false;
if (!DEBUG)
@@ -311,7 +311,7 @@ public class WebdavProviderTestCase exte
{
message("Deleting temp directory " + RepoDirectory);
FileUtils.deleteDirectory(RepoDirectory);
- } catch (IOException e)
+ } catch (final IOException e)
{
message(e);
if (RepoDirectory.exists())
@@ -342,9 +342,9 @@ public class WebdavProviderTestCase exte
{
uri = ConnectionUri;
}
- WebdavFileSystemConfigBuilder builder = (WebdavFileSystemConfigBuilder) manager
+ final WebdavFileSystemConfigBuilder builder = (WebdavFileSystemConfigBuilder) manager
.getFileSystemConfigBuilder("webdav");
- FileSystemOptions opts = new FileSystemOptions();
+ final FileSystemOptions opts = new FileSystemOptions();
builder.setRootURI(opts, uri);
return manager.resolveFile(uri, opts);
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavVersioningTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavVersioningTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavVersioningTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/webdav/test/WebdavVersioningTests.java Mon Dec 3 13:37:12 2012
@@ -38,13 +38,13 @@ public class WebdavVersioningTests exten
*/
public void testVersioning() throws Exception
{
- FileObject scratchFolder = createScratchFolder();
- FileSystemOptions opts = scratchFolder.getFileSystem().getFileSystemOptions();
- WebdavFileSystemConfigBuilder builder =
+ final FileObject scratchFolder = createScratchFolder();
+ final FileSystemOptions opts = scratchFolder.getFileSystem().getFileSystemOptions();
+ final WebdavFileSystemConfigBuilder builder =
(WebdavFileSystemConfigBuilder)getManager().getFileSystemConfigBuilder("webdav");
builder.setVersioning(opts, true);
- FileObject file = getManager().resolveFile(scratchFolder, "file1.txt", opts);
- FileSystemOptions newOpts = file.getFileSystem().getFileSystemOptions();
+ final FileObject file = getManager().resolveFile(scratchFolder, "file1.txt", opts);
+ final FileSystemOptions newOpts = file.getFileSystem().getFileSystemOptions();
assertTrue(opts == newOpts);
assertTrue(builder.isVersioning(newOpts));
assertTrue(!file.exists());
@@ -58,7 +58,7 @@ public class WebdavVersioningTests exten
assertTrue(file.isReadable());
assertTrue(file.isWriteable());
Map<?, ?> map = file.getContent().getAttributes();
- String name = ((URLFileName)file.getName()).getUserName();
+ final String name = ((URLFileName)file.getName()).getUserName();
assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString()));
if (name != null)
{
@@ -92,14 +92,14 @@ public class WebdavVersioningTests exten
*/
public void testVersioningWithCreator() throws Exception
{
- FileObject scratchFolder = createScratchFolder();
- FileSystemOptions opts = scratchFolder.getFileSystem().getFileSystemOptions();
- WebdavFileSystemConfigBuilder builder =
+ final FileObject scratchFolder = createScratchFolder();
+ final FileSystemOptions opts = scratchFolder.getFileSystem().getFileSystemOptions();
+ final WebdavFileSystemConfigBuilder builder =
(WebdavFileSystemConfigBuilder)getManager().getFileSystemConfigBuilder("webdav");
builder.setVersioning(opts, true);
builder.setCreatorName(opts, "testUser");
- FileObject file = getManager().resolveFile(scratchFolder, "file1.txt", opts);
- FileSystemOptions newOpts = file.getFileSystem().getFileSystemOptions();
+ final FileObject file = getManager().resolveFile(scratchFolder, "file1.txt", opts);
+ final FileSystemOptions newOpts = file.getFileSystem().getFileSystemOptions();
assertTrue(opts == newOpts);
assertTrue(builder.isVersioning(newOpts));
assertTrue(!file.exists());
@@ -113,7 +113,7 @@ public class WebdavVersioningTests exten
assertTrue(file.isReadable());
assertTrue(file.isWriteable());
Map<?, ?> map = file.getContent().getAttributes();
- String name = ((URLFileName)file.getName()).getUserName();
+ final String name = ((URLFileName)file.getName()).getUserName();
assertTrue(map.containsKey(DeltaVConstants.CREATOR_DISPLAYNAME.toString()));
assertEquals(map.get(DeltaVConstants.CREATOR_DISPLAYNAME.toString()),"testUser");
if (name != null)
@@ -153,7 +153,7 @@ public class WebdavVersioningTests exten
*/
protected FileObject createScratchFolder() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
// Make sure the test folder is empty
scratchFolder.delete(Selectors.EXCLUDE_SELF);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/NestedZipTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/NestedZipTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/NestedZipTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/NestedZipTestCase.java Mon Dec 3 13:37:12 2012
@@ -62,7 +62,7 @@ public class NestedZipTestCase
{
// Locate the base Zip file
final String zipFilePath = AbstractVfsTestCase.getTestResourceFile("nested.zip").getAbsolutePath();
- String uri = "zip:file:" + zipFilePath + "!/test.zip";
+ final String uri = "zip:file:" + zipFilePath + "!/test.zip";
final FileObject zipFile = manager.resolveFile(uri);
// Now build the nested file system
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java Mon Dec 3 13:37:12 2012
@@ -100,7 +100,7 @@ public abstract class AbstractProviderTe
*/
protected DefaultFileSystemManager createManager() throws Exception
{
- DefaultFileSystemManager fs = getProviderConfig().getDefaultFileSystemManager();
+ final DefaultFileSystemManager fs = getProviderConfig().getDefaultFileSystemManager();
fs.setFilesCache(getProviderConfig().getFilesCache());
getProviderConfig().prepare(fs);
if (!fs.hasProvider("file"))
@@ -114,7 +114,7 @@ public abstract class AbstractProviderTe
* some provider config do some post-initialization in getBaseTestFolder.
* This is a hack to allow access to this code for {@code createManager}
*/
- public FileObject getBaseTestFolder(FileSystemManager fs) throws Exception
+ public FileObject getBaseTestFolder(final FileSystemManager fs) throws Exception
{
return providerConfig.getBaseTestFolder(fs);
}
@@ -161,7 +161,7 @@ public abstract class AbstractProviderTe
* Sets the write test folder.
* @param folder
*/
- protected void setWriteFolder(FileObject folder)
+ protected void setWriteFolder(final FileObject folder)
{
writeFolder = folder;
}
@@ -194,10 +194,10 @@ public abstract class AbstractProviderTe
final Capability[] caps = getRequiredCaps();
if (caps != null)
{
- for (Capability cap2 : caps)
+ for (final Capability cap2 : caps)
{
final Capability cap = cap2;
- FileSystem fs = readFolder.getFileSystem();
+ final FileSystem fs = readFolder.getFileSystem();
if (!fs.hasCapability(cap))
{
// String name = fs.getClass().getName();
@@ -376,12 +376,12 @@ public abstract class AbstractProviderTe
return base;
}
- protected void addEmptyDir(boolean addEmptyDir)
+ protected void addEmptyDir(final boolean addEmptyDir)
{
this.addEmptyDir = addEmptyDir;
}
- protected static Test notConfigured(Class<?> testClass)
+ protected static Test notConfigured(final Class<?> testClass)
{
return warning(testClass + " is not configured for tests, skipping");
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/AbstractTestSuite.java Mon Dec 3 13:37:12 2012
@@ -54,7 +54,7 @@ public abstract class AbstractTestSuite
private Thread[] startThreadSnapshot;
private Thread[] endThreadSnapshot;
- private boolean addEmptyDir;
+ private final boolean addEmptyDir;
/**
* Adds the tests for a file system to this suite.
@@ -116,7 +116,7 @@ public abstract class AbstractTestSuite
// Locate the test methods
final Method[] methods = testClass.getMethods();
- for (Method method2 : methods)
+ for (final Method method2 : methods)
{
final Method method = method2;
if (!method.getName().startsWith("test")
@@ -210,10 +210,10 @@ public abstract class AbstractTestSuite
manager.freeUnusedResources();
endThreadSnapshot = createThreadSnapshot();
- Thread[] diffThreadSnapshot = diffThreadSnapshot(startThreadSnapshot, endThreadSnapshot);
+ final Thread[] diffThreadSnapshot = diffThreadSnapshot(startThreadSnapshot, endThreadSnapshot);
if (diffThreadSnapshot.length > 0)
{
- String message = dumpThreadSnapshot(diffThreadSnapshot);
+ final String message = dumpThreadSnapshot(diffThreadSnapshot);
/*
if (providerConfig.checkCleanThreadState())
{
@@ -247,9 +247,9 @@ public abstract class AbstractTestSuite
}
}
- private String dumpThreadSnapshot(Thread[] threadSnapshot)
+ private String dumpThreadSnapshot(final Thread[] threadSnapshot)
{
- StringBuffer sb = new StringBuffer(256);
+ final StringBuffer sb = new StringBuffer(256);
sb.append("created threads still running:\n");
Field threadTargetField = null;
@@ -258,14 +258,14 @@ public abstract class AbstractTestSuite
threadTargetField = Thread.class.getDeclaredField("target");
threadTargetField.setAccessible(true);
}
- catch (NoSuchFieldException e)
+ catch (final NoSuchFieldException e)
{
// ignored
}
for (int iter = 0; iter < threadSnapshot.length; iter++)
{
- Thread thread = threadSnapshot[iter];
+ final Thread thread = threadSnapshot[iter];
if (thread == null)
{
continue;
@@ -292,7 +292,7 @@ public abstract class AbstractTestSuite
sb.append("\t");
try
{
- Object threadTarget = threadTargetField.get(thread);
+ final Object threadTarget = threadTargetField.get(thread);
if (threadTarget != null)
{
sb.append(threadTarget.getClass());
@@ -302,7 +302,7 @@ public abstract class AbstractTestSuite
sb.append("null");
}
}
- catch (IllegalAccessException e)
+ catch (final IllegalAccessException e)
{
sb.append("unknown class");
}
@@ -314,9 +314,9 @@ public abstract class AbstractTestSuite
return sb.toString();
}
- private Thread[] diffThreadSnapshot(Thread[] startThreadSnapshot, Thread[] endThreadSnapshot)
+ private Thread[] diffThreadSnapshot(final Thread[] startThreadSnapshot, final Thread[] endThreadSnapshot)
{
- List<Thread> diff = new ArrayList<Thread>(10);
+ final List<Thread> diff = new ArrayList<Thread>(10);
nextEnd: for (int iterEnd = 0; iterEnd < endThreadSnapshot.length; iterEnd++)
{
@@ -331,7 +331,7 @@ public abstract class AbstractTestSuite
diff.add(endThreadSnapshot[iterEnd]);
}
- Thread ret[] = new Thread[diff.size()];
+ final Thread ret[] = new Thread[diff.size()];
diff.toArray(ret);
return ret;
}
@@ -344,7 +344,7 @@ public abstract class AbstractTestSuite
tg = tg.getParent();
}
- Thread snapshot[] = new Thread[200];
+ final Thread snapshot[] = new Thread[200];
tg.enumerate(snapshot, true);
return snapshot;
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java Mon Dec 3 13:37:12 2012
@@ -48,7 +48,7 @@ public class ContentTests
private void assertSameContent(final FileInfo expected,
final FileObject folder) throws Exception
{
- for (FileInfo fileInfo : expected.children.values())
+ for (final FileInfo fileInfo : expected.children.values())
{
final FileObject child = folder.resolveFile(fileInfo.baseName, NameScope.CHILD);
@@ -108,8 +108,8 @@ public class ContentTests
{
return;
}
- FileSystem fileSystem = getFileSystem();
- String uri = fileSystem.getRootURI();
+ final FileSystem fileSystem = getFileSystem();
+ final String uri = fileSystem.getRootURI();
testRoot(getManager().resolveFile(uri, fileSystem.getFileSystemOptions()));
}
@@ -159,7 +159,7 @@ public class ContentTests
// Test the parent of the root of the file system
// TODO - refactor out test cases for layered vs originating fs
final FileSystem fileSystem = getFileSystem();
- FileObject root = fileSystem.getRoot();
+ final FileObject root = fileSystem.getRoot();
if (fileSystem.getParentLayer() == null)
{
// No parent layer, so parent should be null
@@ -186,7 +186,7 @@ public class ContentTests
file.getChildren();
fail();
}
- catch (FileSystemException e)
+ catch (final FileSystemException e)
{
assertSameMessage("vfs.provider/list-children-not-folder.error", file, e);
}
@@ -209,7 +209,7 @@ public class ContentTests
}
// Should be able to get child by name
- FileObject child = file.resolveFile("some-child");
+ final FileObject child = file.resolveFile("some-child");
assertNotNull(child);
}
@@ -234,14 +234,14 @@ public class ContentTests
{
// Try getting the content of an unknown file
- FileObject unknownFile = getReadFolder().resolveFile("unknown-file");
- FileContent content = unknownFile.getContent();
+ final FileObject unknownFile = getReadFolder().resolveFile("unknown-file");
+ final FileContent content = unknownFile.getContent();
try
{
content.getInputStream();
fail();
}
- catch (FileSystemException e)
+ catch (final FileSystemException e)
{
assertSameMessage("vfs.provider/read-not-file.error", unknownFile, e);
}
@@ -318,7 +318,7 @@ public class ContentTests
public void testReuse() throws Exception
{
// Get the test file
- FileObject file = getReadFolder().resolveFile("file1.txt");
+ final FileObject file = getReadFolder().resolveFile("file1.txt");
assertEquals(FileType.FILE, file.getType());
assertTrue(file.isFile());
@@ -342,7 +342,7 @@ public class ContentTests
public void testInputStreamMultipleCleanup() throws Exception
{
// Get the test file
- FileObject file = getReadFolder().resolveFile("file1.txt");
+ final FileObject file = getReadFolder().resolveFile("file1.txt");
assertEquals(FileType.FILE, file.getType());
assertTrue(file.isFile());
@@ -366,7 +366,7 @@ public class ContentTests
public void testInputStreamSingleCleanup() throws Exception
{
// Get the test file
- FileObject file = getReadFolder().resolveFile("file1.txt");
+ final FileObject file = getReadFolder().resolveFile("file1.txt");
assertEquals(FileType.FILE, file.getType());
assertTrue(file.isFile());
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/FileSystemManagerFactoryTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/FileSystemManagerFactoryTestCase.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/FileSystemManagerFactoryTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/FileSystemManagerFactoryTestCase.java Mon Dec 3 13:37:12 2012
@@ -42,13 +42,13 @@ public class FileSystemManagerFactoryTes
// Lookup a test jar file
final File jarFile = getTestResourceFile("test.jar");
// File
- FileObject file = manager.toFileObject(jarFile);
+ final FileObject file = manager.toFileObject(jarFile);
check(manager, file);
// URI
- FileObject file2 = manager.resolveFile(jarFile.toURI());
+ final FileObject file2 = manager.resolveFile(jarFile.toURI());
check(manager, file2);
// URL
- FileObject file3 = manager.resolveFile(jarFile.toURI().toURL());
+ final FileObject file3 = manager.resolveFile(jarFile.toURI().toURL());
check(manager, file3);
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/LastModifiedTests.java Mon Dec 3 13:37:12 2012
@@ -28,7 +28,7 @@ import org.junit.Assert;
*/
public class LastModifiedTests extends AbstractProviderTestCase
{
- private void asssertDelta(String message, final long expected, final long actual, final long delta)
+ private void asssertDelta(final String message, final long expected, final long actual, final long delta)
{
if (expected == actual)
{
@@ -82,7 +82,7 @@ public class LastModifiedTests extends A
try
{
assertEquals("Check 1", now, lastModifiedTime, lastModTimeAccuracy);
- } catch (AssertionFailedError e)
+ } catch (final AssertionFailedError e)
{
// on linux ext3 the above check is not necessarily true
if (lastModTimeAccuracy < 1000L)
@@ -105,7 +105,7 @@ public class LastModifiedTests extends A
try
{
assertEquals("Check 3", now, lastModifiedTime, lastModTimeAccuracy);
- } catch (AssertionFailedError e)
+ } catch (final AssertionFailedError e)
{
// on linux ext3 the above check is not necessarily true
if (lastModTimeAccuracy < 1000L)
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/NamingTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/NamingTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/NamingTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/NamingTests.java Mon Dec 3 13:37:12 2012
@@ -98,7 +98,7 @@ public class NamingTests
getManager().resolveFile("%");
fail();
}
- catch (FileSystemException e)
+ catch (final FileSystemException e)
{
}
@@ -108,7 +108,7 @@ public class NamingTests
getManager().resolveFile("%5");
fail();
}
- catch (FileSystemException e)
+ catch (final FileSystemException e)
{
}
@@ -118,7 +118,7 @@ public class NamingTests
getManager().resolveFile("%q");
fail();
}
- catch (FileSystemException e)
+ catch (final FileSystemException e)
{
}
@@ -185,7 +185,7 @@ public class NamingTests
assertTrue(!name.getPath().endsWith("/a/b"));
// Test names with the same prefix
- String path = name.getPath() + "/a";
+ final String path = name.getPath() + "/a";
assertSameName(path, name, path, scope);
assertSameName(path, name, "../" + name.getBaseName() + "/a", scope);
@@ -241,9 +241,9 @@ public class NamingTests
* Checks that a relative name resolves to the expected absolute path.
* Tests both forward and back slashes.
*/
- private void assertSameName(String expectedPath,
- FileName baseName,
- String relName) throws Exception
+ private void assertSameName(final String expectedPath,
+ final FileName baseName,
+ final String relName) throws Exception
{
assertSameName(expectedPath, baseName, relName, NameScope.FILE_SYSTEM);
}
@@ -387,7 +387,7 @@ public class NamingTests
getManager().resolveName(name, relName, scope);
fail("expected failure");
}
- catch (FileSystemException e)
+ catch (final FileSystemException e)
{
// TODO - should check error message
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/PermissionsTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/PermissionsTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/PermissionsTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/PermissionsTests.java Mon Dec 3 13:37:12 2012
@@ -139,7 +139,7 @@ public class PermissionsTests extends Ab
private FileObject createTestFile() throws Exception
{
// Get the scratch folder
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
assertNotNull(scratchFolder);
// Make sure the test folder is empty
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderCacheStrategyTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderCacheStrategyTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderCacheStrategyTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderCacheStrategyTests.java Mon Dec 3 13:37:12 2012
@@ -50,7 +50,7 @@ public class ProviderCacheStrategyTests
*/
public void testManualCache() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
if (FileObjectUtils.isInstanceOf(getBaseFolder(), RamFileObject.class) ||
scratchFolder.getFileSystem() instanceof VirtualFileSystem)
{
@@ -60,12 +60,12 @@ public class ProviderCacheStrategyTests
scratchFolder.delete(Selectors.EXCLUDE_SELF);
- DefaultFileSystemManager fs = createManager();
+ final DefaultFileSystemManager fs = createManager();
fs.setCacheStrategy(CacheStrategy.MANUAL);
fs.init();
- FileObject foBase2 = getBaseTestFolder(fs);
+ final FileObject foBase2 = getBaseTestFolder(fs);
- FileObject cachedFolder = foBase2.resolveFile(scratchFolder.getName().getPath());
+ final FileObject cachedFolder = foBase2.resolveFile(scratchFolder.getName().getPath());
FileObject[] fos = cachedFolder.getChildren();
assertContainsNot(fos, "file1.txt");
@@ -85,7 +85,7 @@ public class ProviderCacheStrategyTests
*/
public void testOnResolveCache() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
if (FileObjectUtils.isInstanceOf(getBaseFolder(), RamFileObject.class) ||
scratchFolder.getFileSystem() instanceof VirtualFileSystem)
{
@@ -95,10 +95,10 @@ public class ProviderCacheStrategyTests
scratchFolder.delete(Selectors.EXCLUDE_SELF);
- DefaultFileSystemManager fs = createManager();
+ final DefaultFileSystemManager fs = createManager();
fs.setCacheStrategy(CacheStrategy.ON_RESOLVE);
fs.init();
- FileObject foBase2 = getBaseTestFolder(fs);
+ final FileObject foBase2 = getBaseTestFolder(fs);
FileObject cachedFolder = foBase2.resolveFile(scratchFolder.getName().getPath());
@@ -120,7 +120,7 @@ public class ProviderCacheStrategyTests
*/
public void testOnCallCache() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
if (FileObjectUtils.isInstanceOf(getBaseFolder(), RamFileObject.class) ||
scratchFolder.getFileSystem() instanceof VirtualFileSystem)
{
@@ -130,12 +130,12 @@ public class ProviderCacheStrategyTests
scratchFolder.delete(Selectors.EXCLUDE_SELF);
- DefaultFileSystemManager fs = createManager();
+ final DefaultFileSystemManager fs = createManager();
fs.setCacheStrategy(CacheStrategy.ON_CALL);
fs.init();
- FileObject foBase2 = getBaseTestFolder(fs);
+ final FileObject foBase2 = getBaseTestFolder(fs);
- FileObject cachedFolder = foBase2.resolveFile(scratchFolder.getName().getPath());
+ final FileObject cachedFolder = foBase2.resolveFile(scratchFolder.getName().getPath());
FileObject[] fos = cachedFolder.getChildren();
assertContainsNot(fos, "file1.txt");
@@ -146,9 +146,9 @@ public class ProviderCacheStrategyTests
assertContains(fos, "file1.txt");
}
- public void assertContainsNot(FileObject[] fos, String string)
+ public void assertContainsNot(final FileObject[] fos, final String string)
{
- for (FileObject fo : fos)
+ for (final FileObject fo : fos)
{
if (string.equals(fo.getName().getBaseName()))
{
@@ -157,9 +157,9 @@ public class ProviderCacheStrategyTests
}
}
- public void assertContains(FileObject[] fos, String string)
+ public void assertContains(final FileObject[] fos, final String string)
{
- for (FileObject fo : fos)
+ for (final FileObject fo : fos)
{
if (string.equals(fo.getName().getBaseName()))
{
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderDeleteTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderDeleteTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderDeleteTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderDeleteTests.java Mon Dec 3 13:37:12 2012
@@ -34,19 +34,19 @@ public class ProviderDeleteTests
{
final String basename;
- private FileNameSelector(String basename)
+ private FileNameSelector(final String basename)
{
this.basename = basename;
}
@Override
- public boolean includeFile(FileSelectInfo fileInfo) throws Exception
+ public boolean includeFile(final FileSelectInfo fileInfo) throws Exception
{
return this.basename.equals(fileInfo.getFile().getName().getBaseName());
}
@Override
- public boolean traverseDescendents(FileSelectInfo fileInfo) throws Exception
+ public boolean traverseDescendents(final FileSelectInfo fileInfo) throws Exception
{
return true;
}
@@ -72,7 +72,7 @@ public class ProviderDeleteTests
*/
protected FileObject createScratchFolder() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
// Make sure the test folder is empty
scratchFolder.delete(Selectors.EXCLUDE_SELF);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadTests.java Mon Dec 3 13:37:12 2012
@@ -53,7 +53,7 @@ public class ProviderRandomReadTests
try
{
file = getReadFolder().resolveFile("file1.txt");
- RandomAccessContent ra = file.getContent().getRandomAccessContent(RandomAccessMode.READ);
+ final RandomAccessContent ra = file.getContent().getRandomAccessContent(RandomAccessMode.READ);
// read first byte
byte c = ra.readByte();
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadWriteTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadWriteTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadWriteTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadWriteTests.java Mon Dec 3 13:37:12 2012
@@ -52,7 +52,7 @@ public class ProviderRandomReadWriteTest
*/
protected FileObject createScratchFolder() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
// Make sure the test folder is empty
scratchFolder.delete(Selectors.EXCLUDE_SELF);
@@ -71,7 +71,7 @@ public class ProviderRandomReadWriteTest
{
file = createScratchFolder().resolveFile("random_write.txt");
file.createFile();
- RandomAccessContent ra = file.getContent().getRandomAccessContent(RandomAccessMode.READWRITE);
+ final RandomAccessContent ra = file.getContent().getRandomAccessContent(RandomAccessMode.READWRITE);
// write first byte
ra.writeByte(TEST_DATA.charAt(0));
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomSetLengthTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomSetLengthTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomSetLengthTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomSetLengthTests.java Mon Dec 3 13:37:12 2012
@@ -90,7 +90,7 @@ public class ProviderRandomSetLengthTest
{
ra.readByte();
Assert.fail("Expected " + Exception.class.getName());
- } catch (IOException e)
+ } catch (final IOException e)
{
// Expected
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderReadTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderReadTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderReadTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderReadTests.java Mon Dec 3 13:37:12 2012
@@ -103,7 +103,7 @@ public class ProviderReadTests extends A
int length = children.length;
if (info.children.size() != children.length)
{
- for (FileObject element : children)
+ for (final FileObject element : children)
{
if (element.getName().getBaseName().startsWith("."))
{
@@ -119,7 +119,7 @@ public class ProviderReadTests extends A
// Recursively check each child
for (final FileObject child : children)
{
- String childName = child.getName().getBaseName();
+ final String childName = child.getName().getBaseName();
if (childName.startsWith("."))
{
continue;
@@ -165,8 +165,8 @@ public class ProviderReadTests extends A
{
return;
}
- FileSystem fs = getFileSystem();
- String uri = fs.getRootURI();
+ final FileSystem fs = getFileSystem();
+ final String uri = fs.getRootURI();
final FileObject file = getManager().resolveFile(uri, fs.getFileSystemOptions());
file.getChildren();
}
@@ -183,7 +183,7 @@ public class ProviderReadTests extends A
final FileObject[] actualFiles = getReadFolder().findFiles(selector);
Arrays.sort(actualFiles);
FileObject prevActualFile = actualFiles[0];
- for (FileObject actualFile : actualFiles)
+ for (final FileObject actualFile : actualFiles)
{
assertTrue(prevActualFile.toString().compareTo(actualFile.toString()) <= 0);
prevActualFile = actualFile;
@@ -214,12 +214,12 @@ public class ProviderReadTests extends A
}
// Try getting the content of a folder
- FileObject folder = getReadFolderDir1();
+ final FileObject folder = getReadFolderDir1();
try
{
folder.getContent().getInputStream();
fail();
- } catch (FileSystemException e)
+ } catch (final FileSystemException e)
{
assertSameMessage("vfs.provider/read-not-file.error", folder, e);
}
@@ -230,7 +230,7 @@ public class ProviderReadTests extends A
*/
public void testFolderIsHidden() throws Exception
{
- FileObject folder = getReadFolderDir1();
+ final FileObject folder = getReadFolderDir1();
Assert.assertFalse(folder.isHidden());
}
@@ -239,7 +239,7 @@ public class ProviderReadTests extends A
*/
public void testFolderIsReadable() throws Exception
{
- FileObject folder = getReadFolderDir1();
+ final FileObject folder = getReadFolderDir1();
Assert.assertTrue(folder.isReadable());
}
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRenameTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRenameTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRenameTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderRenameTests.java Mon Dec 3 13:37:12 2012
@@ -54,7 +54,7 @@ public class ProviderRenameTests
*/
protected FileObject createScratchFolder() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
// Make sure the test folder is empty
scratchFolder.delete(Selectors.EXCLUDE_SELF);
@@ -66,7 +66,7 @@ public class ProviderRenameTests
private void moveFile(final FileObject scratchFolder, final FileObject file, final String content)
throws FileSystemException, Exception
{
- FileObject fileMove = scratchFolder.resolveFile("file1move.txt");
+ final FileObject fileMove = scratchFolder.resolveFile("file1move.txt");
assertTrue(!fileMove.exists());
file.moveTo(fileMove);
Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderWriteAppendTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderWriteAppendTests.java?rev=1416507&r1=1416506&r2=1416507&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderWriteAppendTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderWriteAppendTests.java Mon Dec 3 13:37:12 2012
@@ -51,7 +51,7 @@ public class ProviderWriteAppendTests
*/
protected FileObject createScratchFolder() throws Exception
{
- FileObject scratchFolder = getWriteFolder();
+ final FileObject scratchFolder = getWriteFolder();
// Make sure the test folder is empty
scratchFolder.delete(Selectors.EXCLUDE_SELF);
@@ -99,7 +99,7 @@ public class ProviderWriteAppendTests
assertSameContent(contentAppend, file);
// Make sure we can copy the new file to another file on the same filesystem
- FileObject fileCopy = scratchFolder.resolveFile("file1copy.txt");
+ final FileObject fileCopy = scratchFolder.resolveFile("file1copy.txt");
assertTrue(!fileCopy.exists());
fileCopy.copyFrom(file, Selectors.SELECT_SELF);