use of com.navercorp.pinpoint.test.util.AssertionErrorBuilder in project pinpoint by naver.
the class PluginVerifierExternalAdaptor method verifyService.
@Override
public void verifyService(String serverName, List<String> libs) {
List<ServiceInfo> serviceInfos = getServerMetaData().getServiceInfos();
for (ServiceInfo serviceInfo : serviceInfos) {
if (serviceInfo.getServiceName().equals(serverName)) {
List<String> actualLibs = serviceInfo.getServiceLibs();
if (actualLibs.size() != libs.size()) {
AssertionErrorBuilder builder = new AssertionErrorBuilder("serviceName " + serverName, libs, actualLibs);
builder.throwAssertionError();
}
for (String lib : libs) {
if (!actualLibs.contains(lib)) {
AssertionErrorBuilder builder = new AssertionErrorBuilder("serviceName " + serverName, libs, actualLibs);
builder.throwAssertionError();
}
}
// OK
return;
}
}
AssertionErrorBuilder builder = new AssertionErrorBuilder("serviceName " + serverName, libs, "no such service");
builder.throwAssertionError();
}
use of com.navercorp.pinpoint.test.util.AssertionErrorBuilder in project pinpoint by naver.
the class PluginVerifierExternalAdaptor method verifyConnector.
@Override
public void verifyConnector(String protocol, int port) {
Map<Integer, String> connectorMap = getServerMetaData().getConnectors();
String actualProtocol = connectorMap.get(port);
if (actualProtocol == null || !actualProtocol.equals(protocol)) {
// port validation??
AssertionErrorBuilder builder = new AssertionErrorBuilder("protocol", protocol + ":" + port, actualProtocol);
builder.throwAssertionError();
}
}
use of com.navercorp.pinpoint.test.util.AssertionErrorBuilder in project pinpoint by naver.
the class PluginVerifierExternalAdaptor method verifyException.
private void verifyException(Exception expectedException, String actualExceptionClassName, String actualExceptionMessage) {
String expectedExceptionClassName = expectedException.getClass().getName();
String expectedExceptionMessage = StringUtils.abbreviate(expectedException.getMessage(), 256);
if (!ObjectUtils.equals(actualExceptionClassName, expectedExceptionClassName)) {
AssertionErrorBuilder builder = new AssertionErrorBuilder("ExceptionClassName", expectedExceptionClassName, actualExceptionClassName);
builder.throwAssertionError();
}
if (!ObjectUtils.equals(actualExceptionMessage, expectedExceptionMessage)) {
AssertionErrorBuilder builder = new AssertionErrorBuilder("Exception Message", expectedExceptionMessage, actualExceptionMessage);
builder.throwAssertionError();
}
}
Aggregations