@Override public boolean equals(final Object obj) { if (!(obj instanceof SynchronousReplyMessage)) { return false; } if (this == obj) { return true; } final SynchronousReplyMessage other = (SynchronousReplyMessage) obj; return (this.getTimestamp() == other.getTimestamp()) && this.getSendingExecution().equals(other.getSendingExecution()) && this.getReceivingExecution().equals(other.getReceivingExecution()); }
@Override public boolean equals(final Object obj) { if (!(obj instanceof SynchronousCallMessage)) { return false; } if (this == obj) { return true; } final SynchronousCallMessage other = (SynchronousCallMessage) obj; return (this.getTimestamp() == other.getTimestamp()) && this.getSendingExecution().equals(other.getSendingExecution()) && this.getReceivingExecution().equals(other.getReceivingExecution()); }
if ((!prevE.equals(rootExecution)) && (prevE.getEss() >= curE.getEss())) {
private SynchronousCallMessage createCallMessage(final Execution rootExecution, final Execution prevE, final Execution curE) throws InvalidTraceException { final SynchronousCallMessage message; if (prevE.equals(rootExecution)) { // initial execution callMessage message = new SynchronousCallMessage(curE.getTin(), rootExecution, curE); } else if ((prevE.getEss() + 1) == curE.getEss()) { // usual callMessage with senderComponentName and // receiverComponentName message = new SynchronousCallMessage(curE.getTin(), prevE, curE); } else if (prevE.getEss() < curE.getEss()) { // detect ess incrementation by > 1 final InvalidTraceException ex = new InvalidTraceException( "Ess are only allowed to increment by 1 --" + "but found sequence <" + prevE.getEss() + "," + curE.getEss() + ">" + "(Execution: " + curE + ")"); // don't log and throw // LOG.error("Found invalid trace:" + ex.getMessage()); // don't need the stack trace here throw ex; } else { final String errorMessage = "Unexpected trace: " + prevE + " and " + curE; throw new IllegalStateException(errorMessage); } return message; }
/** * Creates a broken execution trace version of the "well-known" Bookstore trace. * * The trace is broken in that the eoi/ess values of an execution with eoi/ess [1,1] are replaced by the eoi/ess values [1,3]. Since ess values must only * increment/decrement by 1, this test must lead to an exception. * * @param executionFactory * The factory to be used to create the executions. * * @return The execution trace in question. * * @throws InvalidTraceException * If the traceIds of the execution trace and the executions are incompatible. */ private ExecutionTrace genBrokenBookstoreTraceEssSkip(final ExecutionFactory executionFactory) throws InvalidTraceException { // Create an Execution Trace and add Executions in arbitrary order final ExecutionTrace executionTrace = new ExecutionTrace(TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID); final Execution exec1_1__catalog_getBook__broken = executionFactory.genExecution("Catalog", "catalog", "getBook", // NOCS TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 2 * (1000 * 1000), 4 * (1000 * 1000), 1, 3); // NOCS // (MagicNumberCheck) Assert.assertFalse("Invalid test", exec1_1__catalog_getBook__broken.equals(this.exec1_1__catalog_getBook)); executionTrace.add(this.exec3_2__catalog_getBook); executionTrace.add(this.exec2_1__crm_getOrders); executionTrace.add(this.exec0_0__bookstore_searchBook); executionTrace.add(exec1_1__catalog_getBook__broken); return executionTrace; }
/** * Creates a broken execution trace version of the "well-known" Bookstore * trace leads to an exception. * * The trace is broken in that the eoi/ess values of an execution with eoi/ess * [1,1] are replaced by the eoi/ess values [1,3]. Since ess values must only * increment/decrement by 1, this test must lead to an exception. * * @return * @throws InvalidTraceException * If the internally assembled execution trace is somehow invalid. */ private ExecutionTrace genBrokenBookstoreTraceEssSkip() throws InvalidTraceException { // Create an Execution Trace and add Executions in arbitrary order final ExecutionTrace executionTrace = new ExecutionTrace(TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID); final Execution exec1_1__catalog_getBook__broken = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, // NOCS TestExecutionTraceBookstore.SESSION_ID, 2, 4, 1, 3); // NOCS Assert.assertFalse("Invalid test", exec1_1__catalog_getBook__broken.equals(this.exec1_1__catalog_getBook)); executionTrace.add(this.exec3_2__catalog_getBook); executionTrace.add(this.exec2_1__crm_getOrders); executionTrace.add(this.exec0_0__bookstore_searchBook); executionTrace.add(exec1_1__catalog_getBook__broken); return executionTrace; }
/** * Creates a broken execution trace version of the "well-known" Bookstore * trace leads to an exception. * * The trace is broken in that the eoi/ess values of an execution with eoi/ess * [3,2] are replaced by the eoi/ess values [4,2]. Since eoi values must only * increment by 1, this test must lead to an exception. * * @return * @throws InvalidTraceException * If the internally assembled execution trace is somehow invalid. */ private ExecutionTrace genBrokenBookstoreTraceEoiSkip() throws InvalidTraceException { // Create an Execution Trace and add Executions in arbitrary order final ExecutionTrace executionTrace = new ExecutionTrace(TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID); final Execution exec3_2__catalog_getBook__broken = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, // NOCS TestExecutionTraceBookstore.SESSION_ID, 6, 7, 4, 2); Assert.assertFalse("Invalid test", exec3_2__catalog_getBook__broken.equals(this.exec3_2__catalog_getBook)); executionTrace.add(exec3_2__catalog_getBook__broken); executionTrace.add(this.exec2_1__crm_getOrders); executionTrace.add(this.exec0_0__bookstore_searchBook); executionTrace.add(this.exec1_1__catalog_getBook); return executionTrace; }
public final int compare(final Execution e1, final Execution e2) { if (e1.equals(e2)) { return 0;
execFromTrace0.equals(execToAddToTrace1)); if (vPoint == VariationPoint.TRACE_ID) {
retVal.equals(executionTemplate));