16 package uk.ac.cam.eng.util;
19 import java.io.FileOutputStream;
20 import java.io.IOException;
21 import java.io.InputStream;
22 import java.io.OutputStream;
24 import org.apache.hadoop.conf.Configuration;
25 import org.junit.Assert;
26 import org.junit.BeforeClass;
27 import org.junit.ClassRule;
28 import org.junit.Test;
29 import org.junit.rules.TemporaryFolder;
31 import scala.reflect.internal.Trees.This;
37 private static final String TEST_CONFIG=
"/TestConfigFile";
42 public static TemporaryFolder
folder =
new TemporaryFolder();
45 public static void setup() throws IOException{
46 testConfig = folder.newFile();
47 try (OutputStream writer =
new FileOutputStream(testConfig)) {
50 for (
int in = configFile.read(); in != -1; in = configFile.read()) {
60 String[] args = (
"--input=foo --output=bar @" + testConfig.getAbsolutePath()).split(
" ");
65 public void testApplyConf() throws IllegalArgumentException, IllegalAccessException, IOException{
67 String[] args = (
"--input=foo --output=bar @" + testConfig.getAbsolutePath()).split(
" ");
69 Configuration conf =
new Configuration();
73 Assert.assertEquals(
"cc,nc,yx,web", prov);
static TemporaryFolder folder