コード例 #1
0
 void doTestGetStargateVersionPB() throws IOException {
   Response response = client.get("/version", MIMETYPE_PROTOBUF);
   assertTrue(response.getCode() == 200);
   VersionModel model = new VersionModel();
   model.getObjectFromMessage(response.getBody());
   validate(model);
   LOG.info("success retrieving Stargate version as protobuf");
 }
コード例 #2
0
 void validate(VersionModel model) {
   assertNotNull(model);
   assertNotNull(model.getRESTVersion());
   assertEquals(model.getRESTVersion(), RESTServlet.VERSION_STRING);
   String osVersion = model.getOSVersion();
   assertNotNull(osVersion);
   assertTrue(osVersion.contains(System.getProperty("os.name")));
   assertTrue(osVersion.contains(System.getProperty("os.version")));
   assertTrue(osVersion.contains(System.getProperty("os.arch")));
   String jvmVersion = model.getJVMVersion();
   assertNotNull(jvmVersion);
   assertTrue(jvmVersion.contains(System.getProperty("java.vm.vendor")));
   assertTrue(jvmVersion.contains(System.getProperty("java.version")));
   assertTrue(jvmVersion.contains(System.getProperty("java.vm.version")));
   assertNotNull(model.getServerVersion());
   String jerseyVersion = model.getJerseyVersion();
   assertNotNull(jerseyVersion);
   assertEquals(jerseyVersion, ServletContainer.class.getPackage().getImplementationVersion());
 }