<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.compomics.pride_asa_pipeline.repository;

import com.compomics.pride_asa_pipeline.model.AASequenceMassUnknownException;
<<<<<<< .mine
=======
import com.compomics.pride_asa_pipeline.model.AminoAcid;
import com.compomics.pride_asa_pipeline.model.AminoAcidSequence;
import com.compomics.pride_asa_pipeline.model.AnnotationData;
import com.compomics.pride_asa_pipeline.model.FragmentIonAnnotation;
import com.compomics.pride_asa_pipeline.model.Identification;
import com.compomics.pride_asa_pipeline.model.IdentificationScore;
import com.compomics.pride_asa_pipeline.model.Modification;
import com.compomics.pride_asa_pipeline.model.ModifiedPeptide;
import com.compomics.pride_asa_pipeline.model.Peptide;
>>>>>>> .r42
import com.compomics.pride_asa_pipeline.model.UnknownAAException;
import org.jdom2.JDOMException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.IOException;

/**
 *
 * @author niels
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:springXMLConfig.xml")
public class FileResultHandlerTest {

    @Autowired
//    private FileResultHandler fileResultHandler;
    @Rule
//    public TemporaryFolder temporaryFolder = new TemporaryFolder();

    @Test
    public void testWriteResult() throws IOException, UnknownAAException, JDOMException, AASequenceMassUnknownException {
        File tempResultFile = temporaryFolder.newFile("tempResultFile.txt");

        //add identifications
        List<Identification> identifications = new ArrayList<Identification>();

        //create identification with annotation data
        Peptide peptide = new Peptide(1, 1649.8D, new AminoAcidSequence("AAKENNYLENNART"));
        Identification identification_1 = new Identification(peptide, null, 1L, 1L);
        identifications.add(identification_1);

        List<FragmentIonAnnotation> fragmentIonAnnotations = new ArrayList<FragmentIonAnnotation>();
        FragmentIonAnnotation fragmentIonAnnotation_1 = new FragmentIonAnnotation(1L, FragmentIonAnnotation.IonType.Y_ION, 2, 1L, 1L, 1);
        fragmentIonAnnotations.add(fragmentIonAnnotation_1);

        FragmentIonAnnotation fragmentIonAnnotation_2 = new FragmentIonAnnotation(1L, FragmentIonAnnotation.IonType.Y_ION, 5, 1L, 1L, 2);
        fragmentIonAnnotations.add(fragmentIonAnnotation_2);<commit_msg>- Resolved bad merge operation from last commit.<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.compomics.pride_asa_pipeline.repository;

import com.compomics.pride_asa_pipeline.model.*;
import org.jdom2.JDOMException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static junit.framework.Assert.assertEquals;

/**
 *
 * @author niels
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:springXMLConfig.xml")
public class FileResultHandlerTest {

    @Autowired
    private FileResultHandler fileResultHandler;
    @Rule
    public TemporaryFolder temporaryFolder = new TemporaryFolder();

    @Test
    public void testWriteResult() throws IOException, UnknownAAException, JDOMException, AASequenceMassUnknownException {
        File tempResultFile = temporaryFolder.newFile("tempResultFile.txt");

        //add identifications
        List<Identification> identifications = new ArrayList<Identification>();

        //create identification with annotation data
        Peptide peptide = new Peptide(1, 1649.8D, new AminoAcidSequence("AAKENNYLENNART"));
        Identification identification_1 = new Identification(peptide, null, 1L, 1L);
        identifications.add(identification_1);

        List<FragmentIonAnnotation> fragmentIonAnnotations = new ArrayList<FragmentIonAnnotation>();
        FragmentIonAnnotation fragmentIonAnnotation_1 = new FragmentIonAnnotation(1L, FragmentIonAnnotation.IonType.Y_ION, 2, 1L, 1L, 1);
        fragmentIonAnnotations.add(fragmentIonAnnotation_1);

        FragmentIonAnnotation fragmentIonAnnotation_2 = new FragmentIonAnnotation(1L, FragmentIonAnnotation.IonType.Y_ION, 5, 1L, 1L, 2);
        fragmentIonAnnotations.add(fragmentIonAnnotation_2);
{'fraction_non_alphanumeric': 0.09009921036647095, 'fraction_numerical': 0.011743267867989472, 'mean_word_length': 5.508563899868248, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '834100', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1409, 'n_words': 275}