Removed test dependencies on Ning's and Apache's HTTP client.

This commit is contained in:
Simone Bordet 2013-10-21 11:27:23 +02:00
parent 5cc0247a67
commit 208382b07d
3 changed files with 0 additions and 123 deletions

View File

@ -124,18 +124,5 @@
<artifactId>jetty-test-helper</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ning</groupId>
<artifactId>async-http-client</artifactId>
<version>1.7.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,34 +0,0 @@
//
// ========================================================================
// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.client.api;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.junit.Ignore;
import org.junit.Test;
@Ignore
public class ApacheUsage
{
@Test
public void test()
{
HttpClient client = new DefaultHttpClient();
}
}

View File

@ -1,76 +0,0 @@
//
// ========================================================================
// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.client.api;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import org.junit.Ignore;
import org.junit.Test;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.BodyDeferringAsyncHandler;
import com.ning.http.client.Cookie;
import com.ning.http.client.Realm;
import com.ning.http.client.Request;
import com.ning.http.client.Response;
@Ignore
public class NingUsage
{
@Test
public void testFileUpload() throws Exception
{
AsyncHttpClient client = new AsyncHttpClient();
Request request = client.prepareGet("http://localhost:8080/foo").setBody(new FileInputStream("")).build();
client.executeRequest(request);
}
@Test
public void testAuthentication() throws Exception
{
AsyncHttpClient client = new AsyncHttpClient();
Response response = client.prepareGet("http://localhost:8080/foo")
// Not sure what a builder buys me in this case...
.setRealm(new Realm.RealmBuilder().build()).execute().get();
}
@Test
public void testCookies() throws Exception
{
AsyncHttpClient client = new AsyncHttpClient();
// Cookie class too complex
client.prepareGet("").addCookie(new Cookie("domain", "name", "value", "path", 3600, false)).execute();
}
@Test
public void testResponseStream() throws Exception
{
AsyncHttpClient client = new AsyncHttpClient();
ByteArrayOutputStream output = new ByteArrayOutputStream();
BodyDeferringAsyncHandler handler = new BodyDeferringAsyncHandler(output);
client.prepareGet("").execute(handler);
// What I would really like is an InputStream, not an OutputStream
// so I can read the response content
Response response = handler.getResponse(); // No timeout
// Not sure how I can read the body ONLY if status == 200 ?
}
}