public class BambooTestUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NL
Convenience constant for new line
|
static String |
SEP
Convenice constant for file separators
|
Modifier and Type | Method and Description |
---|---|
static void |
assertFormError(ErrorCollection errorCollection,
String field,
String errorMessage) |
static void |
createActionContext() |
static void |
destroyActionContext() |
static File |
getFileFromResourceDirectory(Object object,
String fileName) |
static InputStream |
getInputStream(String resourceName)
Obtains the given fileName as an input stream.
|
static InputStream |
getInputStream(String resourceName,
Class<?> clazz)
Obtains the given fileName as an input stream.
|
static InputStream |
getInputStream(String resourceName,
Object object)
Obtains the given fileName as an input stream.
|
static org.codehaus.jackson.JsonNode |
getJsonResource(String resourceName,
Class<?> clazz) |
static String |
getSubstitutedResource(String resourceName,
Object object,
Properties subs) |
static File |
getTestDataFile(String fileName)
Get file from test data directory.
|
static String |
readFileFromResource(Object object,
String fileName) |
static <T extends Serializable> |
serializeAndDeserialize(T object) |
static String |
toVariableUsage(String variableName)
Converts variable name to a variable usage string using the default namespace "bamboo".
|
static String |
toVariableUsage(String variableNamespace,
String variableName)
Converts variable name to a variable usage string using the provided namespace.
|
public static final String NL
public static final String SEP
public static String getSubstitutedResource(@NotNull String resourceName, @NotNull Object object, @NotNull Properties subs)
public static InputStream getInputStream(String resourceName)
resourceName
- The file to read as a streampublic static InputStream getInputStream(@NotNull String resourceName, @NotNull Object object)
resourceName
- The file to read as a streamobject
- This object's class is used to load resourcepublic static InputStream getInputStream(String resourceName, Class<?> clazz)
resourceName
- The resource nameclazz
- The class to be used to load resourcepublic static org.codehaus.jackson.JsonNode getJsonResource(String resourceName, Class<?> clazz) throws IOException
IOException
public static void assertFormError(ErrorCollection errorCollection, String field, String errorMessage)
public static File getFileFromResourceDirectory(Object object, String fileName) throws IOException
IOException
public static File getTestDataFile(String fileName) throws IOException
IOException
public static String readFileFromResource(Object object, String fileName) throws IOException
IOException
public static void createActionContext()
public static void destroyActionContext()
public static <T extends Serializable> T serializeAndDeserialize(@NotNull T object) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
@NotNull public static String toVariableUsage(@NotNull String variableName)
variableName
- variable namepublic static String toVariableUsage(@NotNull String variableNamespace, @NotNull String variableName)
variableNamespace
- variable namespacevariableName
- variable nameCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.