public abstract class AbstractITest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
ATTEMPT_COUNT |
protected static long |
ATTEMPT_DELAY |
protected static String |
authentication |
protected static String |
authHeader |
protected static String |
baseGwUri |
protected static String |
baseInvUri |
protected static String |
baseMetricsUri |
protected okhttp3.OkHttpClient |
client |
protected static String |
hawkularFeedId |
protected static String |
hawkularHost |
protected static int |
hawkularHttpPort |
protected static int |
hawkularManagementPort |
protected static String |
managementPasword |
protected static String |
managementUser |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected static String |
testPasword |
protected static String |
testUser |
protected static Object |
waitForAccountsLock |
protected static Object |
waitForAgentLock |
protected static File |
wfHome |
| Constructor and Description |
|---|
AbstractITest() |
| Modifier and Type | Method and Description |
|---|---|
void |
after() |
protected void |
assertNodeAttributeEquals(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
String attributeName,
String expectedAttributeValue) |
protected void |
assertNodeEquals(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
Class<?> caller,
String expectedNodeFileName) |
protected void |
assertNodeEquals(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
Class<?> caller,
String expectedNodeFileName,
boolean saveActual) |
protected void |
assertResourceCount(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode address,
String childType,
int expectedCount) |
protected void |
assertResourceExists(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode address,
boolean expectedExists) |
protected void |
assertResourceNotInInventory(String listPath,
Predicate<org.hawkular.inventory.api.model.Resource> predicate,
int attemptCount,
long attemptDelay) |
protected static String |
assertWelcomeResponse(String msg) |
void |
before() |
protected org.jboss.dmr.ModelNode |
getAgentInventoryReport(String host,
int managementPort) |
protected org.hawkular.inventory.api.model.DataEntity |
getDataEntity(String path,
int attemptCount,
long attemptDelay) |
protected Collection<String> |
getDMRChildrenNames(WildFlyClientConfig config,
String childTypeName,
org.jboss.as.controller.PathAddress parentAddress)
Gets a list of all DMR children names.
|
protected org.hawkular.inventory.paths.CanonicalPath |
getHawkularWildFlyServerResourcePath()
Return the
CanonicalPath of the only WildFly server present in inventory under the hawkular feed. |
protected org.hawkular.inventory.paths.CanonicalPath |
getHostController(WildFlyClientConfig hostControllerClientConfig)
Return the
CanonicalPath of the only WildFly Host Controller present in inventory under the feed
found in the given client config. |
protected String |
getNodeAttribute(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
String attributeName) |
protected org.hawkular.inventory.api.model.OperationType |
getOperationType(String path,
int attemptCount,
long attemptDelay) |
protected static WildFlyClientConfig |
getPlainWildFlyClientConfig()
If a plain WildFly server was configured for the tests, this returns its data.
|
protected org.hawkular.inventory.api.model.Resource |
getResource(String listPath,
Predicate<org.hawkular.inventory.api.model.Resource> predicate) |
protected org.hawkular.inventory.api.model.Resource |
getResource(String listPath,
Predicate<org.hawkular.inventory.api.model.Resource> predicate,
int attemptCount,
long attemptDelay) |
protected List<org.hawkular.inventory.api.model.Resource> |
getResources(String path,
int minCount) |
protected List<org.hawkular.inventory.api.model.Resource> |
getResources(String path,
int minCount,
int attemptCount,
long attemptDelay) |
protected org.hawkular.inventory.api.model.ResourceType |
getResourceType(String path,
int attemptCount,
long attemptDelay) |
protected Map<String,org.hawkular.inventory.api.model.StructuredData> |
getStructuredData(String path,
int attemptCount,
long attemptDelay) |
protected String |
getTenantId()
Subclass tests can override this if they are putting things in other tenants.
|
protected File |
getTestApplicationFile() |
protected String |
getWithRetries(String url) |
protected String |
getWithRetries(String url,
int attemptCount,
long attemptDelay) |
protected okhttp3.Request.Builder |
newAuthRequest() |
protected static org.jboss.as.controller.client.ModelControllerClient |
newHawkularModelControllerClient() |
protected static org.jboss.as.controller.client.ModelControllerClient |
newModelControllerClient(String host,
int managementPort) |
protected static org.jboss.as.controller.client.ModelControllerClient |
newPlainWildFlyModelControllerClient(WildFlyClientConfig config) |
static String |
readNode(Class<?> caller,
String nodeFileName) |
protected void |
waitForAccountsAndInventory() |
protected boolean |
waitForAgent(org.jboss.as.controller.client.ModelControllerClient mcc) |
protected boolean |
waitForAgent(org.jboss.as.controller.client.ModelControllerClient mcc,
Address agentAddress) |
static void |
writeNode(Class<?> caller,
org.jboss.dmr.ModelNode node,
String nodeFileName) |
protected void |
writeNodeAttribute(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
String attributeName,
Integer value) |
protected void |
writeNodeAttribute(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
String attributeName,
String value) |
protected static final int ATTEMPT_COUNT
protected static final long ATTEMPT_DELAY
protected static final String authentication
protected static final String baseMetricsUri
protected static final String baseGwUri
protected static final String baseInvUri
protected static final String hawkularHost
protected static final int hawkularHttpPort
protected static final String managementPasword
protected static final int hawkularManagementPort
protected static final String managementUser
protected static final String testPasword
protected static final String testUser
protected static final String authHeader
protected static final String hawkularFeedId
protected static final File wfHome
protected static final Object waitForAccountsLock
protected static final Object waitForAgentLock
protected okhttp3.OkHttpClient client
protected com.fasterxml.jackson.databind.ObjectMapper mapper
public static String readNode(Class<?> caller, String nodeFileName) throws IOException
IOExceptionpublic static void writeNode(Class<?> caller, org.jboss.dmr.ModelNode node, String nodeFileName) throws UnsupportedEncodingException, FileNotFoundException
public void before()
public void after()
protected String getNodeAttribute(org.jboss.as.controller.client.ModelControllerClient mcc, org.jboss.dmr.ModelNode addressActual, String attributeName)
protected void writeNodeAttribute(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
String attributeName,
String value)
protected void writeNodeAttribute(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
String attributeName,
Integer value)
protected void assertNodeAttributeEquals(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
String attributeName,
String expectedAttributeValue)
protected void assertNodeEquals(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
Class<?> caller,
String expectedNodeFileName)
protected void assertNodeEquals(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode addressActual,
Class<?> caller,
String expectedNodeFileName,
boolean saveActual)
protected void assertResourceCount(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode address,
String childType,
int expectedCount)
throws IOException
IOExceptionprotected void assertResourceExists(org.jboss.as.controller.client.ModelControllerClient mcc,
org.jboss.dmr.ModelNode address,
boolean expectedExists)
throws IOException
IOExceptionprotected org.hawkular.inventory.api.model.Resource getResource(String listPath, Predicate<org.hawkular.inventory.api.model.Resource> predicate) throws Throwable
Throwableprotected org.hawkular.inventory.api.model.Resource getResource(String listPath, Predicate<org.hawkular.inventory.api.model.Resource> predicate, int attemptCount, long attemptDelay) throws Throwable
Throwableprotected List<org.hawkular.inventory.api.model.Resource> getResources(String path, int minCount) throws Throwable
Throwableprotected List<org.hawkular.inventory.api.model.Resource> getResources(String path, int minCount, int attemptCount, long attemptDelay) throws Throwable
Throwableprotected org.hawkular.inventory.api.model.ResourceType getResourceType(String path, int attemptCount, long attemptDelay) throws Throwable
Throwableprotected org.hawkular.inventory.api.model.OperationType getOperationType(String path, int attemptCount, long attemptDelay) throws Throwable
Throwableprotected org.hawkular.inventory.api.model.DataEntity getDataEntity(String path, int attemptCount, long attemptDelay) throws Throwable
Throwableprotected Map<String,org.hawkular.inventory.api.model.StructuredData> getStructuredData(String path, int attemptCount, long attemptDelay) throws Throwable
Throwableprotected String getWithRetries(String url, int attemptCount, long attemptDelay) throws Throwable
Throwableprotected void assertResourceNotInInventory(String listPath, Predicate<org.hawkular.inventory.api.model.Resource> predicate, int attemptCount, long attemptDelay) throws Throwable
Throwableprotected okhttp3.Request.Builder newAuthRequest()
protected String getTenantId()
protected static WildFlyClientConfig getPlainWildFlyClientConfig()
protected static org.jboss.as.controller.client.ModelControllerClient newHawkularModelControllerClient()
protected static org.jboss.as.controller.client.ModelControllerClient newPlainWildFlyModelControllerClient(WildFlyClientConfig config)
#getPlainWildFlyConfig()protected static org.jboss.as.controller.client.ModelControllerClient newModelControllerClient(String host, int managementPort)
protected Collection<String> getDMRChildrenNames(WildFlyClientConfig config, String childTypeName, org.jboss.as.controller.PathAddress parentAddress)
config - if null, uses newHawkularModelControllerClient(), or creates
connector to newPlainWildFlyModelControllerClient(WildFlyClientConfig)childTypeName - the DMR name of the child typeparentAddress - the parent whose children are to be returnedprotected void waitForAccountsAndInventory()
throws Throwable
Throwableprotected boolean waitForAgent(org.jboss.as.controller.client.ModelControllerClient mcc)
throws Throwable
Throwableprotected boolean waitForAgent(org.jboss.as.controller.client.ModelControllerClient mcc,
Address agentAddress)
throws Throwable
Throwableprotected org.jboss.dmr.ModelNode getAgentInventoryReport(String host, int managementPort)
protected org.hawkular.inventory.paths.CanonicalPath getHawkularWildFlyServerResourcePath()
throws Throwable
CanonicalPath of the only WildFly server present in inventory under the hawkular feed.
This is the Hawkular Server itself.Throwableprotected org.hawkular.inventory.paths.CanonicalPath getHostController(WildFlyClientConfig hostControllerClientConfig) throws Throwable
CanonicalPath of the only WildFly Host Controller present in inventory under the feed
found in the given client config.Throwableprotected File getTestApplicationFile()
Copyright © 2015–2017 Red Hat, Inc.. All rights reserved.