Repository: camel Updated Branches: refs/heads/master 7fb7e8f7a -> 158b8bb68
CAMEL-10103: More unittest Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/158b8bb6 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/158b8bb6 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/158b8bb6 Branch: refs/heads/master Commit: 158b8bb68efb9b885a296b78e0218218dfda92ee Parents: 7fb7e8f Author: Arno Noordover <anoordo...@users.noreply.github.com> Authored: Sat Jul 2 01:01:16 2016 +0200 Committer: Arno Noordover <anoordo...@users.noreply.github.com> Committed: Sat Jul 2 01:01:16 2016 +0200 ---------------------------------------------------------------------- .../file/remote/OsgiParserFactoryTest.java | 55 +++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/158b8bb6/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/OsgiParserFactoryTest.java ---------------------------------------------------------------------- diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/OsgiParserFactoryTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/OsgiParserFactoryTest.java index 10f1719..785c224 100644 --- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/OsgiParserFactoryTest.java +++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/OsgiParserFactoryTest.java @@ -19,7 +19,12 @@ package org.apache.camel.component.file.remote; import org.apache.commons.net.ftp.FTPClientConfig; import org.apache.commons.net.ftp.FTPFileEntryParser; import org.apache.commons.net.ftp.parser.CompositeFileEntryParser; +import org.apache.commons.net.ftp.parser.MVSFTPEntryParser; +import org.apache.commons.net.ftp.parser.MacOsPeterFTPEntryParser; import org.apache.commons.net.ftp.parser.NTFTPEntryParser; +import org.apache.commons.net.ftp.parser.NetwareFTPEntryParser; +import org.apache.commons.net.ftp.parser.OS2FTPEntryParser; +import org.apache.commons.net.ftp.parser.OS400FTPEntryParser; import org.apache.commons.net.ftp.parser.UnixFTPEntryParser; import org.apache.commons.net.ftp.parser.VMSVersioningFTPEntryParser; import org.junit.Before; @@ -96,9 +101,57 @@ public class OsgiParserFactoryTest { @Test public void createFileEntryParserWin32() throws Exception { - when(ftpClientConfig.getServerSystemKey()).thenReturn("WIN32"); + when(ftpClientConfig.getServerSystemKey()).thenReturn("bla WIN32 bla"); FTPFileEntryParser result = OSGI_PARSER_FACTORY.createFileEntryParser(ftpClientConfig); assertThat(result, instanceOf(CompositeFileEntryParser.class)); } + @Test + public void createFileEntryParserOs2() + throws Exception { + when(ftpClientConfig.getServerSystemKey()).thenReturn("bla OS/2 bla"); + FTPFileEntryParser result = OSGI_PARSER_FACTORY.createFileEntryParser(ftpClientConfig); + assertThat(result, instanceOf(OS2FTPEntryParser.class)); + } + + @Test + public void createFileEntryParserPlainOs400() + throws Exception { + when(ftpClientConfig.getServerSystemKey()).thenReturn("OS/400"); + FTPFileEntryParser result = OSGI_PARSER_FACTORY.createFileEntryParser(ftpClientConfig); + assertThat(result, instanceOf(OS400FTPEntryParser.class)); + } + + @Test + public void createFileEntryParserNotPlainOs400() + throws Exception { + when(ftpClientConfig.getServerSystemKey()).thenReturn("OS/400 bla"); + FTPFileEntryParser result = OSGI_PARSER_FACTORY.createFileEntryParser(ftpClientConfig); + assertThat(result, instanceOf(CompositeFileEntryParser.class)); + } + + @Test + public void createFileEntryParserMvs() + throws Exception { + when(ftpClientConfig.getServerSystemKey()).thenReturn("bla MvS bla"); + FTPFileEntryParser result = OSGI_PARSER_FACTORY.createFileEntryParser(ftpClientConfig); + assertThat(result, instanceOf(MVSFTPEntryParser.class)); + } + + @Test + public void createFileEntryParserNetware() + throws Exception { + when(ftpClientConfig.getServerSystemKey()).thenReturn("bla NeTwArE bla"); + FTPFileEntryParser result = OSGI_PARSER_FACTORY.createFileEntryParser(ftpClientConfig); + assertThat(result, instanceOf(NetwareFTPEntryParser.class)); + } + + @Test + public void createFileEntryParserMacOsPeter() + throws Exception { + when(ftpClientConfig.getServerSystemKey()).thenReturn("bla MaCoS PeTER bla"); + FTPFileEntryParser result = OSGI_PARSER_FACTORY.createFileEntryParser(ftpClientConfig); + assertThat(result, instanceOf(MacOsPeterFTPEntryParser.class)); + } + } \ No newline at end of file