Removing try-catch from tests and minor formatting (#1840)

* BAEL-876 - Remove try-catch

* BAEL-876 - Remove try - catch

* formatting
This commit is contained in:
buddhini81 2017-05-14 01:57:37 +05:30 committed by Grzegorz Piwowarek
parent e5cccec42e
commit 44b0f6b02c
3 changed files with 5 additions and 18 deletions

View File

@ -4,13 +4,8 @@ import static org.junit.Assert.fail;
import org.junit.Test;
public class CyclicDependancyManualTest {
@Test
@Test(expected = StackOverflowError.class)
public void whenInstanciatingClassOne_thenThrowsException() {
try {
ClassOne obj = new ClassOne();
fail();
} catch (StackOverflowError soe) {
soe.printStackTrace();
}
}
}

View File

@ -21,16 +21,11 @@ public class InfiniteRecursionWithTerminationConditionManualTest {
assertEquals(120, irtc.calculateFactorial(numToCalcFactorial));
}
@Test
@Test(expected = StackOverflowError.class)
public void givenNegativeInt_whenCalcFact_thenThrowsException() {
try {
int numToCalcFactorial = -1;
InfiniteRecursionWithTerminationCondition irtc = new InfiniteRecursionWithTerminationCondition();
irtc.calculateFactorial(numToCalcFactorial);
fail();
} catch (StackOverflowError soe) {
soe.printStackTrace();
}
}
}

View File

@ -7,8 +7,7 @@ public class UnintendedInfiniteRecursionManualTest {
@Test(expected = StackOverflowError.class)
public void givenPositiveIntNoOne_whenCalFact_thenThrowsException() {
int numToCalcFactorial= 1;
UnintendedInfiniteRecursion uir
= new UnintendedInfiniteRecursion();
UnintendedInfiniteRecursion uir = new UnintendedInfiniteRecursion();
uir.calculateFactorial(numToCalcFactorial);
}
@ -16,8 +15,7 @@ public class UnintendedInfiniteRecursionManualTest {
@Test(expected = StackOverflowError.class)
public void givenPositiveIntGtOne_whenCalcFact_thenThrowsException() {
int numToCalcFactorial= 2;
UnintendedInfiniteRecursion uir
= new UnintendedInfiniteRecursion();
UnintendedInfiniteRecursion uir = new UnintendedInfiniteRecursion();
uir.calculateFactorial(numToCalcFactorial);
}
@ -25,8 +23,7 @@ public class UnintendedInfiniteRecursionManualTest {
@Test(expected = StackOverflowError.class)
public void givenNegativeInt_whenCalcFact_thenThrowsException() {
int numToCalcFactorial= -1;
UnintendedInfiniteRecursion uir
= new UnintendedInfiniteRecursion();
UnintendedInfiniteRecursion uir = new UnintendedInfiniteRecursion();
uir.calculateFactorial(numToCalcFactorial);
}