Rename JobResult -> OperationResult

This commit is contained in:
Richard Downer 2011-12-02 17:24:12 +02:00
parent acf19637da
commit 5e1e0806e9
2 changed files with 9 additions and 9 deletions

View File

@ -10,7 +10,7 @@ import com.google.gson.annotations.SerializedName;
*
* @author Richard Downer
*/
public class OperationResult implements Comparable<OperationResult> {
public class JobResult implements Comparable<JobResult> {
private boolean success;
@SerializedName("displaytext")
@ -19,10 +19,10 @@ public class OperationResult implements Comparable<OperationResult> {
/**
* present only for the serializer
*/
OperationResult() {
JobResult() {
}
public OperationResult(boolean success, String displayText) {
public JobResult(boolean success, String displayText) {
this.success = success;
this.displayText = displayText;
}
@ -40,7 +40,7 @@ public class OperationResult implements Comparable<OperationResult> {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OperationResult that = (OperationResult) o;
JobResult that = (JobResult) o;
if (success != that.success) return false;
if (displayText != null ? !displayText.equals(that.displayText) : that.displayText != null) return false;
@ -64,7 +64,7 @@ public class OperationResult implements Comparable<OperationResult> {
}
@Override
public int compareTo(OperationResult other) {
public int compareTo(JobResult other) {
int comparison = Boolean.valueOf(success).compareTo(other.success);
if (comparison == 0)
comparison = displayText.compareTo(other.displayText);

View File

@ -19,7 +19,7 @@
package org.jclouds.cloudstack.parse;
import org.jclouds.cloudstack.domain.AsyncJob;
import org.jclouds.cloudstack.domain.OperationResult;
import org.jclouds.cloudstack.domain.JobResult;
import org.jclouds.json.BaseItemParserTest;
import org.jclouds.rest.annotations.SelectJson;
import org.testng.annotations.Test;
@ -29,7 +29,7 @@ import org.testng.annotations.Test;
* @author Richard Downer
*/
@Test(groups = "unit", testName = "DeleteNetworkResponseTest")
public class OperationResultResponseTest extends BaseItemParserTest<AsyncJob> {
public class JobResultResponseTest extends BaseItemParserTest<AsyncJob> {
@Override
public String resource() {
@ -39,8 +39,8 @@ public class OperationResultResponseTest extends BaseItemParserTest<AsyncJob> {
@Override
@SelectJson("queryasyncjobresultresponse")
public AsyncJob expected() {
OperationResult payload = new OperationResult(true, null);
AsyncJob<OperationResult> wrapper = AsyncJob.<OperationResult>builder().id(118).status(1).progress(0).resultCode(0).resultType("object").result(payload).build();
JobResult payload = new JobResult(true, null);
AsyncJob<JobResult> wrapper = AsyncJob.<JobResult>builder().id(118).status(1).progress(0).resultCode(0).resultType("object").result(payload).build();
return wrapper;
}