Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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
      No files shared here yet.
    • 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);
      	}
      
  • No labels