This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 1003dc93 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Fixing Tests

parent b93f9c8f
Branches
Tags
1 merge request!55June Release
......@@ -391,13 +391,33 @@ public class ElasticSearchTestServerConfiguration {
}
}
/**
* parse the mete data file and return a normalized meta data
* @param metaDataFile the meta data file
* @return parsed metadata
* @throws JsonParseException
* @throws JsonMappingException
* @throws IOException
*/
private UserProvidedMetadataDTO parseMetaDataFile(File metaDataFile)
throws JsonParseException, JsonMappingException, IOException {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
mapper.findAndRegisterModules();
UserProvidedMetadataDTO result = mapper.readValue(metaDataFile, UserProvidedMetadataDTO.class);
makeUpperCase(result.getProgrammingLanguage());
return result;
}
/**
* make all strings in Array uppercase.
* @param strings
*/
private void makeUpperCase(String[] strings) {
if(strings==null) return;
for(int i=0; i<strings.length; i++) {
strings[i] = strings[i].toUpperCase();
}
}
private ExtendedGitProject parseProjectFile(File projectFile)
throws JsonParseException, JsonMappingException, IOException {
......@@ -407,12 +427,26 @@ public class ElasticSearchTestServerConfiguration {
return result;
}
/**
* an interface that is invoked on each node of the tree with a metadata
* @author Michael Breu
*
* @param <T> the harvested data type
*/
private interface Harvester<T> {
/**
*
* @param f the metaData File
* @param subResults the list of results of the next node level
* @param relativePath the relative path from test root
* @param gitProject the information about the git project.
* @return
*/
List<T> harvest(File f, List<T> subResults, String relativePath, ExtendedGitProject gitProject);
}
/**
* recursively visits all nodes, collects all children metadta and then calls
* recursively visits all nodes, collects all children metadata and then calls
* the harvester
*
* @param <T> the type the harvester returns
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment