public class BaseCompilationTest extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_APP_PACKAGE |
static String |
KEY_CLASS_NAME |
static String |
KEY_CLASS_TYPE |
static String |
KEY_DEPENDENCIES |
static String |
KEY_IMPORT_TYPE |
static String |
KEY_INCLUDE_ID |
static String |
KEY_MANIFEST_PACKAGE |
static String |
KEY_SETTINGS_INCLUDES |
static String |
KEY_VIEW_ID |
TestName |
name |
protected File |
testFolder |
Constructor and Description |
---|
BaseCompilationTest() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
protected void |
copyResourceDirectory(String name,
String targetPath) |
protected void |
copyResourceTo(String name,
File targetFile) |
protected void |
copyResourceTo(String name,
File targetFile,
Map<String,String> replacements) |
protected void |
copyResourceTo(String name,
String path) |
protected void |
copyResourceTo(String name,
String path,
Map<String,String> replacements) |
protected String |
extract(String pathInApp,
Location location)
Extracts the text in the given location from the the at the given application path.
|
protected void |
prepareApp(Map<String,String> replacements) |
protected void |
prepareModule(String moduleName,
String packageName,
Map<String,String> replacements) |
protected void |
prepareProject() |
protected CompilationResult |
runGradle(String... params) |
protected static Map<String,String> |
toMap(String... keysAndValues) |
public TestName name
public static final String KEY_MANIFEST_PACKAGE
public static final String KEY_DEPENDENCIES
public static final String KEY_SETTINGS_INCLUDES
public static final String DEFAULT_APP_PACKAGE
public static final String KEY_CLASS_NAME
public static final String KEY_CLASS_TYPE
public static final String KEY_IMPORT_TYPE
public static final String KEY_INCLUDE_ID
public static final String KEY_VIEW_ID
protected final File testFolder
protected void copyResourceTo(String name, String path) throws IOException
IOException
protected void copyResourceTo(String name, String path, Map<String,String> replacements) throws IOException
IOException
protected void copyResourceDirectory(String name, String targetPath) throws URISyntaxException, IOException
URISyntaxException
IOException
public void clear() throws IOException
IOException
protected String extract(String pathInApp, Location location) throws IOException
pathInApp
- The path, relative to the root of the application under testlocation
- The location to extractIOException
- If file is invalid.protected void copyResourceTo(String name, File targetFile) throws IOException
IOException
protected void copyResourceTo(String name, File targetFile, Map<String,String> replacements) throws IOException
IOException
protected void prepareProject() throws IOException, URISyntaxException
IOException
URISyntaxException
protected void prepareApp(Map<String,String> replacements) throws IOException, URISyntaxException
IOException
URISyntaxException
protected void prepareModule(String moduleName, String packageName, Map<String,String> replacements) throws IOException, URISyntaxException
IOException
URISyntaxException
protected CompilationResult runGradle(String... params) throws IOException, InterruptedException
IOException
InterruptedException