This is the codeAbility Sharing Platform! Learn more about the
codeAbility Sharing Platform
.
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
codeAbility Sharing Platform
Manage
Activity
Members
Labels
Plan
Issues
41
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
development
sharing
codeAbility Sharing Platform
Commits
1003dc93
Commit
1003dc93
authored
3 years ago
by
Michael Breu
Browse files
Options
Downloads
Patches
Plain Diff
Fixing Tests
parent
b93f9c8f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!55
June Release
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/at/ac/uibk/gitsearch/repository/search/testESService/ElasticSearchTestServerConfiguration.java
+35
-1
35 additions, 1 deletion
...h/testESService/ElasticSearchTestServerConfiguration.java
with
35 additions
and
1 deletion
src/test/java/at/ac/uibk/gitsearch/repository/search/testESService/ElasticSearchTestServerConfiguration.java
+
35
−
1
View file @
1003dc93
...
...
@@ -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 metad
a
ta and then calls
* the harvester
*
* @param <T> the type the harvester returns
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment