Esempio n. 1
0
        public virtual void TestHadoopFileSystem()
        {
            Configuration conf = TestHdfsHelper.GetHdfsConf();
            FileSystem    fs   = FileSystem.Get(conf);

            try
            {
                OutputStream os = fs.Create(new Path(TestHdfsHelper.GetHdfsTestDir(), "foo"));
                os.Write(new byte[] { 1 });
                os.Close();
                InputStream @is = fs.Open(new Path(TestHdfsHelper.GetHdfsTestDir(), "foo"));
                NUnit.Framework.Assert.AreEqual(@is.Read(), 1);
                NUnit.Framework.Assert.AreEqual(@is.Read(), -1);
                @is.Close();
            }
            finally
            {
                fs.Close();
            }
        }
Esempio n. 2
0
 /// <exception cref="System.Exception"/>
 public virtual void TestHdfsNoAnnotation2()
 {
     TestHdfsHelper.GetHdfsTestDir();
 }