Skip to content

Commit bf1857f

Browse files
committed
---
yaml --- r: 5883 b: refs/heads/tswast-patch-1 c: 030713d h: refs/heads/master i: 5881: 176aea0 5879: 167c355
1 parent e092038 commit bf1857f

11 files changed

Lines changed: 535 additions & 2 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 40e5ae0f379d2ee4a359e877690d1b13fdf320a8
60+
refs/heads/tswast-patch-1: 030713daa4ed2ed3a876d214eda87f0799707973
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.datastore;
18+
19+
import static junit.framework.TestCase.assertFalse;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertTrue;
22+
23+
import org.junit.Test;
24+
25+
public class BlobValueTest {
26+
27+
private static final Blob CONTENT = Blob.copyFrom(new byte[] {1, 2});
28+
29+
@Test
30+
public void testToBuilder() throws Exception {
31+
BlobValue value = BlobValue.of(CONTENT);
32+
assertEquals(value, value.toBuilder().build());
33+
}
34+
35+
@Test
36+
public void testOf() throws Exception {
37+
BlobValue value = BlobValue.of(CONTENT);
38+
assertEquals(CONTENT, value.get());
39+
assertFalse(value.hasIndexed());
40+
assertFalse(value.hasMeaning());
41+
}
42+
43+
@Test
44+
public void testBuilder() throws Exception {
45+
BlobValue.Builder builder = BlobValue.builder(CONTENT);
46+
BlobValue value = builder.meaning(1).indexed(false).build();
47+
assertEquals(CONTENT, value.get());
48+
assertTrue(value.hasMeaning());
49+
assertEquals(Integer.valueOf(1), value.meaning());
50+
assertTrue(value.hasIndexed());
51+
assertFalse(value.indexed());
52+
}
53+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.datastore;
18+
19+
import static junit.framework.TestCase.assertFalse;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertTrue;
22+
23+
import org.junit.Test;
24+
25+
public class BooleanValueTest {
26+
27+
@Test
28+
public void testToBuilder() throws Exception {
29+
BooleanValue value = BooleanValue.of(true);
30+
assertEquals(value, value.toBuilder().build());
31+
}
32+
33+
@Test
34+
public void testOf() throws Exception {
35+
BooleanValue value = BooleanValue.of(false);
36+
assertFalse(value.get());
37+
assertFalse(value.hasIndexed());
38+
assertFalse(value.hasMeaning());
39+
}
40+
41+
@Test
42+
public void testBuilder() throws Exception {
43+
BooleanValue.Builder builder = BooleanValue.builder(true);
44+
BooleanValue value = builder.meaning(1).indexed(true).build();
45+
assertTrue(value.get());
46+
assertTrue(value.hasMeaning());
47+
assertEquals(Integer.valueOf(1), value.meaning());
48+
assertTrue(value.hasIndexed());
49+
assertTrue(value.indexed());
50+
}
51+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.datastore;
18+
19+
import static junit.framework.TestCase.assertFalse;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertTrue;
22+
23+
import org.junit.Test;
24+
25+
public class DateTimeValueTest {
26+
27+
private static final DateTime CONTENT = DateTime.now();
28+
29+
@Test
30+
public void testToBuilder() throws Exception {
31+
DateTimeValue value = DateTimeValue.of(CONTENT);
32+
assertEquals(value, value.toBuilder().build());
33+
}
34+
35+
@Test
36+
public void testOf() throws Exception {
37+
DateTimeValue value = DateTimeValue.of(CONTENT);
38+
assertEquals(CONTENT, value.get());
39+
assertFalse(value.hasIndexed());
40+
assertFalse(value.hasMeaning());
41+
}
42+
43+
@Test
44+
public void testBuilder() throws Exception {
45+
DateTimeValue.Builder builder = DateTimeValue.builder(CONTENT);
46+
DateTimeValue value = builder.meaning(1).indexed(false).build();
47+
assertEquals(CONTENT, value.get());
48+
assertTrue(value.hasMeaning());
49+
assertEquals(Integer.valueOf(1), value.meaning());
50+
assertTrue(value.hasIndexed());
51+
assertFalse(value.indexed());
52+
}
53+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.datastore;
18+
19+
import static junit.framework.TestCase.assertFalse;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertTrue;
22+
23+
import org.junit.Test;
24+
25+
public class DoubleValueTest {
26+
27+
private static final Double CONTENT = 1.25;
28+
29+
@Test
30+
public void testToBuilder() throws Exception {
31+
DoubleValue value = DoubleValue.of(CONTENT);
32+
assertEquals(value, value.toBuilder().build());
33+
}
34+
35+
@Test
36+
public void testOf() throws Exception {
37+
DoubleValue value = DoubleValue.of(CONTENT);
38+
assertEquals(CONTENT, value.get());
39+
assertFalse(value.hasIndexed());
40+
assertFalse(value.hasMeaning());
41+
}
42+
43+
@Test
44+
public void testBuilder() throws Exception {
45+
DoubleValue.Builder builder = DoubleValue.builder(CONTENT);
46+
DoubleValue value = builder.meaning(1).indexed(false).build();
47+
assertEquals(CONTENT, value.get());
48+
assertTrue(value.hasMeaning());
49+
assertEquals(Integer.valueOf(1), value.meaning());
50+
assertTrue(value.hasIndexed());
51+
assertFalse(value.indexed());
52+
}
53+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.datastore;
18+
19+
import static junit.framework.TestCase.assertFalse;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertTrue;
22+
23+
import org.junit.Test;
24+
25+
public class EntityValueTest {
26+
27+
private static final Key KEY = Key.builder("ds", "kind", 1).build();
28+
private static final Entity CONTENT = Entity.builder(KEY).set("FOO", "BAR").build();
29+
30+
@Test
31+
public void testToBuilder() throws Exception {
32+
EntityValue value = EntityValue.of(CONTENT);
33+
assertEquals(value, value.toBuilder().build());
34+
}
35+
36+
@Test
37+
public void testOf() throws Exception {
38+
EntityValue value = EntityValue.of(CONTENT);
39+
assertEquals(CONTENT, value.get());
40+
assertTrue(value.hasIndexed());
41+
assertFalse(value.indexed());
42+
assertFalse(value.hasMeaning());
43+
}
44+
45+
@Test
46+
public void testBuilder() throws Exception {
47+
EntityValue.Builder builder = EntityValue.builder(CONTENT);
48+
EntityValue value = builder.meaning(1).indexed(false).build();
49+
assertEquals(CONTENT, value.get());
50+
assertTrue(value.hasMeaning());
51+
assertEquals(Integer.valueOf(1), value.meaning());
52+
assertTrue(value.hasIndexed());
53+
assertFalse(value.indexed());
54+
}
55+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.datastore;
18+
19+
import static junit.framework.TestCase.assertFalse;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertTrue;
22+
23+
import org.junit.Test;
24+
25+
public class KeyValueTest {
26+
27+
private static final Key CONTENT = Key.builder("ds", "kind", 1).build();
28+
29+
@Test
30+
public void testToBuilder() throws Exception {
31+
KeyValue value = KeyValue.of(CONTENT);
32+
assertEquals(value, value.toBuilder().build());
33+
}
34+
35+
@Test
36+
public void testOf() throws Exception {
37+
KeyValue value = KeyValue.of(CONTENT);
38+
assertEquals(CONTENT, value.get());
39+
assertFalse(value.hasIndexed());
40+
assertFalse(value.hasMeaning());
41+
}
42+
43+
@Test
44+
public void testBuilder() throws Exception {
45+
KeyValue.Builder builder = KeyValue.builder(CONTENT);
46+
KeyValue value = builder.meaning(1).indexed(false).build();
47+
assertEquals(CONTENT, value.get());
48+
assertTrue(value.hasMeaning());
49+
assertEquals(Integer.valueOf(1), value.meaning());
50+
assertTrue(value.hasIndexed());
51+
assertFalse(value.indexed());
52+
}
53+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.gcloud.datastore;
18+
19+
import static junit.framework.TestCase.assertFalse;
20+
import static org.junit.Assert.assertEquals;
21+
import static org.junit.Assert.assertTrue;
22+
23+
import org.junit.Test;
24+
25+
public class LongValueTest {
26+
27+
private static final Long CONTENT = 125L;
28+
29+
@Test
30+
public void testToBuilder() throws Exception {
31+
LongValue value = LongValue.of(CONTENT);
32+
assertEquals(value, value.toBuilder().build());
33+
}
34+
35+
@Test
36+
public void testOf() throws Exception {
37+
LongValue value = LongValue.of(CONTENT);
38+
assertEquals(CONTENT, value.get());
39+
assertFalse(value.hasIndexed());
40+
assertFalse(value.hasMeaning());
41+
}
42+
43+
@Test
44+
public void testBuilder() throws Exception {
45+
LongValue.Builder builder = LongValue.builder(CONTENT);
46+
LongValue value = builder.meaning(1).indexed(false).build();
47+
assertEquals(CONTENT, value.get());
48+
assertTrue(value.hasMeaning());
49+
assertEquals(Integer.valueOf(1), value.meaning());
50+
assertTrue(value.hasIndexed());
51+
assertFalse(value.indexed());
52+
}
53+
}

0 commit comments

Comments
 (0)