Skip to content

Commit b795324

Browse files
author
Ajay Kannan
committed
Assuage checkstyle's complaints
1 parent f220cb7 commit b795324

File tree

1 file changed

+16
-5
lines changed
  • datastore/src/main/java/com/google/datastore/snippets

1 file changed

+16
-5
lines changed

datastore/src/main/java/com/google/datastore/snippets/Concepts.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,25 @@ public class Concepts {
8989
@Rule
9090
public ExpectedException thrown = ExpectedException.none();
9191

92+
/**
93+
* Starts the local Datastore emulator.
94+
*
95+
* @throws IOException
96+
* @throws InterruptedException
97+
*/
9298
@BeforeClass
9399
public static void beforeClass() throws IOException, InterruptedException {
94-
// Start the local Datastore emulator.
95100
if (!LocalGcdHelper.isActive(PROJECT_ID, PORT)) {
96101
gcdHelper = LocalGcdHelper.start(PROJECT_ID, PORT);
97102
}
98103
}
99104

105+
/**
106+
* Initializes Datastore and cleans out any residual values. Also initializes global variables
107+
* used for testing.
108+
*/
100109
@Before
101110
public void setUp() {
102-
// Initialize Datastore and clean out any residual values.
103111
datastore = DatastoreOptions.builder()
104112
.projectId(PROJECT_ID)
105113
.namespace("ghijklmnop") // for namespace metadata query
@@ -109,8 +117,6 @@ public void setUp() {
109117
StructuredQuery<Key> query = Query.keyQueryBuilder().build();
110118
QueryResults<Key> result = datastore.run(query);
111119
datastore.delete(Iterators.toArray(result, Key.class));
112-
113-
// Initialize global variables.
114120
keyFactory = datastore.newKeyFactory().kind("Task");
115121
taskKey = keyFactory.newKey("some-arbitrary-key");
116122
testEntity = Entity.builder(taskKey, TEST_FULL_ENTITY).build();
@@ -125,9 +131,14 @@ public void setUp() {
125131
includedDate = DateTime.copyFrom(includedCalendar);
126132
}
127133

134+
/**
135+
* Stops the local Datastore emulator.
136+
*
137+
* @throws IOException
138+
* @throws InterruptedException
139+
*/
128140
@AfterClass
129141
public static void afterClass() throws IOException, InterruptedException {
130-
// Stop the local Datastore emulator.
131142
if (gcdHelper != null) {
132143
gcdHelper.stop();
133144
}

0 commit comments

Comments
 (0)