public void stop() {
        if (!isRunning()) {
            return;
        }
        super.stop();
        // At the end save cookies to the file specified in the order file.
        if (getCookieStore() != null) {
            AbstractCookieStore r = getCookieStore();
            if (r.getCookiesSaveFile() != null) {
                r.saveCookies(r.getCookiesSaveFile().getFile().getAbsolutePath());
            }
            getCookieStore().stop();
            setCookieStore(null);
        }
    }
@Test
    public void testSocksProxy() throws Exception {
        // create a fetcher with socks enabled
        FetchHTTP socksFetcher = newSocksTestFetchHttp(getUserAgentString(), "localhost", 7800);

        CrawlURI curi = makeCrawlURI("http://localhost:7777/");
        socksFetcher().process(curi);
        runDefaultChecks(curi);

        socksServer.stop();
    }