Skip to content

Commit

Permalink
adapt to upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrik Muhs committed Dec 4, 2018
1 parent 9f6b85d commit dd08f7b
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ public Request(String id) {
public Request() {
}

public String getId() {
return id;
public Request(StreamInput in) throws IOException {
super(in);
id = in.readString();
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
public String getId() {
return id;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public Request(String id) {

public Request() {}

public Request(StreamInput in) throws IOException {
super(in);
id = in.readString();
}

@Override
public boolean match(Task task) {
// If we are retrieving all the jobs, the task description does not contain the id
Expand All @@ -75,12 +80,6 @@ public String getId() {
return id;
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public Request(String id) {

public Request() {}

public Request(StreamInput in) throws IOException {
super(in);
id = in.readString();
}

@Override
public boolean match(Task task) {
// If we are retrieving all the jobs, the task description does not contain the id
Expand All @@ -74,12 +79,6 @@ public String getId() {
return id;
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ public Request(String id) {
public Request() {
}

public String getId() {
return id;
public Request(StreamInput in) throws IOException {
super(in);
id = in.readString();
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
public String getId() {
return id;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public Request(String id) {
public Request() {
}

public Request(StreamInput in) throws IOException {
super(in);
id = in.readString();
}

public String getId() {
return id;
}
Expand All @@ -64,12 +69,6 @@ public void setId(String id) {
this.id = id;
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@

package org.elasticsearch.xpack.dataframe.action;

import org.elasticsearch.test.AbstractStreamableTestCase;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.dataframe.action.DeleteDataFrameJobAction.Request;

public class DeleteDataFrameJobActionRequestTests extends AbstractStreamableTestCase<Request> {
public class DeleteDataFrameJobActionRequestTests extends AbstractWireSerializingTestCase<Request> {
@Override
protected Request createTestInstance() {
return new Request(randomAlphaOfLengthBetween(1, 20));
}

@Override
protected Request createBlankInstance() {
return new Request();
protected Writeable.Reader<Request> instanceReader() {
return Request::new;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
package org.elasticsearch.xpack.dataframe.action;

import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.test.AbstractStreamableTestCase;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.dataframe.action.GetDataFrameJobsAction.Request;

public class GetDataFrameJobsActionRequestTests extends AbstractStreamableTestCase<Request> {
public class GetDataFrameJobsActionRequestTests extends AbstractWireSerializingTestCase<Request> {

@Override
protected Request createTestInstance() {
Expand All @@ -21,7 +22,7 @@ protected Request createTestInstance() {
}

@Override
protected Request createBlankInstance() {
return new Request();
protected Writeable.Reader<Request> instanceReader() {
return Request::new;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
package org.elasticsearch.xpack.dataframe.action;

import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.test.AbstractStreamableTestCase;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.dataframe.action.GetDataFrameJobsStatsAction.Request;

public class GetDataFrameJobsStatsActionRequestTests extends AbstractStreamableTestCase<Request> {
public class GetDataFrameJobsStatsActionRequestTests extends AbstractWireSerializingTestCase<Request> {
@Override
protected Request createTestInstance() {
if (randomBoolean()) {
Expand All @@ -20,7 +21,7 @@ protected Request createTestInstance() {
}

@Override
protected Request createBlankInstance() {
return new Request();
protected Writeable.Reader<Request> instanceReader() {
return Request::new;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
* you may not use this file except in compliance with the Elastic License.
*/

import org.elasticsearch.test.AbstractStreamableTestCase;
import org.elasticsearch.xpack.core.rollup.action.StartRollupJobAction.Request;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.dataframe.action.StartDataFrameJobAction.Request;

public class StartDataFrameJobActionTests extends AbstractStreamableTestCase<Request> {
public class StartDataFrameJobActionTests extends AbstractWireSerializingTestCase<Request> {
@Override
protected Request createTestInstance() {
return new Request(randomAlphaOfLengthBetween(1, 20));
}

@Override
protected Request createBlankInstance() {
return new Request();
protected Writeable.Reader<Request> instanceReader() {
return Request::new;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,19 @@

package org.elasticsearch.xpack.dataframe.action;

import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.dataframe.action.StopDataFrameJobAction.Request;

import java.io.IOException;

public class StopDataFrameJobActionRequestTests extends AbstractStreamableXContentTestCase<Request> {
public class StopDataFrameJobActionRequestTests extends AbstractWireSerializingTestCase<Request> {

@Override
protected Request createTestInstance() {
return new Request(randomAlphaOfLengthBetween(1, 10));
}

@Override
protected boolean supportsUnknownFields() {
return false;
}

@Override
protected Request doParseInstance(XContentParser parser) throws IOException {
return Request.PARSER.parse(parser, null);
}

@Override
protected Request createBlankInstance() {
return new Request();
protected Writeable.Reader<Request> instanceReader() {
return Request::new;
}
}

0 comments on commit dd08f7b

Please sign in to comment.