/** * Check if decora tag is currently defined and throws an exception * on nested tags. */ protected void checkNestedDecoraTags() { if (decoraTagName != null) { throw new DecoraException("Nested Decora tags not allowed"); } } }
@Override public void end() { if (!regionMarkers.isEmpty()) { throw new DecoraException("Invalid regions detected: " + regionMarkers.getLast().name); } } }
@Test public final void testDecoraExceptionThrowable() { // when Exception cause = new Exception(); DecoraException decoraException = new DecoraException(cause); // then assertEquals(cause, decoraException.getCause()); }
@Test public final void testDecoraExceptionString() { // when DecoraException decoraException = new DecoraException(TEST_STRING); // then assertEquals(TEST_STRING, decoraException.getMessage()); }
@Test public final void testDecoraExceptionStringThrowable() { // when Exception cause = new Exception(); DecoraException decoraException = new DecoraException(TEST_STRING, cause); // then assertEquals(cause, decoraException.getCause()); assertTrue(decoraException.getMessage().contains(TEST_STRING)); }
throw new DecoraException("Region end is not aligned: " + tag.getName());
/** * Check if decora tag is currently defined and throws an exception * on nested tags. */ protected void checkNestedDecoraTags() { if (decoraTagName != null) { throw new DecoraException("Nested Decora tags not allowed"); } } }
@Override public void end() { if (currentRegions != 0) { throw new DecoraException("Some regions are not defined correctly."); } } }
/** * Check if decora tag is currently defined and throws an exception * on nested tags. */ protected void checkNestedDecoraTags() { if (decoraTagName != null) { throw new DecoraException("Nested Decora tags not allowed"); } } }
@Override public void end() { if (!regionMarkers.isEmpty()) { throw new DecoraException("Invalid regions detected: " + regionMarkers.getLast().name); } } }
throw new DecoraException("Region end is not aligned: " + tag.getName());