Arquillian Drone Extension Implementation 1.0.0.CR3

org.jboss.arquillian.drone.impl
Class DroneContext

java.lang.Object
  extended by org.jboss.arquillian.drone.impl.DroneContext
Direct Known Subclasses:
MethodContext

public class DroneContext
extends Object

Holder of Drone context. It is able to store different instances of drone instances as well as their configurations and to retrieve them during testing.

Author:
Constructor Summary
DroneContext()
           
 
Method Summary
<T> DroneContext
add(Class<?> key, Class<? extends Annotation> qualifier, T instance)
          Adds object under given key and given qualifier
<T> DroneContext
add(Class<T> key, T instance)
          Adds object under given key and Default qualifier
<T> T
get(Class<T> key)
          Gets object stored under Default qualifier and given key
<T> T
get(Class<T> key, Class<? extends Annotation> qualifier)
          Gets object stored under given qualifier and given key
 DroneContext remove(Class<?> key)
          Removes object under given key and Default qualifier
 DroneContext remove(Class<?> key, Class<? extends Annotation> qualifier)
          Removes object under given key and given qualifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DroneContext

public DroneContext()
Method Detail

get

public <T> T get(Class<T> key)
Gets object stored under Default qualifier and given key

Type Parameters:
T - Type of the object
Parameters:
key - Key used to find the object
Returns:
Object stored under given qualified key

get

public <T> T get(Class<T> key,
                 Class<? extends Annotation> qualifier)
Gets object stored under given qualifier and given key

Type Parameters:
T - Type of the object
Parameters:
key - Key used to find the object
qualifier - Qualifier used to find the object
Returns:
Object stored under given qualified key

add

public <T> DroneContext add(Class<T> key,
                            T instance)
Adds object under given key and Default qualifier

Type Parameters:
T - Type of the object
Parameters:
key - Key used to store the object
instance - Object to be stored
Returns:
Modified context

add

public <T> DroneContext add(Class<?> key,
                            Class<? extends Annotation> qualifier,
                            T instance)
Adds object under given key and given qualifier

Type Parameters:
T - Type of the object
Parameters:
key - Key used to store the object
qualifier - Qualifier used to store the object
instance - Object to be stored
Returns:
Modified context

remove

public DroneContext remove(Class<?> key)
Removes object under given key and Default qualifier

Parameters:
key - Key used to find the object
Returns:
Modified context

remove

public DroneContext remove(Class<?> key,
                           Class<? extends Annotation> qualifier)
Removes object under given key and given qualifier

Parameters:
key - Key used to find the object
qualifier - Qualifier used to find the object
Returns:
Modified context

Arquillian Drone Extension Implementation 1.0.0.CR3

Copyright © 2011 JBoss by Red Hat. All Rights Reserved.