/** * Creates a new instance of this class. */ public TestTraceReconstructionFilter() { final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), new AnalysisController()); final ExecutionFactory executionFactory = new ExecutionFactory(systemEntityFactory); // Manually create Executions for a trace this.exec0_0__bookstore_searchBook = executionFactory.genExecution("Bookstore", "bookstore", "searchBook", TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 1 * (1000 * 1000), 10 * (1000 * 1000), 0, 0); this.exec1_1__catalog_getBook = executionFactory.genExecution("Catalog", "catalog", "getBook", TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 2 * (1000 * 1000), 4 * (1000 * 1000), 1, 1); this.exec2_1__crm_getOrders = executionFactory.genExecution("CRM", "crm", "getOrders", TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 5 * (1000 * 1000), 8 * (1000 * 1000), 2, 1); this.exec3_2__catalog_getBook = executionFactory.genExecution("Catalog", "catalog", "getBook", TestTraceReconstructionFilter.TRACE_ID, TestTraceReconstructionFilter.SESSION_ID, 6 * (1000 * 1000), 7 * (1000 * 1000), 3, 2); }
boolean successfulExecution = true; final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), this.analysisController);
final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), controller); final ExecutionFactory executionFactory = new ExecutionFactory(systemEntityFactory);
controller); final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), controller);
final AnalysisController controller = new AnalysisController(); final SystemModelRepository systemEntityFactory = new SystemModelRepository(new Configuration(), controller); final ExecutionFactory executionFactory = new ExecutionFactory(systemEntityFactory);
@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; }
final SystemModelRepository systemModelRepository = new SystemModelRepository(new Configuration(), analysisController);
private static GraphTestSetup prepareEnvironment(final AnalysisController analysisController, final AbstractGraphProducingFilter<?> graphProducer, final String inputPortName, final String systemModelRepositoryPortName, final List<OperationExecutionRecord> executionRecords, final AbstractGraphFilter<?, ?, ?, ?>... graphFilters) throws AnalysisConfigurationException { final SystemModelRepository systemModelRepository = new SystemModelRepository(new Configuration(), analysisController); final ListReader<OperationExecutionRecord> readerPlugin = new ListReader<>(new Configuration(), analysisController); readerPlugin.addAllObjects(executionRecords); final ExecutionRecordTransformationFilter transformationFilter = new ExecutionRecordTransformationFilter(new Configuration(), analysisController); final TraceReconstructionFilter traceReconstructionFilter = new TraceReconstructionFilter(new Configuration(), analysisController); // Correct the behavior of the extended list filter as properties are not inherited. final Configuration graphReceiverConfiguration = new Configuration(); graphReceiverConfiguration.setProperty(ListCollectionFilter.CONFIG_PROPERTY_NAME_MAX_NUMBER_OF_ENTRIES, ListCollectionFilter.CONFIG_PROPERTY_VALUE_NUMBER_OF_ENTRIES); final GraphReceiverPlugin graphReceiver = new GraphReceiverPlugin(graphReceiverConfiguration, analysisController); // Connect repositories analysisController.connect(transformationFilter, AbstractTraceAnalysisFilter.REPOSITORY_PORT_NAME_SYSTEM_MODEL, systemModelRepository); analysisController.connect(traceReconstructionFilter, AbstractTraceAnalysisFilter.REPOSITORY_PORT_NAME_SYSTEM_MODEL, systemModelRepository); if (systemModelRepositoryPortName != null) { analysisController.connect(graphProducer, systemModelRepositoryPortName, systemModelRepository); } // Connect plugins analysisController.connect(readerPlugin, ListReader.OUTPUT_PORT_NAME, transformationFilter, ExecutionRecordTransformationFilter.INPUT_PORT_NAME_RECORDS); analysisController.connect(transformationFilter, ExecutionRecordTransformationFilter.OUTPUT_PORT_NAME_EXECUTIONS, traceReconstructionFilter, TraceReconstructionFilter.INPUT_PORT_NAME_EXECUTIONS); analysisController.connect(traceReconstructionFilter, TraceReconstructionFilter.OUTPUT_PORT_NAME_MESSAGE_TRACE, graphProducer, inputPortName); DependencyGraphTestUtil.connectGraphFilters(analysisController, graphProducer, graphFilters, graphReceiver); return new GraphTestSetup(analysisController, graphReceiver); }
private static void createAndConnectPlugins(final IAnalysisController analysisController) { final SystemModelRepository traceRepo = new SystemModelRepository(new Configuration(), analysisController);