use of javax.measure.MeasurementException in project unit-api by unitsofmeasurement.
the class ExceptionsTest method testMeasurementExceptionWithMessageAndCause.
@Test(expected = MeasurementException.class)
public void testMeasurementExceptionWithMessageAndCause() {
Exception cause = new IllegalStateException();
MeasurementException e = new MeasurementException("state error", cause);
assertEquals("state error", e.getMessage());
assertEquals(cause, e.getCause());
throw e;
}
use of javax.measure.MeasurementException in project unit-api by unitsofmeasurement.
the class ExceptionsTest method testDefaultConstructor.
@Test(expected = MeasurementException.class)
public void testDefaultConstructor() {
MeasurementException e = new TestException();
assertNull(e.getMessage());
assertNull(e.getCause());
throw e;
}
use of javax.measure.MeasurementException in project unit-api by unitsofmeasurement.
the class ExceptionsTest method testMeasurementException.
@Test(expected = MeasurementException.class)
public void testMeasurementException() {
MeasurementException e = new MeasurementException("error");
assertEquals("error", e.getMessage());
assertNull(e.getCause());
throw e;
}
Aggregations