- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.google.cloud.compute.deprecated.ZoneOperationId.getZone()
方法的一些代码示例,展示了ZoneOperationId.getZone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneOperationId.getZone()
方法的具体详情如下:
包路径:com.google.cloud.compute.deprecated.ZoneOperationId
类名称:ZoneOperationId
方法名:getZone
[英]Returns the name of the zone this operation belongs to.
[中]返回此操作所属区域的名称。
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testListEmptyZoneOperations() {
ImmutableList<com.google.api.services.compute.model.Operation> operations = ImmutableList.of();
Tuple<String, Iterable<com.google.api.services.compute.model.Operation>> result =
Tuple.<String, Iterable<com.google.api.services.compute.model.Operation>>of(
null, operations);
EasyMock.expect(
computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS))
.andReturn(result);
EasyMock.replay(computeRpcMock);
compute = options.getService();
Page<Operation> page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone());
assertNull(page.getNextPageToken());
assertArrayEquals(operations.toArray(), Iterables.toArray(page.getValues(), Operation.class));
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testGetZoneOperation_Null() {
EasyMock.expect(
computeRpcMock.getZoneOperation(
ZONE_OPERATION_ID.getZone(), ZONE_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS))
.andReturn(null);
EasyMock.replay(computeRpcMock);
compute = options.getService();
assertNull(compute.getOperation(ZONE_OPERATION_ID));
}
代码示例来源:origin: googleapis/google-cloud-java
@Override
public Boolean call() {
switch (operation.getType()) {
case REGION:
RegionOperationId regionOperationId = (RegionOperationId) operation;
return computeRpc.deleteRegionOperation(
regionOperationId.getRegion(), regionOperationId.getOperation());
case ZONE:
ZoneOperationId zoneOperationId = (ZoneOperationId) operation;
return computeRpc.deleteZoneOperation(
zoneOperationId.getZone(), zoneOperationId.getOperation());
case GLOBAL:
return computeRpc.deleteGlobalOperation(operation.getOperation());
default:
throw new IllegalArgumentException("Unexpected operation identity type");
}
}
},
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testDeleteZoneOperation_True() {
EasyMock.expect(
computeRpcMock.deleteZoneOperation(
ZONE_OPERATION_ID.getZone(), ZONE_OPERATION_ID.getOperation()))
.andReturn(true);
EasyMock.replay(computeRpcMock);
compute = options.getService();
assertTrue(compute.deleteOperation(ZONE_OPERATION_ID));
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testDeleteZoneOperation_False() {
EasyMock.expect(
computeRpcMock.deleteZoneOperation(
ZONE_OPERATION_ID.getZone(), ZONE_OPERATION_ID.getOperation()))
.andReturn(false);
EasyMock.replay(computeRpcMock);
compute = options.getService();
assertFalse(compute.deleteOperation(ZONE_OPERATION_ID));
}
代码示例来源:origin: googleapis/google-cloud-java
@Override
public com.google.api.services.compute.model.Operation call() {
switch (operationId.getType()) {
case REGION:
RegionOperationId regionOperationId = (RegionOperationId) operationId;
return computeRpc.getRegionOperation(
regionOperationId.getRegion(),
regionOperationId.getOperation(),
optionsMap);
case ZONE:
ZoneOperationId zoneOperationId = (ZoneOperationId) operationId;
return computeRpc.getZoneOperation(
zoneOperationId.getZone(), zoneOperationId.getOperation(), optionsMap);
case GLOBAL:
return computeRpc.getGlobalOperation(operationId.getOperation(), optionsMap);
default:
throw new IllegalArgumentException("Unexpected operation identity type");
}
}
},
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testListZoneOperations() {
String cursor = "cursor";
compute = options.getService();
ImmutableList<Operation> operationList = ImmutableList.of(zoneOperation, zoneOperation);
Tuple<String, Iterable<com.google.api.services.compute.model.Operation>> result =
Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION));
EasyMock.expect(
computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS))
.andReturn(result);
EasyMock.replay(computeRpcMock);
Page<Operation> page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone());
assertEquals(cursor, page.getNextPageToken());
assertArrayEquals(
operationList.toArray(), Iterables.toArray(page.getValues(), Operation.class));
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testGetZoneOperation() {
EasyMock.expect(
computeRpcMock.getZoneOperation(
ZONE_OPERATION_ID.getZone(), ZONE_OPERATION_ID.getOperation(), EMPTY_RPC_OPTIONS))
.andReturn(zoneOperation.toPb());
EasyMock.replay(computeRpcMock);
compute = options.getService();
Operation operation = compute.getOperation(ZONE_OPERATION_ID);
assertEquals(zoneOperation, operation);
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testListZoneOperationsWithOptions() {
String cursor = "cursor";
compute = options.getService();
ImmutableList<Operation> operationList = ImmutableList.of(zoneOperation, zoneOperation);
Tuple<String, Iterable<com.google.api.services.compute.model.Operation>> result =
Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION));
EasyMock.expect(
computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), OPERATION_LIST_OPTIONS))
.andReturn(result);
EasyMock.replay(computeRpcMock);
Page<Operation> page =
compute.listZoneOperations(
ZONE_OPERATION_ID.getZone(),
OPERATION_LIST_PAGE_SIZE,
OPERATION_LIST_PAGE_TOKEN,
OPERATION_LIST_FILTER);
assertEquals(cursor, page.getNextPageToken());
assertArrayEquals(
operationList.toArray(), Iterables.toArray(page.getValues(), Operation.class));
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testListZoneOperationsNextPage() {
String cursor = "cursor";
String nextCursor = "nextCursor";
compute = options.getService();
ImmutableList<Operation> operationList = ImmutableList.of(zoneOperation, zoneOperation);
ImmutableList<Operation> nextOperationList = ImmutableList.of(zoneOperation);
Tuple<String, Iterable<com.google.api.services.compute.model.Operation>> result =
Tuple.of(cursor, Iterables.transform(operationList, OPERATION_TO_PB_FUNCTION));
Tuple<String, Iterable<com.google.api.services.compute.model.Operation>> nextResult =
Tuple.of(nextCursor, Iterables.transform(nextOperationList, OPERATION_TO_PB_FUNCTION));
Map<ComputeRpc.Option, ?> nextOptions = ImmutableMap.of(ComputeRpc.Option.PAGE_TOKEN, cursor);
EasyMock.expect(
computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), EMPTY_RPC_OPTIONS))
.andReturn(result);
EasyMock.expect(computeRpcMock.listZoneOperations(ZONE_OPERATION_ID.getZone(), nextOptions))
.andReturn(nextResult);
EasyMock.replay(computeRpcMock);
Page<Operation> page = compute.listZoneOperations(ZONE_OPERATION_ID.getZone());
assertEquals(cursor, page.getNextPageToken());
assertArrayEquals(
operationList.toArray(), Iterables.toArray(page.getValues(), Operation.class));
page = page.getNextPage();
assertEquals(nextCursor, page.getNextPageToken());
assertArrayEquals(
nextOperationList.toArray(), Iterables.toArray(page.getValues(), Operation.class));
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testGetZoneOperationWithSelectedFields() {
Capture<Map<ComputeRpc.Option, Object>> capturedOptions = Capture.newInstance();
EasyMock.expect(
computeRpcMock.getZoneOperation(
eq(ZONE_OPERATION_ID.getZone()),
eq(ZONE_OPERATION_ID.getOperation()),
capture(capturedOptions)))
.andReturn(zoneOperation.toPb());
EasyMock.replay(computeRpcMock);
compute = options.getService();
Operation operation = compute.getOperation(ZONE_OPERATION_ID, OPERATION_OPTION_FIELDS);
String selector =
(String) capturedOptions.getValue().get(OPERATION_OPTION_FIELDS.getRpcOption());
assertTrue(selector.contains("selfLink"));
assertTrue(selector.contains("id"));
assertTrue(selector.contains("description"));
assertEquals(23, selector.length());
assertEquals(zoneOperation, operation);
}
代码示例来源:origin: googleapis/google-cloud-java
private void compareZoneOperationId(ZoneOperationId expected, ZoneOperationId value) {
assertEquals(expected, value);
assertEquals(expected.getProject(), expected.getProject());
assertEquals(expected.getZone(), expected.getZone());
assertEquals(expected.getOperation(), expected.getOperation());
assertEquals(expected.getSelfLink(), expected.getSelfLink());
assertEquals(expected.hashCode(), expected.hashCode());
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testListZoneOperations() {
Page<Operation> operationPage = compute.listZoneOperations(ZONE);
Iterator<Operation> operationIterator = operationPage.iterateAll().iterator();
while (operationIterator.hasNext()) {
Operation operation = operationIterator.next();
assertNotNull(operation.getGeneratedId());
assertNotNull(operation.getOperationId());
assertEquals(ZONE, operation.<ZoneOperationId>getOperationId().getZone());
// todo(mziccard): uncomment or remove once #727 is closed
// assertNotNull(operation.getCreationTimestamp());
assertNotNull(operation.getOperationType());
assertNotNull(operation.getStatus());
assertNotNull(operation.getUser());
}
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testListZoneOperationsWithFilter() {
Page<Operation> operationPage =
compute.listZoneOperations(
ZONE,
Compute.OperationListOption.filter(
Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE")));
Iterator<Operation> operationIterator = operationPage.iterateAll().iterator();
while (operationIterator.hasNext()) {
Operation operation = operationIterator.next();
assertNotNull(operation.getGeneratedId());
assertNotNull(operation.getOperationId());
assertEquals(ZONE, operation.<ZoneOperationId>getOperationId().getZone());
// todo(mziccard): uncomment or remove once #727 is closed
// assertNotNull(operation.getCreationTimestamp());
assertNotNull(operation.getOperationType());
assertEquals(Operation.Status.DONE, operation.getStatus());
assertNotNull(operation.getUser());
}
}
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testListZoneOperationsWithSelectedFields() {
Page<Operation> operationPage =
compute.listZoneOperations(
ZONE, Compute.OperationListOption.fields(Compute.OperationField.ID));
Iterator<Operation> operationIterator = operationPage.iterateAll().iterator();
while (operationIterator.hasNext()) {
Operation operation = operationIterator.next();
assertNotNull(operation.getGeneratedId());
assertNotNull(operation.getOperationId());
assertEquals(ZONE, operation.<ZoneOperationId>getOperationId().getZone());
assertNull(operation.getOperationType());
assertNull(operation.getTargetLink());
assertNull(operation.getTargetId());
assertNull(operation.getOperationType());
assertNull(operation.getStatus());
assertNull(operation.getStatusMessage());
assertNull(operation.getUser());
assertNull(operation.getProgress());
assertNull(operation.getDescription());
assertNull(operation.getInsertTime());
assertNull(operation.getStartTime());
assertNull(operation.getEndTime());
assertNull(operation.getWarnings());
assertNull(operation.getHttpErrorMessage());
}
}
代码示例来源:origin: googleapis/google-cloud-java
assertEquals(OperationId.Type.ZONE, zoneOperationId.getType());
assertEquals(PROJECT, zoneOperationId.getProject());
assertEquals(ZONE, zoneOperationId.getZone());
assertEquals(NAME, zoneOperationId.getOperation());
assertEquals(ZONE_URL, zoneOperationId.getSelfLink());
assertEquals(OperationId.Type.ZONE, zoneOperationId.getType());
assertNull(zoneOperationId.getProject());
assertEquals(ZONE, zoneOperationId.getZone());
assertEquals(NAME, zoneOperationId.getOperation());
zoneOperationId = ZoneOperationId.of(ZoneId.of(PROJECT, ZONE), NAME);
assertEquals(OperationId.Type.ZONE, zoneOperationId.getType());
assertEquals(PROJECT, zoneOperationId.getProject());
assertEquals(ZONE, zoneOperationId.getZone());
assertEquals(NAME, zoneOperationId.getOperation());
RegionOperationId regionOperationId = RegionOperationId.of(PROJECT, REGION, NAME);
这个问题在这里已经有了答案: How to declare or mark a Java method as deprecated? (6 个回答) 关闭8年前。 我可以使用 @Deprecated
我要使用的代码: window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED) 有FLAG_SHOW_WHEN_LOCKED在 A
这个问题已经有答案了: Can I mix MySQL APIs in PHP? (4 个回答) Why shouldn't I use mysql_* functions in PHP? (14 个
我在我的网站上看到以下消息,我该怎么办? Deprecated: Function eregi() is deprecated in D:\wamp\www\cidoc.gov.mz\modules\
我正在弃用一组 Java 类,以便不再使用它们。我不想关闭不推荐使用的编译器警告,但我发现如果我的一个不推荐使用的类导入另一个不推荐使用的类,我也会收到警告。我不想修改我不赞成使用的代码,但我也不想在
这个问题在这里已经有了答案: How to use Ansible's with_item with a variable? (1 个回答) 3年前关闭。 我认为这是产生错误的剧本的一部分。我应该如何
在我的 Eclipse Indigo 中,只有 @Deprecated 有效,但 @deprecated 在评论中无效,知道吗? 例如 // @deprecated <-- not work @Dep
This question already has answers here: How can I convert ereg expressions to preg in PHP? (4个答案) 去年
我正在将代码从以前版本的 Swift 更改为 Swift5。并且有一条警告消息表明此代码不可用。我想更改此代码,但不知道如何更改。 警告代码 func pbkdf2(hash: CCPBKDFAlg
我正在开发使用 Game Center 的游戏,但我收到了下一个警告; ... 'authenticateWithCompletionHandler:' 已弃用:首先在 iOS 6.0 中弃用 好的,
您好,我在错误日志中收到此错误: "PHP 已弃用:自动填充 $HTTP_RAW_POST_DATA 已弃用,并将在未来版本中删除。为避免此警告,请在 php.ini 中将 'always_popul
您好,我在错误日志中收到此错误: "PHP 已弃用:自动填充 $HTTP_RAW_POST_DATA 已弃用,并将在未来版本中删除。为避免此警告,请在 php.ini 中将 'always_popul
CC_MD5 已在 ios14 中弃用,但我的项目至少支持 ios14。我仍然需要 MD5。我应该怎么办?我使用的开发语言是OC 最佳答案 MD5 已被弃用,因为它是一种有缺陷、不安全的算法。如果可以
我在 Xcode 上的这个条目上有以下问题: CLRegion *pushRegion = [[CLRegion alloc] initCircularRegionWithCenter:coordin
所以我有一个代码可以开始录制音频并不断收到上述警告消息。有帮助吗? - (IBAction)recordStart:(id)sender { AVAudioSession *recSessio
我制作了这个返回文档目录中文件大小的函数,它可以工作,但我得到警告,我想修复,函数: -(unsigned long long int)getFileSize:(NSString*)path { NS
我收到警告: >typings ls typings WARN deprecated 2016-08-05: "registry:dt/react#0.14.0+20160423065914" is
问题的表述有点奇怪,但我想要的是 Rspec 中 stub! 的替代方案,它不会产生弃用警告。 场景: 我使用 stub! 在我的帮助程序规范中对某些帮助程序方法进行 stub 。 例如 stub!(
最近我将我的 Rails 版本从 3.2 迁移到 4.2.6,同时我修改了一些 gem,例如回形针 2.3 到 4.3.6。当我运行 rails server 时,我得到以下弃用: DEPRECATI
My Goal: To fix this error and be able to run my app without an error. Error Message: Note:D:\Learni
我是一名优秀的程序员,十分优秀!