[Jiemamy-notify:1415] commit [2649] テスト記述ミス修正。

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2009年 2月 10日 (火) 01:33:36 JST


Revision: 2649
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2649
Author:   daisuke_m
Date:     2009-02-10 01:33:36 +0900 (Tue, 10 Feb 2009)

Log Message:
-----------
テスト記述ミス修正。

Modified Paths:
--------------
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/validator/impl/AbstractIdentifierValidator.java
    artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/validator/impl/AbstractIdentifierValidatorTest.java


-------------- next part --------------
Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/validator/impl/AbstractIdentifierValidator.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/validator/impl/AbstractIdentifierValidator.java	2009-02-09 16:30:32 UTC (rev 2648)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/validator/impl/AbstractIdentifierValidator.java	2009-02-09 16:33:36 UTC (rev 2649)
@@ -32,6 +32,7 @@
 import org.jiemamy.model.entity.EntityModel;
 import org.jiemamy.model.entity.TableModel;
 import org.jiemamy.model.index.IndexModel;
+import org.jiemamy.utils.CollectionsUtil;
 import org.jiemamy.validator.AbstractProblem;
 import org.jiemamy.validator.AbstractValidator;
 import org.jiemamy.validator.Problem;
@@ -43,7 +44,7 @@
  */
 public abstract class AbstractIdentifierValidator extends AbstractValidator {
 	
-	Collection<Problem> result;
+	Collection<Problem> result = CollectionsUtil.newArrayList();
 	
 	/** 識別子としての妥当性を判断する正規表現パターン */
 	private Pattern identifierPattern;

Modified: artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/validator/impl/AbstractIdentifierValidatorTest.java
===================================================================
--- artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/validator/impl/AbstractIdentifierValidatorTest.java	2009-02-09 16:30:32 UTC (rev 2648)
+++ artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/validator/impl/AbstractIdentifierValidatorTest.java	2009-02-09 16:33:36 UTC (rev 2649)
@@ -61,20 +61,13 @@
 	 */
 	@Test
 	public void test_バリデータ動作テスト() throws Exception {
-		assertThat(validator.result.size(), is(0));
 		// 基本的な正規表現バリデート
 		assertThat(validator.isValid("ABC"), is(true));
-		assertThat(validator.result.size(), is(0));
 		assertThat(validator.isValid("012"), is(false));
-		assertThat(validator.result.size(), is(1));
 		assertThat(validator.isValid("ABC012"), is(true));
-		assertThat(validator.result.size(), is(1));
 		assertThat(validator.isValid("abc012"), is(false));
-		assertThat(validator.result.size(), is(2));
 		assertThat(validator.isValid(""), is(false));
-		assertThat(validator.result.size(), is(3));
 		assertThat(validator.isValid(null), is(true)); // nullは無条件に通過
-		assertThat(validator.result.size(), is(3));
 		
 		// 予約語バリデート
 		assertThat(validator.isValid("RESERVED1"), is(false));
@@ -91,9 +84,6 @@
 		public IdentifierValidatorMock() {
 			super("^[A-Z][A-Z0-9]*$", new ReservedWordsProvider() {
 				
-				/**
-				 * {@inheritDoc}
-				 */
 				public String[] getReservedWords() {
 					return new String[] {
 						"RESERVED1",



Jiemamy-notify メーリングリストの案内
アーカイブの一覧に戻る