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

com.chutneytesting.action.assertion.compare.Parser Maven / Gradle / Ivy

There is a newer version: 2.9.0
Show newest version
package com.chutneytesting.action.assertion.compare;

import com.chutneytesting.action.spi.injectable.Logger;

public class Parser {

     static double actualDouble;
     static double expectedDouble;

    public static boolean isParsableFrom(Logger logger, String actual, String expected) {

        try {
            actualDouble = Double.parseDouble(actual);
        } catch (NumberFormatException nfe) {
            logger.error("[" + actual + "] is Not Numeric");
        }

        try {
            expectedDouble = Double.parseDouble(expected);
        } catch (NumberFormatException nfe) {
            logger.error("[" + expected + "] is Not Numeric");
            return false;
        }

        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy