From 754a941c35349fae7bf02a4f29e019b6e0283ddd Mon Sep 17 00:00:00 2001 From: travismccauley Date: Wed, 12 Nov 2003 15:02:04 +0000 Subject: [PATCH] Added the beginnings of a jWebUnit Functionality test. Added the start of a jMeter Load Test including a recorder that includes an Http Proxy Server to record navigation through the application. This will be the basis for an automated test of most functionality of the application --- src/java/org/thdl/lex/test/LexTestCase.java | 80 +++++++++++ src/java/org/thdl/lex/test/LoadTest.jmx | 134 ++++++++++++++++++ .../org/thdl/lex/test/LoadTestRecorder.jmx | 124 ++++++++++++++++ 3 files changed, 338 insertions(+) create mode 100644 src/java/org/thdl/lex/test/LexTestCase.java create mode 100644 src/java/org/thdl/lex/test/LoadTest.jmx create mode 100644 src/java/org/thdl/lex/test/LoadTestRecorder.jmx diff --git a/src/java/org/thdl/lex/test/LexTestCase.java b/src/java/org/thdl/lex/test/LexTestCase.java new file mode 100644 index 0000000..ec013f4 --- /dev/null +++ b/src/java/org/thdl/lex/test/LexTestCase.java @@ -0,0 +1,80 @@ +package org.thdl.lex.test; + +import net.sourceforge.jwebunit.WebTestCase; + + +/** + * Description of the Class + * + * @author travis + * @created November 10, 2003 + */ +public class LexTestCase extends WebTestCase +{ + + /** + * Description of the Method + */ + public void begin() + { + beginAt( "/action" ); + System.out.println( "Starting at /action" ); + } + + + /** + * A unit test for JUnit + * + * @param user Description of the Parameter + * @param pass Description of the Parameter + */ + public void testLoginPageInterceptThenProceed( String user, String pass ) + { + System.out.println( "Verifying Login Form intercept" ); + assertFormPresent( "loginForm" ); + assertFormElementPresent( "username" ); + assertFormElementPresent( "password" ); + setFormElement( "username", user ); + setFormElement( "password", pass ); + submit(); + } + + + /** + * A unit test for JUnit + */ + public void testLex() + { + assertFormPresent( "quickSearch" ); + assertFormPresent( "newTerm" ); + assertFormPresent( "defults" ); + assertFormPresent( "preferences" ); + } + + + /** + *Constructor for the LexTestCase object + * + * @param name Description of the Parameter + */ + public LexTestCase( String name ) + { + super( name ); + getTestContext().setBaseUrl( "http://haley.local:2020/lex" ); + } + + + /** + * The main program for the LexTestCase class + * + * @param args The command line arguments + */ + public static void main( String[] args ) + { + LexTestCase tc = new LexTestCase( "menu" ); + tc.begin(); + tc.testLoginPageInterceptThenProceed( args[0], args[1] ); + tc.testLex(); + } +} + diff --git a/src/java/org/thdl/lex/test/LoadTest.jmx b/src/java/org/thdl/lex/test/LoadTest.jmx new file mode 100644 index 0000000..f270699 --- /dev/null +++ b/src/java/org/thdl/lex/test/LoadTest.jmx @@ -0,0 +1,134 @@ + + + + +org.apache.jmeter.config.gui.ArgumentsPanel +org.apache.jmeter.config.Arguments + +Argument List +true + +org.apache.jmeter.control.gui.TestPlanGui + +org.apache.jmeter.testelement.TestPlan +false +Test Plan +true +false + + + +org.apache.jmeter.threads.gui.ThreadGroupGui +1068560706000 +org.apache.jmeter.threads.ThreadGroup + +org.apache.jmeter.control.gui.LoopControlPanel +250 +org.apache.jmeter.control.LoopController +Loop Controller +true +false + +/lex/action Thread Group +1068560706000 +true +1 +false +1 + + + +org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui + +org.apache.jmeter.config.ConfigTestElement +HTTP Request Defaults +haley.local +http +true + +org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel +org.apache.jmeter.config.Arguments + +Argument List +true + +2020 + + + + +/lex/action +org.apache.jmeter.protocol.http.sampler.HTTPSampler +/lex/action +GET +true + +true +false +true + +org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel +org.apache.jmeter.config.Arguments + + += +menu +true +cmd +false + + +Argument List +true + + + +org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui + +cmd=menu + + + + + + +org.apache.jmeter.visualizers.ViewResultsFullVisualizer +org.apache.jmeter.reporters.ResultCollector +View Results Tree +true + +false + + + + +org.apache.jmeter.visualizers.StatVisualizer +org.apache.jmeter.reporters.ResultCollector +Aggregate Report +true + +false + + + + +org.apache.jmeter.timers.gui.UniformRandomTimerGui +org.apache.jmeter.timers.UniformRandomTimer +Uniform Random Timer +true +2000 +1000 + + + + +org.apache.jmeter.protocol.http.gui.CookiePanel +org.apache.jmeter.protocol.http.control.CookieManager +HTTP Cookie Manager +false +true + + + + + diff --git a/src/java/org/thdl/lex/test/LoadTestRecorder.jmx b/src/java/org/thdl/lex/test/LoadTestRecorder.jmx new file mode 100644 index 0000000..07175d2 --- /dev/null +++ b/src/java/org/thdl/lex/test/LoadTestRecorder.jmx @@ -0,0 +1,124 @@ + + + + +org.apache.jmeter.config.gui.ArgumentsPanel +org.apache.jmeter.config.Arguments + +Argument List +true + +org.apache.jmeter.control.gui.TestPlanGui + +org.apache.jmeter.testelement.TestPlan +false +Test Plan +true +false + + + +org.apache.jmeter.threads.gui.ThreadGroupGui +1068560706000 +org.apache.jmeter.threads.ThreadGroup + +org.apache.jmeter.control.gui.LoopControlPanel +250 +org.apache.jmeter.control.LoopController +Loop Controller +true +false + +/lex/action Thread Group +1068560706000 +true +1 +false +1 + + + + +org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui +org.apache.jmeter.config.ConfigTestElement +HTTP Request Defaults +haley.local +http +true +2020 + +org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel +org.apache.jmeter.config.Arguments + +Argument List +true + + + + + +/lex/action +org.apache.jmeter.protocol.http.sampler.HTTPSampler +/lex/action +GET +true + +true +false +true + +org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel +org.apache.jmeter.config.Arguments + + += +menu +true +cmd +false + + +Argument List +true + + + +org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui + +cmd=menu + + + + + + +org.apache.jmeter.visualizers.ViewResultsFullVisualizer +org.apache.jmeter.reporters.ResultCollector +View Results Tree +true + +false + + + + +org.apache.jmeter.visualizers.StatVisualizer +org.apache.jmeter.reporters.ResultCollector +Aggregate Report +true + +false + + + + +org.apache.jmeter.timers.gui.UniformRandomTimerGui +org.apache.jmeter.timers.UniformRandomTimer +Uniform Random Timer +true +1000 +2000 + + + +