Permalink
Browse files

Reverted jgrapht library, and fixed some more checkstyle issues

  • Loading branch information...
mcasperson committed Jan 4, 2018
1 parent 26c2e12 commit b23f55bc52efe0419bc23f2ebf0d7892e0ebe424
Showing with 134 additions and 135 deletions.
  1. +1 −7 build.gradle
  2. BIN lib/zap-2.5.0.jar
  3. +2 −1 src/main/java/au/com/agic/apptesting/Main.java
  4. +6 −2 src/main/java/au/com/agic/apptesting/State.java
  5. +7 −7 src/main/java/au/com/agic/apptesting/TestRunner.java
  6. +1 −1 src/main/java/au/com/agic/apptesting/aspects/EarlyExitAspect.java
  7. +2 −2 src/main/java/au/com/agic/apptesting/steps/AGStepDefinitions.java
  8. +12 −12 src/main/java/au/com/agic/apptesting/steps/ClickingStepDefinitions.java
  9. +2 −2 src/main/java/au/com/agic/apptesting/steps/CustomEventStepDefinitions.java
  10. +5 −5 src/main/java/au/com/agic/apptesting/steps/DataExtractionStepDefinitions.java
  11. +4 −4 src/main/java/au/com/agic/apptesting/steps/DebuggingStepDefinitions.java
  12. +4 −4 src/main/java/au/com/agic/apptesting/steps/DropDownStepDefinitions.java
  13. +2 −2 src/main/java/au/com/agic/apptesting/steps/FocusStepDefinitions.java
  14. +2 −2 src/main/java/au/com/agic/apptesting/steps/JavaScriptStepDefinitions.java
  15. +11 −11 src/main/java/au/com/agic/apptesting/steps/KeyEventSetpDefinitions.java
  16. +1 −1 src/main/java/au/com/agic/apptesting/steps/ModifyAttributeDefinitions.java
  17. +4 −4 src/main/java/au/com/agic/apptesting/steps/NavigationStepDefinitions.java
  18. +3 −3 src/main/java/au/com/agic/apptesting/steps/OpenStepDefinitions.java
  19. +1 −1 src/main/java/au/com/agic/apptesting/steps/ProxyStepDefinitions.java
  20. +2 −2 src/main/java/au/com/agic/apptesting/steps/ScrollStepDefinitions.java
  21. +2 −2 src/main/java/au/com/agic/apptesting/steps/StepEventHandling.java
  22. +3 −3 src/main/java/au/com/agic/apptesting/steps/TabAndWindowStepDefinition.java
  23. +13 −13 src/main/java/au/com/agic/apptesting/steps/TextEntryStepDefinitions.java
  24. +17 −17 src/main/java/au/com/agic/apptesting/steps/ValidationStepDefinitions.java
  25. +14 −14 src/main/java/au/com/agic/apptesting/steps/WaitStepDefinitions.java
  26. +1 −1 src/main/java/au/com/agic/apptesting/utils/FeatureState.java
  27. +3 −3 src/main/java/au/com/agic/apptesting/utils/impl/BrowserInteropUtilsImpl.java
  28. +2 −2 src/main/java/au/com/agic/apptesting/utils/impl/RemoteTestsUtilsImpl.java
  29. +1 −1 src/main/java/au/com/agic/apptesting/utils/impl/ScreenshotUtilsImpl.java
  30. +6 −6 src/main/java/au/com/agic/apptesting/utils/impl/SimpleWebElementInteractionImpl.java
  31. BIN src/main/resources-full/zap/plugin/fuzzdb-release-4.zap
View
@@ -33,11 +33,6 @@ buildScan {
licenseAgree = 'yes'
}
/*
Define the URL to the internal Nexus instance
*/
def nexusProxy = 'http://prod-vm-fv-ag-snx-x1.budgetdirect.com.au:8081/nexus/content/groups/public'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'application'
@@ -113,7 +108,6 @@ processResources {
}
repositories {
maven { url nexusProxy }
mavenCentral()
mavenLocal()
}
@@ -257,7 +251,7 @@ dependencies {
compile group: 'org.jdom', name: 'jdom', version: '1.1.3'
compile group: 'net.htmlparser.jericho', name: 'jericho-html', version: '3.4'
compile group: 'org.jfree', name: 'jfreechart', version: '1.5.0'
compile group: 'org.jgrapht', name: 'jgrapht-core', version: '1.1.0'
compile group: 'org.jgrapht', name: 'jgrapht-core', version: '0.9.2'
compile group: 'com.sun.woodstock.dependlibs', name: 'jh', version: '2.0'
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.4', classifier: 'jdk15'
compile group: 'com.yuvimasory', name: 'orange-extensions', version: '1.3.0'
View
Binary file not shown.
@@ -25,6 +25,7 @@
private static final Logger LOGGER = LoggerFactory.getLogger(Main.class);
private static final SystemPropertyUtils SYSTEM_PROPERTY_UTILS = new SystemPropertyUtilsImpl();
private static final int MILLIS_PER_SECOND = 1000;
private static final int MAX_EXECUTION_TIME_CODE = -2;
/**
* Used to name threads that might be reused
*/
@@ -138,7 +139,7 @@ private static void createShutdownTimer() {
LOGGER.error(
"WEBAPPTESTER-INFO-0011: "
+ "Iridium was shut down because it ran longer than the maximum execution time of " + maxExecutionTime + " seconds");
System.exit(-2);
System.exit(MAX_EXECUTION_TIME_CODE);
} catch (final Exception ex) {
LOGGER.error(
"WEBAPPTESTER-BUG-0009: The shutdown timer threw an exception", ex);
@@ -14,7 +14,7 @@
*/
public final class State {
public static ThreadWebDriverMap threadDesiredCapabilityMap;
private static ThreadWebDriverMap threadDesiredCapabilityMap;
private static final SystemPropertyUtils SYSTEM_PROPERTY_UTILS = new SystemPropertyUtilsImpl();
public static void initialise() {
@@ -28,7 +28,11 @@ private State() {
}
public static FeatureState getFeatureStateForThread() {
return threadDesiredCapabilityMap.getDesiredCapabilitiesForThread(
return getThreadDesiredCapabilityMap().getDesiredCapabilitiesForThread(
Thread.currentThread().getName());
}
public static ThreadWebDriverMap getThreadDesiredCapabilityMap() {
return threadDesiredCapabilityMap;
}
}
@@ -168,7 +168,7 @@ private void init(
State.initialise();
State.threadDesiredCapabilityMap.initialise(
State.getThreadDesiredCapabilityMap().initialise(
DESIRED_CAPABILITIES_LOADER.getCapabilities(),
APPLICATION_URL_LOADER.getAppUrls(appName),
APPLICATION_URL_LOADER.getDatasets(),
@@ -224,8 +224,8 @@ private void runScripts(@NotNull final String reportDirectory, @NotNull final Li
/*
For each combination of browser and url run a test
*/
LOGGER.info("Running " + State.threadDesiredCapabilityMap.getNumberCapabilities() + " test combinations");
for (int i = 0; i < State.threadDesiredCapabilityMap.getNumberCapabilities(); ++i) {
LOGGER.info("Running " + State.getThreadDesiredCapabilityMap().getNumberCapabilities() + " test combinations");
for (int i = 0; i < State.getThreadDesiredCapabilityMap().getNumberCapabilities(); ++i) {
/*
For those first few threads that are execute immediately, add a small offset.
Obviously this doesn't have any impact as the thread pool is used up,
@@ -246,7 +246,7 @@ private void runScripts(@NotNull final String reportDirectory, @NotNull final Li
/*
Wait for the thread to finish
*/
while (completed != State.threadDesiredCapabilityMap.getNumberCapabilities()) {
while (completed != State.getThreadDesiredCapabilityMap().getNumberCapabilities()) {
try {
Thread.sleep(THREAD_COMPLETE_SLEEP);
} catch (final Exception ignored) {
@@ -265,7 +265,7 @@ private void runScripts(@NotNull final String reportDirectory, @NotNull final Li
LOGGER.info("Report files can be found in {}", reportDirectory);
} finally {
State.threadDesiredCapabilityMap.shutdown();
State.getThreadDesiredCapabilityMap().shutdown();
FileUtils.deleteQuietly(testPath);
SCREEN_CAPTURE.stop();
}
@@ -335,7 +335,7 @@ public void run() {
Get the details for this thread
*/
final FeatureState featureState =
State.threadDesiredCapabilityMap.getDesiredCapabilitiesForThread(
State.getThreadDesiredCapabilityMap().getDesiredCapabilitiesForThread(
Thread.currentThread().getName());
/*
@@ -431,7 +431,7 @@ public void run() {
/*
Clean up this web driver so we don't hold windows open
*/
State.threadDesiredCapabilityMap.shutdown(Thread.currentThread().getName());
State.getThreadDesiredCapabilityMap().shutdown(Thread.currentThread().getName());
++completed;
}
@@ -22,7 +22,7 @@
@Around("execution(public void au.com.agic.apptesting.steps..*(..))")
public void aroundStep(final ProceedingJoinPoint joinPoint) throws Throwable {
final FeatureState featureState =
State.threadDesiredCapabilityMap.getDesiredCapabilitiesForThread();
State.getThreadDesiredCapabilityMap().getDesiredCapabilitiesForThread();
if (!featureState.getSkipSteps()) {
joinPoint.proceed();
@@ -45,7 +45,7 @@
*/
@When("I autoselect the post code of( alias)? \"([^\"]*)\"")
public void autoselectPostcode(final String alias, final String postcode) {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final String postcodeValue = autoAliasUtils.getValue(
postcode, StringUtils.isNotBlank(alias), State.getFeatureStateForThread());
@@ -91,7 +91,7 @@ public void clickElementWithDatepicker(
final String value = autoAliasUtils.getValue(
attributeValue, StringUtils.isNotBlank(attributeValueAlias), State.getFeatureStateForThread());
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
LocalDate theDate = LocalDate.now();
int today = theDate.getDayOfMonth();
@@ -75,7 +75,7 @@ public void clickElementSimpleStep(
try {
final Integer fixedTimes = countConverter.convertCountToInteger(timesAlias, times);
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final JavascriptExecutor js = (JavascriptExecutor) webDriver;
final WebElement element = simpleWebElementInteraction.getClickableElementFoundBy(
@@ -138,7 +138,7 @@ public void clickElementStep(
try {
final Integer fixedTimes = countConverter.convertCountToInteger(timesAlias, times);
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final By by = getBy.getBy(
selector,
StringUtils.isNotBlank(alias),
@@ -206,7 +206,7 @@ public void clickSimpleHiddenElementStep(
try {
final Integer fixedTimes = countConverter.convertCountToInteger(timesAlias, times);
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final WebElement element = simpleWebElementInteraction.getClickableElementFoundBy(
StringUtils.isNotBlank(alias),
selectorValue,
@@ -262,7 +262,7 @@ public void clickHiddenElementStep(
try {
final Integer fixedTimes = countConverter.convertCountToInteger(timesAlias, times);
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final By by = getBy.getBy(
selector,
StringUtils.isNotBlank(alias),
@@ -325,7 +325,7 @@ public void clickLinkStep(
checkState(text != null, "the aliased link content does not exist");
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
for (int i = 0; i < fixedTimes; ++i) {
final WebElement element = browserInteropUtils.getLinkByText(webDriver, text);
@@ -384,7 +384,7 @@ public void clickHiddenLinkStep(
checkState(text != null, "the aliased link content does not exist");
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
for (int i = 0; i < fixedTimes; ++i) {
final RetryTemplate template = new RetryTemplate();
@@ -467,7 +467,7 @@ public void clickElementWithRandomNumberStep(
final Integer random = SecureRandom.getInstance("SHA1PRNG").nextInt(
Math.abs(int2 - int1)) + Math.min(int1, int2);
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final WebDriverWait wait = new WebDriverWait(
webDriver,
State.getFeatureStateForThread().getDefaultWait(),
@@ -532,7 +532,7 @@ public void clickElementWithAttrStep(
final String value = autoAliasUtils.getValue(
attributeValue, StringUtils.isNotBlank(attributeValueAlias), State.getFeatureStateForThread());
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
for (int i = 0; i < fixedTimes; ++i) {
final WebDriverWait wait = new WebDriverWait(
@@ -578,7 +578,7 @@ public void clickOKOnAlert(
try {
final Integer fixedTimes = countConverter.convertCountToInteger(timesAlias, times);
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
for (int i = 0; i < fixedTimes; ++i) {
browserInteropUtils.acceptAlert(webDriver);
@@ -609,7 +609,7 @@ public void clickCancelOnAlert(
try {
final Integer fixedTimes = countConverter.convertCountToInteger(timesAlias, times);
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
for (int i = 0; i < fixedTimes; ++i) {
browserInteropUtils.cancelAlert(webDriver);
@@ -649,7 +649,7 @@ public void clickInElement(
try {
final Integer fixedTimes = countConverter.convertCountToInteger(timesAlias, times);
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final JavascriptExecutor js = (JavascriptExecutor) webDriver;
for (int i = 0; i < fixedTimes; ++i) {
@@ -731,7 +731,7 @@ public void openInNewWindow(
checkState(text != null, "the aliased link content does not exist");
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
for (int i = 0; i < fixedTimes; ++i) {
final WebDriverWait wait = new WebDriverWait(
@@ -68,7 +68,7 @@ public void triggetCustom(
selectorValue,
State.getFeatureStateForThread());
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final JavascriptExecutor js = (JavascriptExecutor) webDriver;
js.executeScript("var ev = document.createEvent('HTMLEvents');"
+ " ev.initEvent("
@@ -106,7 +106,7 @@ public void triggetCustom(
final String selectorValue,
final String exists) {
try {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final By by = getBy.getBy(selector, StringUtils.isNotBlank(alias), selectorValue, State.getFeatureStateForThread());
final WebDriverWait wait = new WebDriverWait(
webDriver,
@@ -154,7 +154,7 @@ public void saveAttributeContent(
final String destinationAlias,
final String exists) {
try {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final By by = getBy.getBy(
selector,
StringUtils.isNotBlank(alias),
@@ -236,7 +236,7 @@ public void saveTextContent(
final String destinationAlias,
final String exists) {
try {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final By by = getBy.getBy(
selector,
StringUtils.isNotBlank(alias),
@@ -285,7 +285,7 @@ public void saveSimpleHiddenTextContent(
selectorValue,
State.getFeatureStateForThread());
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final JavascriptExecutor js = (JavascriptExecutor) webDriver;
final String text = js.executeScript(
"return arguments[0].textContent.trim();",
@@ -326,7 +326,7 @@ public void saveHiddenTextContent(
final String destinationAlias,
final String exists) {
try {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final By by = getBy.getBy(
selector,
StringUtils.isNotBlank(alias),
@@ -365,7 +365,7 @@ public void saveSelectedTextContent(
final String exists) {
try {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final By by = getBy.getBy(
selector,
@@ -46,7 +46,7 @@ public void takeScreenshotStep(final String filename) {
*/
@When("^I dump the value of the cookie called \"(.*?)\"$")
public void dumpCookieName(final String cookieName) {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
webDriver.manage().getCookies().stream()
.filter(e -> StringUtils.equals(cookieName, e.getName()))
.forEach(e -> LOGGER.info("Dumping cookie {}", e));
@@ -61,7 +61,7 @@ public void dumpCookieName(final String cookieName) {
*/
@When("^I delete cookies called \"(.*?)\"(?: with the path \"(.*?)\")?$")
public void deleteCookie(final String cookieName, final String path) {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final List<Cookie> deleteCookies = webDriver.manage().getCookies().stream()
.filter(e -> StringUtils.equals(cookieName, e.getName()))
.filter(e -> StringUtils.isBlank(path) || StringUtils.equals(path, e.getPath()))
@@ -79,7 +79,7 @@ public void deleteCookie(final String cookieName, final String path) {
*/
@When("^I delete all cookies$")
public void deleteAllCookie() {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
webDriver.manage().deleteAllCookies();
}
@@ -111,7 +111,7 @@ public void dumpIndividualAlias(final String alias) {
*/
@When("I display a starting marker$")
public void displayStartingMarker() {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final JavascriptExecutor js = (JavascriptExecutor) webDriver;
js.executeScript("javascript:window.document.body.innerHTML = "
+ "'<div style=\"margin: 50px; font-size: 20px\">Starting</div>'");
@@ -73,7 +73,7 @@ public void selectSimpleDropDownListItemStep(
final String exists) {
try {
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final String selection = autoAliasUtils.getValue(
itemName, StringUtils.isNotBlank(itemAlias), State.getFeatureStateForThread());
@@ -135,7 +135,7 @@ public void selectDropDownListItemStep(
StringUtils.isNotBlank(alias),
selectorValue,
State.getFeatureStateForThread());
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final WebDriverWait wait = new WebDriverWait(
webDriver,
State.getFeatureStateForThread().getDefaultWait(),
@@ -185,7 +185,7 @@ public void selectSimpleDropDownListIndexStep(
checkState(selection != null, "the aliased item index does not exist");
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final WebElement element = simpleWebElementInteraction.getClickableElementFoundBy(
StringUtils.isNotBlank(alias),
@@ -242,7 +242,7 @@ public void selectDropDownListIndexStep(
StringUtils.isNotBlank(alias),
selectorValue,
State.getFeatureStateForThread());
final WebDriver webDriver = State.threadDesiredCapabilityMap.getWebDriverForThread();
final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread();
final WebDriverWait wait = new WebDriverWait(
webDriver,
State.getFeatureStateForThread().getDefaultWait(),
Oops, something went wrong.

0 comments on commit b23f55b

Please sign in to comment.