@Test(groups = "unit") public void should_create_proper_overloaded_exception() { OverloadedException e = new OverloadedException(address1, "I'm busy"); assertThat(e.getMessage()) .isEqualTo("Queried host (" + address1 + ") was overloaded: I'm busy"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); e = e.copy(); assertThat(e.getMessage()) .isEqualTo("Queried host (" + address1 + ") was overloaded: I'm busy"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); }
@Override public OverloadedException copy() { return new OverloadedException(address, getMessage(), this); } }
Lists.<Exception>newArrayList( new UnavailableException(ConsistencyLevel.ANY, 0, 0), new OverloadedException(null, "Overloaded"), new BootstrappingException(null, "Bootstrapping"), new UnpreparedException(null, "Unprepared"),
@Override public OverloadedException copy() { return new OverloadedException(address, getMessage(), this); } }
return ((UnavailableException) infos).copy(host); // We copy to have a nice stack trace case OVERLOADED: return new OverloadedException(host, message); case IS_BOOTSTRAPPING: return new BootstrappingException(host, message);
@Test(groups = "unit") public void should_create_proper_overloaded_exception() { OverloadedException e = new OverloadedException(address1, "I'm busy"); assertThat(e.getMessage()) .isEqualTo("Queried host (" + address1 + ") was overloaded: I'm busy"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); e = e.copy(); assertThat(e.getMessage()) .isEqualTo("Queried host (" + address1 + ") was overloaded: I'm busy"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); }
@Override public OverloadedException copy() { return new OverloadedException(address, getMessage(), this); } }
Lists.<Exception>newArrayList( new UnavailableException(ConsistencyLevel.ANY, 0, 0), new OverloadedException(null, "Overloaded"), new BootstrappingException(null, "Bootstrapping"), new UnpreparedException(null, "Unprepared"),
@Override public OverloadedException copy() { return new OverloadedException(address, getMessage(), this); } }
return ((UnavailableException) infos).copy(host); // We copy to have a nice stack trace case OVERLOADED: return new OverloadedException(host, message); case IS_BOOTSTRAPPING: return new BootstrappingException(host, message);
return ((UnavailableException) infos).copy(host); // We copy to have a nice stack trace case OVERLOADED: return new OverloadedException(host, message); case IS_BOOTSTRAPPING: return new BootstrappingException(host, message);
return ((UnavailableException) infos).copy(host); // We copy to have a nice stack trace case OVERLOADED: return new OverloadedException(host, message); case IS_BOOTSTRAPPING: return new BootstrappingException(host, message);