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

refactor: changes to close ELY-2595,2596,2597,2603,2605,2606,2607 #1996

Merged
merged 7 commits into from
Oct 12, 2023

Conversation

abhishek-nigam
Copy link
Contributor

This makes some refactoring changes to close the following tickets:

Copy link
Contributor

@fjuma fjuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @abhishek-nigam, welcome to the WildFly Elytron project! Thank you very much for your contribution!

It's good practice to have one commit per ELY issue (this makes it easier for us to review and verify changes).

Would you be able to update this PR so that it has 7 commits (one for each of the ELY issues you have listed in the description)? If you prefer, another option would be to submit a separate PR for each issue.

There's also a useful post here on how to split a commit in case it helps:
https://emmanuelbernard.com/blog/2014/04/14/split-a-commit-in-two-with-git/

Feel free to let us know if you have any questions about this.

Thanks!

@abhishek-nigam abhishek-nigam force-pushed the refactoring-1 branch 3 times, most recently from 42ca09c to 5921b39 Compare October 6, 2023 19:27
@abhishek-nigam
Copy link
Contributor Author

Hi @fjuma Thank you for welcoming my contribution. As instructed, I have split up my commit into 7 commits in which each tackles an ELY issue. Please let me know if any other change is required from my end, I'll be happy to do them.

Also, I want to mention that I haven't been able to successfully run mvn clean install on my local just yet. I'm not sure if these are due to my changes or if it's due to me not having configured MVN settings/configuration correctly. In README it's mentioned to setup JBOSS MVN repository using setting.xml, but I didn't quite understand how to do that. I am guessing that it might be due to it.

Here is the error output I'm getting:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.wildfly.security.ssl.CipherSuiteSelectorTest
Tests run: 32, Failures: 0, Errors: 32, Skipped: 0, Time elapsed: 0.783 sec <<< FAILURE! - in org.wildfly.security.ssl.CipherSuiteSelectorTest
testSingleSuiteUsingOpensslName(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.492 sec  <<< ERROR!
java.lang.ExceptionInInitializerError
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testSingleSuiteUsingOpensslName(CipherSuiteSelectorTest.java:103)
Caused by: java.lang.IllegalArgumentException: Logger implementation class org.wildfly.security.ssl.ElytronMessages_$logger could not be instantiated
        at org.jboss.logging.Logger.doGetMessageLogger(Logger.java:2579)
        at org.jboss.logging.Logger.getMessageLogger(Logger.java:2530)
        at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516)
        at org.wildfly.security.ssl.ElytronMessages.<clinit>(ElytronMessages.java:56)
        ... 3 more
Caused by: java.lang.Error: Unresolved compilation problems: 
        The type javax.annotation.Generated is not accessible
        Generated cannot be resolved to a type

        at org.wildfly.security.ssl.ElytronMessages_$logger.<init>(ElytronMessages_$logger.java:6)
        at org.jboss.logging.Logger.doGetMessageLogger(Logger.java:2573)
        ... 6 more

testNotRsaAfterRsa(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.004 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testNotRsaAfterRsa(CipherSuiteSelectorTest.java:205)

testInvalidFormatCipherSuites(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.003 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.fromNamesString(CipherSuiteSelector.java:516)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testInvalidFormatCipherSuites(CipherSuiteSelectorTest.java:310)

testMinusAesBetweenRsaAndAes(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testMinusAesBetweenRsaAndAes(CipherSuiteSelectorTest.java:184)

testStrengthForAllAndComplementofall(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testStrengthForAllAndComplementofall(CipherSuiteSelectorTest.java:227)

testAll(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.003 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testAll(CipherSuiteSelectorTest.java:58)

testComplementofdefault(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testComplementofdefault(CipherSuiteSelectorTest.java:87)

testSeparatorColon(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.008 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testSeparatorColon(CipherSuiteSelectorTest.java:265)

testSeparatorComma(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testSeparatorComma(CipherSuiteSelectorTest.java:257)

testSeparatorSpace(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testSeparatorSpace(CipherSuiteSelectorTest.java:249)

testSingleSuiteUsingStandardName(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testSingleSuiteUsingStandardName(CipherSuiteSelectorTest.java:95)

testDoublePlusBetweenAnonAndTls12(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testDoublePlusBetweenAnonAndTls12(CipherSuiteSelectorTest.java:135)

testMinusBetweenRsaAndAes(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testMinusBetweenRsaAndAes(CipherSuiteSelectorTest.java:176)

testValidCipherSuites(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.02 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:51)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testValidCipherSuites(CipherSuiteSelectorTest.java:292)

testMinusBetweenRsaAes(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.004 sec  <<< ERROR!
java.lang.Exception: Unexpected exception, expected<java.lang.IllegalArgumentException> but was<java.lang.NoClassDefFoundError>
        at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:30)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
        at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
        at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.fromString(CipherSuiteSelector.java:484)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testMinusBetweenRsaAes(CipherSuiteSelectorTest.java:200)

testNotRsaBetweenRsaAndRsa(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testNotRsaBetweenRsaAndRsa(CipherSuiteSelectorTest.java:212)

testCombinedDefaultCipherSuites(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelector$3.evaluate(CipherSuiteSelector.java:556)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testCombinedDefaultCipherSuites(CipherSuiteSelectorTest.java:319)

testMinusAesAfterRsa(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.005 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testMinusAesAfterRsa(CipherSuiteSelectorTest.java:168)

testPlusBeforeFirstRsa(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testPlusBeforeFirstRsa(CipherSuiteSelectorTest.java:159)

testSingleTlsSuiteUsingSslPrefixName(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.003 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testSingleTlsSuiteUsingSslPrefixName(CipherSuiteSelectorTest.java:111)

testPlusBetweenAnonAndTls12AndAfter(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.005 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testPlusBetweenAnonAndTls12AndAfter(CipherSuiteSelectorTest.java:143)

testSeparatorCommaSpace(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testSeparatorCommaSpace(CipherSuiteSelectorTest.java:273)

testDefault(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testDefault(CipherSuiteSelectorTest.java:79)

testMinusRsaBetweenRsaAndRsa(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testMinusRsaBetweenRsaAndRsa(CipherSuiteSelectorTest.java:192)

testTLS12NameInCipherSuites(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.fromNamesString(CipherSuiteSelector.java:516)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testTLS12NameInCipherSuites(CipherSuiteSelectorTest.java:301)

testMultiplePlus(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testMultiplePlus(CipherSuiteSelectorTest.java:151)

testPlusBetweenAnonAndNullEncryption(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testPlusBetweenAnonAndNullEncryption(CipherSuiteSelectorTest.java:119)

testStrengthForComplementofallAndAll(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testStrengthForComplementofallAndAll(CipherSuiteSelectorTest.java:238)

testComplementofall(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testComplementofall(CipherSuiteSelectorTest.java:71)

testPlusBetweenAnonAndTls12(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testPlusBetweenAnonAndTls12(CipherSuiteSelectorTest.java:127)

testNotAesBetweenRsaAndAes(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.evaluate(CipherSuiteSelector.java:286)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.getSelectedSuites(CipherSuiteSelectorTest.java:53)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testNotAesBetweenRsaAndAes(CipherSuiteSelectorTest.java:219)

testTLS13NameInCipherList(org.wildfly.security.ssl.CipherSuiteSelectorTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.security.ssl.ElytronMessages
        at org.wildfly.security.ssl.CipherSuiteSelector.fromString(CipherSuiteSelector.java:484)
        at org.wildfly.security.ssl.CipherSuiteSelectorTest.testTLS13NameInCipherList(CipherSuiteSelectorTest.java:282)

Running org.wildfly.security.ssl.MechanismDatabaseTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.717 sec - in org.wildfly.security.ssl.MechanismDatabaseTest

Results :

Tests in error: 
  CipherSuiteSelectorTest.testAll:58->getSelectedSuites:53 » NoClassDefFound Cou...
  CipherSuiteSelectorTest.testCombinedDefaultCipherSuites:319 » NoClassDefFound ...
  CipherSuiteSelectorTest.testComplementofall:71->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testComplementofdefault:87->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testDefault:79->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testDoublePlusBetweenAnonAndTls12:135->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testInvalidFormatCipherSuites:310 » NoClassDefFound Co...
  CipherSuiteSelectorTest.testMinusAesAfterRsa:168->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testMinusAesBetweenRsaAndAes:184->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testMinusBetweenRsaAes »  Unexpected exception, expect...
  CipherSuiteSelectorTest.testMinusBetweenRsaAndAes:176->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testMinusRsaBetweenRsaAndRsa:192->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testMultiplePlus:151->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testNotAesBetweenRsaAndAes:219->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testNotRsaAfterRsa:205->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testNotRsaBetweenRsaAndRsa:212->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testPlusBeforeFirstRsa:159->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testPlusBetweenAnonAndNullEncryption:119->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testPlusBetweenAnonAndTls12:127->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testPlusBetweenAnonAndTls12AndAfter:143->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testSeparatorColon:265->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testSeparatorComma:257->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testSeparatorCommaSpace:273->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testSeparatorSpace:249->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testSingleSuiteUsingOpensslName:103->getSelectedSuites:53 » ExceptionInInitializer
  CipherSuiteSelectorTest.testSingleSuiteUsingStandardName:95->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testSingleTlsSuiteUsingSslPrefixName:111->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testStrengthForAllAndComplementofall:227->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testStrengthForComplementofallAndAll:238->getSelectedSuites:53 » NoClassDefFound
  CipherSuiteSelectorTest.testTLS12NameInCipherSuites:301 » NoClassDefFound Coul...
  CipherSuiteSelectorTest.testTLS13NameInCipherList:282 » NoClassDefFound Could ...
  CipherSuiteSelectorTest.testValidCipherSuites:292->getSelectedSuites:51 » NoClassDefFound

Tests run: 35, Failures: 0, Errors: 32, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for WildFly Elytron Parent 2.3.0.CR1-SNAPSHOT:
[INFO] 
[INFO] WildFly Elytron Parent ............................. SUCCESS [  4.129 s]
[INFO] WildFly Elytron - ASN.1 ............................ SUCCESS [  8.891 s]
[INFO] WildFly Elytron - Base ............................. SUCCESS [  2.288 s]
[INFO] WildFly Elytron - Util ............................. SUCCESS [  5.822 s]
[INFO] WildFly Elytron - Auth ............................. SUCCESS [  0.508 s]
[INFO] WildFly Elytron - Provider Util .................... SUCCESS [  0.829 s]
[INFO] WildFly Elytron - X.500 ............................ SUCCESS [  3.531 s]
[INFO] WildFly Elytron - X.500 Certificate Utility Classes  SUCCESS [  0.661 s]
[INFO] WildFly Elytron - X.500 Certificates ............... SUCCESS [  7.065 s]
[INFO] WildFly Elytron - Credential ....................... SUCCESS [ 11.617 s]
[INFO] WildFly Elytron - Digest ........................... SUCCESS [  0.421 s]
[INFO] WildFly Elytron - Credential ....................... SUCCESS [  3.943 s]
[INFO] WildFly Elytron - Permission ....................... SUCCESS [  1.955 s]
[INFO] WildFly Elytron - Auth Server ...................... SUCCESS [  7.485 s]
[INFO] WildFly Elytron - Audit Logging .................... SUCCESS [  0.661 s]
[INFO] WildFly Elytron - Encryption ....................... SUCCESS [  3.833 s]
[INFO] WildFly Elytron - Password Implementation .......... SUCCESS [ 25.503 s]
[INFO] WildFly Elytron - Security Manager Action .......... SUCCESS [  0.371 s]
[INFO] WildFly Elytron - Mechanism GSSAPI ................. SUCCESS [  0.610 s]
[INFO] WildFly Elytron - Auth Util ........................ SUCCESS [  5.288 s]
[INFO] WildFly Elytron - X.500 Principals ................. SUCCESS [  0.379 s]
[INFO] WildFly Elytron - Realm ............................ SUCCESS [ 11.849 s]
[INFO] WildFly Elytron - Realm JDBC ....................... SUCCESS [  7.466 s]
[INFO] WildFly Elytron - Credential Store ................. SUCCESS [  7.291 s]
[INFO] WildFly Elytron - Credential Source Implementation . SUCCESS [  0.600 s]
[INFO] WildFly Elytron - HTTP ............................. SUCCESS [  0.717 s]
[INFO] WildFly Elytron - Mechanism ........................ SUCCESS [  0.717 s]
[INFO] WildFly Elytron - SSL .............................. FAILURE [  7.160 s]
[INFO] WildFly Elytron - SASL ............................. SKIPPED
[INFO] WildFly Elytron - SSH Util ......................... SKIPPED
[INFO] WildFly Elytron - Client ........................... SKIPPED
[INFO] WildFly Elytron - Realm LDAP ....................... SKIPPED
[INFO] WildFly Elytron - JSON Utility Classes ............. SKIPPED
[INFO] WildFly Elytron - Realm Token ...................... SKIPPED
[INFO] WildFly Elytron - Auth Server HTTP ................. SKIPPED
[INFO] WildFly Elytron - Auth Server SASL ................. SKIPPED
[INFO] WildFly Elytron - Auth Server Deprecated ........... SKIPPED
[INFO] WildFly Elytron - Credential Source Deprecated ..... SKIPPED
[INFO] WildFly Elytron - Mechanism Http ................... SKIPPED
[INFO] WildFly Elytron - HTTP Basic ....................... SKIPPED
[INFO] WildFly Elytron - HTTP Bearer ...................... SKIPPED
[INFO] WildFly Elytron - HTTP Cert ........................ SKIPPED
[INFO] WildFly Elytron - Mechanism Digest ................. SKIPPED
[INFO] WildFly Elytron - HTTP DIGEST ...................... SKIPPED
[INFO] WildFly Elytron - HTTP External .................... SKIPPED
[INFO] WildFly Elytron - HTTP Basic ....................... SKIPPED
[INFO] WildFly Elytron - HTTP SPNEGO ...................... SKIPPED
[INFO] WildFly Elytron - HTTP Util ........................ SKIPPED
[INFO] WildFly Elytron - HTTP ............................. SKIPPED
[INFO] WildFly Elytron - Jose Util ........................ SKIPPED
[INFO] WildFly Elytron - JWK .............................. SKIPPED
[INFO] WildFly Elytron - HTTP Stateful Basic .............. SKIPPED
[INFO] WildFly Elytron - SASL Anonymous ................... SKIPPED
[INFO] WildFly Elytron - SASL Digest ...................... SKIPPED
[INFO] WildFly Elytron - SASL Entity ...................... SKIPPED
[INFO] WildFly Elytron - Tests Common ..................... SKIPPED
[INFO] WildFly Elytron - SASL External .................... SKIPPED
[INFO] WildFly Elytron - SASL GS2 ......................... SKIPPED
[INFO] WildFly Elytron - SASL GSSAPI ...................... SKIPPED
[INFO] WildFly Elytron - SASL JBOSS-LOCAL-USER ............ SKIPPED
[INFO] WildFly Elytron - Mechanism OAuth2 ................. SKIPPED
[INFO] WildFly Elytron - SASL OAuth2 ...................... SKIPPED
[INFO] WildFly Elytron - SASL OTP ......................... SKIPPED
[INFO] WildFly Elytron - SASL Plain ....................... SKIPPED
[INFO] WildFly Elytron - Mechanism SCRAM .................. SKIPPED
[INFO] WildFly Elytron - SASL SCRAM ....................... SKIPPED
[INFO] WildFly Elytron - X.500 Certificate ACME ........... SKIPPED
[INFO] WildFly Elytron - Tests ............................ SKIPPED
[INFO] WildFly Elytron - HTTP OIDC ........................ SKIPPED
[INFO] WildFly Elytron - HTTP SSO ......................... SKIPPED
[INFO] WildFly Elytron - Security Manager ................. SKIPPED
[INFO] WildFly Elytron - SASL Auth Utility Classes ........ SKIPPED
[INFO] WildFly Elytron - SASL Deprecated .................. SKIPPED
[INFO] WildFly Elytron Tool ............................... SKIPPED
[INFO] WildFly Elytron - X.500 Deprecated ................. SKIPPED
[INFO] WildFly Elytron .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:13 min
[INFO] Finished at: 2023-10-07T01:04:55+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project wildfly-elytron-ssl: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/abhishek/Code/wildfly-elytron-2/ssl/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :wildfly-elytron-ssl

@abhishek-nigam abhishek-nigam requested a review from fjuma October 6, 2023 19:39
@PrarthonaPaul
Copy link
Contributor

Hi @abhishek-nigam
Are you using the guide posted here to set up?
Also, if you would like to run a single test class to test your changes, you can navigate to the closest directory containing a pom.xml file and run the commands mvn clean install -Dtest=<testclassname>. This way you are not having to wait a long time for everything to build.
Once you have confirmed that your tests work, you can run mvn clean install before pushing to make sure your changes did not break anything else.
LMK if you have any questions :)
Thanks again for your contributions

@abhishek-nigam
Copy link
Contributor Author

Hi @PrarthonaPaul ,

I just went over the guide. I have installed Java 11 using Sdkman and I am running WSL (Ubuntu) on Windows 11. Here are the points I checked:

  • I'm running openJDK version 11.0.20.1
  • I have JAVA_HOME environment variable set correctly and it's in my PATH as well
  • I have Maven installed, version 3.9.5
  • I have git installed

In the guide I wasn't able to successfully run

Next, configure the default JVM version for your system:

Ubuntu: sudo update-alternatives --config java
Fedora: sudo alternatives --config java
Arch: archlinux-java set java-11-openjdk

It gives me the following output

update-alternatives: error: no alternatives for java

I'm guess it might be since I haven't installed Java using Ubuntu's packages manager.

I'm not sure why I'm getting the error I posted, also the Github action too just failed. However, I do notice that in it, it was able to fail at a later stage/test where it was failing on my local. I'm not sure what's happening 🥵

Do you have an idea?

@PrarthonaPaul
Copy link
Contributor

Hi @abhishek-nigam when you run java --version do you get any outputs?
If not (or if you don't get OpenJDK11), please try installing it using sudo apt-get install openjdk-11-jdk
if you still run into issues, please feel free to lmk :)

@abhishek-nigam
Copy link
Contributor Author

abhishek-nigam commented Oct 6, 2023

Hi @PrarthonaPaul ,

Yes, I get the following output when I run java --version

openjdk 11.0.20.1 2023-08-24 LTS
OpenJDK Runtime Environment (build 11.0.20.1+1-LTS)
OpenJDK 64-Bit Server VM (build 11.0.20.1+1-LTS, mixed mode)

Is it as expected? Thank you for the help :)

@PrarthonaPaul
Copy link
Contributor

It seems right. Are your tests still failing?
Try checking that you have maven installed as well.
Also, make sure the java_home path is added to the config file and then run source <config file>.

@Skyllarr
Copy link
Contributor

Skyllarr commented Oct 9, 2023

@abhishek-nigam You do not need to setup JBOSS MVN repository, the project can be build without it.

Are you building the project from the command line or with IDE?

@abhishek-nigam
Copy link
Contributor Author

Hi

@PrarthonaPaul Unfortunely yes, I do have maven installed and JAVA_HOME environment variable is set and it's also present in my PATH.
@Skyllarr I'm trying to build the project from the command line using mvn clean install

@abhishek-nigam abhishek-nigam force-pushed the refactoring-1 branch 2 times, most recently from 5bdd4df to 43bed9f Compare October 10, 2023 10:47
@abhishek-nigam
Copy link
Contributor Author

abhishek-nigam commented Oct 10, 2023

Hi,

I have gotten further on this. There were two issues that I overcame:

  1. There was a bug in my first commit titled "refactor(ELY-2603): replace switch statement with if condition to improve readability", I was breaking out of the while loop which was not correct. When I converted the switch statement to an if condition I missed removing the 'break' keyword.
  2. It seems that some dependencies aren't met in the Java setup I was using earlier using Sdkman, as I had described here. Fortunately, I had another laptop running Ubuntu. I followed the instructions as described here to setup the dev environment.

Now, it seems that on Github Actions workflow has passed. On my native Ubuntu setup, I've passed the tests that were failing earlier but now getting the following error in HTTP OIDC step:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.wildfly.security.http.oidc.OidcSecurityRealmTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.276 sec - in org.wildfly.security.http.oidc.OidcSecurityRealmTest
Running org.wildfly.security.http.oidc.BearerTest
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v9.Java9 (file:/home/abhishek/.m2/repository/org/codehaus/groovy/groovy/3.0.7/groovy-3.0.7.jar) to constructor java.lang.AssertionError(java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v9.Java9
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Tests run: 2, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 67.876 sec <<< FAILURE! - in org.wildfly.security.http.oidc.BearerTest
org.wildfly.security.http.oidc.BearerTest  Time elapsed: 67.875 sec  <<< ERROR!
org.testcontainers.containers.ContainerLaunchException: Container startup failed
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:330)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:311)
	at org.wildfly.security.http.oidc.BearerTest.startTestContainers(BearerTest.java:84)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:323)
	... 2 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:497)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:325)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for URL to be accessible (http://localhost:32782/ should return HTTP 200)
	at org.testcontainers.containers.wait.strategy.HttpWaitStrategy.waitUntilReady(HttpWaitStrategy.java:264)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:35)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:892)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:440)
	... 5 more

org.wildfly.security.http.oidc.BearerTest  Time elapsed: 67.875 sec  <<< FAILURE!
java.lang.AssertionError: 
1 expectation failed.
Expected status code <204> but was <404>.

	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:59)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
	at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:493)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
	at io.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:674)
	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:61)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
	at io.restassured.internal.ResponseSpecificationImpl.statusCode(ResponseSpecificationImpl.groovy:126)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
	at io.restassured.internal.ResponseSpecificationImpl.statusCode(ResponseSpecificationImpl.groovy:134)
	at io.restassured.internal.ValidatableResponseOptionsImpl.statusCode(ValidatableResponseOptionsImpl.java:89)
	at io.restassured.internal.ValidatableResponseImpl.super$2$statusCode(ValidatableResponseImpl.groovy)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
	at io.restassured.internal.ValidatableResponseImpl.statusCode(ValidatableResponseImpl.groovy:142)
	at io.restassured.internal.ValidatableResponseImpl.statusCode(ValidatableResponseImpl.groovy)
	at org.wildfly.security.http.oidc.BearerTest.generalCleanup(BearerTest.java:141)

Running org.wildfly.security.http.oidc.TypClaimValidationEnabledTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.744 sec - in org.wildfly.security.http.oidc.TypClaimValidationEnabledTest
Running org.wildfly.security.http.oidc.OidcTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 67.589 sec <<< FAILURE! - in org.wildfly.security.http.oidc.OidcTest
org.wildfly.security.http.oidc.OidcTest  Time elapsed: 67.587 sec  <<< ERROR!
org.testcontainers.containers.ContainerLaunchException: Container startup failed
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:330)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:311)
	at org.wildfly.security.http.oidc.OidcTest.startTestContainers(OidcTest.java:57)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:323)
	... 2 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:497)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:325)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 3 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for URL to be accessible (http://localhost:32785/ should return HTTP 200)
	at org.testcontainers.containers.wait.strategy.HttpWaitStrategy.waitUntilReady(HttpWaitStrategy.java:264)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:35)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:892)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:440)
	... 5 more

org.wildfly.security.http.oidc.OidcTest  Time elapsed: 67.588 sec  <<< ERROR!
org.apache.http.NoHttpResponseException: localhost:32785 failed to respond
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
	at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:294)
	at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:207)
	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:679)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:481)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
	at io.restassured.internal.RequestSpecificationImpl$RestAssuredHttpBuilder.doRequest(RequestSpecificationImpl.groovy:2055)
	at io.restassured.internal.http.HTTPBuilder.post(HTTPBuilder.java:350)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
	at io.restassured.internal.RequestSpecificationImpl.sendRequest(RequestSpecificationImpl.groovy:1181)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:819)
	at groovy.lang.GroovyObject.invokeMethod(GroovyObject.java:39)
	at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:45)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:166)
	at io.restassured.internal.filter.SendRequestFilter.filter(SendRequestFilter.groovy:30)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at io.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:72)
	at io.restassured.filter.time.TimingFilter.filter(TimingFilter.java:56)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:157)
	at io.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:72)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
	at io.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1655)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:819)
	at groovy.lang.GroovyObject.invokeMethod(GroovyObject.java:39)
	at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:45)
	at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:55)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:203)
	at io.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1661)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:819)
	at groovy.lang.GroovyObject.invokeMethod(GroovyObject.java:39)
	at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:45)
	at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:55)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:203)
	at io.restassured.internal.RequestSpecificationImpl.post(RequestSpecificationImpl.groovy:175)
	at io.restassured.internal.RequestSpecificationImpl.post(RequestSpecificationImpl.groovy)
	at org.wildfly.security.http.oidc.KeycloakConfiguration.getAdminAccessToken(KeycloakConfiguration.java:87)
	at org.wildfly.security.http.oidc.KeycloakConfiguration.getAdminAccessToken(KeycloakConfiguration.java:75)
	at org.wildfly.security.http.oidc.OidcTest.generalCleanup(OidcTest.java:68)

Running org.wildfly.security.http.oidc.TypClaimValidationDisabledTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.426 sec - in org.wildfly.security.http.oidc.TypClaimValidationDisabledTest

Results :

Tests in error: 
org.wildfly.security.http.oidc.BearerTest.org.wildfly.security.http.oidc.BearerTest
  Run 1: BearerTest.startTestContainers:84 » ContainerLaunch Container startup failed
  Run 2: BearerTest.generalCleanup:141 1 expectation failed.
Expected status code <204> but was <404>.


org.wildfly.security.http.oidc.OidcTest.org.wildfly.security.http.oidc.OidcTest
  Run 1: OidcTest.startTestContainers:57 » ContainerLaunch Container startup failed
  Run 2: OidcTest.generalCleanup:68 » NoHttpResponse localhost:32785 failed to respond


Tests run: 14, Failures: 0, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for WildFly Elytron - HTTP OIDC 2.3.0.CR1-SNAPSHOT:
[INFO] 
[INFO] WildFly Elytron - HTTP OIDC ........................ FAILURE [02:31 min]
[INFO] WildFly Elytron - HTTP SSO ......................... SKIPPED
[INFO] WildFly Elytron - Security Manager ................. SKIPPED
[INFO] WildFly Elytron - SASL Auth Utility Classes ........ SKIPPED
[INFO] WildFly Elytron - SASL Deprecated .................. SKIPPED
[INFO] WildFly Elytron Tool ............................... SKIPPED
[INFO] WildFly Elytron - X.500 Deprecated ................. SKIPPED
[INFO] WildFly Elytron .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:32 min
[INFO] Finished at: 2023-10-10T16:57:42+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project wildfly-elytron-http-oidc: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/abhishek/Code/wildfly-elytron/http/oidc/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

in which I note the lines

org.testcontainers.containers.ContainerLaunchException: Container startup failed
...
org.apache.http.NoHttpResponseException: localhost:32785 failed to respond

I'd like to mention that I'm getting the above even on 2.x branch which doesn't have my changes. So, I'm guessing this is related to local environment and my changes are okay.

@fjuma
Copy link
Contributor

fjuma commented Oct 10, 2023

Hi @abhishek-nigam, the HTTP OIDC tests require docker to be installed and running in your environment.

@abhishek-nigam
Copy link
Contributor Author

Thank you @fjuma and all maintainers! Happy to see this output finally

[INFO] Installing /home/abhishek/Code/wildfly-elytron/wildfly-elytron/target/wildfly-elytron-2.3.0.CR1-SNAPSHOT.jar to /home/abhishek/.m2/repository/org/wildfly/security/wildfly-elytron/2.3.0.CR1-SNAPSHOT/wildfly-elytron-2.3.0.CR1-SNAPSHOT.jar
[INFO] Installing /home/abhishek/Code/wildfly-elytron/wildfly-elytron/pom.xml to /home/abhishek/.m2/repository/org/wildfly/security/wildfly-elytron/2.3.0.CR1-SNAPSHOT/wildfly-elytron-2.3.0.CR1-SNAPSHOT.pom
[INFO] Installing /home/abhishek/Code/wildfly-elytron/wildfly-elytron/target/wildfly-elytron-2.3.0.CR1-SNAPSHOT-sources.jar to /home/abhishek/.m2/repository/org/wildfly/security/wildfly-elytron/2.3.0.CR1-SNAPSHOT/wildfly-elytron-2.3.0.CR1-SNAPSHOT-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for WildFly Elytron - HTTP OIDC 2.3.0.CR1-SNAPSHOT:
[INFO] 
[INFO] WildFly Elytron - HTTP OIDC ........................ SUCCESS [03:06 min]
[INFO] WildFly Elytron - HTTP SSO ......................... SUCCESS [  1.246 s]
[INFO] WildFly Elytron - Security Manager ................. SUCCESS [  2.626 s]
[INFO] WildFly Elytron - SASL Auth Utility Classes ........ SUCCESS [  0.540 s]
[INFO] WildFly Elytron - SASL Deprecated .................. SUCCESS [  0.335 s]
[INFO] WildFly Elytron Tool ............................... SUCCESS [01:08 min]
[INFO] WildFly Elytron - X.500 Deprecated ................. SUCCESS [  0.625 s]
[INFO] WildFly Elytron .................................... SUCCESS [01:09 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:30 min
[INFO] Finished at: 2023-10-10T20:19:11+05:30
[INFO] ------------------------------------------------------------------------

Build is successful!

@fjuma
Copy link
Contributor

fjuma commented Oct 10, 2023

That's awesome, @abhishek-nigam, glad you were able to build successfully!

@@ -445,7 +445,7 @@ private void printSummary (String keystorePassword, String salt, int iterationCo
if (keystorePassword != null) {
password = keystorePassword;
if (salt != null && iterationCount > -1) {
password = keystorePassword.startsWith("MASK-") ? keystorePassword + ";" + salt + ";" + String.valueOf(iterationCount)
password = keystorePassword.startsWith("MASK-") ? keystorePassword + ";" + salt + ";" + iterationCount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub is showing a conflict in this file. Let us know if you need help with resolving the conflict.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes. I just resolved the conflict. Please let me know if any other changes are required!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, as an inside, I was wondering if it would be good to add dev containers support in the project. In my understanding, it would make it trivial for any developer to get the environment set up for the project

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an interesting suggestion. We'll look into that some more to see if it makes sense.

Copy link
Contributor

@fjuma fjuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much @abhishek-nigam, looks good!

@abhishek-nigam
Copy link
Contributor Author

Thank you all! Happy about this :)

@Skyllarr
Copy link
Contributor

@abhishek-nigam just a last minor detail, can you please change the title of the commits to not include the refactor() keyword? So it is consistent with the rest of git history? Thank you very much!

@abhishek-nigam
Copy link
Contributor Author

@Skyllarr Sure, I have made the edits now. I wanted to ask if should I start each commit message title with a capital letter or if the current one is fine. Thank you!

@Skyllarr
Copy link
Contributor

@abhishek-nigam Actually I'm sorry I was not clear in my previous message. Each issue has to have an issue number at the beginning, but without the refactor word which was there previously. You can look at the merged PRs to see a examples: https://github.com/wildfly-security/wildfly-elytron/pulls?q=is%3Apr+is%3Aclosed . Then, it is not important whether you use the capital letter or not.

Thank you for understanding!

This add missing @OverRide annotation on dispose() method of class FileSystemSecurityRealm

This closes ticket https://issues.redhat.com/browse/ELY-2596
This makes data members ElytronToolExitStatus_unrecognizedCommand & ElytronToolExitStatus_OK final (they're already declared as public static) since their values don't change.

This closes ticket https://issues.redhat.com/browse/ELY-2606
This makes data members ACTION_NOT_DEFINED & ALIAS_NOT_FOUND final (they're already declared as public static) since their values don't change.

This closes ticket https://issues.redhat.com/browse/ELY-2605
This removes unused parameter identityToWrite from requiredVersion method signature.

This closes ticket https://issues.redhat.com/browse/ELY-2595
This merges an if statement with it's enclosing if statement to increase readability.

This closes ticket https://issues.redhat.com/browse/ELY-2597
@abhishek-nigam
Copy link
Contributor Author

Hi @Skyllarr No worries! I have made the edits now

Copy link
Contributor

@Skyllarr Skyllarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhishek-nigam Looks perfect, thank you!

@Skyllarr Skyllarr merged commit 2d4b225 into wildfly-security:2.x Oct 12, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants