All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.seleniumtests.reporter.info.StringInfo Maven / Gradle / Ivy

The newest version!
package com.seleniumtests.reporter.info;

import com.seleniumtests.customexception.CustomSeleniumTestsException;
import com.seleniumtests.util.StringUtility;
import org.json.JSONObject;
import org.testng.ITestResult;

public class StringInfo extends Info {

    public StringInfo(String info) {
        super(info);
    }

    public String encode(String format) {
       // if (format == null) {
       //     logger.error("format cannot be null");
       //     return description;
       // } else {
            try {
                return StringUtility.encodeString(description, format);
            } catch (CustomSeleniumTestsException e) {
                return description;
            }
        //}
    }

    @Override
    public JSONObject toJson() {
        return new JSONObject().put("type", "string")
                .put("info", description == null ? JSONObject.NULL: description);

    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy