MCPcopy Create free account
hub / github.com/GateNLP/gate-core / testWriteTempFile

Method testWriteTempFile

src/test/java/gate/util/TestFiles.java:69–89  ·  view source on GitHub ↗

Test the writeTempFile... method.

()

Source from the content-addressed store, hash-verified

67
68 /** Test the writeTempFile... method. */
69 public void testWriteTempFile() throws Exception {
70 assertTrue(true);
71 String japeResName = "gate.ac.uk/tests/ft-bt-03-aug-2001.html";
72 String firstLine = "<!-- Vignette V/5 Mon Aug 06 07:50:01 2001 -->";
73
74 File f = Files.writeTempFile(Files.getGateResourceAsStream(japeResName));
75 BufferedReader bfr = null;
76
77 try {
78 bfr = new BufferedReader(new FileReader(f));
79
80 String firstLn = bfr.readLine();
81 assertTrue("first line from jape/combined/testloc.jape doesn't match",
82 firstLine.equals(firstLn));
83
84 f.delete ();
85 }
86 finally {
87 IOUtils.closeQuietly(bfr);
88 }
89 } // testWriteTempFile()
90
91 /** Test the find method. */
92 public void testFind(){

Callers

nothing calls this directly

Calls 5

writeTempFileMethod · 0.95
readLineMethod · 0.80
equalsMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected