Search in sources :

Example 56 with Value

use of com.spotify.ffwd.v1.Value in project googleads-java-lib by googleads.

the class PqlTest method testCreateValue_commaTextSet.

@Test
public void testCreateValue_commaTextSet() {
    Set<String> textSet = new LinkedHashSet<String>();
    textSet.add("value1");
    textSet.add("comma \",\" separated");
    Value value1 = ((SetValue) Pql.createValue(textSet)).getValues().get(0);
    Value value2 = ((SetValue) Pql.createValue(textSet)).getValues().get(1);
    assertEquals("value1", ((TextValue) value1).getValue());
    assertEquals("comma \",\" separated", ((TextValue) value2).getValue());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) DateTimeValue(com.google.api.ads.admanager.jaxws.v202108.DateTimeValue) NumberValue(com.google.api.ads.admanager.jaxws.v202108.NumberValue) TextValue(com.google.api.ads.admanager.jaxws.v202108.TextValue) SetValue(com.google.api.ads.admanager.jaxws.v202108.SetValue) BooleanValue(com.google.api.ads.admanager.jaxws.v202108.BooleanValue) TargetingValue(com.google.api.ads.admanager.jaxws.v202108.TargetingValue) Value(com.google.api.ads.admanager.jaxws.v202108.Value) DateValue(com.google.api.ads.admanager.jaxws.v202108.DateValue) Test(org.junit.Test)

Example 57 with Value

use of com.spotify.ffwd.v1.Value in project googleads-java-lib by googleads.

the class PqlTest method testCreateValue_dateTimeSet.

@Test
public void testCreateValue_dateTimeSet() {
    Set<DateTime> dateTimeSet = new LinkedHashSet<DateTime>();
    dateTimeSet.add(dateTime1);
    Value value1 = ((SetValue) Pql.createValue(dateTimeSet)).getValues().get(0);
    assertEquals("2012-12-02T12:45:00+08:00", DateTimes.toStringWithTimeZone(((DateTimeValue) value1).getValue()));
}
Also used : LinkedHashSet(java.util.LinkedHashSet) DateTimeValue(com.google.api.ads.admanager.jaxws.v202111.DateTimeValue) DateTimeValue(com.google.api.ads.admanager.jaxws.v202111.DateTimeValue) SetValue(com.google.api.ads.admanager.jaxws.v202111.SetValue) NumberValue(com.google.api.ads.admanager.jaxws.v202111.NumberValue) Value(com.google.api.ads.admanager.jaxws.v202111.Value) BooleanValue(com.google.api.ads.admanager.jaxws.v202111.BooleanValue) TextValue(com.google.api.ads.admanager.jaxws.v202111.TextValue) TargetingValue(com.google.api.ads.admanager.jaxws.v202111.TargetingValue) DateValue(com.google.api.ads.admanager.jaxws.v202111.DateValue) DateTime(com.google.api.ads.admanager.jaxws.v202111.DateTime) Test(org.junit.Test)

Example 58 with Value

use of com.spotify.ffwd.v1.Value in project googleads-java-lib by googleads.

the class PqlTest method testCreateValue_dateSet.

@Test
public void testCreateValue_dateSet() {
    Set<Date> numberSet = new LinkedHashSet<Date>();
    numberSet.add(date1);
    Value value1 = ((SetValue) Pql.createValue(numberSet)).getValues().get(0);
    assertEquals("2012-12-02", DateTimes.toString(((DateValue) value1).getValue()));
}
Also used : LinkedHashSet(java.util.LinkedHashSet) DateValue(com.google.api.ads.admanager.jaxws.v202111.DateValue) DateTimeValue(com.google.api.ads.admanager.jaxws.v202111.DateTimeValue) SetValue(com.google.api.ads.admanager.jaxws.v202111.SetValue) NumberValue(com.google.api.ads.admanager.jaxws.v202111.NumberValue) Value(com.google.api.ads.admanager.jaxws.v202111.Value) BooleanValue(com.google.api.ads.admanager.jaxws.v202111.BooleanValue) TextValue(com.google.api.ads.admanager.jaxws.v202111.TextValue) TargetingValue(com.google.api.ads.admanager.jaxws.v202111.TargetingValue) DateValue(com.google.api.ads.admanager.jaxws.v202111.DateValue) Date(com.google.api.ads.admanager.jaxws.v202111.Date) Test(org.junit.Test)

Example 59 with Value

use of com.spotify.ffwd.v1.Value in project googleads-java-lib by googleads.

the class PqlTest method testCreateValue_numberSet.

@Test
public void testCreateValue_numberSet() {
    Set<Long> numberSet = new LinkedHashSet<Long>();
    numberSet.add(1L);
    Value value1 = ((SetValue) Pql.createValue(numberSet)).getValues().get(0);
    assertEquals("1", ((NumberValue) value1).getValue());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) DateTimeValue(com.google.api.ads.admanager.jaxws.v202111.DateTimeValue) SetValue(com.google.api.ads.admanager.jaxws.v202111.SetValue) NumberValue(com.google.api.ads.admanager.jaxws.v202111.NumberValue) Value(com.google.api.ads.admanager.jaxws.v202111.Value) BooleanValue(com.google.api.ads.admanager.jaxws.v202111.BooleanValue) TextValue(com.google.api.ads.admanager.jaxws.v202111.TextValue) TargetingValue(com.google.api.ads.admanager.jaxws.v202111.TargetingValue) DateValue(com.google.api.ads.admanager.jaxws.v202111.DateValue) Test(org.junit.Test)

Example 60 with Value

use of com.spotify.ffwd.v1.Value in project googleads-java-lib by googleads.

the class PqlTest method testCreateValue_commaTextSet.

@Test
public void testCreateValue_commaTextSet() {
    Set<String> textSet = new LinkedHashSet<String>();
    textSet.add("value1");
    textSet.add("comma \",\" separated");
    Value value1 = ((SetValue) Pql.createValue(textSet)).getValues().get(0);
    Value value2 = ((SetValue) Pql.createValue(textSet)).getValues().get(1);
    assertEquals("value1", ((TextValue) value1).getValue());
    assertEquals("comma \",\" separated", ((TextValue) value2).getValue());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) DateTimeValue(com.google.api.ads.admanager.jaxws.v202111.DateTimeValue) SetValue(com.google.api.ads.admanager.jaxws.v202111.SetValue) NumberValue(com.google.api.ads.admanager.jaxws.v202111.NumberValue) Value(com.google.api.ads.admanager.jaxws.v202111.Value) BooleanValue(com.google.api.ads.admanager.jaxws.v202111.BooleanValue) TextValue(com.google.api.ads.admanager.jaxws.v202111.TextValue) TargetingValue(com.google.api.ads.admanager.jaxws.v202111.TargetingValue) DateValue(com.google.api.ads.admanager.jaxws.v202111.DateValue) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)126 Value (com.google.firestore.v1.Value)108 ArrayValue (com.google.firestore.v1.ArrayValue)73 LinkedHashSet (java.util.LinkedHashSet)71 ObjectValue (com.google.firebase.firestore.model.ObjectValue)53 NullValue (com.google.protobuf.NullValue)50 MapValue (com.google.firestore.v1.MapValue)47 ArrayList (java.util.ArrayList)30 HashMap (java.util.HashMap)24 Value (com.google.datastore.v1.Value)20 Map (java.util.Map)19 TableFieldSchema (com.google.api.services.bigquery.model.TableFieldSchema)17 List (java.util.List)17 Record (org.apache.avro.generic.GenericData.Record)16 SchemaAndRecord (org.apache.beam.sdk.io.gcp.bigquery.SchemaAndRecord)16 CoreMatchers.notNullValue (org.hamcrest.CoreMatchers.notNullValue)16 Set (java.util.Set)14 TestUtil.wrapObject (com.google.firebase.firestore.testutil.TestUtil.wrapObject)13 Nullable (androidx.annotation.Nullable)10 Value (com.google.privacy.dlp.v2.Value)9