/** * @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)); }
/** * Get requests. * * @return list of events */ protected List<AccessEvent> getRequests() { return server.getRequests(); }
/** * Stop the server. * * @throws Exception */ public void stop() throws Exception { server.tearDown(); }
/** * Start the server on a random local port. * * @throws Exception * the server cannot be started, testing is not possible. */ public void setUp() throws Exception { RecordingLogger.clear(); log.clear(); server.start(); config.setSecurePort(getSecurePort()); if (secureConfig != null) { secureConfig.setSecurePort(getSecurePort()); } }
/** * Constructor for <code>SimpleHttpServer</code>. * * @param repository * @param withSsl */ public SimpleHttpServer(Repository repository, boolean withSsl) { this.db = repository; server = new AppServer(0, withSsl ? 0 : -1); }
/** {@inheritDoc} */ @Override public Logger getLogger(@SuppressWarnings("hiding") String name) { return new RecordingLogger(name); }
/** * Get port. * * @return the local port number the server is listening on. */ public int getPort() { assertAlreadySetUp(); return connector.getLocalPort(); }
/** * 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)); }
/** * Get requests. * * @param base * @param path * * @return list of events */ protected List<AccessEvent> getRequests(URIish base, String path) { return server.getRequests(base, path); }
public SimpleHttpServer(Repository repository) { this.db = repository; server = new AppServer(); }
public void stop() throws Exception { server.tearDown(); }
public Logger getLogger(@SuppressWarnings("hiding") String name) { return new RecordingLogger(name); }
/** * Get requests. * * @param path * * @return list of events */ protected List<AccessEvent> getRequests(String path) { return server.getRequests(path); }
/** * Create the {@link AppServer}.This default implementation creates a server * without SSLsupport listening for HTTP connections on a dynamically chosen * port, which can be gotten once the server has been started via its * {@link org.eclipse.jgit.junit.http.AppServer#getPort()} method. * Subclasses may override if they need a more specialized server. * * @return the {@link org.eclipse.jgit.junit.http.AppServer}. * @since 4.9 */ protected AppServer createServer() { return new AppServer(); }
protected List<AccessEvent> getRequests() { return server.getRequests(); }
protected List<AccessEvent> getRequests(String path) { return server.getRequests(path); }
protected List<AccessEvent> getRequests(URIish base, String path) { return server.getRequests(base, path); }