[Jiemamy-notify] commit [2121] 現状の仕様に合わせてテストを修正。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 11月 10日 (月) 21:09:09 JST


Revision: 2121
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=2121
Author:   daisuke_m
Date:     2008-11-10 21:09:08 +0900 (Mon, 10 Nov 2008)

Log Message:
-----------
現状の仕様に合わせてテストを修正。

Modified Paths:
--------------
    artemis/trunk/org.jiemamy.serializer/src/test/java/org/jiemamy/serializer/ModelInputStreamTest.java


-------------- next part --------------
Modified: artemis/trunk/org.jiemamy.serializer/src/test/java/org/jiemamy/serializer/ModelInputStreamTest.java
===================================================================
--- artemis/trunk/org.jiemamy.serializer/src/test/java/org/jiemamy/serializer/ModelInputStreamTest.java	2008-11-10 12:06:40 UTC (rev 2120)
+++ artemis/trunk/org.jiemamy.serializer/src/test/java/org/jiemamy/serializer/ModelInputStreamTest.java	2008-11-10 12:09:08 UTC (rev 2121)
@@ -31,7 +31,6 @@
 import org.junit.Test;
 
 import org.jiemamy.core.S2FactoryStrategy;
-import org.jiemamy.core.model.ApplicationModelCreator;
 import org.jiemamy.core.model.typedef.datatype.impl.IntegerDataTypeMock;
 import org.jiemamy.core.model.typedef.datatype.impl.TimestampDataTypeMock;
 import org.jiemamy.core.model.typedef.datatype.impl.VarcharDataTypeMock;
@@ -78,7 +77,7 @@
 		rootModel.appendModel(t);
 		
 		// もっと複雑なモデルを出したい時、コメント外す。
-		rootModel = new ApplicationModelCreator().createModel();
+//		rootModel = new ApplicationModelCreator().createModel();
 		
 		StrBuilder sbActual = new StrBuilder();
 		BufferedReader reader = null;
@@ -93,17 +92,19 @@
 		}
 		
 		StrBuilder sbExpected = new StrBuilder();
-		sbExpected.appendln("<?xml version=\"1.0\" standalone=\"yes\"?>");
-		sbExpected.append("<rootModel id=\"").append(rootModel.getId().toString()).appendln(
-				"\" xmlns=\"http://jiemamy.org/ns/core/v1\">");
-		sbExpected.appendln("  <rdbmsName>org.jiemamy.dialect.mysql.MySqlDialect</rdbmsName>");
+		sbExpected.appendln("<?xml version=\"1.0\"?>");
+		sbExpected.appendln("<rootModel id=\"" + rootModel.getId().toString() + "\" "
+				+ "xsi:schemaLocation=\"http://jiemamy.org/xml/ns/core jiemamy-core.xsd\""
+				+ " xmlns=\"http://jiemamy.org/xml/ns/core\""
+				+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
+		sbExpected.appendln("  <dialect class=\"org.jiemamy.dialect.mysql.MySqlDialect\"/>");
+		sbExpected.appendln("  <schemaName>FOO</schemaName>");
 		sbExpected.appendln("  <beginScript>BEGIN;</beginScript>");
 		sbExpected.appendln("  <endScript>COMMIT;</endScript>");
 		sbExpected.appendln("  <description>シリアライゼーションイメージ</description>");
-		sbExpected.appendln("  <schemaName>FOO</schemaName>");
 		sbExpected.appendln("  <domains/>");
 		sbExpected.appendln("  <nodes>");
-		sbExpected.append("    <table id=\"").append(t.getId().toString()).appendln("\">");
+		sbExpected.appendln("    <table id=\"" + t.getId().toString() + "\">");
 		sbExpected.appendln("      <name>T_DEPT</name>");
 		sbExpected.appendln("      <logicalName/>");
 		sbExpected.appendln("      <sourceConnections/>");
@@ -112,44 +113,46 @@
 		sbExpected.appendln("      <endScript/>");
 		sbExpected.appendln("      <description>HOGEHOGE</description>");
 		sbExpected.appendln("      <columns>");
-		sbExpected.append("        <column id=\"").append(t.getColumns().get(0).getId().toString()).appendln("\">");
+		sbExpected.appendln("        <column id=\"" + t.getColumns().get(0).getId().toString() + "\">");
 		sbExpected.appendln("          <name>col1</name>");
 		sbExpected.appendln("          <logicalName/>");
-		sbExpected.append("          <dataType id=\"").append(t.getColumns().get(0).getDataType().getId().toString())
-			.appendln("\" type=\"org.jiemamy.core.model.typedef.datatype.impl.VarcharDataTypeMock\"/>");
+		sbExpected
+			.appendln("          <dataType class=\"org.jiemamy.core.model.typedef.datatype.impl.IntegerDataTypeMock\""
+					+ " id=\"" + t.getColumns().get(0).getDataType().getId().toString() + "\"/>");
 		sbExpected.appendln("          <defaultValue/>");
-		sbExpected.appendln("          <constraints id=\"").append(
-				t.getColumns().get(0).getConstraints().getId().toString()).appendln("\"/>");
+		sbExpected.appendln("          <constraints/>");
 		sbExpected.appendln("          <simpleIndex>false</simpleIndex>");
 		sbExpected.appendln("          <freeString/>");
 		sbExpected.appendln("          <description/>");
 		sbExpected.appendln("          <options/>");
 		sbExpected.appendln("          <representation>false</representation>");
 		sbExpected.appendln("        </column>");
-		sbExpected.append("        <column id=\"").append(t.getColumns().get(1).getId().toString()).appendln("\">");
+		sbExpected.appendln("        <column id=\"" + t.getColumns().get(1).getId().toString() + "\">");
 		sbExpected.appendln("          <name>col2</name>");
 		sbExpected.appendln("          <logicalName/>");
-		sbExpected.append("          <dataType id=\"").append(t.getColumns().get(1).getDataType().getId().toString())
-			.appendln("\" type=\"org.jiemamy.core.model.typedef.datatype.impl.IntegerDataTypeMock\">");
+		sbExpected
+			.appendln("          <dataType class=\"org.jiemamy.core.model.typedef.datatype.impl.VarcharDataTypeMock\""
+					+ " id=\"" + t.getColumns().get(1).getDataType().getId().toString() + "\">");
 		sbExpected.appendln("            <size>16</size>");
 		sbExpected.appendln("          </dataType>");
 		sbExpected.appendln("          <defaultValue/>");
-		sbExpected.appendln("          <constraints id=\"").append(
-				t.getColumns().get(1).getConstraints().getId().toString()).appendln("\"/>");
+		sbExpected.appendln("          <constraints/>");
 		sbExpected.appendln("          <simpleIndex>false</simpleIndex>");
 		sbExpected.appendln("          <freeString/>");
 		sbExpected.appendln("          <description/>");
 		sbExpected.appendln("          <options/>");
 		sbExpected.appendln("          <representation>false</representation>");
 		sbExpected.appendln("        </column>");
-		sbExpected.append("        <column id=\"").append(t.getColumns().get(2).getId().toString()).appendln("\">");
+		sbExpected.appendln("        <column id=\"" + t.getColumns().get(2).getId().toString() + "\">");
 		sbExpected.appendln("          <name>col3</name>");
 		sbExpected.appendln("          <logicalName/>");
-		sbExpected.append("          <dataType id=\"").append(t.getColumns().get(2).getDataType().getId().toString())
-			.appendln("\" type=\"org.jiemamy.core.model.typedef.datatype.impl.TimestampDataTypeMock\"/>");
+		sbExpected
+			.appendln("          <dataType class=\"org.jiemamy.core.model.typedef.datatype.impl.TimestampDataTypeMock\""
+					+ " id=\"" + t.getColumns().get(2).getDataType().getId().toString() + "\">");
+		sbExpected.appendln("            <timezone>false</timezone>");
+		sbExpected.appendln("          </dataType>");
 		sbExpected.appendln("          <defaultValue/>");
-		sbExpected.appendln("          <constraints id=\"").append(
-				t.getColumns().get(2).getConstraints().getId().toString()).appendln("\"/>");
+		sbExpected.appendln("          <constraints/>");
 		sbExpected.appendln("          <simpleIndex>false</simpleIndex>");
 		sbExpected.appendln("          <freeString/>");
 		sbExpected.appendln("          <description/>");
@@ -161,9 +164,8 @@
 		sbExpected.appendln("  </nodes>");
 		sbExpected.appendln("  <connections/>");
 		sbExpected.appendln("  <insertDataSetModels/>");
-		sbExpected.appendln("  <diagramPresentations/>");
+		sbExpected.appendln("  <view:diagramPresentations/>");
 		sbExpected.appendln("</rootModel>");
-		sbExpected.appendln("");
 		
 		System.out.println(sbActual.toString());
 //		System.out.println(sbExpected.toString());


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