[java-idp-integration-tests] branch main updated: Log test class and method names
Tom Zeller
tzeller at dragonacea.biz
Wed Jun 23 00:45:08 UTC 2021
This is an automated email from the git hooks/post-receive script.
tzeller pushed a commit to branch main
in repository java-idp-integration-tests.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=fb73882df42423b822c9017773e3447a8097dd5e
The following commit(s) were added to refs/heads/main by this push:
new fb73882 Log test class and method names
fb73882 is described below
commit fb73882df42423b822c9017773e3447a8097dd5e
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Tue Jun 22 19:44:54 2021 -0500
Log test class and method names
---
.../shibboleth/idp/test/BaseIntegrationTest.java | 2 +-
.../net/shibboleth/idp/test/TestNameLogger.java | 73 ++++++++++++++++++++++
2 files changed, 74 insertions(+), 1 deletion(-)
diff --git a/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java b/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
index 9fffcc2..f46f55f 100644
--- a/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
@@ -177,7 +177,7 @@ import com.saucelabs.testng.SauceOnDemandAuthenticationProvider;
* See {@link org.openqa.selenium.Platform}. Or, configure a new TestNG data provider.
* </p>
*/
- at Listeners({CustomSauceOnDemandTestListener.class})
+ at Listeners({TestNameLogger.class, CustomSauceOnDemandTestListener.class})
public abstract class BaseIntegrationTest
implements SauceOnDemandSessionIdProvider, SauceOnDemandAuthenticationProvider {
diff --git a/src/test/java/net/shibboleth/idp/test/TestNameLogger.java b/src/test/java/net/shibboleth/idp/test/TestNameLogger.java
new file mode 100644
index 0000000..c16769f
--- /dev/null
+++ b/src/test/java/net/shibboleth/idp/test/TestNameLogger.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.test;
+
+import javax.annotation.Nonnull;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.ITestContext;
+import org.testng.ITestListener;
+import org.testng.ITestResult;
+
+/**
+ * Log test class and method names.
+ */
+public class TestNameLogger implements ITestListener {
+
+ /** Class logger. */
+ @Nonnull
+ private final Logger log = LoggerFactory.getLogger(TestNameLogger.class);
+
+ /** {@inheritDoc} */
+ public void onStart(ITestContext context) {
+ ITestListener.super.onStart(context);
+ log.info("Test start class {}", context.getAllTestMethods()[0].getTestClass().getName());
+ }
+
+ /** {@inheritDoc} */
+ public void onFinish(ITestContext context) {
+ ITestListener.super.onFinish(context);
+ log.info("Test finish class {}", context.getAllTestMethods()[0].getTestClass().getName());
+ }
+
+ /** {@inheritDoc} */
+ public void onTestStart(ITestResult result) {
+ ITestListener.super.onTestStart(result);
+ log.info("Test start {}", result.getMethod().getQualifiedName());
+ }
+
+ /** {@inheritDoc} */
+ public void onTestSuccess(ITestResult result) {
+ ITestListener.super.onTestSuccess(result);
+ log.info("Test success {}", result.getMethod().getQualifiedName());
+ }
+
+ /** {@inheritDoc} */
+ public void onTestFailure(ITestResult result) {
+ ITestListener.super.onTestFailure(result);
+ log.info("Test failure {}", result.getMethod().getQualifiedName());
+ }
+
+ /** {@inheritDoc} */
+ public void onTestSkipped(ITestResult result) {
+ ITestListener.super.onTestSkipped(result);
+ log.info("Test skipped {}", result.getMethod().getQualifiedName());
+ }
+
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list