Class HttpTestCase

    • Field Detail

      • master

        protected static final java.lang.String master
        Constant master="Constants.R_HEADS + Constants.MASTER"
        See Also:
        Constant Field Values
      • server

        protected AppServer server
        In-memory application server; subclass must start.
    • Constructor Detail

      • HttpTestCase

        public HttpTestCase()
    • Method Detail

      • createServer

        protected AppServer createServer()
        Create the 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 AppServer.getPort() method. Subclasses may override if they need a more specialized server.
        Returns:
        the AppServer.
        Since:
        4.9
      • createTestRepository

        protected TestRepository<Repository> createTestRepository()
                                                           throws java.io.IOException
        Create TestRepository
        Returns:
        the TestRepository
        Throws:
        java.io.IOException
      • toURIish

        protected URIish toURIish​(java.lang.String path)
                           throws java.net.URISyntaxException
        Convert path to URIish
        Parameters:
        path -
        Returns:
        the URIish
        Throws:
        java.net.URISyntaxException
      • toURIish

        protected URIish toURIish​(org.eclipse.jetty.servlet.ServletContextHandler app,
                                  java.lang.String name)
                           throws java.net.URISyntaxException
        Convert a path relative to the app's context path to a URIish
        Parameters:
        app -
        name -
        Returns:
        the warnings (if any) from the last execution
        Throws:
        java.net.URISyntaxException
      • getRequests

        protected java.util.List<AccessEvent> getRequests()
        Get requests.
        Returns:
        list of events
      • getRequests

        protected java.util.List<AccessEvent> getRequests​(URIish base,
                                                          java.lang.String path)
        Get requests.
        Parameters:
        base -
        path -
        Returns:
        list of events
      • getRequests

        protected java.util.List<AccessEvent> getRequests​(java.lang.String path)
        Get requests.
        Parameters:
        path -
        Returns:
        list of events
      • fsck

        protected static void fsck​(Repository db,
                                   RevObject... tips)
                            throws java.lang.Exception
        Run fsck
        Parameters:
        db -
        tips -
        Throws:
        java.lang.Exception
      • mirror

        protected static java.util.Set<RefSpec> mirror​(java.lang.String... refs)
        Mirror refs
        Parameters:
        refs -
        Returns:
        set of RefSpecs
      • push

        protected static java.util.Collection<RemoteRefUpdate> push​(TestRepository from,
                                                                    RevCommit q)
                                                             throws java.io.IOException
        Push a commit
        Parameters:
        from -
        q -
        Returns:
        collection of RefUpdates
        Throws:
        java.io.IOException
      • loose

        public static java.lang.String loose​(URIish base,
                                             AnyObjectId id)
        Create loose object path
        Parameters:
        base -
        id -
        Returns:
        path of the loose object
      • join

        public static java.lang.String join​(URIish base,
                                            java.lang.String path)
        Join a base URIish and a path
        Parameters:
        base -
        path - a relative path
        Returns:
        the joined path
      • rewriteUrl

        protected static java.lang.String rewriteUrl​(java.lang.String url,
                                                     java.lang.String newProtocol,
                                                     int newPort)
        Rewrite a url
        Parameters:
        url -
        newProtocol -
        newPort -
        Returns:
        the rewritten url
      • extendPath

        protected static URIish extendPath​(URIish uri,
                                           java.lang.String pathComponents)
                                    throws java.net.URISyntaxException
        Extend a path
        Parameters:
        uri -
        pathComponents -
        Returns:
        the extended URIish
        Throws:
        java.net.URISyntaxException