Skip to main content
more compact..
Source Link
Andreas Petersson
  • 16.6k
  • 11
  • 62
  • 93

i did something very simple

testBla(){ booleantry fail{  = true;  try { someFailingMethod() someFailingMethodfail(); //method provided by junit } catch(Exception e) { fail = false;  //do nothing } if (fail) fail(); //method provided by junit } 

i did something very simple

testBla(){ boolean fail = true;  try { someFailingMethod() } catch(Exception e) { fail = false;  } if (fail) fail(); //method provided by junit } 

i did something very simple

testBla(){ try {   someFailingMethod() fail(); //method provided by junit } catch(Exception e) { //do nothing } } 
improved formatting
Source Link
guerda
  • 24.2k
  • 28
  • 102
  • 151

i did something very simple

 testBla(){   boolean fail = true;   try { someFailingMethod()   } catch(Exception e) { fail = false;   }   if (fail) fail(); //method provided by junit  } 

i did something very simple

 testBla(){   boolean fail = true;   try{ someFailingMethod()   }catch(Exception e){ fail = false;   }   if (fail) fail(); //method provided by junit  } 

i did something very simple

testBla(){ boolean fail = true; try { someFailingMethod() } catch(Exception e) { fail = false; } if (fail) fail(); //method provided by junit } 
Source Link
Andreas Petersson
  • 16.6k
  • 11
  • 62
  • 93

i did something very simple

 testBla(){ boolean fail = true; try{ someFailingMethod() }catch(Exception e){ fail = false; } if (fail) fail(); //method provided by junit }