Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Commit dddeba9

Browse files
author
Andres Pegam
committed
warnings and javadoc
1 parent b0ac8c9 commit dddeba9

31 files changed

+237
-24
lines changed

example-project/src/main/java/io/wcm/qa/galenium/example/pageobjects/ConferencePage.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
public class ConferencePage extends AbstractPage {
2626

27+
/**
28+
* Relative path to conference page.
29+
*/
2730
public static final String PATH_TO_CONFERENCE = "/en/conference.html";
2831

2932
@Override

example-project/src/main/java/io/wcm/qa/galenium/example/pageobjects/Homepage.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
public class Homepage extends AbstractPage {
2626

27+
/**
28+
* Relative path to home page.
29+
*/
2730
public static final String PATH_TO_HOMEPAGE = "/en.html";
2831

2932
@Override

galenium/src/main/java/io/wcm/qa/galenium/exceptions/GaleniumException.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,19 @@ public class GaleniumException extends RuntimeException {
2626

2727
private static final long serialVersionUID = 7561233675534113771L;
2828

29+
/**
30+
* @param msg message for exception
31+
*/
2932
public GaleniumException(String msg) {
3033
super(msg);
3134
}
3235

33-
public GaleniumException(String message, Throwable ex) {
34-
super(message, ex);
36+
/**
37+
* @param msg message for exception
38+
* @param ex optional exception
39+
*/
40+
public GaleniumException(String msg, Throwable ex) {
41+
super(msg, ex);
3542
}
3643

3744
}

galenium/src/main/java/io/wcm/qa/galenium/listeners/DefaultGaleniumListener.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,23 @@ public class DefaultGaleniumListener extends TestListenerAdapter {
3939

4040
private List<ITestListener> listeners = new ArrayList<ITestListener>();
4141

42+
/**
43+
* Constructor.
44+
*/
4245
public DefaultGaleniumListener() {
4346
add(new LoggingListener());
4447
add(new ExtentReportsListener());
4548
add(new WebDriverListener());
4649
add(new TextSamplePersistenceListener());
4750
}
4851

49-
public boolean add(ITestListener e) {
50-
return listeners.add(e);
52+
/**
53+
* Adds an additional test listener.
54+
* @param listener to add
55+
* @return true
56+
*/
57+
public boolean add(ITestListener listener) {
58+
return listeners.add(listener);
5159
}
5260

5361
@Override

galenium/src/main/java/io/wcm/qa/galenium/listeners/ExtentReportsListener.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
import io.wcm.qa.galenium.util.TestDevice;
4040
import io.wcm.qa.galenium.webdriver.WebDriverManager;
4141

42-
42+
/**
43+
* Handles {@link ExtentReports} life cycle.
44+
*/
4345
public class ExtentReportsListener implements ITestListener, IConfigurationListener2 {
4446

4547
@Override

galenium/src/main/java/io/wcm/qa/galenium/listeners/WebDriverListener.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import static io.wcm.qa.galenium.util.GaleniumConfiguration.isSuppressAutoAdjustBrowserSize;
2626
import static io.wcm.qa.galenium.util.GaleniumContext.getDriver;
2727

28+
import org.openqa.selenium.WebDriver;
2829
import org.slf4j.Logger;
2930
import org.slf4j.Marker;
3031
import org.slf4j.MarkerFactory;
@@ -42,7 +43,9 @@
4243
import io.wcm.qa.galenium.util.TestInfoUtil;
4344
import io.wcm.qa.galenium.webdriver.WebDriverManager;
4445

45-
46+
/**
47+
* Handles {@link WebDriver} life cycle in single and multi threaded scenarios.
48+
*/
4649
public class WebDriverListener implements ITestListener {
4750

4851
private static final Marker MARKER_WEBDRIVER = MarkerFactory.getMarker("webdriver");

galenium/src/main/java/io/wcm/qa/galenium/providers/TestNgProviderUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* Utility class to help with writing {@link DataProvider} code.
3030
*/
31-
final public class TestNgProviderUtil {
31+
public final class TestNgProviderUtil {
3232

3333
private TestNgProviderUtil() {
3434
// do not instantiate

galenium/src/main/java/io/wcm/qa/galenium/reporting/GaleniumReportUtil.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,20 @@ public static void addGalenResult(GalenTestInfo galenTestInfo) {
122122
}
123123
}
124124

125+
/**
126+
* Assigns categories to {@link ExtentTest}.
127+
* @param categories to add
128+
*/
125129
public static void assignCategories(String... categories) {
126130
for (String category : categories) {
127131
assignCategory(category);
128132
}
129133
}
130134

135+
/**
136+
* Assigns a single category to {@link ExtentTest}.
137+
* @param category to add
138+
*/
131139
public static void assignCategory(String category) {
132140
ExtentTest extentTest = getExtentTest();
133141
List<TestAttribute> categoryList = extentTest.getTest().getCategoryList();
@@ -220,10 +228,18 @@ public static ExtentTest getExtentTest(String name) {
220228
return currentReport;
221229
}
222230

231+
/**
232+
* Gets a logger which marks every entry with the passed {@link Marker}.
233+
* @param marker to use with this logger
234+
* @return a {@link MarkedLogger} using the marker
235+
*/
223236
public static Logger getMarkedLogger(Marker marker) {
224237
return new MarkedLogger(getLogger(), marker);
225238
}
226239

240+
/**
241+
* @return the logger used for the current test, if no test is set, it will use "NO_TEST_NAME_SET" as the test name
242+
*/
227243
public static Logger getLogger() {
228244
String name = "NO_TEST_NAME_SET";
229245
ExtentTest extentTest = getExtentTest();

galenium/src/main/java/io/wcm/qa/galenium/reporting/MarkedLogger.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@
2323
import org.slf4j.Marker;
2424
import org.slf4j.MarkerFactory;
2525

26+
/**
27+
* Wraps a {@link Logger} in a way that marks every statement with the configured additional marker.
28+
*/
2629
public class MarkedLogger implements Logger {
2730

2831
private Logger delegate;
2932
private Marker markerToAdd;
3033

34+
/**
35+
* @param delegateLogger logger to wrap
36+
* @param additionalMarker marker to use
37+
*/
3138
public MarkedLogger(Logger delegateLogger, Marker additionalMarker) {
3239
delegate = delegateLogger;
3340
markerToAdd = additionalMarker;

galenium/src/main/java/io/wcm/qa/galenium/sampling/differences/DifferenceNameComparator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121

2222
import java.util.Comparator;
2323

24-
24+
/**
25+
* Sort differences by their name.
26+
*/
2527
public class DifferenceNameComparator implements Comparator<Difference> {
2628

2729
@Override

0 commit comments

Comments
 (0)