public class

TraceContext

extends Object
java.lang.Object
   ↳ com.atlassian.jira.pageobjects.util.TraceContext

Class Overview

Provides utility methods for waiting for ajax results. To send events from the javascript side, call JIRA.trace(key, args...). To turn on logging:

org.apache.log4j.Logger.getLogger(TraceContext.class).setLevel(org.apache.log4j.Level.DEBUG);

Summary

Public Constructors
TraceContext()
Public Methods
Tracer checkpoint()
Returns a tracer containing the current state of trace list.
TimedCondition condition(Tracer tracer, String key)
Waits for the occurrence of a trace with the given key after the given tracer.
TimedCondition condition(Tracer tracer, String key, Pattern argumentPattern)
Waits for the occurrence of a trace with the given key and optionally arguments after the given tracer.
TimedCondition conditionFromPageLoad(String key)
Return a TimedCondition that waits for the occurrence of a trace at some point after the page load.
boolean exists(Tracer tracer, String key)
boolean exists(Tracer tracer, String key, Pattern argumentPattern)
Check whether trace record of given key exists, also test argument if argumentPattern is provided
List<Map<StringObject>> getArguments(Tracer tracer, String key)
void waitFor(Tracer tracer, String key)
Waits for the occurrence of a trace with the given key after the given tracer.
void waitFor(Tracer tracer, String key, Pattern argumentPattern)
Waits for the occurrence of a trace with the given key and optionally test argument against given argumentPattern
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TraceContext ()

Public Methods

public Tracer checkpoint ()

Returns a tracer containing the current state of trace list.

public TimedCondition condition (Tracer tracer, String key)

Waits for the occurrence of a trace with the given key after the given tracer.

Parameters
tracer checkpoint. Only traces after this checkpoint will be inspected.
key tracer key to watch for

public TimedCondition condition (Tracer tracer, String key, Pattern argumentPattern)

Waits for the occurrence of a trace with the given key and optionally arguments after the given tracer.

Parameters
tracer checkpoint. Only traces after this checkpoint will be inspected.
key tracer key to watch for
argumentPattern check consecutive arguments of JIRA.trace call(after key argument)

public TimedCondition conditionFromPageLoad (String key)

Return a TimedCondition that waits for the occurrence of a trace at some point after the page load.

Parameters
key the key to check for.
Returns
  • a TimedCondition that waits for the occurrence of a trace at some point after the page load.

public boolean exists (Tracer tracer, String key)

public boolean exists (Tracer tracer, String key, Pattern argumentPattern)

Check whether trace record of given key exists, also test argument if argumentPattern is provided

Parameters
tracer checkpoint. Only traces after this checkpoint will be inspected.
key tracer key to watch for
argumentPattern test argument of JIRA.trace call(after key argument)

public List<Map<StringObject>> getArguments (Tracer tracer, String key)

public void waitFor (Tracer tracer, String key)

Waits for the occurrence of a trace with the given key after the given tracer.

Parameters
tracer checkpoint. Only traces after this checkpoint will be inspected.
key tracer key to watch for

public void waitFor (Tracer tracer, String key, Pattern argumentPattern)

Waits for the occurrence of a trace with the given key and optionally test argument against given argumentPattern

Parameters
tracer checkpoint. Only traces after this checkpoint will be inspected.
key tracer key to watch for
argumentPattern test argument of JIRA.trace call(after key argument)