-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update methods to take Object instead of typed overloads
- Loading branch information
1 parent
6698c5d
commit 3cee096
Showing
14 changed files
with
59 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
core/src/test/java/dev/morphia/test/query/filters/TestBitsAllSet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package dev.morphia.test.query.filters; | ||
|
||
import dev.morphia.test.ServerVersion; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import static dev.morphia.query.filters.Filters.bitsAllSet; | ||
|
||
public class TestBitsAllSet extends FilterTest { | ||
@Test | ||
public void testExample1() { | ||
testQuery(ServerVersion.ANY, false, true, (query) -> query.filter( | ||
bitsAllSet("a", new int[] { 1, 5 }))); | ||
} | ||
|
||
@Test | ||
public void testExample2() { | ||
testQuery(ServerVersion.ANY, false, true, (query) -> query.filter( | ||
bitsAllSet("a", 50))); | ||
} | ||
|
||
@Test | ||
public void testExample3() { | ||
testQuery(ServerVersion.ANY, false, true, (query) -> query.filter( | ||
bitsAllSet("a", new byte[] { 48 }))); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example1/action.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
db.collection.find( { a: { $bitsAllSet: [ 1, 5 ] } } ) |
4 changes: 4 additions & 0 deletions
4
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example1/data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ _id: 1, a: 54, binaryValueofA: "00110110" }, | ||
{ _id: 2, a: 20, binaryValueofA: "00010100" }, | ||
{ _id: 3, a: 20.0, binaryValueofA: "00010100" }, | ||
{ _id: 4, a: BinData(0, "Zg=="), binaryValueofA: "01100110" } |
2 changes: 2 additions & 0 deletions
2
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example1/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ "_id" : 1, "a" : 54, "binaryValueofA" : "00110110" } | ||
{ "_id" : 4, "a" : BinData(0,"Zg=="), "binaryValueofA" : "01100110" } |
1 change: 1 addition & 0 deletions
1
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example1/name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Bit Position Array |
1 change: 1 addition & 0 deletions
1
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example2/action.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
db.collection.find( { a: { $bitsAllSet: 50 } } ) |
4 changes: 4 additions & 0 deletions
4
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example2/data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ _id: 1, a: 54, binaryValueofA: "00110110" }, | ||
{ _id: 2, a: 20, binaryValueofA: "00010100" }, | ||
{ _id: 3, a: 20.0, binaryValueofA: "00010100" }, | ||
{ _id: 4, a: BinData(0, "Zg=="), binaryValueofA: "01100110" } |
1 change: 1 addition & 0 deletions
1
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example2/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "_id" : 1, "a" : 54, "binaryValueofA" : "00110110" } |
1 change: 1 addition & 0 deletions
1
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example2/name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Integer Bitmask |
1 change: 1 addition & 0 deletions
1
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example3/action.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
db.collection.find( { a: { $bitsAllSet: BinData(0, "MA==") } } ) |
4 changes: 4 additions & 0 deletions
4
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example3/data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ _id: 1, a: 54, binaryValueofA: "00110110" }, | ||
{ _id: 2, a: 20, binaryValueofA: "00010100" }, | ||
{ _id: 3, a: 20.0, binaryValueofA: "00010100" }, | ||
{ _id: 4, a: BinData(0, "Zg=="), binaryValueofA: "01100110" } |
1 change: 1 addition & 0 deletions
1
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example3/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ _id: 1, a: 54, binaryValueofA: "00110110" } |
1 change: 1 addition & 0 deletions
1
core/src/test/resources/dev/morphia/test/query/filters/bitsAllSet/example3/name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BinData Bitmask |