Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
variety
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
variety
Commits
999c3792
Commit
999c3792
authored
Oct 14, 2014
by
Tomas Dvorak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unnamed objects analysis test fixed
parent
97a34e7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
UnnamedObjectsAnalysisTest.java
...a/com/github/variety/test/UnnamedObjectsAnalysisTest.java
+7
-11
No files found.
test/src/test/java/com/github/variety/test/UnnamedObjectsAnalysisTest.java
View file @
999c3792
...
...
@@ -5,6 +5,7 @@ import com.github.variety.VarietyAnalysis;
import
com.mongodb.DBObject
;
import
com.mongodb.util.JSON
;
import
org.junit.After
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -33,20 +34,15 @@ public class UnnamedObjectsAnalysisTest {
public
void
testUnnamedObjects
()
throws
Exception
{
final
VarietyAnalysis
analysis
=
variety
.
runAnalysis
();
Assert
.
assertEquals
(
6
,
analysis
.
getResultsCollection
().
count
());
analysis
.
verifyResult
(
"_id"
,
2
,
100
,
"ObjectId"
);
analysis
.
verifyResult
(
"title"
,
2
,
100
,
"String"
);
analysis
.
verifyResult
(
"comments"
,
2
,
100
,
"Array"
);
// TODO: current version of variety is not able to handle unnamed inside objects. Earlier they were marked with XX. key prefix.
// Now the unnamed object are skipped and not analysed at all. Example of earlier version results can be seen
// in issue https://github.com/variety/variety/issues/29
// There should be 6 different keys: _id, title, comments and three from anonymous objects: comments.XX.author, comments.XX.body, comments.XX.visible
// FIXME: Assert.assertEquals(6, analysis.getResultsCollection().count());
// FIXME: analysis.verifyResult("comments.XX.author", 2, 100, "String");
// FIXME: analysis.verifyResult("comments.XX.body", 2, 100, "String");
// FIXME: analysis.verifyResult("comments.XX.visible", 1, 50, "Boolean");
// unnamed objects are prefixed with .XX key
analysis
.
verifyResult
(
"comments.XX.author"
,
2
,
100
,
"String"
);
analysis
.
verifyResult
(
"comments.XX.body"
,
2
,
100
,
"String"
);
analysis
.
verifyResult
(
"comments.XX.visible"
,
1
,
50
,
"Boolean"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment