/** * This method represents the input port receiving the incoming events. * * @param record * The record to display and relay. */ @Override protected void execute(final OperationExecutionRecord record) { final String shortClassName = ClassOperationSignaturePair.splitOperationSignatureStr(record.getOperationSignature()).getSimpleClassname(); final String methodName = shortClassName + '.' + this.extractMethodName(record.getOperationSignature()); this.methodTagCloud.incrementCounter(methodName); this.componentTagCloud.incrementCounter(shortClassName); }
/** * Tests if the counter value in the component TagCloud is set correctly. */ @Test public void componentTagCloudShouldBeCorrect() { final String className = "Class"; final TagCloud componentTagCloud = new TagCloud(); componentTagCloud.incrementCounter(className); StageTester.test(this.methodAndComponentFlowDisplayFilter).and().send(this.record).to(this.methodAndComponentFlowDisplayFilter.getInputPort()).start(); Assert.assertEquals(this.methodAndComponentFlowDisplayFilter.componentTagCloudDisplay().getCounters().get(className).get(), componentTagCloud.getCounters().get(className).get()); }
/** * Tests if the counter value in the method TagCloud is set correctly. */ @Test public void methodTagCloudShouldBeCorrect() { final String methodName = "Class.method"; final TagCloud methodTagCloud = new TagCloud(); methodTagCloud.incrementCounter(methodName); StageTester.test(this.methodAndComponentFlowDisplayFilter).and().send(this.record).to(this.methodAndComponentFlowDisplayFilter.getInputPort()).start(); Assert.assertEquals(this.methodAndComponentFlowDisplayFilter.methodTagCloudDisplay().getCounters().get(methodName).get(), methodTagCloud.getCounters().get(methodName).get()); }
/** * This method represents the input port receiving the incoming events. * * @param record * The record to display and relay. */ @InputPort(name = MethodAndComponentFlowDisplayFilter.INPUT_PORT_NAME_EVENTS, eventTypes = { OperationExecutionRecord.class }) public void input(final OperationExecutionRecord record) { final String shortClassName = ClassOperationSignaturePair.splitOperationSignatureStr(record.getOperationSignature()).getSimpleClassname(); final String methodName = shortClassName + '.' + this.extractMethodName(record.getOperationSignature()); this.methodTagCloud.incrementCounter(methodName); this.componentTagCloud.incrementCounter(shortClassName); }
/** * This method represents the input port receiving the incoming events. * * @param record * The record to display and relay. */ @InputPort(name = MethodAndComponentFlowDisplayFilter.INPUT_PORT_NAME_EVENTS, eventTypes = { OperationExecutionRecord.class }) public void input(final OperationExecutionRecord record) { final String shortClassName = ClassOperationSignaturePair.splitOperationSignatureStr(record.getOperationSignature()).getSimpleClassname(); final String methodName = shortClassName + '.' + this.extractMethodName(record.getOperationSignature()); this.methodTagCloud.incrementCounter(methodName); this.componentTagCloud.incrementCounter(shortClassName); }