public abstract class JUnitUtils
extends com.avcompris.util.AbstractUtils
| Modifier and Type | Class and Description |
|---|---|
static class |
JUnitUtils.TestMethodAndClassNames |
| Constructor and Description |
|---|
JUnitUtils() |
| Modifier and Type | Method and Description |
|---|---|
static File |
createTmpFileFromCommentsAroundThisMethod()
load a plain text fragment from comments in or just below the current
test method.
|
static File |
createTmpFileFromCommentsAroundThisMethod(int index)
load a plain text fragment from comments in or just below the current
test method.
|
static File |
createTmpFileFromCommentsAroundThisMethod(String thisMethodName) |
static File |
createTmpFileFromCommentsAroundThisMethod(String thisMethodName,
int index) |
static JUnitUtils.TestMethodAndClassNames |
getCurrentTestMethodAndClassNames()
find the name of the test method (annotated with @Test)
currently executing, or null
|
static String |
getCurrentTestMethodName()
find the name of the test method (annotated with @Test)
currently executing, or null
|
static File |
newTmpFileNamedAfterCurrentTest(String extension)
create a File object in the "target" directory with name
of current test class and method.
|
public static JUnitUtils.TestMethodAndClassNames getCurrentTestMethodAndClassNames()
@Nullable public static String getCurrentTestMethodName()
public static File createTmpFileFromCommentsAroundThisMethod() throws IOException
TODO: externalize this method, use AST in it.
IOExceptionpublic static File createTmpFileFromCommentsAroundThisMethod(int index) throws IOException
TODO: externalize this method, use AST in it.
index - (start at 0) the index of the comments to extract within the
method.IOExceptioncreateTmpFileFromCommentsAroundThisMethod()public static File createTmpFileFromCommentsAroundThisMethod(@Nullable String thisMethodName) throws IOException
thisMethodName - the name of the test method in which, or around which, search
for text content in Java comments. If this parameter is
null, rely on the JUnit test method currently
executing.IOExceptioncreateTmpFileFromCommentsAroundThisMethod()public static File createTmpFileFromCommentsAroundThisMethod(@Nullable String thisMethodName, int index) throws IOException
thisMethodName - the name of the test method in which, or around which, search
for text content in Java comments. If this parameter is
null, rely on the JUnit test method currently
executing.index - (start at 0) the index of the comments to extract within the
method.IOExceptioncreateTmpFileFromCommentsAroundThisMethod()Copyright © 2018 David Andrianavalontsalama. All rights reserved.