diff options
Diffstat (limited to 'org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java')
-rw-r--r-- | org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java b/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java new file mode 100644 index 00000000..65a3fa74 --- /dev/null +++ b/org.eclipse.mylyn.commons.repositories.http.tests/src/org/eclipse/mylyn/commons/repositories/http/tests/CommonHttpClientTest.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2011 Tasktop Technologies and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tasktop Technologies - initial API and implementation + *******************************************************************************/ + +package org.eclipse.mylyn.commons.repositories.http.tests; + +import static org.junit.Assert.assertEquals; + +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.client.methods.HttpGet; +import org.eclipse.mylyn.commons.repositories.core.RepositoryLocation; +import org.eclipse.mylyn.commons.repositories.http.core.CommonHttpClient; +import org.junit.Test; + +/** + * @author Steffen Pingel + */ +public class CommonHttpClientTest { + + @Test + public void testGetRequest() throws Exception { + RepositoryLocation location = new RepositoryLocation(); + location.setUrl("http://eclipse.org/"); + + HttpGet request = new HttpGet(location.getUrl()); + CommonHttpClient client = new CommonHttpClient(location); + HttpResponse response = client.execute(request, null); + assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode()); + } + +} |