@@ -0,0 +1,2172 @@
+/*%0A * Copyright 2014-present Facebook, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A * not use this file except in compliance with the License. You may obtain%0A * a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage com.facebook.buck.core.test.rule;%0A%0Aimport com.facebook.buck.core.model.BuildTarget;%0Aimport com.facebook.buck.core.util.immutables.BuckStyleValue;%0Aimport com.fasterxml.jackson.core.JsonGenerator;%0Aimport com.fasterxml.jackson.databind.SerializerProvider;%0Aimport com.fasterxml.jackson.databind.jsontype.TypeSerializer;%0Aimport com.google.common.collect.ImmutableMap;%0Aimport java.io.IOException;%0Aimport java.util.Map;%0A%0A/** The JSON serializable object for test protocol */%0A@BuckStyleValue%0Aabstract class ExternalRunnerTestProtocol implements ExternalTestSpec %7B%0A%0A  /** @return the build target of this rule. */%0A  protected abstract BuildTarget getTarget();%0A%0A  /**%0A   * @return the test protocol specs defined in the BUCK file. This is a free form dictionary that%0A   *     will be serialized and passed to the test runners.%0A   */%0A  protected abstract ImmutableMap%3CString, String%3E getSpecs();%0A%0A  @Override%0A  public void serialize(JsonGenerator jsonGenerator, SerializerProvider serializerProvider)%0A      throws IOException %7B%0A    jsonGenerator.writeStartObject();%0A    jsonGenerator.writeStringField(%22target%22, getTarget().toString());%0A    for (Map.Entry%3CString, String%3E entry : getSpecs().entrySet()) %7B%0A      jsonGenerator.writeStringField(entry.getKey(), entry.getValue());%0A    %7D%0A    jsonGenerator.writeEndObject();%0A  %7D%0A%0A  @Override%0A  public void serializeWithType(%0A      JsonGenerator jsonGenerator,%0A      SerializerProvider serializerProvider,%0A      TypeSerializer typeSerializer)%0A      throws IOException %7B%0A    serialize(jsonGenerator, serializerProvider);%0A  %7D%0A%7D%0A

Add new ExternalRunnerTestProtocol serializable object