@@ -84,8 +84,7 @@ public CrudTest(final String filename, final String description, final String da
84
84
@ Before
85
85
public void setUp () {
86
86
assumeFalse (skipTest );
87
- // No runOn syntax for legacy CRUD, so skipping these manually for now
88
- assumeFalse (isSharded () && description .startsWith ("Aggregate with $currentOp" ));
87
+ assumeFalse (isSharded ());
89
88
90
89
collectionHelper = new CollectionHelper <Document >(new DocumentCodec (), new MongoNamespace (databaseName , collectionName ));
91
90
collectionHelper .killAllSessions ();
@@ -128,17 +127,16 @@ public void shouldPassAllOutcomes() {
128
127
if (definition .containsKey ("operation" )) {
129
128
runOperation (expectedOutcome , definition .getDocument ("operation" ),
130
129
expectedOutcome .containsKey ("result" ) && expectedOutcome .isDocument ("result" )
131
- ? expectedOutcome .get ("result" ). asDocument () : null );
130
+ ? expectedOutcome .get ("result" ) : null );
132
131
} else { // v2 test
133
132
BsonArray operations = definition .getArray ("operations" );
134
133
for (BsonValue operation : operations ) {
135
- runOperation (expectedOutcome , operation .asDocument (),
136
- operation .asDocument ().containsKey ("result" ) ? operation .asDocument ().getDocument ("result" ) : null );
134
+ runOperation (expectedOutcome , operation .asDocument (), operation .asDocument ().get ("result" , null ));
137
135
}
138
136
}
139
137
}
140
138
141
- private void runOperation (final BsonDocument expectedOutcome , final BsonDocument operation , final BsonDocument expectedResult ) {
139
+ private void runOperation (final BsonDocument expectedOutcome , final BsonDocument operation , final BsonValue expectedResult ) {
142
140
BsonDocument outcome = null ;
143
141
boolean wasException = false ;
144
142
try {
@@ -189,7 +187,7 @@ public static Collection<Object[]> data() throws URISyntaxException, IOException
189
187
data .add (new Object []{file .getName (), test .asDocument ().getString ("description" ).getValue (),
190
188
testDocument .getString ("database_name" , new BsonString (getDefaultDatabaseName ())).getValue (),
191
189
testDocument .getString ("collection_name" , new BsonString ("test" )).getValue (),
192
- testDocument .getArray ("data" ), test .asDocument (), skipTest (testDocument , test .asDocument ())});
190
+ testDocument .getArray ("data" , new BsonArray () ), test .asDocument (), skipTest (testDocument , test .asDocument ())});
193
191
}
194
192
}
195
193
return data ;
0 commit comments