Package org.netmelody.cieye.server.response

Examples of org.netmelody.cieye.server.response.CiEyeResponse.inputStream()


        context.checking(new Expectations() {{
            allowing(spyIntermediary).briefingOn(feature); will(returnValue(briefing));
        }});
       
        final CiEyeResponse response = responder.respond(null);
        assertThat(IOUtils.toString(response.inputStream()), startsWith("{\"targets\":[]}"));
    }

}
View Full Code Here


            allowing(configFetcher).getVersion(); will(returnValue("myVersion"));
            ignoring(updateChecker);
        }});
       
        final CiEyeResponse response = ciEyeVersionResponder.respond(null);
        assertThat(IOUtils.toString(response.inputStream()), containsString("\"currentServerVersion\":\"myVersion\""));
    }
   
    @Test public void
    providesJsonWithLatestVersionInformation() throws IOException {
        context.checking(new Expectations() {{
View Full Code Here

            ignoring(configFetcher);
        }});
       
        final CiEyeResponse response = ciEyeVersionResponder.respond(null);
       
        assertThat(IOUtils.toString(response.inputStream()), containsString("\"latestServerVersion\":\"myNewVersion\""));
    }

}
View Full Code Here

            response.setCode(result.status.getCode());
            response.setText(result.status.getDescription());
            for (Entry<String, String> header : result.additionalStringHeaders.entrySet()) {
                response.set(header.getKey(), header.getValue());
            }
            IOUtils.copy(result.inputStream(), response.getOutputStream());
        }
        catch (Exception e) {
            LOG.error("Failed to respond to request for resource " + request.getPath().getPath(), e);
            response.setCode(Status.NOT_FOUND.getCode());
            response.setText(Status.NOT_FOUND.getDescription());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.