summaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
<
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
    xmlns:m="http://ant.apache.org/ivy/maven">

    <info organisation="com.vaadin" module="vaadin-liferay" revision="${vaadin.version}" />

    <configurations>
        <conf name="build" />
        <conf name="build-provided" />
        <conf name="deps" visibility="private" />
    </configurations>

    <publications>
        <artifact type="zip" ext="zip" />
    </publications>

    <dependencies>
        <dependency org="com.vaadin" name="vaadin-client-compiled"
            rev="${vaadin.version}" conf="deps -> build" transitive="false"/>
        <dependency org="com.vaadin" name="vaadin-themes"
            rev="${vaadin.version}" conf="deps -> build" transitive="false"/>
        <dependency org="com.vaadin" name="vaadin-push"
            rev="${vaadin.version}" conf="deps -> build" transitive="false" />
        <dependency org="com.vaadin" name="vaadin-server"
            rev="${vaadin.version}" conf="deps -> build" transitive="false" />
    </dependencies>

</ivy-module>
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-04-01 14:18:30 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-04-06 15:42:53 +0200
commit231960b5fafc744c9f7bf466e0978d5127c71575 (patch)
ify(listener).finished(true);
+ verifyNoMoreInteractions(listener);
+ }
+
+ @Test
+ public void execute_calls_listener_finished_method_even_if_a_step_throws_an_exception() {
+ RuntimeException toBeThrown = new RuntimeException("simulating failing execute Step method");
+ doThrow(toBeThrown)
+ .when(computationStep1)
+ .execute();
+
+ try {
+ new ComputationStepExecutor(mockComputationSteps(computationStep1, computationStep2), listener)
+ .execute();
+ fail("exception toBeThrown should have been raised");
+ } catch (RuntimeException e) {
+ assertThat(e).isSameAs(toBeThrown);
+ verify(listener).finished(false);
+ verifyNoMoreInteractions(listener);
+ }
+
+ }
+
private static ComputationSteps mockComputationSteps(ComputationStep... computationSteps) {
ComputationSteps steps = mock(ComputationSteps.class);
when(steps.instances()).thenReturn(Arrays.asList(computationSteps));