1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 package org.apache.hc.core5.util;
29
30 import org.junit.Test;
31
32
33
34
35 public class TestAsserts {
36
37 @Test
38 public void testExpressionCheckPass() {
39 Asserts.check(true, "All is well");
40 }
41
42 @Test(expected=IllegalStateException.class)
43 public void testExpressionCheckFail() {
44 Asserts.check(false, "Oopsie");
45 }
46
47 @Test(expected=IllegalStateException.class)
48 public void testExpressionNotNullFail() {
49 Asserts.notNull(null, "Stuff");
50 }
51
52 @Test(expected=IllegalStateException.class)
53 public void testExpressionNotEmptyFail1() {
54 Asserts.notEmpty((String) null, "Stuff");
55 }
56
57 @Test(expected=IllegalStateException.class)
58 public void testExpressionNotEmptyFail2() {
59 Asserts.notEmpty("", "Stuff");
60 }
61
62 @Test(expected=IllegalStateException.class)
63 public void testExpressionNotEmptyBlank1() {
64 Asserts.notBlank((String) null, "Stuff");
65 }
66
67 @Test(expected=IllegalStateException.class)
68 public void testExpressionNotEmptyBlank2() {
69 Asserts.notBlank("", "Stuff");
70 }
71
72 @Test(expected=IllegalStateException.class)
73 public void testExpressionNotBlankFail3() {
74 Asserts.notBlank(" \t \n\r", "Stuff");
75 }
76
77 }