@Before public void setUpRepos() throws Exception { buckRepoRoot = temp.newFolder().toPath(); thirdPartyRelative = Paths.get("third-party").resolve("java"); thirdParty = buckRepoRoot.resolve(thirdPartyRelative); localRepo = temp.newFolder().toPath(); resolver = new Resolver(buckRepoRoot, thirdPartyRelative, localRepo, httpd.getUri("/").toString()); }
@BeforeClass public static void setUpFakeMavenRepo() throws Exception { repo = TestDataHelper.getTestDataDirectory(new ResolverIntegrationTest()); // If we're running this test in IJ, then this path doesn't exist. Fall back to one that does if (!Files.exists(repo)) { repo = Paths.get("test/com/facebook/buck/maven/testdata"); } httpd = new HttpdForTests(); ResourceHandler resourceHandler = new ResourceHandler(); resourceHandler.setDirectoriesListed(true); resourceHandler.setResourceBase(repo.toAbsolutePath().toString()); ContextHandler contextHandler = new ContextHandler("/"); contextHandler.setHandler(resourceHandler); contextHandler.setLogger(new StdErrLog()); httpd.addHandler(contextHandler); httpd.start(); }
@AfterClass public static void shutDownHttpd() throws Exception { httpd.close(); }