use of io.cryostat.core.log.Logger in project cryostat by cryostatio.
the class Cryostat method main.
public static void main(String[] args) throws Exception {
CryostatCore.initialize();
Security.addProvider(BouncyCastleProviderSingleton.getInstance());
final Logger logger = Logger.INSTANCE;
final Environment environment = new Environment();
logger.trace("env: {}", environment.getEnv().toString());
logger.info("{} started.", System.getProperty("java.rmi.server.hostname", "cryostat"));
Client client = DaggerCryostat_Client.builder().build();
CompletableFuture<Void> future = new CompletableFuture<>();
client.httpServer().addShutdownListener(() -> future.complete(null));
client.credentialsManager().load();
client.ruleRegistry().loadRules();
client.vertx().deployVerticle(client.httpServer(), new DeploymentOptions(), res -> logger.info("HTTP Server Verticle Started"));
client.vertx().deployVerticle(client.webServer(), new DeploymentOptions().setWorker(true), res -> logger.info("WebServer Verticle Started"));
client.vertx().deployVerticle(client.messagingServer(), new DeploymentOptions(), res -> logger.info("MessagingServer Verticle Started"));
client.vertx().deployVerticle(client.ruleProcessor(), new DeploymentOptions().setWorker(true), res -> logger.info("RuleProcessor Verticle Started"));
client.platformClient().start();
client.recordingMetadataManager().load();
future.join();
}
use of io.cryostat.core.log.Logger in project cryostat by cryostatio.
the class OpenShiftAuthManagerTest method testPropertiesResourceMapProcessing.
@ParameterizedTest
@MethodSource("getResourceMaps")
void testPropertiesResourceMapProcessing(Map<String, Object> map) throws IOException {
ClassPropertiesLoader loader = Mockito.mock(ClassPropertiesLoader.class);
Map<String, String> resourcesMap = new HashMap<>();
map.entrySet().stream().filter(e -> !e.getKey().equals("expected")).forEach(e -> resourcesMap.put((String) e.getKey(), (String) e.getValue()));
Map<ResourceType, Set<GroupResource>> expected = (Map<ResourceType, Set<GroupResource>>) map.get("expected");
Mockito.when(loader.loadAsMap(Mockito.any())).thenReturn(resourcesMap);
Map<ResourceType, Set<GroupResource>> result = OpenShiftAuthManager.processResourceMapping(loader, logger);
MatcherAssert.assertThat(result, Matchers.equalTo(expected));
}
use of io.cryostat.core.log.Logger in project cryostat by cryostatio.
the class PeriodicArchiverTest method setup.
@BeforeEach
void setup() throws Exception {
this.serviceRef = new ServiceRef(new URI(jmxUrl), "com.example.App");
this.failureCounter = new AtomicInteger();
this.rule = new Rule.Builder().name("Test Rule").description("Automated unit test rule").matchExpression("target.alias=='com.example.App'").eventSpecifier("template=Continuous").maxAgeSeconds(30).maxSizeBytes(1234).preservedArchives(2).archivalPeriodSeconds(67).build();
this.archiver = new PeriodicArchiver(serviceRef, credentialsManager, rule, recordingArchiveHelper, p -> {
failureCounter.incrementAndGet();
return null;
}, logger, base32);
}
Aggregations