[jbosstools-commits] JBoss Tools SVN: r23369 - in branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model: command and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Jul 12 08:17:53 EDT 2010


Author: DartPeng
Date: 2010-07-12 08:17:53 -0400 (Mon, 12 Jul 2010)
New Revision: 23369

Added:
   branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/
   branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java
Log:


Added: branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java
===================================================================
--- branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java	                        (rev 0)
+++ branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java	2010-07-12 12:17:53 UTC (rev 23369)
@@ -0,0 +1,63 @@
+/**
+ * 
+ */
+package org.jboss.tools.smooks.model.command;
+
+import junit.framework.TestCase;
+
+import org.jboss.tools.smooks.model.csv.CSVReader;
+import org.junit.Assert;
+
+/**
+ * @author Dart
+ * 
+ */
+public class SetCommandTest extends TestCase {
+	public void testCSVReaderSet() {
+		CSVReader reader = new CSVReader();
+		
+		SetCommand command1 = new SetCommand(reader, "name,address,age", "fields");
+		SetCommand command2 = new SetCommand(reader, "people", "rootElementName");
+		SetCommand command3 = new SetCommand(reader, "person", "recordElementName");
+		SetCommand command4 = new SetCommand(reader, true, "indent");
+		
+		
+		command1.execute();
+		command2.execute();
+		command3.execute();
+		command4.execute();
+		
+		Assert.assertSame(reader.getFields(), "name,address,age");
+		Assert.assertSame(reader.getRecordElementName(), "person");
+		Assert.assertSame(reader.getRootElementName(), "people");
+		Assert.assertSame(reader.getIndent(),true);
+		
+		
+		
+		command1.undo();
+		command2.undo();
+		command3.undo();
+		command4.undo();
+		
+		Assert.assertSame(reader.getFields(), null);
+		Assert.assertSame(reader.getRecordElementName(), null);
+		Assert.assertSame(reader.getRootElementName(),null);
+//		Assert.assertSame(reader.getIndent(),true);
+		
+		command1.redo();
+		command2.redo();
+		command3.redo();
+		command4.redo();
+		
+		Assert.assertSame(reader.getFields(), "name,address,age");
+		Assert.assertSame(reader.getRecordElementName(), "person");
+		Assert.assertSame(reader.getRootElementName(), "people");
+		Assert.assertSame(reader.getIndent(),true);
+		
+//		reader.setFields("name,address,age");
+//		reader.setRootElementName("people");
+//		reader.setRecordElementName("person");
+//		reader.setIndent(true);
+		
+	}
+}


Property changes on: branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain



More information about the jbosstools-commits mailing list