Top Fields Constructors Methods
com.vladsch.flexmark.test.util

public Class TestUtils

extends Object
Class Inheritance
Imports
com.vladsch.flexmark.test.util.spec.*, com.vladsch.flexmark.util.ast.Node, com.vladsch.flexmark.util.data.DataHolder, .DataKey, .DataSet, .MutableDataSet, com.vladsch.flexmark.util.misc.CharPredicate, .DelimitedBuilder, .Extension, .Pair, com.vladsch.flexmark.util.sequence.BasedSequence, .RichSequence, .SegmentedSequence, .SequenceUtils, com.vladsch.flexmark.util.sequence.builder.SequenceBuilder, org.jetbrains.annotations.NotNull, .Nullable, org.junit.AssumptionViolatedException, java.io.File, .IOException, java.net.URL, java.util.*, java.util.function.BiFunction, .Function

Field Summary

Modifier and TypeField and Description
public static final @NotNull CharPredicate
public static final DataKey<BiFunction<String, String, DataHolder>>
public static final String
public static final char
public static final DataKey<Boolean>
public static final String
public static final int[]
private static final DataHolder
public static final DataKey<Boolean>
public static final String
public static final String
public static final String
public static final DataKey<Boolean>
public static final String
public static final DataKey<String>
public static final DataKey<Collection<Extension>>
public static final String
public static final char
public static final @NotNull CharPredicate
public static final String
public static final char
public static final String
public static final char
public static final DataKey<Boolean>
public static final DataHolder
public static final String
public static final DataKey<String>
public static final DataKey<String>
public static final DataKey<String>
public static final DataKey<Boolean>
public static final String
public static final DataKey<Integer>
public static final String
public static final String
public static final DataKey<Collection<Class<? extends Extension>>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <T> MutableDataSet
addOption(DataHolder options, DataKey<T> key, T value)

public static String
addSpecExample(boolean includeExampleStart, String source, String html, String ast, String optionsSet)

public static void
addSpecExample(boolean includeExampleStart, StringBuilder sb, String source, String html, String ast, String optionsSet, boolean includeExampleCoords, String section, int number)

public static void
addSpecExample(boolean includeExampleStart, boolean toVisibleSpecText, StringBuilder sb, String source, String html, String ast, String optionsSet, boolean includeExampleCoords, String section, int number)

public static void
addSpecExample(boolean useTestExample, boolean includeExampleStart, boolean toVisibleSpecText, StringBuilder sb, String source, String html, String ast, String optionsSet, boolean includeExampleCoords, String section, int number)

public static void
addSpecExample(CharSequence exampleBreak, CharSequence sectionBreak, boolean includeExampleStart, boolean toVisibleSpecText, Appendable out, CharSequence source, CharSequence html, CharSequence ast, CharSequence optionsSet, boolean includeExampleCoords, CharSequence section, int number)

public static void
addSpecExample(CharSequence exampleBreakOpen, CharSequence htmlBreak, CharSequence astBreak, CharSequence exampleBreakClose, boolean includeExampleStart, boolean toVisibleSpecText, Appendable out, CharSequence source, CharSequence html, CharSequence ast, CharSequence optionsSet, boolean includeExampleCoords, CharSequence section, CharSequence number, CharSequence exampleKeyword, CharSequence optionsKeyword)

public static @NotNull Pair<String, Integer>
addSpecSection(@NotNull String headingLine, @NotNull String headingText, String[] sectionHeadings)

public static String
public static void
public static void
appendBanner(@NotNull StringBuilder out, @NotNull String banner, boolean addBlankLine)

public static void
public static @NotNull String
public static @NotNull String
public static <T> @NotNull HashMap<String, T>
public static <
type of value in the map
T
>
@NotNull HashMap<String, T>

Returns:

constructed hash map of option name
buildOptionsMap
(boolean
if true, throws IllegalStateException if some built-in options are missing
ensureAllBuiltInPresent
,
@NotNull Object[][]
array of object arrays, each row represents option values with first element ([0]) of each row being an option string. Each row is passed to factory to allow creating custom options.
options
,
@NotNull BiFunction<ExampleOption, Object[], T>
factory creating a type from ExampleOption and given row of parameters
factory
)

Build options map, optionally ensuring all built-ins are present

public static @Nullable DataHolder
public static DataHolder
public static DataHolder
public static @Nullable DataHolder[]
public static Pair<BasedSequence, int[]>
public static String

Returns:

spec test special visible chars converted to normal
fromVisibleSpecText
(String
text to convert to from visible chars to normal
s
)

public static CharSequence

Returns:

spec test special visible chars converted to normal
fromVisibleSpecText
(CharSequence
text to convert to from visible chars to normal
s
)

public static @NotNull String
getAbsoluteSpecResourcePath(@NotNull String testClassPath, @NotNull String resourceRootPath, @NotNull String resourcePath)

public static @NotNull String
getFormattedSection(String section, int exampleNumber)

public static String
getFormattedTimingInfo(int iterations, long start, long parse, long render)

public static String
getFormattedTimingInfo(String section, int exampleNumber, int iterations, long start, long parse, long render)

public static DataHolder

Returns:

combined set from applying these options together
getOptions
(@NotNull SpecExample
spec example instance for which options are being processed
example
,
@Nullable String
comma separate list of option set names
optionSets
,
@NotNull Function<String, DataHolder>
function to take a string option name and provide settings based on it
optionsProvider
)

process comma separated list of option sets and combine them for final set to use

public static @NotNull String
public static @NotNull String
getRootDirectoryForModule(@NotNull Class<?> resourceClass, @NotNull String moduleDirectoryName)

public static @NotNull String
getSpecResourceFileUrl(@NotNull Class<?> resourceClass, @NotNull String resourcePath)

public static ArrayList<Object[]>
public static @NotNull String
public static @NotNull String
getUrlWithLineNumber(@NotNull String fileUrl, int lineNumber)

public static SequenceBuilder
insertCaretMarkup(BasedSequence sequence, int[] offsets)

public static @Nullable Map<String, ? extends DataHolder>
optionsMaps(@Nullable Map<String, ? extends DataHolder> other, @Nullable Map<String, ? extends DataHolder> overrides)

public static DataHolder
processOption(@NotNull Map<String, ? extends DataHolder> optionsMap, @NotNull String option)

public static String

Returns:

spec test special chars converted to visible
showTabs
(String
text to convert to visible chars
s
)
Deprecated use toVisibleSpecText(String)

public static BasedSequence
stripIndent(BasedSequence input, CharSequence sourceIndent)

public static void
public static void
public static String

Returns:

spec test special chars converted to visible
toVisibleSpecText
(String
text to convert to visible chars
s
)

public static CharSequence

Returns:

spec test special chars converted to visible
toVisibleSpecText
(CharSequence
text to convert to visible chars
s
)

public static String
trimTrailingEOL(String parseSource)

public static String

Returns:

spec test special visible chars converted to normal
unShowTabs
(String
text to convert to from visible chars to normal
s
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait