use of com.nike.riposte.server.Server in project riposte by Nike-Inc.
the class VerifyResponseHttpStatusCodeHandlingRfcCorrectnessComponentTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
// The slf4j-test logger causes a huge amount of spam to be output for these tests. Disable for these tests, then re-enable in tearDown().
logPrintLevelAtStart = TestLoggerFactory.getInstance().getPrintLevel();
TestLoggerFactory.getInstance().setPrintLevel(Level.WARN);
System.setProperty(StreamingAsyncHttpClient.SHOULD_LOG_BAD_MESSAGES_AFTER_REQUEST_FINISHES_SYSTEM_PROP_KEY, "true");
int backendPort = ComponentTestUtils.findFreePort();
backendServerConfig = new BackendServerConfig(backendPort);
backendServer = new Server(backendServerConfig);
backendServer.startup();
int intermediateRouterPort = ComponentTestUtils.findFreePort();
intermediateRouterServerConfig = new RouterServerConfig(intermediateRouterPort, backendPort);
intermediateRouterServer = new Server(intermediateRouterServerConfig);
intermediateRouterServer.startup();
int edgeRouterPort = ComponentTestUtils.findFreePort();
edgeRouterServerConfig = new RouterServerConfig(edgeRouterPort, intermediateRouterPort);
edgeRouterServer = new Server(edgeRouterServerConfig);
edgeRouterServer.startup();
}
use of com.nike.riposte.server.Server in project riposte by Nike-Inc.
the class VerifyRequestAndResponseFilteringComponentTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
serverConfig = new RequestAndResponseFilterTestConfig();
server = new Server(serverConfig);
server.startup();
}
use of com.nike.riposte.server.Server in project riposte by Nike-Inc.
the class VerifyPreEndpointExecutionWorkChainComponentTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
serverConfig = new PreEndpointExecutionWorkChainTestConfig(false);
server = new Server(serverConfig);
server.startup();
downstreamServerConfig = new PreEndpointExecutionWorkChainTestConfig(false);
downstreamServer = new Server(downstreamServerConfig);
downstreamServer.startup();
nonWorkChainServerConfig = new PreEndpointExecutionWorkChainTestConfig(true);
nonWorkChainServer = new Server(nonWorkChainServerConfig);
nonWorkChainServer.startup();
}
use of com.nike.riposte.server.Server in project riposte by Nike-Inc.
the class VerifyAsyncHttpClientHelperComponentTest method setup.
@BeforeClass
public static void setup() throws Exception {
serverPort = findFreePort();
serverConfig = new AppServerConfigForTesting(singleton(new TestEndpoint()), serverPort);
server = new Server(serverConfig);
server.startup();
}
use of com.nike.riposte.server.Server in project riposte by Nike-Inc.
the class ArchaiusServer method infrastructureInit.
/**
* Initializes the Archaius system and configures the Netty leak detection level (if necessary).
* DO NOT CALL THIS DIRECTLY. Use {@link #launchServer(String[])} when you're ready to start the server.
*/
protected void infrastructureInit() {
MainClassUtils.setupJbossLoggingToUseSlf4j();
try {
Pair<String, String> appIdAndEnvironmentPair = MainClassUtils.getAppIdAndEnvironmentFromSystemProperties();
ConfigurationManager.loadCascadedPropertiesFromResources(appIdAndEnvironmentPair.getLeft());
} catch (IOException e) {
throw new RuntimeException("Error loading Archaius properties", e);
}
AbstractConfiguration appConfig = ConfigurationManager.getConfigInstance();
Function<String, Boolean> hasPropertyFunction = (propKey) -> appConfig.getProperty(propKey) != null;
Function<String, String> propertyExtractionFunction = (propKey) -> {
// Properties in Archaius might be a Collection or an Object.
Object propValObj = appConfig.getProperty(propKey);
return (propValObj instanceof Collection) ? ((Collection<?>) propValObj).stream().map(String::valueOf).collect(Collectors.joining(",")) : String.valueOf(propValObj);
};
Set<String> propKeys = new LinkedHashSet<>();
appConfig.getKeys().forEachRemaining(propKeys::add);
MainClassUtils.logApplicationPropertiesIfDebugActionsEnabled(hasPropertyFunction, propertyExtractionFunction, propKeys, false);
MainClassUtils.setupNettyLeakDetectionLevel(hasPropertyFunction, propertyExtractionFunction);
}
Aggregations