You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: branches/logging-alpha/gcloud-java-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,9 @@ public DatastoreOptions build() {
75
75
returnnewDatastoreOptions(this);
76
76
}
77
77
78
+
/**
79
+
* Sets the default namespace to be used by the datastore service.
Copy file name to clipboardExpand all lines: branches/logging-alpha/gcloud-java-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java
+17-6Lines changed: 17 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -556,17 +556,28 @@ private static int findAvailablePort() {
556
556
}
557
557
}
558
558
559
+
privateDatastoreOptions.BuilderoptionsBuilder() {
560
+
returnDatastoreOptions.builder()
561
+
.projectId(projectId)
562
+
.host("localhost:" + Integer.toString(port))
563
+
.authCredentials(AuthCredentials.noAuth())
564
+
.retryParams(RetryParams.noRetries());
565
+
}
566
+
559
567
/**
560
568
* Returns a {@link DatastoreOptions} instance that sets the host to use the Datastore emulator on
561
569
* localhost.
562
570
*/
563
571
publicDatastoreOptionsoptions() {
564
-
returnDatastoreOptions.builder()
565
-
.projectId(projectId)
566
-
.host("localhost:" + Integer.toString(port))
567
-
.authCredentials(AuthCredentials.noAuth())
568
-
.retryParams(RetryParams.noRetries())
569
-
.build();
572
+
returnoptionsBuilder().build();
573
+
}
574
+
575
+
/**
576
+
* Returns a {@link DatastoreOptions} instance that sets the host to use the Datastore emulator on
577
+
* localhost. The default namespace is set to {@code namespace}.
Copy file name to clipboardExpand all lines: branches/logging-alpha/gcloud-java-datastore/src/test/java/com/google/cloud/datastore/testing/LocalDatastoreHelperTest.java
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@
16
16
17
17
packagecom.google.cloud.datastore.testing;
18
18
19
+
importstaticorg.junit.Assert.assertEquals;
19
20
importstaticorg.junit.Assert.assertSame;
20
21
importstaticorg.junit.Assert.assertTrue;
21
22
@@ -31,6 +32,7 @@ public class LocalDatastoreHelperTest {
0 commit comments