@Test(groups = "unit") public void should_create_proper_unprepared_exception() { UnpreparedException e = new UnpreparedException(address1, "Caught me unawares"); assertThat(e.getMessage()) .isEqualTo( "A prepared query was submitted on " + address1 + " but was not known of that node: Caught me unawares"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); e = e.copy(); assertThat(e.getMessage()) .isEqualTo( "A prepared query was submitted on " + address1 + " but was not known of that node: Caught me unawares"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); }
@Override public UnpreparedException copy() { return new UnpreparedException(address, getMessage(), this); } }
new OverloadedException(null, "Overloaded"), new BootstrappingException(null, "Bootstrapping"), new UnpreparedException(null, "Unprepared"), new InvalidQueryException("Validation", new Exception()));
@Override public UnpreparedException copy() { return new UnpreparedException(address, getMessage(), this); } }
return ((AlreadyExistsException) infos).copy(host); case UNPREPARED: return new UnpreparedException(host, message); default: return new DriverInternalError(
@Test(groups = "unit") public void should_create_proper_unprepared_exception() { UnpreparedException e = new UnpreparedException(address1, "Caught me unawares"); assertThat(e.getMessage()) .isEqualTo( "A prepared query was submitted on " + address1 + " but was not known of that node: Caught me unawares"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); e = e.copy(); assertThat(e.getMessage()) .isEqualTo( "A prepared query was submitted on " + address1 + " but was not known of that node: Caught me unawares"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); }
@Override public UnpreparedException copy() { return new UnpreparedException(address, getMessage(), this); } }
new OverloadedException(null, "Overloaded"), new BootstrappingException(null, "Bootstrapping"), new UnpreparedException(null, "Unprepared"), new InvalidQueryException("Validation", new Exception()));
@Override public UnpreparedException copy() { return new UnpreparedException(address, getMessage(), this); } }
return ((AlreadyExistsException) infos).copy(host); case UNPREPARED: return new UnpreparedException(host, message); default: return new DriverInternalError(String.format("Unknown protocol error code %s returned by %s. The error message was: %s", code, host, message));
return ((AlreadyExistsException) infos).copy(host); case UNPREPARED: return new UnpreparedException(host, message); default: return new DriverInternalError(String.format("Unknown protocol error code %s returned by %s. The error message was: %s", code, host, message));
return ((AlreadyExistsException) infos).copy(host); case UNPREPARED: return new UnpreparedException(host, message); default: return new DriverInternalError(String.format("Unknown protocol error code %s returned by %s. The error message was: %s", code, host, message));