Search in sources :

Example 6 with FileSystemFactory

use of com.qlangtech.tis.offline.FileSystemFactory in project tis by qlangtech.

the class MockTest method testMock.

public void testMock() {
    final String fsPath = "/user/admin/test";
    FileSystemFactory indexBuilderFileSystemFactory = EasyMock.createMock("indexBuildFileSystem", FileSystemFactory.class);
    ITISFileSystem tisFileSystem = EasyMock.createMock("tisFileSystem", ITISFileSystem.class);
    EasyMock.expect(tisFileSystem.getName()).andReturn("mocktest");
    IPath path = EasyMock.createMock("mockpath", IPath.class);
    EasyMock.expect(tisFileSystem.getPath(fsPath)).andReturn(path);
    EasyMock.expect(indexBuilderFileSystemFactory.getFileSystem()).andReturn(tisFileSystem);
    EasyMock.replay(indexBuilderFileSystemFactory, tisFileSystem, path);
    ITISFileSystem fs = indexBuilderFileSystemFactory.getFileSystem();
    assertEquals("mocktest", fs.getName());
    assertNotNull(fs.getPath(fsPath));
}
Also used : IPath(com.qlangtech.tis.fs.IPath) ITISFileSystem(com.qlangtech.tis.fs.ITISFileSystem) FileSystemFactory(com.qlangtech.tis.offline.FileSystemFactory)

Aggregations

FileSystemFactory (com.qlangtech.tis.offline.FileSystemFactory)6 ITISFileSystem (com.qlangtech.tis.fs.ITISFileSystem)4 IPath (com.qlangtech.tis.fs.IPath)3 Configuration (com.alibaba.datax.common.util.Configuration)2 IDataxProcessor (com.qlangtech.tis.datax.IDataxProcessor)2 DataxProcessor (com.qlangtech.tis.datax.impl.DataxProcessor)2 HdfsPath (com.qlangtech.tis.hdfs.impl.HdfsPath)2 File (java.io.File)2 Path (org.apache.hadoop.fs.Path)2 Test (org.junit.Test)2 HdfsColMeta (com.alibaba.datax.plugin.writer.hdfswriter.HdfsColMeta)1 HdfsHelper (com.alibaba.datax.plugin.writer.hdfswriter.HdfsHelper)1 HudiWriter (com.alibaba.datax.plugin.writer.hudi.HudiWriter)1 Lists (com.google.common.collect.Lists)1 IHiveConnGetter (com.qlangtech.tis.config.hive.IHiveConnGetter)1 HiveTable (com.qlangtech.tis.config.hive.meta.HiveTable)1 IHiveMetaStore (com.qlangtech.tis.config.hive.meta.IHiveMetaStore)1 ISparkConnGetter (com.qlangtech.tis.config.spark.ISparkConnGetter)1 DefaultSparkConnGetter (com.qlangtech.tis.config.spark.impl.DefaultSparkConnGetter)1 TargetResName (com.qlangtech.tis.coredefine.module.action.TargetResName)1