Search in sources :

Example 1 with DelQuery

use of jakarta.nosql.query.DelQuery in project jnosql-diana by eclipse.

the class RemoveProviderTest method shouldReturnParserQuery2.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "del 12.12" })
public void shouldReturnParserQuery2(String query) {
    DelQuery delQuery = provider.apply(query);
    List<QueryValue<?>> keys = delQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(12.12, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) DelQuery(jakarta.nosql.query.DelQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with DelQuery

use of jakarta.nosql.query.DelQuery in project jnosql-diana by eclipse.

the class RemoveProviderTest method shouldReturnParserQuery.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "del \"Diana\"" })
public void shouldReturnParserQuery(String query) {
    DelQuery delQuery = provider.apply(query);
    List<QueryValue<?>> keys = delQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof StringQueryValue);
    assertEquals("Diana", StringQueryValue.class.cast(key).get());
}
Also used : DelQuery(jakarta.nosql.query.DelQuery) StringQueryValue(jakarta.nosql.query.StringQueryValue) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 3 with DelQuery

use of jakarta.nosql.query.DelQuery in project jnosql-diana by eclipse.

the class RemoveProviderTest method shouldReturnParserQuery1.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "del 12" })
public void shouldReturnParserQuery1(String query) {
    DelQuery delQuery = provider.apply(query);
    List<QueryValue<?>> keys = delQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(12L, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) DelQuery(jakarta.nosql.query.DelQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 4 with DelQuery

use of jakarta.nosql.query.DelQuery in project jnosql-diana by eclipse.

the class RemoveProviderTest method shouldReturnParserQuery3.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "del -12" })
public void shouldReturnParserQuery3(String query) {
    DelQuery delQuery = provider.apply(query);
    List<QueryValue<?>> keys = delQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(-12L, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) DelQuery(jakarta.nosql.query.DelQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 5 with DelQuery

use of jakarta.nosql.query.DelQuery in project jnosql-diana by eclipse.

the class RemoveProviderTest method shouldReturnParserQuery4.

@ParameterizedTest(name = "Should parser the query {0}")
@ValueSource(strings = { "del -12.12" })
public void shouldReturnParserQuery4(String query) {
    DelQuery delQuery = provider.apply(query);
    List<QueryValue<?>> keys = delQuery.getKeys();
    assertEquals(1, keys.size());
    QueryValue<?> key = keys.get(0);
    assertTrue(key instanceof NumberQueryValue);
    assertEquals(-12.12, NumberQueryValue.class.cast(key).get());
}
Also used : NumberQueryValue(jakarta.nosql.query.NumberQueryValue) DelQuery(jakarta.nosql.query.DelQuery) NumberQueryValue(jakarta.nosql.query.NumberQueryValue) QueryValue(jakarta.nosql.query.QueryValue) ArrayQueryValue(jakarta.nosql.query.ArrayQueryValue) StringQueryValue(jakarta.nosql.query.StringQueryValue) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

DelQuery (jakarta.nosql.query.DelQuery)8 ArrayQueryValue (jakarta.nosql.query.ArrayQueryValue)6 NumberQueryValue (jakarta.nosql.query.NumberQueryValue)6 QueryValue (jakarta.nosql.query.QueryValue)6 StringQueryValue (jakarta.nosql.query.StringQueryValue)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 ValueSource (org.junit.jupiter.params.provider.ValueSource)6 Params (jakarta.nosql.Params)2 QueryException (jakarta.nosql.QueryException)2 ServiceLoaderProvider (jakarta.nosql.ServiceLoaderProvider)2 Value (jakarta.nosql.Value)2 BucketManager (jakarta.nosql.keyvalue.BucketManager)2 KeyValuePreparedStatement (jakarta.nosql.keyvalue.KeyValuePreparedStatement)2 DelQueryProvider (jakarta.nosql.query.DelQuery.DelQueryProvider)2 List (java.util.List)2 Collectors.toList (java.util.stream.Collectors.toList)2 Stream (java.util.stream.Stream)2