Skip to content

Commit

Permalink
Assuage checkstyle's complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajay Kannan committed Feb 10, 2016
1 parent f220cb7 commit b795324
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,25 @@ public class Concepts {
@Rule
public ExpectedException thrown = ExpectedException.none();

/**
* Starts the local Datastore emulator.
*
* @throws IOException
* @throws InterruptedException
*/
@BeforeClass
public static void beforeClass() throws IOException, InterruptedException {
// Start the local Datastore emulator.
if (!LocalGcdHelper.isActive(PROJECT_ID, PORT)) {
gcdHelper = LocalGcdHelper.start(PROJECT_ID, PORT);
}
}

/**
* Initializes Datastore and cleans out any residual values. Also initializes global variables
* used for testing.
*/
@Before
public void setUp() {
// Initialize Datastore and clean out any residual values.
datastore = DatastoreOptions.builder()
.projectId(PROJECT_ID)
.namespace("ghijklmnop") // for namespace metadata query
Expand All @@ -109,8 +117,6 @@ public void setUp() {
StructuredQuery<Key> query = Query.keyQueryBuilder().build();
QueryResults<Key> result = datastore.run(query);
datastore.delete(Iterators.toArray(result, Key.class));

// Initialize global variables.
keyFactory = datastore.newKeyFactory().kind("Task");
taskKey = keyFactory.newKey("some-arbitrary-key");
testEntity = Entity.builder(taskKey, TEST_FULL_ENTITY).build();
Expand All @@ -125,9 +131,14 @@ public void setUp() {
includedDate = DateTime.copyFrom(includedCalendar);
}

/**
* Stops the local Datastore emulator.
*
* @throws IOException
* @throws InterruptedException
*/
@AfterClass
public static void afterClass() throws IOException, InterruptedException {
// Stop the local Datastore emulator.
if (gcdHelper != null) {
gcdHelper.stop();
}
Expand Down

0 comments on commit b795324

Please sign in to comment.