<commit_before>package edu.columbia.gemma.controller.flow;

import java.util.HashMap;
import java.util.Map;

import org.springframework.test.web.flow.AbstractFlowExecutionTests;
import org.springframework.web.flow.SimpleEvent;
import org.springframework.web.flow.ViewDescriptor;

/**
 * Tests the pubMedSearch-flow.
 * <hr>
 * <p>
 * Copyright (c) 2004 - 2005 Columbia University
 * 
 * @author keshav
 * @version $Id$
 */
public class SearchPubMedFlowTests extends AbstractFlowExecutionTests {
    /**
     * 
     *
     */
    public SearchPubMedFlowTests() {
        setDependencyCheck( false );
    }

    /**
     * Test criteria.view with an invalid argument. Expect to return to the criteria.view.
     */
    //TODO add validator object. Fail on validation should take me back to the criteria.view.
    //    public void testCriteriaView_Submit_Error() {
    //        startFlow();
    //        ViewDescriptor view = signalEvent( new SimpleEvent( this, "submit", null ) );
    //        assertCurrentStateEquals( "criteria.view" );
    //    }
    /**
     * Test criteria.view with a valid argument. Expect the results.view to be entered. Expect 1 bibliographic reference
     * to be returned from 1 pubMed Id.
     */
    public void testCriteriaView_Submit_Success() {
        startFlow();
        Map properties = new HashMap();
        properties.put( "pubMedId", "15173114" );
        ViewDescriptor view = signalEvent( new SimpleEvent( this, "submit", properties ) );
        assertCurrentStateEquals( "results.view" );<commit_msg>updated tests<commit_after>package edu.columbia.gemma.controller.flow;

import java.util.HashMap;
import java.util.Map;

import org.springframework.test.web.flow.AbstractFlowExecutionTests;
import org.springframework.web.flow.SimpleEvent;
import org.springframework.web.flow.ViewDescriptor;

/**
 * Tests the pubMedSearch-flow.
 * <hr>
 * <p>
 * Copyright (c) 2004 - 2005 Columbia University
 * 
 * @author keshav
 * @version $Id$
 */
public class SearchPubMedFlowTests extends AbstractFlowExecutionTests {
    /**
     * 
     *
     */
    public SearchPubMedFlowTests() {
        setDependencyCheck( false );
    }

    /**
     * Test criteria.view with an invalid argument. Expect to return to the criteria.view.
     */
    //TODO add validator object. Fail on validation should take me back to the criteria.view.
    //    public void testCriteriaView_Submit_Error() {
    //        startFlow();
    //        ViewDescriptor view = signalEvent( new SimpleEvent( this, "submit", null ) );
    //        assertCurrentStateEquals( "criteria.view" );
    //    }
    /**
     * Test criteria.view with a valid argument. Expect the results.view to be entered. Expect 1 bibliographic reference
     * to be returned from 1 pubMed Id.
     */
    public void testCriteriaView_Submit_Success() {
        startFlow();
        Map properties = new HashMap();
        properties.put( "pubMedId", "15173114" );
        ViewDescriptor view = signalEvent( new SimpleEvent( this, "submitPubMed", properties ) );
        assertCurrentStateEquals( "results.view" );
{'fraction_non_alphanumeric': 0.10631443298969072, 'fraction_numerical': 0.011597938144329897, 'mean_word_length': 2.8909774436090228, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '138873', 'n_tokens_mistral': 880, 'n_tokens_neox': 847, 'n_words': 241}