SHARE
TWEET

Untitled

a guest Apr 18th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Rule
  2.     public TemporaryFolder tempFolder = new TemporaryFolder();
  3.  
  4.     @Before
  5.     public void setup() {
  6.     }
  7.  
  8.     @Test
  9.     public void getContentFile() throws IOException {
  10.         File textFile = tempFolder.newFile("testText.txt");
  11.         String pathFile = textFile.getPath();
  12.         FileWriter fileWriter = new FileWriter(textFile.getName());
  13.         fileWriter.write("Line1 a");
  14.         fileWriter.write("Line2 b c");
  15.         fileWriter.write("Line3 3");
  16.         String[] testedContent = contentFileRetriever.getContentFile(pathFile);
  17.         String[] expected = {"Line1 a", "Line2 b c", "Line 3"};
  18.         assertArrayEquals(expected, testedContent);
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top