woolfel 2003/10/21 05:33:56
Modified: src/protocol/http/org/apache/jmeter/protocol/http/control/gui
AccessLogSamplerGui.java
Log:
added unit test to the gui class
Revision Changes Path
1.8 +36 -0
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/AccessLogSamplerGui.java
Index: AccessLogSamplerGui.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/AccessLogSamplerGui.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AccessLogSamplerGui.java 21 Oct 2003 00:00:00 -0000 1.7
+++ AccessLogSamplerGui.java 21 Oct 2003 12:33:56 -0000 1.8
@@ -73,6 +73,8 @@
import org.apache.jorphan.gui.JLabeledTextField;
import org.apache.jorphan.gui.layout.VerticalLayout;
+import junit.framework.TestCase;
+
/**
* Title: JMeter Access Log utilities<br>
* Copyright: Apache.org<br>
@@ -349,4 +351,38 @@
JOptionPane.ERROR_MESSAGE);
}
}
+
+ /**
+ * Added basic TestCase for AccessLogSamplerGui. It does
+ * the same test at HttpTestSampleGui.java.
+ * @author peter lin
+ */
+ public static class Test extends TestCase
+ {
+ AccessLogSamplerGui gui;
+
+ public Test(String name)
+ {
+ super(name);
+ }
+
+ public void setUp()
+ {
+ gui = new AccessLogSamplerGui();
+ }
+
+ public void testCloneSampler() throws Exception
+ {
+ AccessLogSampler sampler =
(AccessLogSampler)gui.createTestElement();
+ sampler.addArgument("param","value");
+ AccessLogSampler clonedSampler =
(AccessLogSampler)sampler.clone();
+ clonedSampler.setRunningVersion(true);
+ sampler.getArguments().getArgument(0).setValue("new value");
+ assertEquals(
+ "Sampler didn't clone correctly",
+ "new value",
+ sampler.getArguments().getArgument(0).getValue());
+ }
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]