<commit_before>package org.intermine.web.struts;

/*
 * Copyright (C) 2002-2007 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import java.util.Arrays;
import java.util.HashSet;

import org.intermine.metadata.Model;
import org.intermine.objectstore.ObjectStoreSummary;
import org.intermine.web.logic.Constants;
import org.intermine.web.logic.query.DisplayConstraint;
import org.intermine.web.logic.query.PathNode;
import org.intermine.web.logic.query.PathQuery;

import servletunit.struts.MockStrutsTestCase;

public class DisplayConstraintTest extends MockStrutsTestCase
{
    DisplayConstraint dc;

    public DisplayConstraintTest(String arg) {
        super(arg);
    }

    public void setUp() throws Exception {
        super.setUp();

        PathQuery query = new PathQuery(Model.getInstanceByName("testmodel"));
        PathNode node = query.addNode("Employee.name");

        dc = new DisplayConstraint(node, Model.getInstanceByName("testmodel"),
                (ObjectStoreSummary) getActionServlet().getServletContext().getAttribute(Constants.OBJECT_STORE_SUMMARY),
                null, null);
    }

    public void testValidOps() throws Exception {
        assertEquals(8, dc.getValidOps().size());
    }

    public void testOptionsList() throws Exception {
        assertEquals(6, dc.getOptionsList().size());
    }

    public void testFixedOpsIndeces() throws Exception {
        assertEquals(new HashSet(Arrays.asList(new Object[]{new Integer(0), new Integer(1)})),
                     new HashSet(dc.getFixedOpIndices()));
    }
}
<commit_msg>fixed constraint test.  removed MATCHES/DOES_NOT_MATCH and added CONTAINS.<commit_after>package org.intermine.web.struts;

/*
 * Copyright (C) 2002-2007 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import java.util.Arrays;
import java.util.HashSet;

import org.intermine.metadata.Model;
import org.intermine.objectstore.ObjectStoreSummary;
import org.intermine.web.logic.Constants;
import org.intermine.web.logic.query.DisplayConstraint;
import org.intermine.web.logic.query.PathNode;
import org.intermine.web.logic.query.PathQuery;

import servletunit.struts.MockStrutsTestCase;

public class DisplayConstraintTest extends MockStrutsTestCase
{
    DisplayConstraint dc;

    public DisplayConstraintTest(String arg) {
        super(arg);
    }

    public void setUp() throws Exception {
        super.setUp();

        PathQuery query = new PathQuery(Model.getInstanceByName("testmodel"));
        PathNode node = query.addNode("Employee.name");

        dc = new DisplayConstraint(node, Model.getInstanceByName("testmodel"),
                (ObjectStoreSummary) getActionServlet().getServletContext().getAttribute(Constants.OBJECT_STORE_SUMMARY),
                null, null);
    }

    public void testValidOps() throws Exception {
        int opSize = dc.getValidOps().size();
        assertEquals(7, opSize);
    }

    public void testOptionsList() throws Exception {
        assertEquals(6, dc.getOptionsList().size());
    }

    public void testFixedOpsIndeces() throws Exception {
        assertEquals(new HashSet(Arrays.asList(new Object[]{new Integer(0), new Integer(1)})),
                     new HashSet(dc.getFixedOpIndices()));
    }
}

{'fraction_non_alphanumeric': 0.10289301310043668, 'fraction_numerical': 0.006550218340611353, 'mean_word_length': 3.615869017632242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5530430', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1006, 'n_words': 244}