• R/O
  • SSH
  • HTTPS

orangesignal: Commit


Commit MetaInfo

Revision1720 (tree)
Time2010-03-27 15:49:41
Authorsugisawa

Log Message

junit 4.7 向けリファクタリング

Change Summary

Incremental Difference

--- trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvBeanSaverTest.java (revision 1719)
+++ trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvBeanSaverTest.java (revision 1720)
@@ -19,7 +19,9 @@
1919
2020 import jp.sf.orangesignal.csv.entity.Price;
2121
22+import org.junit.Rule;
2223 import org.junit.Test;
24+import org.junit.rules.ExpectedException;
2325
2426 /**
2527 * {@link CsvBeanSaver} クラスの単体テストです。
@@ -28,8 +30,13 @@
2830 */
2931 public class CsvBeanSaverTest {
3032
31- @Test(expected = IllegalArgumentException.class)
33+ @Rule
34+ public ExpectedException exception = ExpectedException.none();
35+
36+ @Test
3237 public void testCsvBeanSaverIllegalArgumentException() {
38+ exception.expect(IllegalArgumentException.class);
39+ exception.expectMessage("CsvConfig must not be null");
3340 new CsvBeanSaver<Price>(null, null, Price.class);
3441 }
3542
--- trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvEntityManagerTest.java (revision 1719)
+++ trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvEntityManagerTest.java (revision 1720)
@@ -34,7 +34,9 @@
3434 import jp.sf.orangesignal.csv.filters.SimpleCsvNamedValueFilter;
3535
3636 import org.junit.BeforeClass;
37+import org.junit.Rule;
3738 import org.junit.Test;
39+import org.junit.rules.ExpectedException;
3840
3941 /**
4042 * {@link CsvEntityManager} クラスの単体テストです。
@@ -45,6 +47,9 @@
4547
4648 private static CsvConfig cfg;
4749
50+ @Rule
51+ public ExpectedException exception = ExpectedException.none();
52+
4853 @BeforeClass
4954 public static void setUpBeforeClass() throws Exception {
5055 cfg = new CsvConfig(',');
@@ -61,8 +66,10 @@
6166 new CsvEntityManager(cfg);
6267 }
6368
64- @Test(expected = IllegalArgumentException.class)
69+ @Test
6570 public void testCsvEntityManagerIllegalArgumentException() {
71+ exception.expect(IllegalArgumentException.class);
72+ exception.expectMessage("CsvConfig must not be null");
6673 new CsvEntityManager(null);
6774 }
6875
@@ -71,8 +78,10 @@
7178 new CsvEntityManager().config(cfg);
7279 }
7380
74- @Test(expected = IllegalArgumentException.class)
81+ @Test
7582 public void testConfigIllegalArgumentException() {
83+ exception.expect(IllegalArgumentException.class);
84+ exception.expectMessage("CsvConfig must not be null");
7685 new CsvEntityManager().config(null);
7786 }
7887
--- trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvColumnNameMappingBeanManagerTest.java (revision 1719)
+++ trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvColumnNameMappingBeanManagerTest.java (revision 1720)
@@ -35,7 +35,9 @@
3535 import jp.sf.orangesignal.csv.model.SampleBean;
3636
3737 import org.junit.BeforeClass;
38+import org.junit.Rule;
3839 import org.junit.Test;
40+import org.junit.rules.ExpectedException;
3941
4042 /**
4143 * {@link CsvColumnNameMappingBeanManager} クラスの単体テストです。
@@ -46,6 +48,9 @@
4648
4749 private static CsvConfig cfg;
4850
51+ @Rule
52+ public ExpectedException exception = ExpectedException.none();
53+
4954 @BeforeClass
5055 public static void setUpBeforeClass() throws Exception {
5156 cfg = new CsvConfig(',');
@@ -62,8 +67,10 @@
6267 new CsvColumnNameMappingBeanManager(cfg);
6368 }
6469
65- @Test(expected = IllegalArgumentException.class)
70+ @Test
6671 public void testCsvColumnNameMappingBeanManagerIllegalArgumentException() {
72+ exception.expect(IllegalArgumentException.class);
73+ exception.expectMessage("CsvConfig must not be null");
6774 new CsvColumnNameMappingBeanManager(null);
6875 }
6976
@@ -72,8 +79,10 @@
7279 new CsvColumnNameMappingBeanManager().config(cfg);
7380 }
7481
75- @Test(expected = IllegalArgumentException.class)
82+ @Test
7683 public void testConfigIllegalArgumentException() {
84+ exception.expect(IllegalArgumentException.class);
85+ exception.expectMessage("CsvConfig must not be null");
7786 new CsvColumnNameMappingBeanManager().config(null);
7887 }
7988
--- trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvBeanLoaderTest.java (revision 1719)
+++ trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvBeanLoaderTest.java (revision 1720)
@@ -19,7 +19,9 @@
1919
2020 import jp.sf.orangesignal.csv.entity.Price;
2121
22+import org.junit.Rule;
2223 import org.junit.Test;
24+import org.junit.rules.ExpectedException;
2325
2426 /**
2527 * {@link CsvBeanLoader} クラスの単体テストです。
@@ -28,8 +30,13 @@
2830 */
2931 public class CsvBeanLoaderTest {
3032
31- @Test(expected = IllegalArgumentException.class)
33+ @Rule
34+ public ExpectedException exception = ExpectedException.none();
35+
36+ @Test
3237 public void testCsvBeanLoaderIllegalArgumentException() {
38+ exception.expect(IllegalArgumentException.class);
39+ exception.expectMessage("CsvConfig must not be null");
3340 new CsvBeanLoader<Price>(null, Price.class);
3441 }
3542
--- trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvColumnPositionMappingBeanManagerTest.java (revision 1719)
+++ trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvColumnPositionMappingBeanManagerTest.java (revision 1720)
@@ -35,7 +35,9 @@
3535 import jp.sf.orangesignal.csv.model.SampleBean;
3636
3737 import org.junit.Before;
38+import org.junit.Rule;
3839 import org.junit.Test;
40+import org.junit.rules.ExpectedException;
3941
4042 /**
4143 * {@link CsvColumnPositionMappingBeanManager} クラスの単体テストです。
@@ -46,6 +48,9 @@
4648
4749 private CsvConfig cfg;
4850
51+ @Rule
52+ public ExpectedException exception = ExpectedException.none();
53+
4954 @Before
5055 public void setUp() throws Exception {
5156 cfg = new CsvConfig(',');
@@ -62,8 +67,10 @@
6267 new CsvColumnPositionMappingBeanManager(cfg);
6368 }
6469
65- @Test(expected = IllegalArgumentException.class)
70+ @Test
6671 public void testCsvColumnPositionMappingBeanManagerIllegalArgumentException() {
72+ exception.expect(IllegalArgumentException.class);
73+ exception.expectMessage("CsvConfig must not be null");
6774 new CsvColumnPositionMappingBeanManager(null);
6875 }
6976
@@ -72,8 +79,10 @@
7279 new CsvColumnPositionMappingBeanManager().config(cfg);
7380 }
7481
75- @Test(expected = IllegalArgumentException.class)
82+ @Test
7683 public void testConfigIllegalArgumentException() {
84+ exception.expect(IllegalArgumentException.class);
85+ exception.expectMessage("CsvConfig must not be null");
7786 new CsvColumnPositionMappingBeanManager().config(null);
7887 }
7988
--- trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvBeanManagerTest.java (revision 1719)
+++ trunk/csv/src/test/java/jp/sf/orangesignal/csv/manager/CsvBeanManagerTest.java (revision 1720)
@@ -35,7 +35,9 @@
3535 import jp.sf.orangesignal.csv.model.SampleBean;
3636
3737 import org.junit.BeforeClass;
38+import org.junit.Rule;
3839 import org.junit.Test;
40+import org.junit.rules.ExpectedException;
3941
4042 /**
4143 * {@link CsvBeanManager} クラスの単体テストです。
@@ -46,6 +48,9 @@
4648
4749 private static CsvConfig cfg;
4850
51+ @Rule
52+ public ExpectedException exception = ExpectedException.none();
53+
4954 @BeforeClass
5055 public static void setUpBeforeClass() throws Exception {
5156 cfg = new CsvConfig(',');
@@ -62,8 +67,10 @@
6267 new CsvBeanManager(cfg);
6368 }
6469
65- @Test(expected = IllegalArgumentException.class)
70+ @Test
6671 public void testCsvBeanManagerIllegalArgumentException() {
72+ exception.expect(IllegalArgumentException.class);
73+ exception.expectMessage("CsvConfig must not be null");
6774 new CsvBeanManager(null);
6875 }
6976
@@ -72,8 +79,10 @@
7279 new CsvBeanManager().config(cfg);
7380 }
7481
75- @Test(expected = IllegalArgumentException.class)
82+ @Test
7683 public void testConfigIllegalArgumentException() {
84+ exception.expect(IllegalArgumentException.class);
85+ exception.expectMessage("CsvConfig must not be null");
7786 new CsvBeanManager().config(null);
7887 }
7988
Show on old repository browser