use of test.lib.NanoHTTPD in project bnd by bndtools.
the class TestObrRepo method setUp.
@Override
protected void setUp() throws Exception {
httpd = new NanoHTTPD(0, IO.getFile("testdata/http"));
httpdPort = httpd.getPort();
Sed.file2File(obrSrc, "__httpdPort__", Integer.toString(httpdPort), obrDst);
reporter = new Processor();
obr = new FixedIndexedRepo();
Map<String, String> config = new HashMap<String, String>();
config.put("name", "obr");
config.put("locations", new File(obrDst).toURI().toString());
config.put("type", "OBR");
obr.setProperties(config);
obr.setReporter(reporter);
File tmpFile = File.createTempFile("cache", ".tmp");
tmpFile.deleteOnExit();
obr.setCacheDirectory(new File(tmpFile.getAbsolutePath() + ".dir"));
}
Aggregations