Example usage for org.apache.commons.net.ftp FTPConnectionClosedException getClass

List of usage examples for org.apache.commons.net.ftp FTPConnectionClosedException getClass

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPConnectionClosedException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:at.beris.virtualfile.client.FtpClientIntegrationTest.java

@Test
public void reconnectAfterIdleTimeout() throws IOException, InterruptedException {
    try {/*from www. ja  va 2s  . c om*/
        ftpClient.createFile(TEST_FILE);
        Thread.currentThread().sleep(3000);
        Assert.assertTrue(ftpClient.list("/").size() > 0);
    } catch (FTPConnectionClosedException e) {
        fail(e.getClass().getSimpleName() + " not handled.");
    }
}

From source file:at.beris.virtualfile.client.FtpClientIntegrationTest.java

@Test
public void reconnectAfterServerClosedConnection() throws IOException {
    try {//  ww  w.j av a2  s.c  om
        ftpClient.createFile(TEST_FILE);
        for (FtpIoSession session : ftpServerListener.getActiveSessions()) {
            session.close();
        }
        Assert.assertTrue(ftpClient.list("/").size() > 0);
    } catch (FTPConnectionClosedException e) {
        fail(e.getClass().getSimpleName() + " not handled.");
    }
}