Search in sources :

Example 6 with UnconvertibleException

use of javax.measure.UnconvertibleException in project unit-api by unitsofmeasurement.

the class ExceptionsTest method testUnconvertibleExceptionWithCause.

@Test(expected = UnconvertibleException.class)
public void testUnconvertibleExceptionWithCause() {
    Exception cause = new IllegalArgumentException();
    UnconvertibleException e = new UnconvertibleException(cause);
    assertEquals(cause, e.getCause());
    throw e;
}
Also used : UnconvertibleException(javax.measure.UnconvertibleException) IncommensurableException(javax.measure.IncommensurableException) MeasurementException(javax.measure.MeasurementException) UnconvertibleException(javax.measure.UnconvertibleException) Test(org.junit.Test)

Aggregations

UnconvertibleException (javax.measure.UnconvertibleException)6 IncommensurableException (javax.measure.IncommensurableException)4 Test (org.junit.Test)3 MeasurementException (javax.measure.MeasurementException)2 UnitConverter (javax.measure.UnitConverter)2 AbstractUOMConverter (com.ibm.streamsx.health.prepare.uomconverter.converters.AbstractUOMConverter)1 ParseException (gov.sandia.n2a.language.ParseException)1 Unit (javax.measure.Unit)1