Search in sources :

Example 1 with CheckResult

use of zipkin.Component.CheckResult in project zipkin by openzipkin.

the class Cassandra3StorageTest method check_failsInsteadOfThrowing.

@Test
public void check_failsInsteadOfThrowing() {
    CheckResult result = Cassandra3Storage.builder().contactPoints("1.1.1.1").build().check();
    assertThat(result.ok).isFalse();
    assertThat(result.exception).isInstanceOf(NoHostAvailableException.class);
}
Also used : CheckResult(zipkin.Component.CheckResult) Test(org.junit.Test)

Example 2 with CheckResult

use of zipkin.Component.CheckResult in project zipkin by openzipkin.

the class CassandraStorageTest method check_failsInsteadOfThrowing.

@Test
public void check_failsInsteadOfThrowing() {
    CheckResult result = CassandraStorage.builder().contactPoints("1.1.1.1").build().check();
    assertThat(result.ok).isFalse();
    assertThat(result.exception).isInstanceOf(NoHostAvailableException.class);
}
Also used : CheckResult(zipkin.Component.CheckResult) Test(org.junit.Test)

Example 3 with CheckResult

use of zipkin.Component.CheckResult in project zipkin by openzipkin.

the class MySQLStorageTest method check_failsInsteadOfThrowing.

@Test
public void check_failsInsteadOfThrowing() throws SQLException {
    DataSource dataSource = mock(DataSource.class);
    when(dataSource.getConnection()).thenThrow(new SQLException("foo"));
    CheckResult result = storage(dataSource).check();
    assertThat(result.ok).isFalse();
    assertThat(result.exception).isInstanceOf(SQLException.class);
}
Also used : SQLException(java.sql.SQLException) CheckResult(zipkin.Component.CheckResult) DataSource(javax.sql.DataSource) Test(org.junit.Test)

Example 4 with CheckResult

use of zipkin.Component.CheckResult in project zipkin by openzipkin.

the class ScribeCollectorTest method check_failsWhenNotStarted.

@Test
public void check_failsWhenNotStarted() {
    try (ScribeCollector scribe = ScribeCollector.builder().storage(new InMemoryStorage()).port(12345).build()) {
        CheckResult result = scribe.check();
        assertThat(result.ok).isFalse();
        assertThat(result.exception).isInstanceOf(IllegalStateException.class);
        scribe.start();
        assertThat(scribe.check().ok).isTrue();
    }
}
Also used : InMemoryStorage(zipkin.storage.InMemoryStorage) CheckResult(zipkin.Component.CheckResult) Test(org.junit.Test)

Example 5 with CheckResult

use of zipkin.Component.CheckResult in project zipkin by openzipkin.

the class ElasticsearchStorageTest method check_failsInsteadOfThrowing.

@Test
public void check_failsInsteadOfThrowing() {
    CheckResult result = ElasticsearchStorage.builder().cluster("1.1.1.1").build().check();
    assertThat(result.ok).isFalse();
    assertThat(result.exception).isInstanceOf(NoNodeAvailableException.class);
}
Also used : CheckResult(zipkin.Component.CheckResult) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)5 CheckResult (zipkin.Component.CheckResult)5 SQLException (java.sql.SQLException)1 DataSource (javax.sql.DataSource)1 InMemoryStorage (zipkin.storage.InMemoryStorage)1