<commit_before>package com.atlassian.plugin.predicate;

import com.atlassian.plugin.descriptors.AbstractModuleDescriptor;
import com.atlassian.plugin.descriptors.MockUnusedModuleDescriptor;
import junit.framework.TestCase;

/**
 * Testing {@link ModuleDescriptorClassModulePredicate}
 */
public class TestModuleDescriptorClassModulePredicate extends TestCase
{
    private ModulePredicate modulePredicate;

    protected void setUp() throws Exception
    {
        modulePredicate = new ModuleDescriptorClassModulePredicate(ModuleDescriptorStubA.class);
    }

    protected void tearDown() throws Exception
    {
        modulePredicate = null;
    }

    public void testCannotCreateWithNullModuleDescritptorClassesArray()
    {
        try
        {
            new ModuleDescriptorClassModulePredicate((Class[]) null);
            fail("Constructor should have thrown illegal argument exception.");
        }
        catch (IllegalArgumentException e)
        {
            // noop
        }
    }

    public void testMatchesModuleWithModuleDescriptorClassExactlyMatchingClass()
    {
        assertTrue(modulePredicate.matches(new ModuleDescriptorStubA()));
    }

    public void testDoesNotMatchModuleWithModuleDescriptorClassExtendingButNotExactlyMatchingClass()
    {
        assertFalse(modulePredicate.matches(new ModuleDescriptorStubB()));
    }

    public void testDoesNotMatchModuleWithModuleDescriptorClassNotMatchingClass()
    {
        assertFalse(modulePredicate.matches(new MockUnusedModuleDescriptor()));
    }

    private static class ModuleDescriptorStubA extends AbstractModuleDescriptor
    {
        public Object getModule()
        {
            return null;
        }
    }

    private static class ModuleDescriptorStubB extends ModuleDescriptorStubA
    {
    }
}<commit_msg>PLUG-40: - Oops change got lost in and undo/redo.<commit_after>package com.atlassian.plugin.predicate;

import com.atlassian.plugin.descriptors.AbstractModuleDescriptor;
import com.atlassian.plugin.descriptors.MockUnusedModuleDescriptor;
import junit.framework.TestCase;

/**
 * Testing {@link ModuleDescriptorClassModulePredicate}
 */
public class TestModuleDescriptorClassModulePredicate extends TestCase
{
    private ModulePredicate modulePredicate;

    protected void setUp() throws Exception
    {
        modulePredicate = new ModuleDescriptorClassModulePredicate(ModuleDescriptorStubA.class);
    }

    protected void tearDown() throws Exception
    {
        modulePredicate = null;
    }

    public void testCannotCreateWithNullModuleDescritptorClassesArray()
    {
        try
        {
            new ModuleDescriptorClassModulePredicate((Class[]) null);
            fail("Constructor should have thrown illegal argument exception.");
        }
        catch (IllegalArgumentException e)
        {
            // noop
        }
    }

    public void testMatchesModuleWithModuleDescriptorClassExactlyMatchingClass()
    {
        assertTrue(modulePredicate.matches(new ModuleDescriptorStubA()));
    }

    public void testDoesNotMatchModuleWithModuleDescriptorClassExtendingButNotExactlyMatchingClass()
    {
        assertTrue(modulePredicate.matches(new ModuleDescriptorStubB()));
    }

    public void testDoesNotMatchModuleWithModuleDescriptorClassNotMatchingClass()
    {
        assertFalse(modulePredicate.matches(new MockUnusedModuleDescriptor()));
    }

    private static class ModuleDescriptorStubA extends AbstractModuleDescriptor
    {
        public Object getModule()
        {
            return null;
        }
    }

    private static class ModuleDescriptorStubB extends ModuleDescriptorStubA
    {
    }
}
{'fraction_non_alphanumeric': 0.06542567752532165, 'fraction_numerical': 0.0005474952094169176, 'mean_word_length': 3.418379685610641, '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': '6444716', 'n_tokens_mistral': 902, 'n_tokens_neox': 893, 'n_words': 175}