8000 unit test fixed by metacret · Pull Request #99 · Netflix/suro · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

unit test fixed #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ subprojects {
runtime 'com.netflix.netflix-commons:netflix-commons-util:0.1.1'

testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'junit:junit:4.+'
testCompile 'junit:junit:4.11'
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.junit.ClassRule;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import java.io.BufferedReader;
import java.io.IOException;
Expand All @@ -30,19 +32,18 @@

import static org.junit.Assert.assertEquals;

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestStatusServer {
@ClassRule
public static SuroServerExternalResource suroServer = new SuroServerExternalResource();

@Test
public void connectionFailureShouldBeDetected() throws Exception {
public void _2_connectionFailureShouldBeDetected() throws Exception {
suroServer.getInjector().getInstance(InputManager.class).getInput("thrift").shutdown();

HttpResponse response = runQuery("surohealthcheck");

assertEquals(500, response.getStatusLine().getStatusCode());

suroServer.getInjector().getInstance(InputManager.class).getInput("thrift").start();
}

private HttpResponse runQuery(String path) throws IOException {
Expand All @@ -57,13 +58,13 @@ private HttpResponse runQuery(String path) throws IOException {
}

@Test
public void healthcheckShouldPassForHealthyServer() throws Exception {
public void _0_healthcheckShouldPassForHealthyServer() throws Exception {
HttpResponse response = runQuery("surohealthcheck");
assertEquals(200, response.getStatusLine().getStatusCode());
}

@Test
public void testSinkStat() throws IOException {
public void _1_testSinkStat() throws IOException {
HttpResponse response = runQuery("surosinkstat");
InputStream data = response.getEntity().getContent();
BufferedReader br = new BufferedReader(new InputStreamReader(data));
Expand Down
0