@Override public String toString() { final StringBuilder strBuild = new StringBuilder(); strBuild.append(this.timestamp) .append(' '); if (this.getSendingExecution().getOperation().getId() == Operation.ROOT_OPERATION_ID) { strBuild.append(SystemModelRepository.ROOT_NODE_LABEL); } else { strBuild.append(this.getSendingExecution()); } strBuild.append(" --> "); if (this.getReceivingExecution().getOperation().getId() == Operation.ROOT_OPERATION_ID) { strBuild.append(SystemModelRepository.ROOT_NODE_LABEL); } else { strBuild.append(this.getReceivingExecution()); } return strBuild.toString(); }
@Override protected AllocationComponentOperationPair concreteCreatePair(final SynchronousCallMessage callMsg) { final AllocationComponent allocationComponent = callMsg.getReceivingExecution().getAllocationComponent(); final Operation op = callMsg.getReceivingExecution().getOperation(); final AllocationComponentOperationPair destination = AggregatedAllocationComponentOperationCallTreeFilter.this.getSystemEntityFactory() .getAllocationPairFactory().getPairInstanceByPair(allocationComponent, op); // will never be null! return destination; } }
/** * {@inheritDoc} */ @Override protected AssemblyComponentOperationPair concreteCreatePair(final SynchronousCallMessage callMsg) { final Execution execution = callMsg.getReceivingExecution(); final AssemblyComponent assemblyComponent = execution.getAllocationComponent().getAssemblyComponent(); final Operation op = execution.getOperation(); return this.getSystemEntityFactory().getAssemblyPairFactory().getPairInstanceByPair(assemblyComponent, op); } }
@Override public AllocationComponentOperationPair createPair(final SynchronousCallMessage callMsg) { final AllocationComponent allocationComponent = callMsg.getReceivingExecution().getAllocationComponent(); final Operation op = callMsg.getReceivingExecution().getOperation(); final AllocationComponentOperationPair destination = TraceCallTreeFilter.this.getSystemEntityFactory().getAllocationPairFactory() .getPairInstanceByPair(allocationComponent, op); // will never be null! return destination; } }, mt, TraceCallTreeFilter.this.dotOutputFn + "-" + mt.getTraceId() + ".dot", false, TraceCallTreeFilter.this.shortLabels); // no weights
/** * Checks whether the given executions are equal or not. * * @param r1 * The first execution object. * @param r2 * The second execution object. * * @return true if and only if the executions have the same values. */ private boolean executionsEqual(final Execution r1, final Execution r2) { if (r1 == r2) { // NOPMD (no equals) return true; } if ((r1 == null) || (r2 == null)) { return false; } return (r1.getAllocationComponent().getId() == r2.getAllocationComponent().getId()) && (r1.getOperation().getId() == r2.getOperation().getId()) && (r1.getEoi() == r2.getEoi()) && (r1.getEss() == r2.getEss()); }
/** * Creates a new instance of this class using the given parameters. * * @param t * The execution trace to be stored in this container. */ public ExecutionTraceHashContainerAllocationEquivalence(final ExecutionTrace t) { super(t); final int prime = 31; int result = 1; for (final Execution r : t.getTraceAsSortedExecutionSet()) { result = (prime * result) + r.getOperation().getId(); result = (prime * result) + r.getAllocationComponent().getId(); result = (prime * result) + r.getEoi(); result = (prime * result) + r.getEss(); } // this.hashcodeBuffer = result; }
final Signature sig = me.getReceivingExecution().getOperation().getSignature(); final StringBuilder msgLabel = new StringBuilder(sig.getName()); msgLabel.append('(');
/** * Checks whether the given executions are equal or not. * * @param r1 * The first execution object. * @param r2 * The second execution object. * * @return true if and only if the executions have the same values. */ private boolean executionsEqual(final Execution r1, final Execution r2) { if (r1 == r2) { // NOPMD (no equals) return true; } if ((r1 == null) || (r2 == null)) { return false; } return (r1.getAllocationComponent().getAssemblyComponent().getId() == r2.getAllocationComponent().getAssemblyComponent().getId()) && (r1.getOperation().getId() == r2.getOperation().getId()) && (r1.getEoi() == r2.getEoi()) && (r1.getEss() == r2.getEss()); }
/** * Creates a new instance of this class using the given parameters. * * @param t * The execution trace to be stored in this container. */ public ExecutionTraceHashContainerAssemblyEquivalence(final ExecutionTrace t) { super(t); final int prime = 31; int result = 1; for (final Execution r : t.getTraceAsSortedExecutionSet()) { result = (prime * result) + r.getOperation().getId(); result = (prime * result) + r.getAllocationComponent().getAssemblyComponent().getId(); result = (prime * result) + r.getEoi(); result = (prime * result) + r.getEss(); } // this.hashCodeBuffer = result; }
/** * This method can be used to debug the {@link java.util.Comparator} provided by {@link ExecutionTrace#createExecutionTraceComparator()}. */ @Test public void testTreeSet() { final SortedSet<Execution> s0 = new TreeSet<>(ExecutionTrace.createExecutionTraceComparator()); final SortedSet<Execution> s1 = new TreeSet<>(ExecutionTrace.createExecutionTraceComparator()); final Execution execFromTrace0 = this.exec0_0__bookstore_searchBook; final Execution long1 = new Execution(execFromTrace0.getOperation(), execFromTrace0.getAllocationComponent(), execFromTrace0.getTraceId(), execFromTrace0.getSessionId(), execFromTrace0.getEoi(), execFromTrace0.getEss(), execFromTrace0.getTin(), execFromTrace0.getTout(), execFromTrace0.isAssumed()); s0.add(execFromTrace0); s1.add(long1); Assert.assertEquals("Expected sets to be equal", s0, s1); }
@Before public void setUp() throws Exception { final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), new AnalysisController()); this.eFactory = new ExecutionFactory(systemEntityFactory); int myNumExecutions = 0; // Manually create Executions for a trace myNumExecutions++; this.exec0_0__bookstore_searchBook = this.eFactory.genExecution("Bookstore", "bookstore", "searchBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 1, 10, 0, 0); this.minTin = this.exec0_0__bookstore_searchBook.getTin(); this.maxTout = this.exec0_0__bookstore_searchBook.getTout(); myNumExecutions++; this.exec1_1__catalog_getBook = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 2, 4, 1, 1); myNumExecutions++; this.exec2_1__crm_getOrders = this.eFactory.genExecution("CRM", "crm", "getOrders", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 5, 8, 2, 1); myNumExecutions++; this.exec3_2__catalog_getBook = this.eFactory.genExecution("Catalog", "catalog", "getBook", TestExecutionTraceBookstore.TRACE_ID, TestExecutionTraceBookstore.SESSION_ID, 6, 7, 3, 2); // Just some basic checks to make sure that the trace has been set up properly (we've had some trouble here) Assert.assertNotSame(this.exec3_2__catalog_getBook.getOperation(), this.exec2_1__crm_getOrders.getOperation()); Assert.assertNotSame(this.exec0_0__bookstore_searchBook.getAllocationComponent(), this.exec1_1__catalog_getBook.getAllocationComponent()); this.numExecutions = myNumExecutions; }
Operation op = executionTemplate.getOperation(); AllocationComponent allocComp = executionTemplate.getAllocationComponent(); long traceId = executionTemplate.getTraceId(); break; case OPERATION: op = variationTemplate.getOperation(); break; case SESSION_ID:
final AllocationComponent receiverComponent = m.getReceivingExecution().getAllocationComponent(); final int rootOperationId = OperationRepository.ROOT_OPERATION.getId(); final Operation senderOperation = m.getSendingExecution().getOperation(); final Operation receiverOperation = m.getReceivingExecution().getOperation();
final AssemblyComponent receiverComponent = m.getReceivingExecution().getAllocationComponent().getAssemblyComponent(); final int rootOperationId = OperationRepository.ROOT_OPERATION.getId(); final Operation senderOperation = m.getSendingExecution().getOperation(); final Operation receiverOperation = m.getReceivingExecution().getOperation();
Assert.assertEquals("Class/Component type names differ", opExecClassOperationSignature.getFqClassname(), exec.getAllocationComponent().getAssemblyComponent().getType().getFullQualifiedName()); Assert.assertEquals("Signatures differ", opExecClassOperationSignature.getSignature(), exec.getOperation().getSignature());
final Execution variationTemplate = new Execution(this.exec1_1__catalog_getBook.getOperation(), this.exec1_1__catalog_getBook.getAllocationComponent(), this.exec1_1__catalog_getBook.getTraceId() + 100, this.exec1_1__catalog_getBook.getSessionId() + "_", this.exec1_1__catalog_getBook.getEoi() + 100, this.exec1_1__catalog_getBook.getEss() + 100,