org.hackystat.projectbrowser.test
Class ProjectBrowserTestHelper

java.lang.Object
  extended by org.hackystat.projectbrowser.test.ProjectBrowserTestHelper
Direct Known Subclasses:
TestDailyProjectDataPage, TestProjectPortfolioPage, TestProjectsModel, TestProjectsPage, TestPropUriRowModel, TestSensorDataPage, TestTelemetryPage

public class ProjectBrowserTestHelper
extends java.lang.Object

Supports JUnit testing of the ProjectBrowser by creating test instances of the sensorbase, dailyprojectdata, and telemetry services.

Author:
Philip Johnson

Field Summary
protected static java.lang.String TEST_EDIT_SPECTATOR
           
protected static java.lang.String TEST_INVITEE
           
protected static java.lang.String TEST_NEW_INVITEE
           
protected static java.lang.String TEST_NEW_SPECTATOR
           
protected static java.lang.String TEST_USER
           
 
Constructor Summary
ProjectBrowserTestHelper()
          Constructor.
 
Method Summary
 void addMember(java.lang.String projectName, java.lang.String owner, java.lang.String newMember)
          Adds newMember to projectName owned by owner.
 void clearData(java.lang.String user)
          Clear data associated with the given user.
protected  void generateSimData(java.lang.String user, java.lang.String projectName, javax.xml.datatype.XMLGregorianCalendar endTime, int days)
          Generate a set of data for testing.
protected  java.lang.String getDailyProjectDataHostName()
          Returns the sensorbase hostname that this Telemetry server communicates with.
protected  java.lang.String getSensorBaseHostName()
          Returns the sensorbase hostname that this Telemetry server communicates with.
protected  java.lang.String getTelemetryHostName()
          Returns the hostname associated with this Telemetry test server.
protected  java.util.Properties getTestProperties()
          Returns a Properties instance with the SensorBase, DPD, and Telemetry services ProjectBrowserProperties set to test values.
static void setupServer()
          Starts the servers going for these tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_USER

protected static final java.lang.String TEST_USER
See Also:
Constant Field Values

TEST_INVITEE

protected static final java.lang.String TEST_INVITEE
See Also:
Constant Field Values

TEST_NEW_INVITEE

protected static final java.lang.String TEST_NEW_INVITEE
See Also:
Constant Field Values

TEST_NEW_SPECTATOR

protected static final java.lang.String TEST_NEW_SPECTATOR
See Also:
Constant Field Values

TEST_EDIT_SPECTATOR

protected static final java.lang.String TEST_EDIT_SPECTATOR
See Also:
Constant Field Values
Constructor Detail

ProjectBrowserTestHelper

public ProjectBrowserTestHelper()
Constructor.

Method Detail

setupServer

public static void setupServer()
                        throws java.lang.Exception
Starts the servers going for these tests.

Throws:
java.lang.Exception - If problems occur setting up the server.

getTelemetryHostName

protected java.lang.String getTelemetryHostName()
Returns the hostname associated with this Telemetry test server.

Returns:
The host name, including the context root.

getSensorBaseHostName

protected java.lang.String getSensorBaseHostName()
Returns the sensorbase hostname that this Telemetry server communicates with.

Returns:
The host name, including the context root.

getDailyProjectDataHostName

protected java.lang.String getDailyProjectDataHostName()
Returns the sensorbase hostname that this Telemetry server communicates with.

Returns:
The host name, including the context root.

getTestProperties

protected java.util.Properties getTestProperties()
Returns a Properties instance with the SensorBase, DPD, and Telemetry services ProjectBrowserProperties set to test values.

Returns:
A Properties instances with the service host names set to test values.

generateSimData

protected void generateSimData(java.lang.String user,
                               java.lang.String projectName,
                               javax.xml.datatype.XMLGregorianCalendar endTime,
                               int days)
Generate a set of data for testing. Effort is decrease 1 per day, end with 3. Size increases by 50 LOC per day, end with 1000. Complexity decrease by 1 per day, end with 3. Builds and unit tests success/pass number decrease by 1 per day, end with 2. Both fail twice a day. Coverage decrease by 3% per day, end with 60%. Commits twice a day, churn decrease by 5 per time, 10 per day, end with 20. Code issues decrease by 2 per day, end with 0.

Parameters:
user - name of the test user. DONOT include the "@hackystat.org", this method will add that in.
projectName - name of the test project.
endTime - end time of the test data.
days - number of days before endTime that this data will cover.

addMember

public void addMember(java.lang.String projectName,
                      java.lang.String owner,
                      java.lang.String newMember)
Adds newMember to projectName owned by owner. The newMember is invited by the owner, and then newMember accepts.

Parameters:
projectName - The name of the project.
owner - The owner of the project (without domain name).
newMember - The member to be added (without domain name).

clearData

public void clearData(java.lang.String user)
Clear data associated with the given user.

Parameters:
user - the given user.