public class IntegrationTestsCommon extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IntegrationTestsCommon.TestUser
Test user details for integration testing
|
Constructor and Description |
---|
IntegrationTestsCommon() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canConnect(String host,
int tcp_port)
Check if we can make a TCP connection to the specified host and port.
|
static void |
checkAccessControlManagerConnection()
Check if the configured Access Control Manager is accessible.
|
static void |
checkDatabaseServerConnection()
Check if the configured database server is accessible.
|
static <T> String |
getDatabaseImportDirectory(Class<T> clazz)
Get the integration testing database import directory.
|
static <T> String |
getModuleDir(Class<T> clazz)
Get the module directory of the specified class.
|
static boolean |
isLocalAppServerReady() |
static void |
startLocalAppServer(String DISPLAYNAME,
String APPCLASSNAME,
String LOCALHOST_URI,
String ACCESSCONTROLSKIPPATTERN)
Start local application server instance for integration testing.
|
static void |
stopLocalAppServer()
Stop the local application server.
|
public static void startLocalAppServer(String DISPLAYNAME, String APPCLASSNAME, String LOCALHOST_URI, String ACCESSCONTROLSKIPPATTERN)
DISPLAYNAME
- The Web Application context display name
(web.xml display-name tag equivalent).APPCLASSNAME
- The full application class name, e.g.
gr.iccs.isense.circ4life.rest.EcoCreditCalculatorModule.LOCALHOST_URI
- The locahost URI to listen to with pattern:
http://127.0.0.1:PORT/CONTEXTPATH/RESOURCEPATH.ACCESSCONTROLSKIPPATTERN
- URI path pattern to skip access control for.public static boolean isLocalAppServerReady()
true
if the local application server instance has
started, false
otherwise.public static void stopLocalAppServer()
public static <T> String getModuleDir(Class<T> clazz)
T
- the type of the class.clazz
- the class.public static boolean canConnect(String host, int tcp_port)
host
- the hostname or IP address.tcp_port
- the TCP port to connect to.true
if a TCP connection is successful,
false
otherwise.public static void checkAccessControlManagerConnection() throws ConfigurationException, URISyntaxException
ConfigurationException
- if the current configuration is not valid.URISyntaxException
- if the conffigured Access Control Manager URL
is malformed.public static void checkDatabaseServerConnection() throws ConfigurationException
ConfigurationException
- if the current configuration is not valid.Copyright © 2020. All rights reserved.