Skip to content

Commit

Permalink
Add missing class
Browse files Browse the repository at this point in the history
  • Loading branch information
juherr committed Feb 17, 2024
1 parent 1bd03db commit f4a7155
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/main/java/org/testng/internal/ant/AntReporterConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.testng.internal.ant;

import org.testng.collections.Lists;

import java.util.List;
import java.util.stream.Collectors;

/**
* Used with the <reporter> sub-element of the Ant task
*
* <p>NOTE: this class needs to be public. It's used by TestNG Ant task
*/
public class AntReporterConfig {

/** The class name of the reporter listener */
protected String className;

/** The properties of the reporter listener */
private final List<Property> properties = Lists.newArrayList();

public void addProperty(Property property) {
properties.add(property);
}

public void setClassName(String className) {
this.className = className;
}

public String serialize() {
List<org.testng.internal.ReporterConfig.Property> properties =
this.properties.stream()
.map(
property ->
new org.testng.internal.ReporterConfig.Property(property.name, property.value))
.collect(Collectors.toList());
return (new org.testng.internal.ReporterConfig(className, properties)).serialize();
}

public static class Property {
private String name;
private String value;

public void setName(String name) {
this.name = name;
}

public void setValue(String value) {
this.value = value;
}
}
}

0 comments on commit f4a7155

Please sign in to comment.