Refer to Datastore everywhere correctly by its capitalized form

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147479683
This commit is contained in:
mcilwain 2017-02-14 09:11:30 -08:00 committed by Ben McIlwain
parent a8cf81bca2
commit cdadb54acd
123 changed files with 232 additions and 235 deletions

View file

@ -735,7 +735,7 @@ public class ExpandRecurringBillingEventsActionTest
// Set target to a TLD that doesn't exist.
recurring = persistResource(recurring.asBuilder().setTargetId("domain.junk").build());
runMapreduce();
assertBillingEvents(recurring); // only the bogus one in datastore
assertBillingEvents(recurring); // only the bogus one in Datastore
assertCursorAt(START_OF_TIME); // Cursor doesn't move on a failure.
}
}

View file

@ -276,7 +276,7 @@ public class CloudDnsWriterTest {
return recordSetBuilder.build();
}
/** Returns a domain to be persisted in the datastore. */
/** Returns a domain to be persisted in Datastore. */
private static DomainResource fakeDomain(
String domainName, ImmutableSet<HostResource> nameservers, int numDsRecords) {
ImmutableSet.Builder<DelegationSignerData> dsDataBuilder = new ImmutableSet.Builder<>();

View file

@ -54,7 +54,7 @@ public class DatastoreBackupInfoTest {
private DateTime startTime = DateTime.parse("2014-08-01T01:02:03Z");
private Entity backupEntity; // Can't initialize until AppEngineRule has set up datastore.
private Entity backupEntity; // Can't initialize until AppEngineRule has set up Datastore.
@Before
public void before() throws Exception {
@ -65,7 +65,7 @@ public class DatastoreBackupInfoTest {
backupEntity.setProperty("start_time", new Date(startTime.getMillis()));
}
/** Force a roundtrip to datastore to ensure that we're simulating a freshly fetched entity. */
/** Force a roundtrip to Datastore to ensure that we're simulating a freshly fetched entity. */
private static Entity persistEntity(Entity entity) throws EntityNotFoundException {
return getDatastoreService().get(getDatastoreService().put(entity));
}

View file

@ -72,7 +72,7 @@ import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
/** Whether to actually write to the datastore or just simulate. */
/** Whether to actually write to Datastore or just simulate. */
public enum CommitMode { LIVE, DRY_RUN }
/** Whether to run in normal or superuser mode. */
@ -256,7 +256,7 @@ public abstract class FlowTestCase<F extends Flow> extends ShardableTestCase {
assertPollMessagesHelper(getPollMessages(), expected);
}
/** Assert that the list matches all the poll messages in the fake datastore. */
/** Assert that the list matches all the poll messages in the fake Datastore. */
public void assertPollMessagesHelper(Iterable<PollMessage> pollMessages, PollMessage... expected)
throws Exception {
// To facilitate comparison, remove the ids.

View file

@ -52,7 +52,7 @@ public abstract class ResourceFlowTestCase<F extends Flow, R extends EppResource
extends FlowTestCase<F> {
protected R reloadResourceByForeignKey(DateTime now) throws Exception {
// Force the session to be cleared so that when we read it back, we read from the datastore and
// Force the session to be cleared so that when we read it back, we read from Datastore and
// not from the transaction cache or memcache.
ofy().clearSessionCache();
return loadByForeignKey(getResourceClass(), getUniqueIdFromCommand(), now);
@ -119,7 +119,7 @@ public abstract class ResourceFlowTestCase<F extends Flow, R extends EppResource
}
/**
* Confirms that an EppResourceIndex entity exists in datastore for a given resource.
* Confirms that an EppResourceIndex entity exists in Datastore for a given resource.
*/
protected static <T extends EppResource> void assertEppResourceIndexEntityFor(final T resource) {
ImmutableList<EppResourceIndex> indices = FluentIterable

View file

@ -334,7 +334,7 @@ public class DomainApplicationInfoFlowTest
@Test
public void testBatchLoadingOfReferences() throws Exception {
persistTestEntities(HostsState.HOSTS_EXIST, MarksState.NO_MARKS_EXIST);
// Clear out memcache and session cache so that we count actual datastore calls.
// Clear out memcache and session cache so that we count actual Datastore calls.
ofy().clearSessionCache();
getLocalMemcacheService().flushAll(
new LocalRpcService.Status(), MemcacheFlushRequest.newBuilder().build());

View file

@ -106,7 +106,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("2fooBAR")))
.build());
// Set the superordinate domain of ns1.example.com to example.com. In reality, this would have
// happened in the flow that created it, but here we just overwrite it in the datastore.
// happened in the flow that created it, but here we just overwrite it in Datastore.
host1 = persistResource(
host1.asBuilder().setSuperordinateDomain(Key.create(domain)).build());
// Create a subordinate host that is not delegated to by anyone.
@ -629,7 +629,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
@Test
public void testBatchLoadingOfReferences() throws Exception {
persistTestEntities(false);
// Clear out memcache and session cache so that we count actual datastore calls.
// Clear out memcache and session cache so that we count actual Datastore calls.
ofy().clearSessionCache();
getLocalMemcacheService().flushAll(
new LocalRpcService.Status(), MemcacheFlushRequest.newBuilder().build());

View file

@ -125,7 +125,7 @@ public class EntityTestCase {
.that(indexed)
.isEqualTo(results != 0);
} catch (IllegalArgumentException e) {
// If the field's type was not indexable (because it's not a supported datastore type) then
// If the field's type was not indexable (because it's not a supported Datastore type) then
// this error will be thrown. If we expected no indexing, that's fine. Otherwise, fail.
if (indexed || !e.getMessage().endsWith(" is not a supported property type.")) {
assert_().fail(String.format("%s was %sindexed", fieldPath, indexed ? "not " : ""));

View file

@ -41,7 +41,7 @@ public class SchemaVersionTest {
private static final String UPDATE_INSTRUCTIONS = Joiner.on('\n').join(
"",
"-------------------------------------------------------------------------------",
"Your changes affect the datastore schema. To update the checked-in schema, run:",
"Your changes affect the Datastore schema. To update the checked-in schema, run:",
UPDATE_COMMAND,
"");

View file

@ -119,7 +119,7 @@ public class TimedTransitionPropertyTest {
// Just for testing, don't extract transitions from a TimedTransitionProperty in real code.
Set<Map.Entry<DateTime, StringTimedTransition>> transitions = timedString.entrySet();
timedString = forMapify("0", StringTimedTransition.class);
// Simulate a load from datastore by clearing and then re-inserting the original transitions.
// Simulate a load from Datastore by clearing and then re-inserting the original transitions.
timedString.clear();
for (Map.Entry<DateTime, StringTimedTransition> transition : transitions) {
timedString.put(transition.getKey(), transition.getValue());
@ -160,7 +160,7 @@ public class TimedTransitionPropertyTest {
@Test
public void testFailure_noValuesAfterSimulatedEmptyLoad() throws Exception {
timedString = forMapify("0", StringTimedTransition.class);
// Simulate a load from datastore by clearing, but don't insert any transitions.
// Simulate a load from Datastore by clearing, but don't insert any transitions.
timedString.clear();
thrown.expect(IllegalStateException.class);
timedString.checkValidity();
@ -171,7 +171,7 @@ public class TimedTransitionPropertyTest {
// Just for testing, don't extract transitions from a TimedTransitionProperty in real code.
StringTimedTransition transition1 = timedString.get(DATE_1);
timedString = forMapify("0", StringTimedTransition.class);
// Simulate a load from datastore by clearing and inserting transitions, but deliberately
// Simulate a load from Datastore by clearing and inserting transitions, but deliberately
// omit a transition corresponding to START_OF_TIME.
timedString.clear();
timedString.put(DATE_1, transition1);

View file

@ -186,7 +186,7 @@ public class PremiumListTest {
Map<String, PremiumListEntry> entries = pl.getPremiumListEntries();
assertThat(entries.keySet()).containsExactly("test");
assertThat(PremiumList.get("pl").get().getPremiumListEntries()).isEqualTo(entries);
// Save again with no changes, and clear the cache to force a re-load from datastore.
// Save again with no changes, and clear the cache to force a re-load from Datastore.
pl.saveAndUpdateEntries();
ofy().clearSessionCache();
assertThat(PremiumList.get("pl").get().getPremiumListEntries()).isEqualTo(entries);
@ -203,7 +203,7 @@ public class PremiumListTest {
Map<String, PremiumListEntry> entries = pl.getPremiumListEntries();
assertThat(entries.keySet()).containsExactly("test");
assertThat(PremiumList.get("pl").get().getPremiumListEntries()).isEqualTo(entries);
// Save again with description changed, and clear the cache to force a re-load from datastore.
// Save again with description changed, and clear the cache to force a re-load from Datastore.
pl.asBuilder().setDescription("foobar").build().saveAndUpdateEntries();
ofy().clearSessionCache();
assertThat(PremiumList.get("pl").get().getPremiumListEntries()).isEqualTo(entries);

View file

@ -61,7 +61,7 @@ public class SignedMarkRevocationListTest {
@Test
public void testEmpty() throws Exception {
// When the datastore is empty, it should give us an empty thing.
// When Datastore is empty, it should give us an empty thing.
assertThat(SignedMarkRevocationList.get())
.isEqualTo(SignedMarkRevocationList.create(
START_OF_TIME, ImmutableMap.<String, DateTime>of()));

View file

@ -366,13 +366,13 @@ public class RdeImportUtilsTest extends ShardableTestCase {
}});
}
/** Confirms that a ForeignKeyIndex exists in the datastore for a given resource. */
/** Confirms that a ForeignKeyIndex exists in Datastore for a given resource. */
private <T extends EppResource> void assertForeignKeyIndexFor(final T resource) {
assertThat(ForeignKeyIndex.load(resource.getClass(), resource.getForeignKey(), clock.nowUtc()))
.isNotNull();
}
/** Confirms that an EppResourceIndex entity exists in datastore for a given resource. */
/** Confirms that an EppResourceIndex entity exists in Datastore for a given resource. */
private static <T extends EppResource> void assertEppResourceIndexEntityFor(final T resource) {
ImmutableList<EppResourceIndex> indices = FluentIterable
.from(ofy().load()

View file

@ -142,6 +142,6 @@ public enum Fixture {
}
};
/** Loads this fixture into the datastore. */
/** Loads this fixture into Datastore. */
public abstract void load();
}

View file

@ -51,7 +51,7 @@ public final class RegistryTestServerMain {
@Parameter(
names = "--fixtures",
description = "Fixtures to load into the datastore.")
description = "Fixtures to load into Datastore.")
private List<Fixture> fixtures = ImmutableList.of(Fixture.BASIC);
@Parameter(
@ -137,7 +137,7 @@ public final class RegistryTestServerMain {
Statement runner = new Statement() {
@Override
public void evaluate() throws InterruptedException {
System.out.printf("%sLoading datastore fixtures...%s\n", BLUE, RESET);
System.out.printf("%sLoading Datastore fixtures...%s\n", BLUE, RESET);
for (Fixture fixture : fixtures) {
fixture.load();
}

View file

@ -63,7 +63,7 @@ import org.mortbay.jetty.servlet.ServletHolder;
* <p>The reason why this is necessary is because the App Engine local testing services (created by
* {@code LocalServiceTestHelper}) only apply to a single thread (probably to allow multi-threaded
* tests). So when Jetty creates random threads to handle requests, they won't have access to the
* datastore and other stuff.
* Datastore and other stuff.
*/
public final class TestServer {

View file

@ -108,7 +108,7 @@ public final class AppEngineRule extends ExternalResource {
private AppEngineRule rule = new AppEngineRule();
/** Turn on the datastore service. */
/** Turn on the Datastore service. */
public Builder withDatastore() {
rule.withDatastore = true;
return this;
@ -327,7 +327,7 @@ public final class AppEngineRule extends ExternalResource {
ObjectifyFilter.complete();
helper.tearDown();
helper = null;
// Test that the datastore didn't need any indexes we don't have listed in our index file.
// Test that Datastore didn't need any indexes we don't have listed in our index file.
try {
Set<String> autoIndexes = getIndexXmlStrings(Files.asCharSource(
new File(temporaryFolder.getRoot(), "datastore-indexes-auto.xml"), UTF_8).read());
@ -345,7 +345,7 @@ public final class AppEngineRule extends ExternalResource {
.readConfiguration(new ByteArrayInputStream(LOGGING_PROPERTIES.getBytes(UTF_8)));
}
/** Read a datastore index file, and parse the indexes into individual strings. */
/** Read a Datastore index file, and parse the indexes into individual strings. */
private static Set<String> getIndexXmlStrings(String indexFile) {
ImmutableSet.Builder<String> builder = new ImmutableSet.Builder<>();
try {

View file

@ -621,14 +621,14 @@ public class DatastoreHelper {
}
/** Assert that the expected billing events are exactly the ones found in the fake datastore. */
/** Assert that the expected billing events are exactly the ones found in the fake Datastore. */
public static void assertBillingEvents(BillingEvent... expected) throws Exception {
assertThat(FluentIterable.from(getBillingEvents()).transform(BILLING_EVENT_ID_STRIPPER))
.containsExactlyElementsIn(
FluentIterable.from(expected).transform(BILLING_EVENT_ID_STRIPPER));
}
/** Assert that the expected billing events set is exactly the one found in the fake datastore. */
/** Assert that the expected billing events set is exactly the one found in the fake Datastore. */
public static void assertBillingEvents(ImmutableSet<BillingEvent> expected) throws Exception {
assertThat(FluentIterable.from(getBillingEvents()).transform(BILLING_EVENT_ID_STRIPPER))
.containsExactlyElementsIn(
@ -755,7 +755,7 @@ public class DatastoreHelper {
* <p>Tests should always use this method (or the shortcut persist methods in this class) to
* persist test data, to avoid potentially subtle bugs related to race conditions and a stale
* ofy() session cache. Specifically, this method calls .now() on the save to force the write to
* actually get sent to datastore (although it does not force it to be applied) and clears the
* actually get sent to Datastore (although it does not force it to be applied) and clears the
* session cache. If necessary, this method also updates the relevant {@link EppResourceIndex},
* {@link ForeignKeyIndex} and {@link DomainApplicationIndex}.
*
@ -804,7 +804,7 @@ public class DatastoreHelper {
public void vrun() {
saveResource(resource, wantBackup);
}});
// Force the session to be cleared so that when we read it back, we read from the datastore
// Force the session to be cleared so that when we read it back, we read from Datastore
// and not from the transaction cache or memcache.
ofy().clearSessionCache();
return ofy().load().entity(resource).now();
@ -845,7 +845,7 @@ public class DatastoreHelper {
}
}});
}
// Force the session to be cleared so that when we read it back, we read from the datastore
// Force the session to be cleared so that when we read it back, we read from Datastore
// and not from the transaction cache or memcache.
ofy().clearSessionCache();
for (R resource : resources) {
@ -957,7 +957,7 @@ public class DatastoreHelper {
public void vrun() {
ofy().saveWithoutBackup().entities(resources);
}});
// Force the session to be cleared so that when we read it back, we read from the datastore
// Force the session to be cleared so that when we read it back, we read from Datastore
// and not from the transaction cache or memcache.
ofy().clearSessionCache();
return ImmutableList.copyOf(ofy().load().entities(resources).values());
@ -965,7 +965,7 @@ public class DatastoreHelper {
public static void deleteResource(final Object resource) {
ofy().deleteWithoutBackup().entity(resource).now();
// Force the session to be cleared so that when we read it back, we read from the datastore and
// Force the session to be cleared so that when we read it back, we read from Datastore and
// not from the transaction cache or memcache.
ofy().clearSessionCache();
}

View file

@ -83,7 +83,7 @@ public abstract class CommandTestCase<C extends Command> {
jcommander.parse(args);
command.run();
} finally {
// Clear the session cache so that subsequent reads for verification purposes hit datastore.
// Clear the session cache so that subsequent reads for verification purposes hit Datastore.
// This primarily matters for AutoTimestamp fields, which otherwise won't have updated values.
ofy().clearSessionCache();
// Reset back to UNITTEST environment.