<commit_before>package org.picocontainer.gems.monitors;

import junit.framework.TestCase;
import org.picocontainer.testmodel.DependsOnList;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Vector;

public class DotGraphComponentMonitorTestCase extends TestCase {


    public void testSimpleClassDependencyGraph() throws NoSuchMethodException {

        DotGraphComponentMonitor monitor = new DotGraphComponentMonitor();

        Vector vec = new Vector();
        List list = new ArrayList();
        DependsOnList dol = new DependsOnList(list);
        DependsOnDependsOnListAndVector dodolav = new DependsOnDependsOnListAndVector(vec, dol);

        monitor.instantiated(Vector.class.getConstructor(new Class[0]), vec, new Object[]{}, 8);
        monitor.instantiated(ArrayList.class.getConstructor(new Class[]{Collection.class}), list, new Object[]{vec}, 12);
        monitor.instantiated(DependsOnList.class.getConstructors()[0], dol, new Object[]{list}, 10);
        monitor.instantiated(DependsOnDependsOnListAndVector.class.getConstructors()[0], dodolav, new Object[]{vec, dol}, 16);

        String graph = monitor.getClassDependencyGraph();

        String expected = "" +
                "  java.util.ArrayList -> java.util.Vector;\n" +
                "  org.picocontainer.testmodel.DependsOnList -> java.util.ArrayList;\n" +
                "  org.picocontainer.gems.monitors.DotGraphComponentMonitorTestCase$DependsOnDependsOnListAndVector -> org.picocontainer.testmodel.DependsOnList;\n" +
                "  org.picocontainer.gems.monitors.DotGraphComponentMonitorTestCase$DependsOnDependsOnListAndVector -> java.util.Vector;\n" +
                "";

        assertEquals(expected, graph);

    }

    public static class DependsOnDependsOnListAndVector {
        public DependsOnDependsOnListAndVector(Vector vec, DependsOnList dol) {
        }<commit_msg>confirm dupes dont affect diagram<commit_after>package org.picocontainer.gems.monitors;

import junit.framework.TestCase;
import org.picocontainer.testmodel.DependsOnList;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Vector;

public class DotGraphComponentMonitorTestCase extends TestCase {


    public void testSimpleClassDependencyGraphCanEliminateDupes() throws NoSuchMethodException {

        DotGraphComponentMonitor monitor = new DotGraphComponentMonitor();

        Vector vec = new Vector();
        List list = new ArrayList();
        DependsOnList dol = new DependsOnList(list);
        DependsOnDependsOnListAndVector dodolav = new DependsOnDependsOnListAndVector(vec, dol);

        monitor.instantiated(Vector.class.getConstructor(new Class[0]), vec, new Object[]{}, 8);
        monitor.instantiated(ArrayList.class.getConstructor(new Class[]{Collection.class}), list, new Object[]{vec}, 12);
        monitor.instantiated(DependsOnList.class.getConstructors()[0], dol, new Object[]{list}, 10);
        monitor.instantiated(DependsOnDependsOnListAndVector.class.getConstructors()[0], dodolav, new Object[]{vec, dol}, 16);
        monitor.instantiated(DependsOnDependsOnListAndVector.class.getConstructors()[0], dodolav, new Object[]{vec, dol}, 12);
        monitor.instantiated(DependsOnDependsOnListAndVector.class.getConstructors()[0], dodolav, new Object[]{vec, dol}, 9);

        String graph = monitor.getClassDependencyGraph();

        String expected = "" +
                "  java.util.ArrayList -> java.util.Vector;\n" +
                "  org.picocontainer.testmodel.DependsOnList -> java.util.ArrayList;\n" +
                "  org.picocontainer.gems.monitors.DotGraphComponentMonitorTestCase$DependsOnDependsOnListAndVector -> org.picocontainer.testmodel.DependsOnList;\n" +
                "  org.picocontainer.gems.monitors.DotGraphComponentMonitorTestCase$DependsOnDependsOnListAndVector -> java.util.Vector;\n" +
                "";

        assertEquals(expected, graph);

    }

    public static class DependsOnDependsOnListAndVector {
        public DependsOnDependsOnListAndVector(Vector vec, DependsOnList dol) {
        }
{'fraction_non_alphanumeric': 0.10444874274661509, 'fraction_numerical': 0.0060444874274661504, 'mean_word_length': 3.9308700834326578, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5015879', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1133, 'n_words': 200}