aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/java_tools/junitrunner/java/com/google/testing
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2016-11-09 10:50:28 +0000
committerGravatar Klaus Aehlig <aehlig@google.com>2016-11-09 10:54:22 +0000
commit90b5b19927540fc1e1c9e1a7fbd05c816ae0e4e2 (patch)
treed69cfd72e5620054aa6b6a94c073394831a589e4 /src/java_tools/junitrunner/java/com/google/testing
parentdc32295f82da3acbd71c30a7e508b0c54f39f694 (diff)
Remove the dependency on AutoValue from the Java test runner so that it doesn't conflict with whatever AutoValue version the code under test has.
Fixes #2044. -- MOS_MIGRATED_REVID=138618191
Diffstat (limited to 'src/java_tools/junitrunner/java/com/google/testing')
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD1
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java146
2 files changed, 121 insertions, 26 deletions
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD
index c579531ff0..55003c8a46 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/BUILD
@@ -11,7 +11,6 @@ java_library(
name = "util",
srcs = glob(["*.java"]),
deps = [
- "//third_party:auto_value",
"//third_party:jsr305",
"//third_party:junit4",
],
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java
index 8ba1527bd8..1e2aaf0bfa 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/util/TestIntegration.java
@@ -14,13 +14,42 @@
package com.google.testing.junit.runner.util;
-import com.google.auto.value.AutoValue;
import java.util.EnumMap;
import java.util.Map;
/** TestIntegration represents an external link that is integrated with the test results. */
-@AutoValue
-public abstract class TestIntegration {
+public class TestIntegration {
+
+ private final String contactEmail;
+ private final String componentId;
+ private final String name;
+ private final String url;
+ private final String iconUrl;
+ private final String iconName;
+ private final String description;
+ private final String foregroundColor;
+ private final String backgroundColor;
+
+ public TestIntegration(
+ String contactEmail,
+ String componentId,
+ String name,
+ String url,
+ String iconUrl,
+ String iconName,
+ String description,
+ String foregroundColor,
+ String backgroundColor) {
+ this.contactEmail = contactEmail;
+ this.componentId = componentId;
+ this.name = name;
+ this.url = url;
+ this.iconUrl = iconUrl;
+ this.iconName = iconName;
+ this.description = description;
+ this.foregroundColor = foregroundColor;
+ this.backgroundColor = backgroundColor;
+ }
/** Represents each available field for TestIntegration. */
public enum ExternalLinkAttribute {
@@ -41,26 +70,51 @@ public abstract class TestIntegration {
}
// Group or user name responsible for this external integration.
- abstract String contactEmail();
+ String contactEmail() {
+ return contactEmail;
+ }
+
// Component id (numeric) for this external integration.
- abstract String componentId();
+ String componentId() {
+ return componentId;
+ }
+
// Display name of this external integration.
- abstract String name();
+ String name() {
+ return name;
+ }
+
// URL that will display more data about this test result or integration.
- abstract String url();
+ String url() {
+ return url;
+ }
+
// Optional: URL or name of the icon to be displayed.
- abstract String iconUrl();
+ String iconUrl() {
+ return iconUrl;
+ }
+
+ String iconName() {
+ return iconName;
+ }
- abstract String iconName();
// Optional: Textual description that shows up as tooltip.
- abstract String description();
+ String description() {
+ return description;
+ }
+
// Optional: Foreground color.
- abstract String foregroundColor();
+ String foregroundColor() {
+ return foregroundColor;
+ }
+
// Optional: Background color.
- abstract String backgroundColor();
+ String backgroundColor() {
+ return backgroundColor;
+ }
public static Builder builder() {
- return new AutoValue_TestIntegration.Builder()
+ return new Builder()
.setIconName("")
.setIconUrl("")
.setDescription("")
@@ -69,15 +123,30 @@ public abstract class TestIntegration {
}
/** Builder is the builder class for TestIntegration */
- @AutoValue.Builder
- public abstract static class Builder {
+ public static class Builder {
+ private String contactEmail;
+ private String componentId;
+ private String name;
+ private String url;
+ private String iconUrl;
+ private String iconName;
+ private String description;
+ private String foregroundColor;
+ private String backgroundColor;
+
+ private Builder() {
+ }
+
/**
* Sets the Contact Email value. The contact email is used for users to identify how to contact
* the TestIntegration owner. This is optional.
* @param email Email of the team responsible for this TestIntegration.
* @return Builder
*/
- public abstract Builder setContactEmail(String email);
+ public Builder setContactEmail(String email) {
+ this.contactEmail = email;
+ return this;
+ }
/**
* Sets the component ID value, used to identify the tool that this TestIntegration belongs to.
@@ -85,14 +154,20 @@ public abstract class TestIntegration {
* @param id ID of the component.
* @return Builder
*/
- public abstract Builder setComponentId(String id);
+ public Builder setComponentId(String id) {
+ this.componentId = id;
+ return this;
+ }
/**
* Sets the name for the tool for this TestIntegration.
* @param name Name of this TestIntegration.
* @return Builder
*/
- public abstract Builder setName(String name);
+ public Builder setName(String name) {
+ this.name = name;
+ return this;
+ }
/**
* Sets the URL of this TestIntegration. It should be a FQDN, with optional url
@@ -100,7 +175,10 @@ public abstract class TestIntegration {
* @param url The location of the TestIntegration.
* @return Builder
*/
- public abstract Builder setUrl(String url);
+ public Builder setUrl(String url) {
+ this.url = url;
+ return this;
+ }
/**
* Sets the url of the icon. The icon should look good even if scaled down to 16x16.
@@ -109,7 +187,10 @@ public abstract class TestIntegration {
* @param iconUrl Location of the icon.
* @return Builder
*/
- public abstract Builder setIconUrl(String iconUrl);
+ public Builder setIconUrl(String iconUrl) {
+ this.iconUrl = iconUrl;
+ return this;
+ }
/**
* Sets the name of the icon. This is optional; if not set it will instead use the value
@@ -117,7 +198,10 @@ public abstract class TestIntegration {
* @param iconName name of the icon.
* @return Builder
*/
- public abstract Builder setIconName(String iconName);
+ public Builder setIconName(String iconName) {
+ this.iconName = iconName;
+ return this;
+ }
/**
* Sets the description. The description is used to describe the TestIntegration object's
@@ -125,7 +209,10 @@ public abstract class TestIntegration {
* @param description The description for this TestIntegration.
* @return Builder
*/
- public abstract Builder setDescription(String description);
+ public Builder setDescription(String description) {
+ this.description = description;
+ return this;
+ }
/**
* Sets the foreground color of the TestIntegration link. This is optional; if it isn't set,
@@ -133,7 +220,10 @@ public abstract class TestIntegration {
* @param foregroundColor The foreground color of the link, e.g. {@code "#000000"}.
* @return Builder
*/
- public abstract Builder setForegroundColor(String foregroundColor);
+ public Builder setForegroundColor(String foregroundColor) {
+ this.foregroundColor = foregroundColor;
+ return this;
+ }
/**
* Sets the background color of the TestIntegration link. This is optional; if it isn't set,
@@ -141,13 +231,19 @@ public abstract class TestIntegration {
* @param backgroundColor The background color of the link, e.g. {@code "#ffffff"}.
* @return Builder
*/
- public abstract Builder setBackgroundColor(String backgroundColor);
+ public Builder setBackgroundColor(String backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ return this;
+ }
/**
* Builds a TestIntegration object.
* @return Builder
*/
- public abstract TestIntegration build();
+ public TestIntegration build() {
+ return new TestIntegration(contactEmail, componentId, name, url, iconUrl, iconName,
+ description, foregroundColor, backgroundColor);
+ }
}
/*