Test-Harness Enhancements

Test-Harness Enhancements for v2.1.x

  • I added some simple load testing capability to Josh's Test Harness
  • You have to apply the following test-harness.diff patch
    •   File Modified

      File test-harness.diff Adding simple load testing to test-harness v2.1.x

      Jun 14, 2006 by Thomas Amsler
    • To apply the patch do:
      • cd sakai-2-1-x/test-harness/src/java
      • patch -p0 < test-harness.diff
  • Examples:
    • 	public void testGetCoursesByTerm() throws Exception {
      		
      		// Unit test
      		List courseList = null;
      		courseList = courseManagementManager.getCoursesByTerm("2006","01");
      		Assert.assertNotNull(courseList);
      		
      		// Load Test
      		SakaiTestMethodInvoker testMethodInvoker = new SakaiTestMethodInvoker();
      		testMethodInvoker.runOnce(courseManagementManager,
      					   "getCoursesByTerm",
      					    new Object[] {"2006","01"}, 
      					    new Class[] {String.class, String.class});
      		
      		testMethodInvoker.runMultipleTimes(courseManagementManager,
      						   "getCoursesByTerm",
      						    new Object[] {"2006","01"}, 
      						    new Class[] {String.class, String.class},
      						    10);
      		
      		testMethodInvoker.runThreadedOnce(courseManagementManager,
      						  "getCoursesByTerm",
      						   new Object[] {"2006","01"}, 
      						   new Class[] {String.class, String.class},
      						   5);
      		
      		testMethodInvoker.runThreadedMultipleTimes(courseManagementManager,
      							   "getCoursesByTerm",
      							    new Object[] {"2006","01"}, 
      							    new Class[] {String.class, String.class}, 10, 5);
      	}