<commit_before>package org.codehaus.groovy.grails.resolve

import org.apache.ivy.core.module.id.ModuleRevisionId
import org.apache.ivy.plugins.resolver.FileSystemResolver
import org.apache.ivy.util.Message
import org.apache.ivy.util.MessageLogger
import org.apache.ivy.util.DefaultMessageLogger
import grails.util.BuildSettings
import grails.util.BuildSettingsHolder
import grails.util.GrailsUtil

/**
 * @author <NAME>
 * @since 1.1
 */

public class IvyDependencyManagerTests extends GroovyTestCase{

    protected void setUp() {
        System.metaClass.static.getenv = { String name -> "." }
    }

    protected void tearDown() {
        GroovySystem.metaClassRegistry.removeMetaClass(System) 
    }

    void testDefaultDependencyDefinition() {

        Message.setDefaultLogger new DefaultMessageLogger(Message.MSG_INFO);
        def manager = new IvyDependencyManager("test", "0.1")
        def props = new Properties()
        new File("./build.properties").withInputStream {
            props.load(it)
        }


        manager.parseDependencies(IvyDependencyManager.getDefaultDependencies(props.'grails.version'))
        def report = manager.resolveDependencies()

        assertFalse "dependency resolve should have no errors!",report.hasError()
    }
    void testInheritence() {
        Message.setDefaultLogger new DefaultMessageLogger(Message.MSG_INFO);<commit_msg>Improved test case further<commit_after>package org.codehaus.groovy.grails.resolve

import org.apache.ivy.core.module.id.ModuleRevisionId
import org.apache.ivy.plugins.resolver.FileSystemResolver
import org.apache.ivy.util.Message
import org.apache.ivy.util.MessageLogger
import org.apache.ivy.util.DefaultMessageLogger
import grails.util.BuildSettings
import grails.util.BuildSettingsHolder
import grails.util.GrailsUtil

/**
 * @author <NAME>
 * @since 1.1
 */

public class IvyDependencyManagerTests extends GroovyTestCase{

    protected void setUp() {
        System.metaClass.static.getenv = { String name -> "." }
    }

    protected void tearDown() {
        GroovySystem.metaClassRegistry.removeMetaClass(System) 
    }

    void testDefaultDependencyDefinition() {

        Message.setDefaultLogger new DefaultMessageLogger(Message.MSG_INFO);
        def manager = new IvyDependencyManager("test", "0.1")
        def props = new Properties()
        new File("./build.properties").withInputStream {
            props.load(it)
        }


        manager.parseDependencies(IvyDependencyManager.getDefaultDependencies(props.'grails.version'))
        assertEquals 52, manager.listDependencies('runtime').size()
        assertEquals 56, manager.listDependencies('test').size()
        assertEquals 16, manager.listDependencies('build').size()
        assertEquals 3, manager.listDependencies('provided').size()
        def report = manager.resolveDependencies()


        assertFalse "dependency resolve should have no errors!",report.hasError()
    }
    void testInheritence() {
        Message.setDefaultLogger new DefaultMessageLogger(Message.MSG_INFO);
{'fraction_non_alphanumeric': 0.10036077402427025, 'fraction_numerical': 0.004919645785503444, 'mean_word_length': 3.7730829420970267, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4047393', 'n_tokens_mistral': 857, 'n_tokens_neox': 802, 'n_words': 154}