/** * Tests if the receiving faults table and the fault receiving counts are correctly updated when * 'incrementFaultsReceiving' is called. */ public void testIncrementFaultsReceiving() { EndpointView endpointView = createMockEndPointView(0); endpointView.incrementFaultsReceiving(100); Assert.assertEquals("Receiving fault count not incremented", 1, endpointView.getFaultsReceiving()); Assert.assertEquals("Receiving fault table not updated", 1, endpointView.getReceivingFaultTable().get(100).longValue()); endpointView.incrementFaultsReceiving(100); Assert.assertEquals("Receiving fault count not incremented", 2, endpointView.getFaultsReceiving()); Assert.assertEquals("Receiving fault table not updated", 2, endpointView.getReceivingFaultTable().get(100).longValue()); }
/** * Number of faults, receiving replies * @return # of faults, receiving replies */ public long getFaultsReceiving() { if (endpoint.getChildren() != null) { long faultsReceiving = 0; for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { faultsReceiving += e.getMetricsMBean().getFaultsReceiving(); } } return faultsReceiving; } else { return faultsReceiving; } }
/** * Number of faults, receiving replies * @return # of faults, receiving replies */ public long getFaultsReceiving() { if (endpoint.getChildren() != null) { long faultsReceiving = 0; for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { faultsReceiving += e.getMetricsMBean().getFaultsReceiving(); } } return faultsReceiving; } else { return faultsReceiving; } }
/** * Method to assert reset statistics of an endpoint view. * * @param endpointView the endpoint view of which statistics should be asserted */ private void assertResetStatistics(EndpointView endpointView) { Assert.assertEquals("message receive count not reset", 0, endpointView.getMessagesReceived()); Assert.assertEquals("Faults receive count not reset", 0, endpointView.getFaultsReceiving()); Assert.assertEquals("Receive timeout count not reset", 0, endpointView.getTimeoutsReceiving()); Assert.assertEquals("Bytes received not reset", 0, endpointView.getBytesReceived()); Assert.assertEquals("Min message size received not reset", 0, endpointView.getMinSizeReceived()); Assert.assertEquals("Max message size received not reset", 0, endpointView.getMaxSizeReceived()); Assert.assertEquals("Average message size received not reset", 0.0, endpointView.getAvgSizeReceived()); Assert.assertEquals("Receiving fault table not cleared", 0, endpointView.getReceivingFaultTable().size()); Assert.assertEquals("Message sent count not reset", 0, endpointView.getMessagesSent()); Assert.assertEquals("Faults sent count not reset", 0, endpointView.getFaultsSending()); Assert.assertEquals("Sending timeout count not reset", 0, endpointView.getTimeoutsSending()); Assert.assertEquals("Bytes send not reset", 0, endpointView.getBytesSent()); Assert.assertEquals("Min message size sent not reset", 0, endpointView.getMinSizeSent()); Assert.assertEquals("Max message size sent not reset", 0, endpointView.getMaxSizeSent()); Assert.assertEquals("Average message size setn not reset", 0.0, endpointView.getAvgSizeSent()); Assert.assertEquals("Sending failut table not cleared", 0, endpointView.getSendingFaultTable().size()); Assert.assertEquals("Response code table not cleared", 0, endpointView.getResponseCodeTable().size()); }