<commit_before>package jcrush;

import jcrush.model.MediaCrushFile;
import java.io.File;

import jcrush.system.exceptions.FileUploadFailedException;
import org.junit.Test;

import java.io.IOException;
import java.net.URI;
import java.net.URL;

public class APITest {
    private static final String TEST_HASH = "CPvuR5lRhmS0";

    @Test(expected = IOException.class)
    public void failedUploadFileTest() throws IOException {
        System.out.println("=== JCrush.uploadFile(File) ===");

        File testFile = new File("src/test/failedTest.gif");
        JCrush.uploadFile(testFile);
        System.out.println("TEST COMPLETE");
    }

    @Test(expected = FileUploadFailedException.class)
    public void uploadAndDeleteFile() throws IOException {
        System.out.println("=== JCrush.uploadFile(File) ===");
        System.out.println("=== JCrush.delete(String) ===");

        File testFile = new File("src/test/test2.gif");
        JCrush.delete("bTVxrDGQ4ks_");
        String hash = JCrush.uploadFile(testFile);
        System.out.println(hash);
        System.out.println("TEST COMPLETE");
    }
    @Test (expected = FileUploadFailedException.class)
    public void uploadViaURL() throws IOException {
        System.out.println("=== JCrush.uploadFileViaURL(URL) ===");
        System.out.println("=== JCrush.uploadFileViaURL(String) ===");
        URL url1 = new URL("http://rmart.org/45341/Src/1ac65c7f45047fb99d58d3c87052fcc1.gif");
        String url2 = "http://25.media.tumblr.com/tumblr_mec3lqCnpg1qce7tgo1_500.gif";

        String hash2 = JCrush.uploadFileViaURL(url1);
        String hash = JCrush.uploadFileViaURL(url2);

        System.out.println(hash);
        System.out.println(hash2);
        System.out.println("TEST COMPLETE");
    }

    @Test(expected = IOException.class)
    public void failedDeleteHashTest() throws IOException {
        System.out.println("=== JCrush.delete(String) ===");

        JCrush.delete(TEST_HASH);
    }

    @Test(expected = IOException.class)
    public void failedDeleteFileTest() throws IOException {<commit_msg>Small bug fix in junit test<commit_after>package jcrush;

import jcrush.model.MediaCrushFile;
import java.io.File;

import jcrush.system.exceptions.FileUploadFailedException;
import org.junit.Test;

import java.io.IOException;
import java.net.URI;
import java.net.URL;

public class APITest {
    private static final String TEST_HASH = "CPvuR5lRhmS0";

    @Test(expected = IOException.class)
    public void failedUploadFileTest() throws IOException {
        System.out.println("=== JCrush.uploadFile(File) ===");

        File testFile = new File("src/test/failedTest.gif");
        JCrush.uploadFile(testFile);
        System.out.println("TEST COMPLETE");
    }

    @Test(expected = FileUploadFailedException.class)
    public void uploadAndDeleteFile() throws IOException {
        System.out.println("=== JCrush.uploadFile(File) ===");
        System.out.println("=== JCrush.delete(String) ===");

        File testFile = new File("src/test/test.gif");
        JCrush.delete("bTVxrDGQ4ks_");
        String hash = JCrush.uploadFile(testFile);
        System.out.println(hash);
        System.out.println("TEST COMPLETE");
    }
    @Test (expected = FileUploadFailedException.class)
    public void uploadViaURL() throws IOException {
        System.out.println("=== JCrush.uploadFileViaURL(URL) ===");
        System.out.println("=== JCrush.uploadFileViaURL(String) ===");
        URL url1 = new URL("http://rmart.org/45341/Src/1ac65c7f45047fb99d58d3c87052fcc1.gif");
        String url2 = "http://25.media.tumblr.com/tumblr_mec3lqCnpg1qce7tgo1_500.gif";

        String hash2 = JCrush.uploadFileViaURL(url1);
        String hash = JCrush.uploadFileViaURL(url2);

        System.out.println(hash);
        System.out.println(hash2);
        System.out.println("TEST COMPLETE");
    }

    @Test(expected = IOException.class)
    public void failedDeleteHashTest() throws IOException {
        System.out.println("=== JCrush.delete(String) ===");

        JCrush.delete(TEST_HASH);
    }

    @Test(expected = IOException.class)
    public void failedDeleteFileTest() throws IOException {
{'fraction_non_alphanumeric': 0.13400335008375208, 'fraction_numerical': 0.0208183776022972, 'mean_word_length': 3.4946236559139785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1059915', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1333, 'n_words': 223}