1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
33
33
public interface TestContext extends AttributeAccessor , Serializable {
34
34
35
35
/**
36
- * Get the {@link ApplicationContext application context} for this test
37
- * context, possibly cached.
38
- *
36
+ * Get the {@linkplain ApplicationContext application context} for this
37
+ * test context, possibly cached.
39
38
* <p>Implementations of this method are responsible for loading the
40
39
* application context if the corresponding context has not already been
41
40
* loaded, potentially caching the context as well.
@@ -46,30 +45,30 @@ public interface TestContext extends AttributeAccessor, Serializable {
46
45
ApplicationContext getApplicationContext ();
47
46
48
47
/**
49
- * Get the {@link Class test class} for this test context.
48
+ * Get the {@linkplain Class test class} for this test context.
50
49
* @return the test class (never {@code null})
51
50
*/
52
51
Class <?> getTestClass ();
53
52
54
53
/**
55
- * Get the current {@link Object test instance} for this test context.
54
+ * Get the current {@linkplain Object test instance} for this test context.
56
55
* <p>Note: this is a mutable property.
57
56
* @return the current test instance (may be {@code null})
58
57
* @see #updateState(Object, Method, Throwable)
59
58
*/
60
59
Object getTestInstance ();
61
60
62
61
/**
63
- * Get the current {@link Method test method} for this test context.
62
+ * Get the current {@linkplain Method test method} for this test context.
64
63
* <p>Note: this is a mutable property.
65
64
* @return the current test method (may be {@code null})
66
65
* @see #updateState(Object, Method, Throwable)
67
66
*/
68
67
Method getTestMethod ();
69
68
70
69
/**
71
- * Get the {@link Throwable exception} that was thrown during execution of
72
- * the {@link #getTestMethod() test method}.
70
+ * Get the {@linkplain Throwable exception} that was thrown during execution
71
+ * of the {@linkplain #getTestMethod() test method}.
73
72
* <p>Note: this is a mutable property.
74
73
* @return the exception that was thrown, or {@code null} if no
75
74
* exception was thrown
@@ -80,8 +79,10 @@ public interface TestContext extends AttributeAccessor, Serializable {
80
79
/**
81
80
* Call this method to signal that the {@linkplain ApplicationContext application
82
81
* context} associated with this test context is <em>dirty</em> and should be
83
- * discarded. Do this if a test has modified the context — for example,
84
- * by replacing a bean definition or modifying the state of a singleton bean.
82
+ * removed from the context cache.
83
+ * <p>Do this if a test has modified the context — for example, by
84
+ * modifying the state of a singleton bean, modifying the state of an embedded
85
+ * database, etc.
85
86
* @param hierarchyMode the context cache clearing mode to be applied if the
86
87
* context is part of a hierarchy (may be {@code null})
87
88
*/
0 commit comments