Debian Codegraph @

src/test/java/org/fest/reflect/util/ExpectedFailures.java

raw
1 /*
2 * Created on Feb 18, 2008
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
5 * License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
10 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
11 * governing permissions and limitations under the License.
12 *
13 * Copyright @2008-2009 the original author or authors.
14 */
15 package org.fest.reflect.util;
16
17 import org.fest.reflect.exception.ReflectionError;
18 import org.fest.test.ExpectedFailure.Message;
19
20 import static org.fest.test.ExpectedFailure.expect;
21
22 /**
23 * Understands expected failures.
24 *
25 * @author Alex Ruiz
26 */
27 public final class ExpectedFailures {
28
29 public static Message expectReflectionError(String message) {
30 return expect(ReflectionError.class).withMessage(message);
31 }
32
33 public static Message expectIllegalArgumentException(String message) {
34 return expect(IllegalArgumentException.class).withMessage(message);
35 }
36
37 public static Message expectNullPointerException(String message) {
38 return expect(NullPointerException.class).withMessage(message);
39 }
40
41 private ExpectedFailures() {}
42 }