vm/src/test/java/org/apidesign/vm4brwsr/Exceptions.java
author tzezula
Sat, 08 Dec 2012 08:50:32 +0100
branchexceptions
changeset 286 15053b74bdd9
child 287 6f696a0ef12f
permissions -rw-r--r--
Fixing unit test.
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 package org.apidesign.vm4brwsr;
     6 
     7 /**
     8  *
     9  * @author tom
    10  */
    11 public class Exceptions {
    12 
    13     public static int methodWithTryCatchNoThrow() {
    14         int res = 0;
    15         try {
    16             res = 1;
    17         } catch (IllegalArgumentException e) {
    18             res = 2;
    19         }
    20         //join point
    21         return res;
    22     }
    23 
    24     public static int methodWithTryCatchThrow() {
    25         int res = 0;
    26         try {
    27             res = 1;
    28             throw new IllegalArgumentException();
    29         } catch (IllegalArgumentException e) {
    30             res = 2;
    31         }
    32         //join point
    33         return res;
    34     }
    35 
    36 }