public final class TestHelper extends Object
Constructor and Description |
---|
TestHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
cleanPathSegment(String toClean)
Removes characters that aren't acceptable in a file path (mostly for windows).
|
static String |
convertPackageToResourcePath(Class clazz)
Takes a class and converts its package name to a path that can be used to access a resource in that package.
|
static File |
generateTempFile(Class clazz,
String fileName,
String fileNameSuffix)
Creates a
File reference in the path returned from makeTestDataPath(java.lang.Class, java.lang.String) in a subdirectory
called temp . |
static File |
generateTempFileFromResource(Class resourceClass,
String resourceName,
String extension)
Copies a file stored as part of a resource to the file system in the path returned from
makeTestDataPath(java.lang.Class, java.lang.String) in a subdirectory called temp/resources . |
static File |
makeTestDataPath(Class clazz,
String childPath)
Creates a
File reference that points to a directory relative to the supplied class in the
/target directory. |
static void |
validateEdgeEquality(Edge originalEdge,
Edge otherEdge) |
static void |
validateEquality(Object original,
Object other) |
static void |
validatePropertyEquality(Property originalProperty,
Property otherProperty) |
static void |
validateVertexEquality(Vertex originalVertex,
Vertex otherVertex,
boolean testEdges) |
static void |
validateVertexPropertyEquality(VertexProperty originalVertexProperty,
VertexProperty otherVertexProperty) |
public static File makeTestDataPath(Class clazz, String childPath)
File
reference that points to a directory relative to the supplied class in the
/target
directory.public static File generateTempFile(Class clazz, String fileName, String fileNameSuffix) throws IOException
File
reference in the path returned from makeTestDataPath(java.lang.Class, java.lang.String)
in a subdirectory
called temp
.IOException
public static File generateTempFileFromResource(Class resourceClass, String resourceName, String extension) throws IOException
makeTestDataPath(java.lang.Class, java.lang.String)
in a subdirectory called temp/resources
.IOException
public static String convertPackageToResourcePath(Class clazz)
public static String cleanPathSegment(String toClean)
public static void validateVertexEquality(Vertex originalVertex, Vertex otherVertex, boolean testEdges)
public static void validateVertexPropertyEquality(VertexProperty originalVertexProperty, VertexProperty otherVertexProperty)
public static void validatePropertyEquality(Property originalProperty, Property otherProperty)
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.