// Path: src/test/java/com/github/mlk/junit/rules/helpers/hadoop/NoAccessToHadoopRule.java
// public class NoAccessToHadoopRule {
// 
//   private final String hadoopUrl;
// 
//   public NoAccessToHadoopRule(String hadoopUrl) {
//     this.hadoopUrl = hadoopUrl;
//   }
// 
// 
//   public List<String> content() throws IOException {
//     Configuration confHadoop = new Configuration();
//     confHadoop.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName());
//     confHadoop.set("fs.file.impl", org.apache.hadoop.fs.LocalFileSystem.class.getName());
//     try (FileSystem hdfs = FileSystem.get(URI.create(hadoopUrl), confHadoop)) {
//       return IOUtils.readLines(hdfs.open(new Path("/new_file.txt")));
//     }
//   }
// }


import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import com.github.mlk.junit.rules.helpers.hadoop.NoAccessToHadoopRule;
import java.io.IOException;
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
package com.github.mlk.junit.rules;



public class TestHadoopRule {

  @Rule
  public HadoopDFSRule subject = new HadoopDFSRule();

  /**
   * "Hello World" example that reads in a text file using a class that has no knowledge of the
   * JUnit rule.
   */
  @Test
  public void helloWorld() throws IOException {
    subject.copyResource("/new_file.txt", "/testfile.txt");

// Path: src/test/java/com/github/mlk/junit/rules/helpers/hadoop/NoAccessToHadoopRule.java
// public class NoAccessToHadoopRule {
// 
//   private final String hadoopUrl;
// 
//   public NoAccessToHadoopRule(String hadoopUrl) {
//     this.hadoopUrl = hadoopUrl;
//   }
// 
// 
//   public List<String> content() throws IOException {
//     Configuration confHadoop = new Configuration();
//     confHadoop.set("fs.hdfs.impl", org.apache.hadoop.hdfs.DistributedFileSystem.class.getName());
//     confHadoop.set("fs.file.impl", org.apache.hadoop.fs.LocalFileSystem.class.getName());
//     try (FileSystem hdfs = FileSystem.get(URI.create(hadoopUrl), confHadoop)) {
//       return IOUtils.readLines(hdfs.open(new Path("/new_file.txt")));
//     }
//   }
// }


// Path: src/test/java/com/github/mlk/junit/rules/TestHadoopRule.java
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import com.github.mlk.junit.rules.helpers.hadoop.NoAccessToHadoopRule;
import java.io.IOException;
import java.util.List;
import org.junit.Rule;
import org.junit.Test;

package com.github.mlk.junit.rules;



public class TestHadoopRule {

  @Rule
  public HadoopDFSRule subject = new HadoopDFSRule();

  /**
   * "Hello World" example that reads in a text file using a class that has no knowledge of the
   * JUnit rule.
   */
  @Test
  public void helloWorld() throws IOException {
    subject.copyResource("/new_file.txt", "/testfile.txt");

    List<String> content = new NoAccessToHadoopRule("hdfs://localhost:" + subject.getNameNodePort())