Search in sources :

Example 11 with NanoHTTPD

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"));
}
Also used : Processor(aQute.bnd.osgi.Processor) HashMap(java.util.HashMap) NanoHTTPD(test.lib.NanoHTTPD) File(java.io.File)

Aggregations

NanoHTTPD (test.lib.NanoHTTPD)11 File (java.io.File)10 DefaultURLConnector (aQute.bnd.deployer.http.DefaultURLConnector)4 URI (java.net.URI)4 Processor (aQute.bnd.osgi.Processor)3 HashMap (java.util.HashMap)3 InputStream (java.io.InputStream)2 URL (java.net.URL)2 Properties (java.util.Properties)2 Reporter (aQute.service.reporter.Reporter)1 IOException (java.io.IOException)1 ExecutorService (java.util.concurrent.ExecutorService)1