Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serenity.compromised.on with SQLException doesn't work? #2394

Closed
aspenboy opened this issue Feb 22, 2021 · 0 comments
Closed

serenity.compromised.on with SQLException doesn't work? #2394

aspenboy opened this issue Feb 22, 2021 · 0 comments

Comments

@aspenboy
Copy link

I'm trying to use serenity.compromised.on property in my serenity.conf file to report SQL-related errors as compromised in the report. Part of my config file looks like this:

serenity {
  project.name = "e2e tests"
  tag.failures = "true"
  linked.tags = "issue"
  restart.browser.for.each = scenario
  jquery.integration = true
  take.screenshots = AFTER_EACH_STEP
  timeout = 20000
  logging = NORMAL
  compromised.on = ["java.sql.SQLNonTransientConnectionException", "java.sql.SQLException"]
  console.colors = true
  reports=single-page-html
}

This leads to following exception:

[2021-02-22 14:11:31] WARN  FailureAnalysisConfiguration - Could not find error class: [
    # C:\(...)\test-ui-e2e\.\src\test\resources\serenity.conf: 36
    "java.sql.SQLNonTransientConnectionException"([
    # C:\(...)\test-ui-e2e\/\src\test\resources\serenity/conf: 36
    "java/sql/SQLNonTransientConnectionException")
java.lang.ClassNotFoundException: [
    # C:\(...)\test-ui-e2e\/\src\test\resources\serenity/conf: 36
    "java/sql/SQLNonTransientConnectionException"
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:333)
	at net.thucydides.core.model.failures.FailureAnalysisConfiguration.typesDefinedIn(FailureAnalysisConfiguration.java:146)

and similar exception for java.sql.SQLException.

I'm not sure how should I pass the values to compromised.on property. I tried also like this:

compromised.on = "java.sql.SQLNonTransientConnectionException", "java.sql.SQLException"

or like this:

compromised.on = java.sql.SQLNonTransientConnectionException, java.sql.SQLException

or like this:

compromised.on = "java.sql.SQLNonTransientConnectionException"

But nothing works. The last approach doesn't bring Could not find error class exception, but test is not reported as compromised.

How can I make this work?

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants