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

com.aventstack.extentreports.viewdefs.Icon Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package com.aventstack.extentreports.viewdefs;

import java.util.EnumMap;
import java.util.Map;

import com.aventstack.extentreports.Status;

public class Icon {

    private static Map map = new EnumMap<>(Status.class);
    
    public void override(Status status, String icon) {
        map.put(status, icon);
    }
    
    public String getIcon(Status status) {
        if (map.containsKey(status))
            return map.get(status);

        String s = status.toString().toLowerCase();

        switch (s) {
            case "fail":
            case "fatal":
                return "times";
            case "error":
                return "exclamation";
            case "warning":
                return "warning";
            case "skip":
                return "long-arrow-right";
            case "pass":
                return "check";
            case "debug":
                return "low_priority";
            case "info":
                return "info";
            default:
                return "help";
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy