org.objectweb.easybeans.tests.common.helper
Class PrintHelper

java.lang.Object
  extended by org.objectweb.easybeans.tests.common.helper.PrintHelper

public final class PrintHelper
extends java.lang.Object

This helper is used to do operation with InvocationContext and interceptors.

Author:
Eduardo Studzinski Estima de Castro, Gisele Pinheiro Souza

Constructor Summary
private PrintHelper()
          Helper should have a private constructor.
 
Method Summary
static
<E> java.lang.Object
addValue(javax.ejb.InvocationContext invocationContext, E value, java.lang.String className)
          Intercepts the method and add a value in the list that was get from InvocationContext.
static java.lang.String getPrintOrderErrorMsg(java.util.List expected, java.util.List result, java.lang.String seedMessage)
          Gets the error msg formatted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintHelper

private PrintHelper()
Helper should have a private constructor.

Method Detail

addValue

public static <E> java.lang.Object addValue(javax.ejb.InvocationContext invocationContext,
                                            E value,
                                            java.lang.String className)
                                 throws java.lang.Exception
Intercepts the method and add a value in the list that was get from InvocationContext.

Type Parameters:
E - Element Type
Parameters:
invocationContext - contains attributes of invocation, the first parameter of the intercepted method must be a list.
value - value to add
className - class that is invoking this method.
Returns:
method's invocation result
Throws:
java.lang.Exception - if invocation fails

getPrintOrderErrorMsg

public static java.lang.String getPrintOrderErrorMsg(java.util.List expected,
                                                     java.util.List result,
                                                     java.lang.String seedMessage)
Gets the error msg formatted.

Parameters:
expected - values to a correct answer
result - result values after an execution
seedMessage - standard message to show
Returns:
error message