Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
package org.apache.commons.digester3.annotations.failingtests;

import static org.apache.commons.digester3.binder.DigesterLoader.newLoader;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.StringStartsWith.startsWith;
import static org.junit.jupiter.api.Assertions.assertThrows;

import org.apache.commons.digester3.annotations.FromAnnotationsRuleModule;
import org.apache.commons.digester3.binder.DigesterLoadingException;
Expand All @@ -29,20 +33,20 @@ public final class FailingTestCase
/**
* Tests to make sure loader fails
*/
@Test(expected = DigesterLoadingException.class)
@Test
public void failsBecauseFailingDigesterLoaderHandlerFactory() {

newLoader(new FromAnnotationsRuleModule()
{
final DigesterLoadingException thrown = assertThrows(DigesterLoadingException.class, () ->
newLoader(new FromAnnotationsRuleModule() {

@Override
protected void configureRules()
{
useAnnotationHandlerFactory( new FailingDigesterLoaderHandlerFactory() );
bindRulesFrom( BeanWithFakeHandler.class );
}
@Override
protected void configureRules() {
useAnnotationHandlerFactory(new FailingDigesterLoaderHandlerFactory());
bindRulesFrom(BeanWithFakeHandler.class);
}

}).newDigester();
}).newDigester());
assertThat(thrown.getMessage(), is(startsWith("Digester creation errors:")));
}

}