/** * Fills the <code>featureNode</code> with the features. Iterates over the features and adds them * as children of the feature node. * * @param featureNode The node to be filled. * @param features The features that will fill the node. */ private void fillFeatureNode(TreeObject featureNode, Collection<String> features) { for (String feature : features) { String featureName = FileUtil.getFileName(feature); if (!this.existChild(featureName, featureNode)) { DocumentTreeObject tdo = new DocumentTreeObject(featureName, feature, DocumentType.useCase); featureNode.addChild(tdo); } } }
/** * Fills the test case node. Iterates over the test suites to add them as children of the test * case node. * * @param testCaseNode The node to be filled with the test cases. * @param testSuites The test suites that will fill the node. */ private void fillTestCaseNode(TreeObject testCaseNode, Collection<String> testSuites) { for (String testSuite : testSuites) { String suiteName = FileUtil.getFileName(testSuite); if (!this.existChild(suiteName, testCaseNode)) { DocumentTreeObject tdo = new DocumentTreeObject(suiteName, testSuite, DocumentType.testCase); testCaseNode.addChild(tdo); } } }
/** * Verifies if there is a file name in a list of absolute file names. * * @param name The name to be verified. * @param names The names where <code>name</code> will be searched. * @return <i>True</i> if the name is in <code>names</code> or <i>false</i> otherwise. */ private boolean hasElements(String name, Collection<String> names) { boolean result = false; for (String string : names) { if (name.equals(FileUtil.getFileName(string))) { result = true; break; } } return result; }