protected TestRepository<Repository> createTestRepository() throws IOException { return new TestRepository<Repository>(createBareRepository()); }
/** * @param base * base URI used to access the server. * @param path * the path to locate requests for, relative to {@code base}. * @return all requests which match the given path. */ public List<AccessEvent> getRequests(URIish base, String path) { return getRequests(HttpTestCase.join(base, path)); }
/** {@inheritDoc} */ @Override public void setUp() throws Exception { super.setUp(); server = createServer(); }
protected URIish toURIish(ServletContextHandler app, String name) throws URISyntaxException { String p = app.getContextPath(); if (!p.endsWith("/") && !name.startsWith("/")) p += "/"; p += name; return toURIish(p); }
/** * Convert a path relative to the app's context path to a URIish * * @param app * @param name * @return the warnings (if any) from the last execution * @throws URISyntaxException */ protected URIish toURIish(ServletContextHandler app, String name) throws URISyntaxException { String p = app.getContextPath(); if (!p.endsWith("/") && !name.startsWith("/")) p += "/"; p += name; return toURIish(p); }
public static String loose(URIish base, AnyObjectId id) { final String objectName = id.name(); final String d = objectName.substring(0, 2); final String f = objectName.substring(2); return join(base, "objects/" + d + "/" + f); }
/** * Create TestRepository * * @return the TestRepository * @throws IOException */ protected TestRepository<Repository> createTestRepository() throws IOException { return new TestRepository<>(createBareRepository()); }
/** * Get requests. * * @param base * base URI used to access the server. * @param path * the path to locate requests for, relative to {@code base}. * @return all requests which match the given path. */ public List<AccessEvent> getRequests(URIish base, String path) { return getRequests(HttpTestCase.join(base, path)); }
/** * Create loose object path * * @param base * @param id * @return path of the loose object */ public static String loose(URIish base, AnyObjectId id) { final String objectName = id.name(); final String d = objectName.substring(0, 2); final String f = objectName.substring(2); return join(base, "objects/" + d + "/" + f); }