protected void addTestSuiteMethodsFromDependencies() { for (CompiledDependency dependency : this.getDependencies()) { for (IOpenMethod depMethod : dependency.getCompiledOpenClass().getOpenClassWithErrors().getMethods()) { if (depMethod instanceof TestSuiteMethod) { TestSuiteMethod testSuiteMethod = (TestSuiteMethod) depMethod; try { // Workaround for set dependency names in method while // compile if (testSuiteMethod.getModuleName() == null) { testSuiteMethod.setModuleName(dependency.getDependencyName()); } TestSuiteMethod newTestSuiteMethod = createNewTestSuiteMethod(testSuiteMethod); addMethod(newTestSuiteMethod); } catch (OpenlNotCheckedException e) { if (Log.isDebugEnabled()) { Log.debug(e.getMessage(), e); } addError(e); } } } } }
private void addDataTables(CompiledOpenClass dependency) { IOpenClass openClass = dependency.getOpenClassWithErrors(); Map<String, IOpenField> fieldsMap = openClass.getFields(); Set<String> tableUrls = new HashSet<String>(); Map<String, IOpenField> fields = getFields(); for (IOpenField openField : fields.values()) { if (openField instanceof DataOpenField) { tableUrls.add(((DataOpenField) openField).getTableUri()); } } for (String key : fieldsMap.keySet()) { IOpenField field = fieldsMap.get(key); if (field instanceof DataOpenField) { DataOpenField dataOpenField = (DataOpenField) field; try { String tableUrl = dataOpenField.getTableUri(); // Test tables are added both as methods and variables. if (!tableUrls.contains(tableUrl) && !duplicatedMethodUrls.contains(tableUrl)) { boolean containsInDependency = false; if (VirtualSourceCodeModule.SOURCE_URI.equals(metaInfo.getSourceUrl())) { for (CompiledDependency d : getDependencies()) { IOpenClass dependentModuleClass = d.getCompiledOpenClass().getOpenClassWithErrors(); if (dependentModuleClass instanceof XlsModuleOpenClass) { if (((XlsModuleOpenClass) dependentModuleClass) .duplicatedMethodUrls.contains(tableUrl)) { containsInDependency = true; break; } } } } if (!containsInDependency) { addField(field); tableUrls.add(tableUrl); } } } catch (OpenlNotCheckedException e) { SyntaxNodeException error = SyntaxNodeExceptionUtils.createError( e.getMessage(), e, dataOpenField.getTable().getTableSyntaxNode()); addError(error); } } } if (openClass instanceof XlsModuleOpenClass) { XlsModuleOpenClass xlsModuleOpenClass = (XlsModuleOpenClass) openClass; if (xlsModuleOpenClass.getDataBase() != null) { for (ITable table : xlsModuleOpenClass.getDataBase().getTables()) { if (XlsNodeTypes.XLS_DATA.toString().equals(table.getTableSyntaxNode().getType())) { try { getDataBase().registerTable(table); } catch (DuplicatedTableException e) { addError(e); } catch (OpenlNotCheckedException e) { addError(e); } } } } } }