-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [#74] rework integration tests pt.1 * [#74] rework integration tests pt.2 * [#74] rework integration tests pt.3, Wagon334MojoHttpIT * [#74] pull dependency versions into properties --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
34f9cd8
commit 5a5f0c9
Showing
26 changed files
with
206 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,4 +80,4 @@ private void disconnectWagon( Wagon wagon ) | |
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,4 @@ protected void execute( Wagon wagon ) | |
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/test/java/org/codehaus/mojo/wagon/AbstractJettyIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.codehaus.mojo.wagon; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import org.eclipse.jetty.server.Handler; | ||
import org.eclipse.jetty.server.Server; | ||
import org.eclipse.jetty.server.ServerConnector; | ||
import org.eclipse.jetty.server.handler.DefaultHandler; | ||
import org.eclipse.jetty.server.handler.HandlerList; | ||
import org.eclipse.jetty.server.handler.ResourceHandler; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
|
||
public abstract class AbstractJettyIT { | ||
|
||
private Server server; | ||
private int port; | ||
|
||
@Before | ||
public void runJetty() throws Exception { | ||
server = new Server(); | ||
ServerConnector connector = new ServerConnector(server); | ||
connector.setPort(0); | ||
connector.setHost("localhost"); | ||
server.addConnector(connector); | ||
|
||
ResourceHandler resource_handler = new ResourceHandler(); | ||
resource_handler.setDirectoriesListed(true); | ||
resource_handler.setResourceBase(getDirectoryToServe().toString()); | ||
|
||
HandlerList handlers = new HandlerList(); | ||
handlers.setHandlers(new Handler[] { resource_handler, new DefaultHandler() }); | ||
server.setHandler(handlers); | ||
|
||
server.start(); | ||
this.port = connector.getLocalPort(); | ||
} | ||
|
||
|
||
@After | ||
public void tearDown() throws Exception { | ||
server.stop(); | ||
} | ||
|
||
protected int getServerPort() { | ||
return this.port; | ||
} | ||
|
||
protected abstract Path getDirectoryToServe() throws IOException; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.