[Jiemamy-notify:1559] commit [2767] CreateNodeCommandでInvocationTargetExceptionする原因を再現するためのテストを追加。とりあえず @ Ignoreしてコミットする。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 3月 2日 (月) 00:49:23 JST


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

Log Message:
-----------
CreateNodeCommandでInvocationTargetExceptionする原因を再現するためのテストを追加。とりあえず@Ignoreしてコミットする。

Modified Paths:
--------------
    artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/facade/JiemamyViewFacadeImplTest.java


-------------- next part --------------
Modified: artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/facade/JiemamyViewFacadeImplTest.java
===================================================================
--- artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/facade/JiemamyViewFacadeImplTest.java	2009-03-01 15:47:52 UTC (rev 2766)
+++ artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/facade/JiemamyViewFacadeImplTest.java	2009-03-01 15:49:23 UTC (rev 2767)
@@ -23,16 +23,19 @@
 import static org.junit.Assert.assertThat;
 
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import org.jiemamy.Artemis;
 import org.jiemamy.ArtemisView;
 import org.jiemamy.Jiemamy;
+import org.jiemamy.Migration;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.NodeProfile;
 import org.jiemamy.model.RootModel;
 import org.jiemamy.model.entity.TableModel;
+import org.jiemamy.model.geometory.JmRectangle;
 import org.jiemamy.model.node.NodeAdapter;
 
 /**
@@ -57,7 +60,7 @@
 	}
 	
 	/**
-	 * {@link JiemamyViewFacadeImpl#addNodeProfile(int, NodeAdapter, NodeProfile)}のテスト。
+	 * {@link JiemamyViewFacadeImpl#addNodeProfile(int, NodeAdapter, NodeProfile)}のテスト
 	 */
 	@Test
 	public void test_addNodeProfile() {
@@ -78,4 +81,39 @@
 		assertThat(rootModel.getAdapter(DiagramPresentations.class).get(0).getFigureProfiles().get(nodeAdapter),
 				nullValue());
 	}
+	
+	/**
+	 * j-eclipse用のGEFコマンドのテスト。
+	 * TODO どこに配置すべきだろうか?それとも、GEFコマンド内での操作のみをj-viewなりj-coreなりに抽出して、
+	 * そこでテストすべきだろうか?
+	 */
+	@Test
+	@Ignore
+	public void test_GEF_createNodeCommand() {
+		RootModel rootModel = jiemamyWithView.getFactory().getRootModel();
+		rootModel.getAdapter(DiagramPresentations.class).add(
+				jiemamyWithView.getFactory().newModel(DiagramPresentationModel.class));
+		TableModel tableModel = jiemamyWithView.getFactory().newModel(TableModel.class);
+		NodeAdapter nodeAdapter = tableModel.getAdapter(NodeAdapter.class);
+		NodeProfile nodeProfile = rootModel.getJiemamy().getFactory().newModel(NodeProfile.class);
+		JmRectangle rectangle = new JmRectangle(0, 0);
+		
+		viewFacade.addEntity(tableModel);
+		viewFacade.addNodeProfile(Migration.DIAGRAM_INDEX, nodeAdapter, nodeProfile);
+		viewFacade.changeNodeConstraint(Migration.DIAGRAM_INDEX, nodeAdapter, rectangle);
+		
+		DiagramPresentationModel diagramPresentationModel = rootModel.getAdapter(DiagramPresentations.class).get(0);
+		assertThat(rootModel.getEntities().contains(tableModel), is(true));
+		assertThat(diagramPresentationModel.getFigureProfiles().get(nodeAdapter), is(nodeProfile));
+		assertThat(nodeProfile.getBoundary(), is(rectangle));
+		
+		viewFacade.undo();
+		assertThat(nodeProfile.getBoundary(), nullValue());
+		
+		viewFacade.undo();
+		assertThat(diagramPresentationModel.getFigureProfiles().get(nodeAdapter), nullValue());
+		
+		viewFacade.undo();
+		assertThat(rootModel.getEntities().contains(tableModel), is(false));
+	}
 }



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