Commit d33660df authored by Martti Käärik's avatar Martti Käärik
Browse files

Remove "expected" from unexpected logging.

parent e6db5878
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -536,10 +536,8 @@ public class HttpSystemAdapter implements SystemAdapter {
	}

	@Override
	public void logUnexpected(Data received, Data expected, Connection connection, NamedElement target) {
		reporter.comment("SystemAdapter | " + target.getName(), "UNEXPECTED: " + describe(received));
		if (expected != null)
			reporter.comment("SystemAdapter | " + target.getName(), "\t vs " + describe(expected));
	public void logUnexpected(Data received, Connection connection, NamedElement target) {
		reporter.log(target.getName(), "SystemAdapter | " + "UNEXPECTED: " + describe(received));
	}

	private String describe(Data data) {
+4 −13
Original line number Diff line number Diff line
@@ -197,19 +197,10 @@ public class ReceiverHub {
				} else {
					tried.clear();
					if (currentlyExpecting.anyReceiver) {
						// Report the unexpected message through the adapter against the
						// highest-priority expected data that was being awaited (if any).
						Data awaited = null;
						synchronized (expecting) {
							Expectable report = null;
							for (Expectable e: expecting)
								if (e.round == currentlyExpecting.round && !e.ignoreUnmatched && !e.anyReceiver
										&& (report == null || e.priority < report.priority))
									report = e;
							if (report != null)
								awaited = report.expected;
						}
						systemAdapter.logUnexpected(data, awaited, connection, testerComponent);
						// Report the unexpected message through the adapter; the comparisons
						// against the awaited expectations have already been logged by the
						// preceding receive attempts.
						systemAdapter.logUnexpected(data, connection, testerComponent);
						if (anyReceiver != null) {
							anyReceiver.behaviour = () -> {
								throw new StopExceptionImpl(
+2 −3
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public interface SystemAdapter {
	 * decoding). This value is only used for logging (and the format must thus be
	 * supported by the {@link Reporter Reporter} implementation).
	 *
	 * @param expected   The type to be used for decoding incoming data and value to
	 * @param expected   The type to be used for decoding incoming data and template to
	 *                   match against. If null then returns any data that is
	 *                   available after decoding.
	 * @param connection The connection on which the message is to be received.
@@ -72,11 +72,10 @@ public interface SystemAdapter {
	 * Logs an unexpected message in an adapter specific format.
	 *
	 * @param received   The (potentially encoded) data, as returned by the {@link #receive(Data, Connection, NamedElement)}.
	 * @param awaited    An expected value, or null if none.
	 * @param connection The connection on which the message was received.
	 * @param target     The component that received the message.
	 */
	void logUnexpected(Data received, Data expected, Connection connection, NamedElement target);
	void logUnexpected(Data received, Connection connection, NamedElement target);

	/**
	 * Calls a remote procedure and blocks until reply is received or exception is