@@ -0,0 +1,1967 @@
+/*%0A * Copyright 2013 Red Hat, Inc. and/or its affiliates.%0A *%0A * Licensed under the Eclipse Public License version 1.0, available at http://www.eclipse.org/legal/epl-v10.html%0A */%0Apackage io.liveoak.git;%0A%0Aimport io.liveoak.spi.Config;%0Aimport io.liveoak.spi.resource.RootResource;%0Aimport io.liveoak.testtools.AbstractHTTPResourceTestCase;%0Aimport org.apache.http.HttpEntity;%0Aimport org.apache.http.client.methods.CloseableHttpResponse;%0Aimport org.apache.http.client.methods.HttpGet;%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0A%0Aimport static org.fest.assertions.Assertions.assertThat;%0A%0A/**%0A * @author %3Ca href=%22http://community.jboss.org/people/kenfinni%22%3EKen Finnigan%3C/a%3E%0A */%0Apublic class HTTPGitResourceTest extends AbstractHTTPResourceTestCase %7B%0A    @Override%0A    public RootResource createRootResource() %7B%0A        return new GitRepoResource( %22git%22 );%0A    %7D%0A%0A    @Override%0A    public Config createConfig() %7B%0A        File repoDir = new File(this.projectRoot, %22/target/repo_http%22);%0A        if (!repoDir.exists()) %7B%0A            repoDir.mkdirs();%0A        %7D%0A%0A        Config config = super.createConfig();%0A        config.put(%22repoPath%22, repoDir.getAbsolutePath());%0A        return config;%0A    %7D%0A%0A    @Test%0A    public void enumerateRoot() throws Exception %7B%0A        HttpGet get = new HttpGet( %22http://localhost:8080/git%22 );%0A        get.addHeader( %22Accept%22, %22application/json%22 );%0A%0A        try %7B%0A            System.out.println( %22DO GET%22 );%0A            CloseableHttpResponse result = httpClient.execute( get );%0A            System.out.println( %22=============%3E%3E%3E%22 );%0A            System.out.println( result );%0A%0A            HttpEntity entity = result.getEntity();%0A            if ( entity.getContentLength() %3E 0 ) %7B%0A                entity.writeTo( System.out );%0A            %7D%0A            System.out.println( %22%5Cn%3C%3C%3C=============%22 );%0A            assertThat( result.getStatusLine().getStatusCode() ).isEqualTo( 200 );%0A        %7D finally %7B%0A            httpClient.close();%0A        %7D%0A    %7D%0A%7D%0A

Add HTTP test for git resource