use of com.google.appengine.api.log.LogQuery.Version in project appengine-java-standard by GoogleCloudPlatform.
the class LogServiceImplTest method testWithModuleVersions.
@Test
public void testWithModuleVersions() throws Exception {
List<Version> versions = ImmutableList.of(new Version("default", "1"), new Version("module2", "1"));
LogQuery query = LogQuery.Builder.withVersions(versions);
getAllLogsForAppVersions(query, versions);
}
use of com.google.appengine.api.log.LogQuery.Version in project appengine-java-standard by GoogleCloudPlatform.
the class LogServiceImplTest method testGetAllLogsForTwoAppVersions.
@Test
public void testGetAllLogsForTwoAppVersions() throws Exception {
List<Version> versions = ImmutableList.of(new Version("default", "1"), new Version("default", "2"));
LogQuery query = LogQuery.Builder.withMajorVersionIds(Lists.newArrayList("1", "2"));
getAllLogsForAppVersions(query, versions);
}
use of com.google.appengine.api.log.LogQuery.Version in project appengine-java-standard by GoogleCloudPlatform.
the class LogServiceImplTest method createLogReadRequest.
public LogReadRequest createLogReadRequest(Long startTime, Long endTime, Integer batchSize, List<Version> versions, List<String> requestIds) {
LogReadRequest.Builder request = LogReadRequest.newBuilder().setAppId(APPLICATION_ID);
if (startTime != null) {
request.setStartTime(startTime);
}
if (endTime != null) {
request.setEndTime(endTime);
}
if (batchSize != null) {
batchSize = 20;
}
if (versions != null) {
for (Version version : versions) {
LogModuleVersion.Builder requestModuleVersion = request.addModuleVersionBuilder();
if (!version.getModuleId().equals("default")) {
requestModuleVersion.setModuleId(version.getModuleId());
}
requestModuleVersion.setVersionId(version.getVersionId());
}
} else {
request.addModuleVersionBuilder().setVersionId(LogServiceImplTest.MAJOR_VERSION_ID);
}
if (requestIds != null) {
for (String requestId : requestIds) {
request.addRequestId(ByteString.copyFromUtf8(requestId));
}
}
if (batchSize == null) {
batchSize = LogService.DEFAULT_ITEMS_PER_FETCH;
}
return request.setCount(batchSize).setIncludeIncomplete(false).setIncludeAppLogs(false).build();
}
Aggregations