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

org.approvaltests.reporters.NotePadLauncher Maven / Gradle / Ivy

There is a newer version: 24.9.0
Show newest version
package org.approvaltests.reporters;

import com.spun.util.ObjectUtils;
import com.spun.util.logger.SimpleLogger;
import org.approvaltests.core.ApprovalFailureReporter;

public class NotePadLauncher implements ApprovalFailureReporter
{
  @Override
  public boolean report(String received, String approved)
  {
    {
      String text = "\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%s\"";
      String text2 = String.format(text, received);
      try
      {
        Runtime.getRuntime().exec(text2);
        return true;
      }
      catch (Exception e)
      {
        SimpleLogger.warning("Error launching Notepad++.", e);
        return false;
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy