<commit_before>/*
 * 
 * 
 * Copyright (C) 2006 SIPfoundry Inc.
 * Licensed by SIPfoundry under the LGPL license.
 * 
 * Copyright (C) 2006 Pingtel Corp.
 * Licensed to SIPfoundry under a Contributor Agreement.
 * 
 * $
 */
package org.sipfoundry.sipxconfig.phone;

import java.util.Iterator;

import junit.framework.Test;
import junit.framework.TestSuite;

import org.sipfoundry.sipxconfig.TestHelper;
import org.sipfoundry.sipxconfig.test.PerformanceTestCase;

import com.clarkware.junitperf.TimedTest;

/**
 * Performace of dealing with large amounts of phones
 */
public class PhoneLoadTestPerformance extends PerformanceTestCase {
    
    private PhoneContext m_context;
    
    public PhoneLoadTestPerformance(String singleTestMethodName) {
        super(singleTestMethodName);
    }
    
    public static Test suite() {

        TestSuite suite = new TestSuite();

        suite.addTest(new TimedTest(new PhoneLoadTestPerformance("testLoad"), getTolerance(5000)));
        
        // lazy loading off, these are about same time
        suite.addTest(new TimedTest(new PhoneLoadTestPerformance("testLoadWithLines"), getTolerance(5000)));
                
        // substantially smaller than above
        suite.addTest(new TimedTest(new PhoneLoadTestPerformance("testLoadPage"), getTolerance(200)));
        
        return suite;
    }
    
    protected void setUpUnTimed() {
        m_context = (PhoneContext) TestHelper.getApplicationContext().getBean(
                PhoneContext.CONTEXT_BEAN_NAME);
        m_context.clear();
        PhoneCreateTestPerformance.seedPhones(m_context, 1000);
    }
    
    public void testLoad() {
        m_context.loadPhones();
    }

    public void testLoadWithLines() {
        Iterator i = m_context.loadPhones().iterator();
        while (i.hasNext()) {
            ((Phone) i.next()).getLines();
        }        
    }

    public void testLoadPage() {
        m_context.loadPhonesByPage(null, 0, 30, "serialNumber", true);
    }
}
<commit_msg>FIX BUILD : compiler error<commit_after>/*
 * 
 * 
 * Copyright (C) 2006 SIPfoundry Inc.
 * Licensed by SIPfoundry under the LGPL license.
 * 
 * Copyright (C) 2006 Pingtel Corp.
 * Licensed to SIPfoundry under a Contributor Agreement.
 * 
 * $
 */
package org.sipfoundry.sipxconfig.phone;

import java.util.Iterator;

import junit.framework.Test;
import junit.framework.TestSuite;

import org.sipfoundry.sipxconfig.TestHelper;
import org.sipfoundry.sipxconfig.test.PerformanceTestCase;

import com.clarkware.junitperf.TimedTest;

/**
 * Performace of dealing with large amounts of phones
 */
public class PhoneLoadTestPerformance extends PerformanceTestCase {
    
    private PhoneContext m_context;
    
    public PhoneLoadTestPerformance(String singleTestMethodName) {
        super(singleTestMethodName);
    }
    
    public static Test suite() {

        TestSuite suite = new TestSuite();

        suite.addTest(new TimedTest(new PhoneLoadTestPerformance("testLoad"), getTolerance(5000)));
        
        // lazy loading off, these are about same time
        suite.addTest(new TimedTest(new PhoneLoadTestPerformance("testLoadWithLines"), getTolerance(5000)));
                
        // substantially smaller than above
        suite.addTest(new TimedTest(new PhoneLoadTestPerformance("testLoadPage"), getTolerance(200)));
        
        return suite;
    }
    
    protected void setUpUnTimed() {
        m_context = (PhoneContext) TestHelper.getApplicationContext().getBean(
                PhoneContext.CONTEXT_BEAN_NAME);
        m_context.clear();
        PhoneCreateTestPerformance.seedPhones(m_context, 1000);
    }
    
    public void testLoad() {
        m_context.loadPhones();
    }

    public void testLoadWithLines() {
        Iterator i = m_context.loadPhones().iterator();
        while (i.hasNext()) {
            ((Phone) i.next()).getLines();
        }        
    }

    public void testLoadPage() {
        m_context.loadPhonesByPage(null, 0, 30, new String[] { "serialNumber" }, true);
    }
}

{'fraction_non_alphanumeric': 0.0983159980188212, 'fraction_numerical': 0.012877662209014363, 'mean_word_length': 2.9481915933528837, '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': '2773941', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1146, 'n_words': 255}