Commit Graph
37 Commits
Author SHA1 Message Date
strangelookingnerdandMark Waite c33bf73f72 Migrate tests to JUnit5 (cli) (#10559)
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
2025-05-31 08:28:08 +01:00
Somasekhar dca009b286 Ssh Command modified in PrivateKeyProvider.java File in cil module (#8756) 2023-12-06 13:22:19 -07:00
Basil Crow 6d179998e1 Use Java 11 methods where possible (#6700) 2022-06-30 09:31:36 -07:00
Basil Crow 520e114ea1 Use explicit character set in tests (#6150) 2022-01-07 06:29:39 -08:00
Basil Crow e27b310065 Enable whitespace-related Checkstyle checks (#6149) 2022-01-03 08:55:03 -08:00
Basil Crow b25b45bc90 Remove trailing whitespace (#6138) 2021-12-31 07:54:03 -08:00
Basil Crow 632033d6ad Sort imports (#5732) 2021-09-18 09:39:42 +01:00
Basil Crow 95e85495ca Enable AvoidStarImport Checkstyle check (#5420) 2021-04-28 17:28:39 +08:00
Elvys Soares 5b8392b8f6 Including expected values and passed parameters to test names generation.
Signed-off-by: Elvys Soares <eas5@cin.ufpe.br>
2021-03-26 18:46:05 -03:00
Elvys Soares 7651079c4e Refactored multiple assertion tests into parameterized ones
Signed-off-by: Elvys Soares <eas5@cin.ufpe.br>
2021-03-25 11:54:47 -03:00
res0nance 4d818c294f Bump sshd-core to 2.6.0 and update tests 2021-01-25 18:00:03 +08:00
Oleg Nenashev e09f1cd028 Merge pull request #4762 from StefanSpieker/cli_tests
moved test class closer to class and added a test
2020-06-05 23:50:01 +02:00
Stefan Spieker 9da5af317f removed accidently added import 2020-05-31 11:48:10 +02:00
Stefan Spieker ce4cc695bf moved test class closer to class and added a test 2020-05-31 11:06:13 +02:00
Søren A D 90f3047483 Support for bearer tokens in jenkins-cli (#4673)
* added -bearer argument to jenkins-cli

* updated message related to bearer/auth. added warning when both are used anyway.
2020-05-24 17:13:23 +02:00
Stefan Spieker ca167e9c43 minor pom cleanup and switched assertions to junit5 because class was already switched to junit5 2020-04-27 10:43:00 +02:00
Jesse Glick 5b5040298f [JEP-222] WebSocket support (#4369)
* Playing with WebSocket connections.

* Pluggable handlers.

* errorWithoutStack

* Server-side keepalive pings.

* Redesigned to work as an HttpResponse.

* Unused dep.

* Comment on JnlpSlaveRestarterInstaller.

* Sketch of WebSocket-based endpoint for JNLPLauncher.

* Comment.

* Test enhancement.

* Making it more obvious from JNLPLauncherTest where remoting.jar is being loaded from.

* Reworked protocol to negotiate remote capabilities.

* Unhelpful comment.

* Simplifying handshake to use HTTP headers.

* Moving code into top-level classes and otherwise prettifying.

* Linking to upstream PRs.

* Timestamped snapshot + incremental.

* Picking up incrementalified build of winstone.

* Working around https://github.com/kohsuke/access-modifier/pull/17.

* Finally have an incrementalified build of remoting.

* Use -webSocket option.

* Handling some close and error methods.

* Sending X-Remoting-Minimum-Version.

* If hudson.remoting.jnlp.Main._main fails, show the error.

* Comment.

* GUI analogue of https://github.com/jenkinsci/remoting/pull/357/commits/86cea5b83fd2fc93a9fc10896962eb42c95f80a0.

* Missing since tags.

* Capitalization.

* WebSockets.isSupported

* Rather than hiding JNLPLauncher.DescriptorImpl when the TCP port is disabled, always display it, but show form validation appropriate to WebSocket or TCP mode.

* Form validation fixes.

* Minor test improvements.

* Reworked WebSocketAgents to be compatible with JnlpAgentReceiver.

* Removing WebSocketSession.keepAlive in favor of a global setting applicable to all services.

* Add a -webSocket option to the Jenkins CLI.

* Using a snapshot deployment of Remoting, pending INFRA-2379.

* After #3838 there is no reason to recheck authentication after parsing CLICommand arguments.

* Advertise the -webSocket option.

* Adapt to newer HtmlUnit.

* https://github.com/HtmlUnit/htmlunit/pull/29 seems to have been incompatible.
WebClient.addRequestHeader will no longer override a header in a WebRequest,
such as when the same WebClient/WebRequest was previously used with different headers.

* Tracked down a behavioral change in passing through URL-encoded path characters.
https://github.com/HtmlUnit/htmlunit/commit/2c4956863420e4baef9d3d8c23ec0577ec64d2bf picks up
https://github.com/apache/httpcomponents-client/commit/8c04c6ae5e5ba1432e40684428338ce68431766b which is the actual change.

* Disabled TCP port does not matter in WebSocket mode.

* Shade dependencies needed for jenkins-cli.jar.

* Help text edit.

* https://github.com/jenkinsci/winstone/pull/79 was released as 5.5.

* https://github.com/jenkinsci/jenkins-test-harness/pull/183 released as 2.59.

* https://github.com/jenkinsci/jenkins/pull/4387#discussion_r362696234

* Bumping remoting to a new deployed snapshot.

* Need https://github.com/jenkinsci/winstone/pull/86.

* https://github.com/jenkinsci/winstone/pull/86 released as 5.6.

* Introduced constant for X-Remoting-Minimum-Version.

* s/slave/agent/ in GUI

* Removing in-JVM test, as it was no longer useful after introducing shading anyway.

* Bump.

* No need to check for anonymous CONNECT here.

* s/jenkins.slaves/jenkins.agents/g for new code.

* Restrict the diagnostic endpoint to administrators.

* Fixed Javadoc import after package move.

* https://github.com/jenkinsci/remoting/pull/357 released as 4.0.
2020-01-21 07:00:39 +01:00
Jesse Glick 8c81991ec0 Race condition in PlainCLIProtocolTest. 2019-11-26 09:03:58 -05:00
StefanSpieker 5057edae53 introduced junit5 as testing backend for cli tests (#4220) 2019-11-18 11:18:22 +01:00
a544a3b3b2 Extracted duplicate code (#4206)
* extracted duplicate code into helper method

* merged two identical switch statements

* Update cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java

Co-Authored-By: Matt Sicker <boards@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com>

* Update cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java

Co-Authored-By: Tim Jacomb <t.jacomb@kainos.com>

* renamed method as suggested by timja
2019-09-28 10:29:13 +02:00
ThomasPerkins1123 f0363a5739 Add unit tests for hudson.cli.HexDump (#4058)
* Add unit tests for hudson.cli.HexDump

These tests were written using Diffblue Cover.

* Changed byte arrays to work for windows
2019-07-03 16:32:57 +02:00
Ivan Fernandez Calvo 46cbaf51e8 [JENKINS-56167] Replace Trilead-ssh2 PEMParser class (#3902)
* [JENKINS-56167] Replace Trilead-ssh2 PEMParser class by Mina SSHD SecurityUtils.loadKeyPairIdentity implementation

* Update PrivateKeyProviderTest.java

* Update cli/src/test/java/hudson/cli/PrivateKeyProviderTest.java

Co-Authored-By: kuisathaverat <kuisathaverat@users.noreply.github.com>

* Update PrivateKeyProviderTest.java

* Update PrivateKeyProvider.java

* Update PrivateKeyProviderTest.java

* Update PrivateKeyProvider.java
2019-02-25 10:11:42 +01:00
Jesse Glick f7ff281997 Removing code to support the Remoting-based CLI. 2019-01-08 22:39:07 -05:00
Oleg Nenashev b5be66014c [JENKINS-53693] - Update PowerMock and Mockito to a Java11-compatible version (#3637)
* [JENKINS-53693] - Update PowerMock and Mockito to a Java11-compatible version

* [JENKINS-53693] - Fix tests which depend on mocking

* [JENKINS-53693] - Apply fixes to PowerMock
2018-09-21 19:08:35 -07:00
Jesse Glick d3645f7dfe Updating Powermock and Objenesis to avoid Mockito/Hamcrest library mismatches. 2017-12-08 10:44:58 -05:00
Jesse Glick 6ffc57ae79 Verifying that PlainCLIProtocol ignores unrecognized opcodes, so long as it has received well-formed frames. 2017-04-06 15:58:23 -04:00
Jesse Glick 7da0d39000 Argument processing mistake. 2017-03-13 11:53:20 -04:00
Kohsuke Kawaguchi 4c0d5ea643 Merge branch 'security-stable-1.596' into security-stable-1.609
Conflicts:
	cli/src/test/java/hudson/cli/ConnectionTest.java
	pom.xml
2015-11-07 21:41:42 -08:00
Kohsuke Kawaguchi 05b0a2a17c How is this payload rejected, you ask? 2015-11-07 14:00:46 -08:00
Kohsuke Kawaguchi 12a970dffa A modest test case for the change 2015-11-07 11:10:09 -08:00
René Scheibe 13ab787d5f don't extend a test class from org.junit.Assert to use its static methods 2015-01-09 12:25:37 +01:00
Jesse Glick d33a63225b Another attempt to diagnose a random test failure. (Cf. #1370.) 2014-08-28 17:02:27 -04:00
Jesse Glick b18d158653 Trying to prevent random failure. 2014-08-19 09:35:12 -04:00
Ben McCann c57761a308 Fix typo in test name 2014-08-10 08:54:30 -07:00
Oliver Gondža 63ceab84a5 Test PrivateKeyProvider 2014-03-10 22:21:50 +01:00
Marco Miller 8067edd97d Throw IOException if negative int from port-based cli connection stream.
-Instead of failing at initializing array with negative size.
Introducing PowerMock test for the zero-size array case.
Negative-size case not tested thx to unhelping PowerMock behavior.
Using ConnectionMockTest instead of ConnectionTest; needed by PowerMock.
2013-11-14 10:46:24 -05:00
Kohsuke Kawaguchi 25d990c539 Implemented transport security to CLI connection.
It uses Diffie Hellman to come up with one-time session key, then have
the server sign this session key to allow the client to verify that
there's no man in the middle.
2012-05-24 15:49:37 -07:00