edu.sdsc.inca.consumer
Class All2AllBean

java.lang.Object
  extended by edu.sdsc.inca.consumer.All2AllBean

public class All2AllBean
extends java.lang.Object

Jsp bean that will query the given depot bean for the specified latest suite instances containing all-to-all tests and will return a summary. It will pick out all-to-all tests by looking for nicknames matching this pattern: all2all:(\S+)_to_(\S+) The first parameter will be taken as the all-to-all test name and the second will be taken as the resource. The summary will contain for each resource, the number of successes (numSuccesses), the number of at-fault failures (numAtFaultFailures), the number of not-at-fault failures numNotAtFaultFailures, and list of failed tests (e.g., ssh_to_B, ssh_to_D). The xml will be formatted as: <all2all-test-summary> <resource> <testname> <numSuccesses> <numAtFaultFailures> <numNotAtFaultFailures> <failures> <nickname> ... </failures> </testname> ... </resource> ... </all2all-test-summary> Required parameters are: suiteName retAttrName

Author:
Shava Smallen <ssmallen@sdsc.edu>

Nested Class Summary
static class All2AllBean.RESULT
           
 class All2AllBean.TestData
           
static class All2AllBean.TestResult
           
 class All2AllBean.TestSummaryResults
           
 
Field Summary
static int AF_FAILURES
           
static org.apache.log4j.Logger logger
           
static int NAF_FAILURES
           
 java.lang.String NAMESPACE_DECLS
           
static int NUM_STATS
           
static int SUCCESSES
           
 
Constructor Summary
All2AllBean()
           
 
Method Summary
protected  All2AllBean.TestSummaryResults computeSummary(All2AllBean.RESULT[][] results)
          Compute the number of successes and failures for each resource given an R X R array of all-to-all integer test results where R = set of resources r[i][j] = 1 if the test from the ith resource to jth resource succeeds, r[i][j] = 0 if test from the ith resource to jth resource fails, r[i][j] = -1 if the result of the test from the ith resource to jth resource is missing The following rules will be used to count the number of successes and failures: 1) if r[i][j] == 1, a success is added to resource i and resource j 2) if r[i][j] == 0, a failure is added to resource i if i == j or r[k][j] == 1 where resource k != i and k != j or it's the only result so far (i.e., if a resource is testing to itself or if at least one other resource successfully tests to resource j or it's the only result so far, then we assume the failure is on resource i).
protected  All2AllBean.TestData extractTestData(java.lang.String testName, edu.sdsc.inca.dataModel.queryResults.ObjectDocument suite)
          Search the given report summaries for those that match our test name and create a R X R matrix of test results, where R is the set of resources involved in the all-to-all test.
 java.lang.String getSuiteGuid()
          Return the name of the suite where all-2-all summary results will be extracted from.
 java.lang.String[] getTestNames(edu.sdsc.inca.dataModel.queryResults.ObjectDocument suite)
          Extract the list of all-to-all test names found in the provided report summaries.
 java.lang.String getXml()
          Retrieves the suite configuration from the consumer cache, finds all all-to-all test results, and returns a summary of the results per resource.
 void setDepotBean(DepotBean depotBean)
          Set the depot bean where suite information can be retrieved from.
 void setSuiteGuid(java.lang.String suiteGuid)
          Set the name of the suite where all-2-all summary results will be extracted from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE_DECLS

public final java.lang.String NAMESPACE_DECLS
See Also:
Constant Field Values

logger

public static org.apache.log4j.Logger logger

NUM_STATS

public static int NUM_STATS

SUCCESSES

public static int SUCCESSES

NAF_FAILURES

public static int NAF_FAILURES

AF_FAILURES

public static int AF_FAILURES
Constructor Detail

All2AllBean

public All2AllBean()
Method Detail

getSuiteGuid

public java.lang.String getSuiteGuid()
Return the name of the suite where all-2-all summary results will be extracted from.

Returns:
the name of a suite.

getTestNames

public java.lang.String[] getTestNames(edu.sdsc.inca.dataModel.queryResults.ObjectDocument suite)
Extract the list of all-to-all test names found in the provided report summaries.

Parameters:
suite - A cached suite document.
Returns:
An array of strings containing the all-to-all test names.

getXml

public java.lang.String getXml()
Retrieves the suite configuration from the consumer cache, finds all all-to-all test results, and returns a summary of the results per resource.

Returns:
A string containing the summary of all-to-all test results per resources or null if problem getting results.

setDepotBean

public void setDepotBean(DepotBean depotBean)
Set the depot bean where suite information can be retrieved from.

Parameters:
depotBean - A depot bean object

setSuiteGuid

public void setSuiteGuid(java.lang.String suiteGuid)
Set the name of the suite where all-2-all summary results will be extracted from.

Parameters:
suiteGuid - the name of a suite

computeSummary

protected All2AllBean.TestSummaryResults computeSummary(All2AllBean.RESULT[][] results)
Compute the number of successes and failures for each resource given an R X R array of all-to-all integer test results where R = set of resources r[i][j] = 1 if the test from the ith resource to jth resource succeeds, r[i][j] = 0 if test from the ith resource to jth resource fails, r[i][j] = -1 if the result of the test from the ith resource to jth resource is missing The following rules will be used to count the number of successes and failures: 1) if r[i][j] == 1, a success is added to resource i and resource j 2) if r[i][j] == 0, a failure is added to resource i if i == j or r[k][j] == 1 where resource k != i and k != j or it's the only result so far (i.e., if a resource is testing to itself or if at least one other resource successfully tests to resource j or it's the only result so far, then we assume the failure is on resource i). 3) if r[i][j] == 0, a failure is added to resource j if r[i][k] == 1 where k != j and k != i or it's the only result so far (i.e., if resource i successfully tests to at least one other resource, then we assume the failure is on resource j).

Parameters:
results - An R X R array of all-to-all boolean test results.
Returns:
An R X 3 array of summary results S, where s[i][0] = number of i successes for resource j s[i][1] = number of i not-at-fault failures for resource j s[i][2] = number of i at fault failures for resource j

extractTestData

protected All2AllBean.TestData extractTestData(java.lang.String testName,
                                               edu.sdsc.inca.dataModel.queryResults.ObjectDocument suite)
Search the given report summaries for those that match our test name and create a R X R matrix of test results, where R is the set of resources involved in the all-to-all test.

Parameters:
testName - The name of the all-to-all test running on the set of resources R.
suite - The suite results
Returns:
The matrix of test results and array of resources returned in a TestData object.