slachiewicz commented on PR #903:
URL: https://github.com/apache/maven-wagon/pull/903#issuecomment-5225922641

   Updated, and the headline is that this is now verified rather than asserted.
   
   **The harness came back.** #904 revives the embedded SSH tests, which had 
not run in over a decade. Running this branch's two commits on top of it: **42 
tests, 0 failures** against a real embedded MINA sshd server. That replaces the 
"unverified by the project's own tests" caveat this PR opened with. #904 should 
go in first. Same change as #902.
   
   **It immediately caught a fatal bug in this branch, now fixed.** My agent 
lookup listed the three connector kinds in a `static final` array:
   
   ```java
   private static final AgentConnectorFactory[] AGENT_CONNECTORS = {
       SSHAgentConnector::new, WindowsSSHAgentConnector::new, 
PageantConnector::new
   };
   ```
   
   `PageantConnector` needs JNA, and the fork declares no dependencies, so 
class initialisation of `ScpWagon` died with `NoClassDefFoundError: 
com/sun/jna/Pointer` wrapped in `ExceptionInInitializerError`. **`wagon-ssh` 
would not have loaded at all.** The default test run never instantiates a 
provider, so it went unnoticed; the embedded harness instantiates one on the 
first test and failed 24 of 42.
   
   Each connector is now both constructed and used inside its own guard that 
catches `LinkageError`, so a missing class is one skipped agent rather than a 
failure to load. Pageant therefore still works if JNA is on the class path and 
is skipped quietly otherwise. Re-run: 42 of 42.
   
   That is a good argument for #904 on its own merits — this defect was 
invisible to everything else in the build.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to