// Path: src/main/java/org/jmeterplugins/repository/exception/DownloadException.java
// public class DownloadException extends RuntimeException {
//     public DownloadException() {
//     }
// 
//     public DownloadException(String message) {
//         super(message);
//     }
// 
//     public DownloadException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import kg.apc.emulators.TestJMeterUtils;
import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import org.apache.jmeter.engine.JMeterEngine;
import org.apache.jmeter.util.JMeterUtils;
import org.jmeterplugins.repository.exception.DownloadException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URL;
import static org.junit.Assert.*;
        String addr = JMeterUtils.getPropDefault("jpgc.repo.address", "https://jmeter-plugins.org/repo/");
        try {
            JMeterUtils.setProperty("jpgc.repo.address", "http://httpstat.us/500");

            Plugin p = Plugin.fromJSON(JSONObject.fromObject(str, new JsonConfig()));
            PluginManager manager = new PluginManager();
            manager.allPlugins.put(p, true); // need to install
            p.setCandidateVersion("9999");

            try {
                manager.applyChanges(new GenericCallback<String>() {
                    @Override
                    public void notify(String progress) {
                    }
                }, true, null);
                fail();
            } catch (IllegalArgumentException ex) {
                assertTrue(ex.getMessage().contains("Version 9999 not found for plugin"));
            }

            manager.allPlugins.put(p, true); // need to install
            p.setCandidateVersion("0.2");

            try {
                manager.applyChanges(new GenericCallback<String>() {
                    @Override
                    public void notify(String progress) {
                    }
                }, true, null);
                fail();
// Path: src/main/java/org/jmeterplugins/repository/exception/DownloadException.java
// public class DownloadException extends RuntimeException {
//     public DownloadException() {
//     }
// 
//     public DownloadException(String message) {
//         super(message);
//     }
// 
//     public DownloadException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: src/test/java/org/jmeterplugins/repository/PluginManagerTest.java
import kg.apc.emulators.TestJMeterUtils;
import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import org.apache.jmeter.engine.JMeterEngine;
import org.apache.jmeter.util.JMeterUtils;
import org.jmeterplugins.repository.exception.DownloadException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URL;
import static org.junit.Assert.*;

        String addr = JMeterUtils.getPropDefault("jpgc.repo.address", "https://jmeter-plugins.org/repo/");
        try {
            JMeterUtils.setProperty("jpgc.repo.address", "http://httpstat.us/500");

            Plugin p = Plugin.fromJSON(JSONObject.fromObject(str, new JsonConfig()));
            PluginManager manager = new PluginManager();
            manager.allPlugins.put(p, true); // need to install
            p.setCandidateVersion("9999");

            try {
                manager.applyChanges(new GenericCallback<String>() {
                    @Override
                    public void notify(String progress) {
                    }
                }, true, null);
                fail();
            } catch (IllegalArgumentException ex) {
                assertTrue(ex.getMessage().contains("Version 9999 not found for plugin"));
            }

            manager.allPlugins.put(p, true); // need to install
            p.setCandidateVersion("0.2");

            try {
                manager.applyChanges(new GenericCallback<String>() {
                    @Override
                    public void notify(String progress) {
                    }
                }, true, null);
                fail();
            } catch (DownloadException ex) {