Tabnine Logo
IBuffer.append
Code IndexAdd Tabnine to your IDE (free)

How to use
append
method
in
org.testng.reporters.IBuffer

Best Java code snippets using org.testng.reporters.IBuffer.append (Showing top 20 results out of 315)

origin: org.testng/testng

public void addString(String s) {
 m_buffer.append(s);
}
origin: org.testng/testng

public static void xmlOpen(IBuffer result, String indent, String tag,
  Properties attributes, boolean noNewLine) {
 result.append(indent).append("<").append(tag);
 appendAttributes(result, attributes);
 result.append(">");
 if (!noNewLine) {
  result.append(EOL);
 }
}
origin: org.testng/testng

public static void xmlClose(IBuffer result, String indent, String tag, String comment) {
 result.append(indent).append("</").append(tag).append(">")
   .append(Strings.getValueOrEmpty(comment))
   .append(EOL);
}
origin: org.testng/testng

/**
 * Add an empty element tag (e.g. <foo/>)
 * @param tagName The name of the tag
 * @param attributes A Properties file containing the attributes (or null)
 */
public void addEmptyElement(String tagName, @Nullable Properties attributes) {
 m_buffer.append(m_currentIndent).append("<").append(tagName);
 XMLUtils.appendAttributes(m_buffer, attributes);
 m_buffer.append("/>").append(EOL);
}
origin: cbeust/testng

public void addString(String s) {
 m_buffer.append(s);
}
origin: cbeust/testng

public static void xmlClose(IBuffer result, String indent, String tag, String comment) {
 result
   .append(indent)
   .append("</")
   .append(tag)
   .append(">")
   .append(Strings.getValueOrEmpty(comment))
   .append(EOL);
}
origin: cbeust/testng

public static void xmlOpen(
  IBuffer result, String indent, String tag, Properties attributes, boolean noNewLine) {
 result.append(indent).append("<").append(tag);
 appendAttributes(result, attributes);
 result.append(">");
 if (!noNewLine) {
  result.append(EOL);
 }
}
origin: org.testng/testng

/**
 * Add a CDATA tag.
 */
public void addCDATA(String content) {
 if (content != null) {
   //Solution from https://coderanch.com/t/455930/java/Remove-control-characters
   content = content.replaceAll("[\\p{Cc}&&[^\\r\\n]]", "");
 }
 m_buffer.append(m_currentIndent);
 if (content == null) {
  m_buffer.append("<![CDATA[null]]>");
 } else if (!content.contains("]]>")) {
  m_buffer.append("<![CDATA[").append(content).append("]]>");
 } else if ("]]>".equals(content)) {
  // Solution from http://stackoverflow.com/q/223652/4234729
  m_buffer.append("<![CDATA[]]]]><![CDATA[>]]>");
 } else { // content contains "]]>"
  String[] subStrings = content.split("]]>");
  m_buffer.append("<![CDATA[").append(subStrings[0]).append("]]]]>");
  for (int i = 1; i < subStrings.length - 1; i++) {
   m_buffer.append("<![CDATA[>").append(subStrings[i]).append("]]]]>");
  }
  m_buffer.append("<![CDATA[>").append(subStrings[subStrings.length - 1]).append("]]>");
  if (content.endsWith("]]>")) {
   m_buffer.append("<![CDATA[]]]]>").append("<![CDATA[>]]>");
  }
 }
 m_buffer.append(EOL);
}
origin: org.testng/testng

public void addComment(String comment) {
 m_buffer.append(m_currentIndent).append("<!-- " + comment.replaceAll("[-]{2,}", "-") + " -->\n");
}
origin: cbeust/testng

/**
 * Add an empty element tag (e.g. <foo/>)
 *
 * @param tagName The name of the tag
 * @param attributes A Properties file containing the attributes (or null)
 */
public void addEmptyElement(String tagName, @Nullable Properties attributes) {
 m_buffer.append(m_currentIndent).append("<").append(tagName);
 XMLUtils.appendAttributes(m_buffer, attributes);
 m_buffer.append("/>").append(EOL);
}
origin: org.testng/testng

/**
 * Appends the attributes to result. The attributes are added on a single line
 * as: key1="value1" key2="value2" ... (a space is added before the first key)
 *
 * @param result
 *          the buffer to append attributes to.
 * @param attributes
 *          the attributes to append (may be null).
 */
public static void appendAttributes(IBuffer result, Properties attributes) {
 if (null != attributes) {
  for (Object element : attributes.entrySet()) {
   Entry entry = (Entry) element;
   String key = entry.getKey().toString();
   String value = escape(entry.getValue().toString());
   result.append(" ").append(key).append("=\"").append(value).append("\"");
  }
 }
}
origin: cbeust/testng

public void addComment(String comment) {
 m_buffer
   .append(m_currentIndent)
   .append("<!-- " + comment.replaceAll("[-]{2,}", "-") + " -->\n");
}
origin: cbeust/testng

/** Add a CDATA tag. */
public void addCDATA(String content) {
 if (content != null) {
  // Solution from https://coderanch.com/t/455930/java/Remove-control-characters
  content = content.replaceAll("[\\p{Cc}&&[^\\r\\n]]", "");
 }
 m_buffer.append(m_currentIndent);
 if (content == null) {
  m_buffer.append("<![CDATA[null]]>");
 } else if (!content.contains("]]>")) {
  m_buffer.append("<![CDATA[").append(content).append("]]>");
 } else if ("]]>".equals(content)) {
  // Solution from http://stackoverflow.com/q/223652/4234729
  m_buffer.append("<![CDATA[]]]]><![CDATA[>]]>");
 } else { // content contains "]]>"
  String[] subStrings = content.split("]]>");
  m_buffer.append("<![CDATA[").append(subStrings[0]).append("]]]]>");
  for (int i = 1; i < subStrings.length - 1; i++) {
   m_buffer.append("<![CDATA[>").append(subStrings[i]).append("]]]]>");
  }
  m_buffer.append("<![CDATA[>").append(subStrings[subStrings.length - 1]).append("]]>");
  if (content.endsWith("]]>")) {
   m_buffer.append("<![CDATA[]]]]>").append("<![CDATA[>]]>");
  }
 }
 m_buffer.append(EOL);
}
origin: org.testng/testng

public static void xmlRequired(IBuffer result, String sp,
  String elementName, @Nullable String value, @Nullable Properties attributes) {
 result.append(xml(sp, elementName, value, attributes));
}
origin: cbeust/testng

/**
 * Appends the attributes to result. The attributes are added on a single line as: key1="value1"
 * key2="value2" ... (a space is added before the first key)
 *
 * @param result the buffer to append attributes to.
 * @param attributes the attributes to append (may be null).
 */
public static void appendAttributes(IBuffer result, Properties attributes) {
 if (null != attributes) {
  for (Object element : attributes.entrySet()) {
   Entry entry = (Entry) element;
   String key = entry.getKey().toString();
   String value = escape(entry.getValue().toString());
   result.append(" ").append(key).append("=\"").append(value).append("\"");
  }
 }
}
origin: cbeust/testng

public static void xmlRequired(
  IBuffer result,
  String sp,
  String elementName,
  @Nullable String value,
  @Nullable Properties attributes) {
 result.append(xml(sp, elementName, value, attributes));
}
origin: org.testng/testng

/**
 * Generate tag.
 * An opening and closing tag will be generated even if value is null.
 * @param name name of the tag
 * @param content content for this tag (or null)
 * @param attributes tag attributes (or null)
 */
static public String xml(String indent,
             String name,
             @Nullable String content,
             @Nullable Properties attributes) {
 IBuffer result = Buffer.create();
 xmlOpen(result, indent, name, attributes, true /* no newline */);
 if (content != null) {
  result.append(content);
 }
 xmlClose(result, "", name, XMLUtils.extractComment(name, attributes));
 return result.toString();
}
origin: cbeust/testng

/**
 * Generate tag. An opening and closing tag will be generated even if value is null.
 *
 * @param name name of the tag
 * @param content content for this tag (or null)
 * @param attributes tag attributes (or null)
 */
public static String xml(
  String indent, String name, @Nullable String content, @Nullable Properties attributes) {
 IBuffer result = Buffer.create();
 xmlOpen(result, indent, name, attributes, true /* no newline */);
 if (content != null) {
  result.append(content);
 }
 xmlClose(result, "", name, XMLUtils.extractComment(name, attributes));
 return result.toString();
}
origin: org.testng/testng

xsb.getStringBuffer().append(d.toXml(indent2));
  xsb.getStringBuffer().append(m_run.toXml(indent2));
xsb.getStringBuffer().append(d.toXml(indent2));
origin: cbeust/testng

xsb.getStringBuffer().append(d.toXml(indent2));
xsb.getStringBuffer().append(m_run.toXml(indent2));
xsb.getStringBuffer().append(d.toXml(indent2));
org.testng.reportersIBufferappend

Popular methods of IBuffer

  • toWriter

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JButton (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now