org.eclipse.test.performance
Class PerformanceTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eclipse.test.performance.PerformanceTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TestCase

public class PerformanceTestCase
extends junit.framework.TestCase

A PerformanceTestCase is a convenience class that takes care of managing a PerformanceMeter.

Here is an example:

 public class MyPerformanceTestCase extends PeformanceTestCase {
                
   public void testMyOperation() {
     for (int i= 0; i < 10; i++) {
       // preparation
       startMeasuring();
       // my operation
       stopMeasuring();
       // clean up
     }
     commitMeasurements();
     assertPerformance();
   }    
 }


Constructor Summary
PerformanceTestCase()
          Constructs a performance test case.
PerformanceTestCase(java.lang.String name)
          Constructs a performance test case with the given name.
 
Method Summary
 void setComment(int commentKind, java.lang.String commentText)
          Set a comment for the scenario represented by this TestCase.
 void tagAsGlobalSummary(java.lang.String shortName, Dimension dimension)
          Mark the scenario of this test case to be included into the global and the component performance summary.
 void tagAsGlobalSummary(java.lang.String shortName, Dimension[] dimensions)
          Mark the scenario represented by the given PerformanceMeter to be included into the global and the component performance summary.
 void tagAsSummary(java.lang.String shortName, Dimension dimension)
          Mark the scenario of this test case to be included into the component performance summary.
 void tagAsSummary(java.lang.String shortName, Dimension[] dimensions)
          Mark the scenario represented by the given PerformanceMeter to be included into the component performance summary.
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PerformanceTestCase

public PerformanceTestCase()
Constructs a performance test case.


PerformanceTestCase

public PerformanceTestCase(java.lang.String name)
Constructs a performance test case with the given name.

Parameters:
name - the name of the performance test case
Method Detail

tagAsGlobalSummary

public void tagAsGlobalSummary(java.lang.String shortName,
                               Dimension dimension)
Mark the scenario of this test case to be included into the global and the component performance summary. The summary shows the given dimension of the scenario and labels the scenario with the short name.

Parameters:
shortName - a short (shorter than 40 characters) descritive name of the scenario
dimension - the dimension to show in the summary

tagAsGlobalSummary

public void tagAsGlobalSummary(java.lang.String shortName,
                               Dimension[] dimensions)
Mark the scenario represented by the given PerformanceMeter to be included into the global and the component performance summary. The summary shows the given dimensions of the scenario and labels the scenario with the short name.

Parameters:
shortName - a short (shorter than 40 characters) descritive name of the scenario
dimensions - an array of dimensions to show in the summary

tagAsSummary

public void tagAsSummary(java.lang.String shortName,
                         Dimension dimension)
Mark the scenario of this test case to be included into the component performance summary. The summary shows the given dimension of the scenario and labels the scenario with the short name.

Parameters:
shortName - a short (shorter than 40 characters) descritive name of the scenario
dimension - the dimension to show in the summary

tagAsSummary

public void tagAsSummary(java.lang.String shortName,
                         Dimension[] dimensions)
Mark the scenario represented by the given PerformanceMeter to be included into the component performance summary. The summary shows the given dimensions of the scenario and labels the scenario with the short name.

Parameters:
shortName - a short (shorter than 40 characters) descritive name of the scenario
dimensions - an array of dimensions to show in the summary

setComment

public void setComment(int commentKind,
                       java.lang.String commentText)
Set a comment for the scenario represented by this TestCase. Currently only comments with a commentKind of EXPLAINS_DEGRADATION_COMMENT are used. Their commentText is shown in a hover of the performance summaries graph if a performance degradation exists.

Parameters:
commentKind - kind of comment. Must be EXPLAINS_DEGRADATION_COMMENT to have an effect.
commentText - the comment (shorter than 400 characters)