<commit_before>/*
 */
package org.datadryad.journalstatistics.extractor;

import java.sql.SQLException;
import org.datadryad.api.DryadDataPackage;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.WorkspaceItem;
import org.dspace.core.Context;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author <NAME> <<EMAIL>>
 */
public class DataPackageCountTest {

    private Context context;
    public DataPackageCountTest() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
        try {
            this.context = new Context();
        } catch (SQLException ex) {
            fail("Unable to instantiate Context " + ex);
        }
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of extract method, of class DataPackageCount.
     * Data packages are items in collection identified by 'stats.datapkgs.coll'
     * having prism.publicationName as provided
     */
    @Test
    public void testExtract() throws SQLException {
        // There should be one package in the database with journal name "Test Journal"
        // Create a data package
        DryadDataPackage dataPackage = DryadDataPackage.create(context);
        // set its journal
        String journalName = "Test Journal";
        dataPackage.setPublicationName(journalName);

        DataPackageCount instance = new DataPackageCount(this.context);
        Integer expResult = 1;
        Integer result = instance.extract(journalName);
        assertEquals(expResult, result);
    }
}
<commit_msg>Turn off authorization system, allow item creation<commit_after>/*
 */
package org.datadryad.journalstatistics.extractor;

import java.sql.SQLException;
import org.datadryad.api.DryadDataPackage;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.WorkspaceItem;
import org.dspace.core.Context;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author <NAME> <<EMAIL>>
 */
public class DataPackageCountTest {

    private Context context;
    public DataPackageCountTest() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
        try {
            this.context = new Context();
            context.turnOffAuthorisationSystem();
        } catch (SQLException ex) {
            fail("Unable to instantiate Context " + ex);
        }
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of extract method, of class DataPackageCount.
     * Data packages are items in collection identified by 'stats.datapkgs.coll'
     * having prism.publicationName as provided
     */
    @Test
    public void testExtract() throws SQLException {
        // There should be one package in the database with journal name "Test Journal"
        // Create a data package
        DryadDataPackage dataPackage = DryadDataPackage.create(context);
        // set its journal
        String journalName = "Test Journal";
        dataPackage.setPublicationName(journalName);

        DataPackageCount instance = new DataPackageCount(this.context);
        Integer expResult = 1;
        Integer result = instance.extract(journalName);
        assertEquals(expResult, result);
    }
}

{'fraction_non_alphanumeric': 0.09266943291839558, 'fraction_numerical': 0.0005532503457814661, 'mean_word_length': 2.842720510095643, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4675527', 'n_tokens_mistral': 1001, 'n_tokens_neox': 985, 'n_words': 273}