forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pinpoint-apm#8965] Apply SharedTestLifeCycle to HttpWebServer
- Loading branch information
Showing
7 changed files
with
127 additions
and
77 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
29 changes: 29 additions & 0 deletions
29
plugins-it/cxf-it/src/test/java/com/navercorp/pinpoint/plugin/cxf/HttpWebServer.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,29 @@ | ||
package com.navercorp.pinpoint.plugin.cxf; | ||
|
||
import com.navercorp.pinpoint.pluginit.utils.WebServer; | ||
import com.navercorp.pinpoint.test.plugin.shared.SharedTestLifeCycle; | ||
|
||
import java.util.Properties; | ||
|
||
public class HttpWebServer implements SharedTestLifeCycle { | ||
private WebServer webServer; | ||
|
||
@Override | ||
public Properties beforeAll() { | ||
try { | ||
webServer = WebServer.newTestWebServer(); | ||
|
||
Properties properties = new Properties(); | ||
properties.setProperty("ADDRESS", webServer.getCallHttpUrl()); | ||
properties.setProperty("HOST_PORT", webServer.getHostAndPort()); | ||
return properties; | ||
} catch (Exception e) { | ||
throw new RuntimeException("webserver start error", e); | ||
} | ||
} | ||
|
||
@Override | ||
public void afterAll() { | ||
webServer = WebServer.cleanup(webServer); | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
...httpclient3-it/src/test/java/com/navercorp/pinpoint/plugin/httpclient3/HttpWebServer.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,29 @@ | ||
package com.navercorp.pinpoint.plugin.httpclient3; | ||
|
||
import com.navercorp.pinpoint.pluginit.utils.WebServer; | ||
import com.navercorp.pinpoint.test.plugin.shared.SharedTestLifeCycle; | ||
|
||
import java.util.Properties; | ||
|
||
public class HttpWebServer implements SharedTestLifeCycle { | ||
private WebServer webServer; | ||
|
||
@Override | ||
public Properties beforeAll() { | ||
try { | ||
webServer = WebServer.newTestWebServer(); | ||
|
||
Properties properties = new Properties(); | ||
properties.setProperty("ADDRESS", webServer.getCallHttpUrl()); | ||
properties.setProperty("HOST_PORT", webServer.getHostAndPort()); | ||
return properties; | ||
} catch (Exception e) { | ||
throw new RuntimeException("webserver start error", e); | ||
} | ||
} | ||
|
||
@Override | ||
public void afterAll() { | ||
webServer = WebServer.cleanup(webServer); | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
...ns-it/spring-it/src/test/java/com/navercorp/pinpoint/plugin/spring/web/HttpWebServer.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,29 @@ | ||
package com.navercorp.pinpoint.plugin.spring.web; | ||
|
||
import com.navercorp.pinpoint.pluginit.utils.WebServer; | ||
import com.navercorp.pinpoint.test.plugin.shared.SharedTestLifeCycle; | ||
|
||
import java.util.Properties; | ||
|
||
public class HttpWebServer implements SharedTestLifeCycle { | ||
private WebServer webServer; | ||
|
||
@Override | ||
public Properties beforeAll() { | ||
try { | ||
webServer = WebServer.newTestWebServer(); | ||
|
||
Properties properties = new Properties(); | ||
properties.setProperty("ADDRESS", webServer.getCallHttpUrl()); | ||
properties.setProperty("HOST_PORT", webServer.getHostAndPort()); | ||
return properties; | ||
} catch (Exception e) { | ||
throw new RuntimeException("webserver start error", e); | ||
} | ||
} | ||
|
||
@Override | ||
public void afterAll() { | ||
webServer = WebServer.cleanup(webServer); | ||
} | ||
} |
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