[Jiemamy-notify:1558] commit [2766] FacadeImplのテストケースが必要だ、と少し作り始めた。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 3月 2日 (月) 00:47:52 JST


Revision: 2766
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2766
Author:   shin1
Date:     2009-03-02 00:47:52 +0900 (Mon, 02 Mar 2009)

Log Message:
-----------
FacadeImplのテストケースが必要だ、と少し作り始めた。

Added Paths:
-----------
    artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/facade/
    artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/facade/JiemamyFacadeImplTest.java


-------------- next part --------------
Added: artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/facade/JiemamyFacadeImplTest.java
===================================================================
--- artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/facade/JiemamyFacadeImplTest.java	                        (rev 0)
+++ artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/facade/JiemamyFacadeImplTest.java	2009-03-01 15:47:52 UTC (rev 2766)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2007-2009 Jiemamy Project and the Others.
+ * Created on 2009/03/02
+ *
+ * This file is part of Jiemamy.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.jiemamy.facade;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.jiemamy.Artemis;
+import org.jiemamy.Jiemamy;
+import org.jiemamy.model.RootModel;
+import org.jiemamy.model.entity.TableModel;
+
+/**
+ * TODO for shin1ogawa
+ * 
+ * @author shin1ogawa
+ */
+public class JiemamyFacadeImplTest {
+	
+	private Jiemamy jiemamy;
+	
+	private JiemamyFacadeImpl coreFacade;
+	
+
+	/**
+	 * 
+	 */
+	@Before
+	public void setUp() {
+		jiemamy = Jiemamy.newInstance(new Artemis());
+		coreFacade = new JiemamyFacadeImpl(jiemamy);
+	}
+	
+	/**
+	 * {@link JiemamyFacadeImpl#addEntity(org.jiemamy.model.entity.EntityModel)}のテスト。
+	 */
+	@Test
+	public void test_addEntity() {
+		RootModel rootModel = jiemamy.getFactory().getRootModel();
+		TableModel tableModel = jiemamy.getFactory().newModel(TableModel.class);
+		
+		// tableはまだrootModelに追加されていない。
+		assertThat(rootModel.getEntities().contains(tableModel), is(false));
+		
+		coreFacade.addEntity(tableModel);
+		
+		assertThat(rootModel.getEntities().contains(tableModel), is(true));
+		
+		coreFacade.undo();
+		
+		assertThat(rootModel.getEntities().contains(tableModel), is(false));
+		
+	}
+}


Property changes on: artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/facade/JiemamyFacadeImplTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



Jiemamy-notify メーリングリストの案内
Back to archive index