use of com.artipie.misc.ArtipieProperties in project artipie by artipie.
the class VersionSliceTest method returnVersionOfApplication.
@Test
void returnVersionOfApplication() {
final ArtipieProperties proprts = new ArtipieProperties();
MatcherAssert.assertThat(new VersionSlice(proprts), new SliceHasResponse(Matchers.allOf(new RsHasStatus(RsStatus.OK), new RsHasBody(new IsJson(new JsonContains(new JsonHas("version", new JsonValueIs(proprts.version())))))), new RequestLine(RqMethod.GET, "/.version")));
}
use of com.artipie.misc.ArtipieProperties in project artipie by artipie.
the class VertxMain method main.
/**
* Entry point.
* @param args CLI args
* @throws Exception If fails
*/
public static void main(final String... args) throws Exception {
final Vertx vertx = Vertx.vertx();
final Path config;
final int port;
final int defp = 80;
final Options options = new Options();
final String popt = "p";
final String fopt = "f";
options.addOption(popt, "port", true, "The port to start artipie on");
options.addOption(fopt, "config-file", true, "The path to artipie configuration file");
final CommandLineParser parser = new DefaultParser();
final CommandLine cmd = parser.parse(options, args);
if (cmd.hasOption(popt)) {
port = Integer.parseInt(cmd.getOptionValue(popt));
} else {
Logger.info(VertxMain.class, "Using default port: %d", defp);
port = defp;
}
if (cmd.hasOption(fopt)) {
config = Path.of(cmd.getOptionValue(fopt));
} else {
throw new IllegalStateException("Storage is not configured");
}
Logger.info(VertxMain.class, "Used version of Artipie: %s", new ArtipieProperties().version());
final JettyClientSlices http = new JettyClientSlices(new HttpClientSettings());
http.start();
new VertxMain(http, config, vertx, port).start();
}
Aggregations