Package org.apache.maven.surefire.group.match

Examples of org.apache.maven.surefire.group.match.GroupMatcher


    }

    public void testParseInvertedGroupedANDedPair()
        throws ParseException
    {
        GroupMatcher matcher = new GroupMatcherParser(
            "NOT (" + GroupMatcherParser.class.getName() + " AND " + SingleGroupMatcher.class.getName() + ")" ).parse();

        assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof InverseGroupMatcher );
        assertTrue( matcher.enabled( GroupMatcherParser.class ) );
        assertFalse( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) );
    }
View Full Code Here


    }

    public void testParseInvertedGroupedORedPair()
        throws ParseException
    {
        GroupMatcher matcher = new GroupMatcherParser(
            "NOT (" + GroupMatcherParser.class.getName() + " OR " + SingleGroupMatcher.class.getName() + ")" ).parse();

        assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof InverseGroupMatcher );
        assertFalse( matcher.enabled( GroupMatcherParser.class ) );
        assertFalse( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) );
    }
View Full Code Here

    }

    public void testSingleMatchWhenDotClassAppended()
        throws ParseException
    {
        GroupMatcher matcher = new GroupMatcherParser( SingleGroupMatcher.class.getName() + ".class" ).parse();
        assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof SingleGroupMatcher );
        assertTrue( matcher.enabled( SingleGroupMatcher.class ) );
    }
View Full Code Here

    }

    public void testSingleMatchWithOnlyClassSimpleName()
        throws ParseException
    {
        GroupMatcher matcher = new GroupMatcherParser( SingleGroupMatcher.class.getSimpleName() ).parse();
        assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof SingleGroupMatcher );
        assertTrue( matcher.enabled( SingleGroupMatcher.class ) );
    }
View Full Code Here

    public Filter createGroupFilter( Properties providerProperties )
    {
        String groups = providerProperties.getProperty( ProviderParameterNames.TESTNG_GROUPS_PROP );
        String excludedGroups = providerProperties.getProperty( ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP );

        GroupMatcher included = null;
        if ( groups != null )
        {
            try
            {
                included = new GroupMatcherParser( groups ).parse();
            }
            catch ( ParseException e )
            {
                throw new IllegalArgumentException(
                    "Invalid group expression: '" + groups + "'. Reason: " + e.getMessage(), e );
            }
        }

        GroupMatcher excluded = null;
        if ( excludedGroups != null )
        {
            try
            {
                excluded = new GroupMatcherParser( excludedGroups ).parse();
            }
            catch ( ParseException e )
            {
                throw new IllegalArgumentException(
                    "Invalid group expression: '" + excludedGroups + "'. Reason: " + e.getMessage(), e );
            }
        }

        // GroupMatcher included = commaSeparatedListToFilters( groups );
        // GroupMatcher excluded = commaSeparatedListToFilters( excludedGroups );

        if ( included != null && testClassLoader != null )
        {
            included.loadGroupClasses( testClassLoader );
        }

        if ( excluded != null && testClassLoader != null )
        {
            excluded.loadGroupClasses( testClassLoader );
        }

        return new GroupMatcherCategoryFilter( included, excluded );
    }
View Full Code Here

        private Map<Description, Boolean> shouldRunAnswers = new HashMap<Description, Boolean>();

        public GroupMatcherCategoryFilter( GroupMatcher included, GroupMatcher excluded )
        {
            GroupMatcher invertedExclude = excluded == null ? null : new InverseGroupMatcher( excluded );
            if ( included != null || invertedExclude != null )
            {
                matcher = new AndGroupMatcher();
                if ( included != null )
                {
View Full Code Here

{

    public void testParseSingleClass()
        throws ParseException
    {
        GroupMatcher matcher = new GroupMatcherParser( GroupMatcherParser.class.getName() ).parse();
        assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof SingleGroupMatcher );
        assertTrue( matcher.enabled( GroupMatcherParser.class ) );
    }
View Full Code Here

    }

    public void testParseInvertedSingleClass()
        throws ParseException
    {
        GroupMatcher matcher = new GroupMatcherParser( "NOT " + GroupMatcherParser.class.getName() ).parse();
        assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof InverseGroupMatcher );
        assertFalse( matcher.enabled( GroupMatcherParser.class ) );
    }
View Full Code Here

    }

    public void testParseBareANDedPair()
        throws ParseException
    {
        GroupMatcher matcher = new GroupMatcherParser(
            GroupMatcherParser.class.getName() + " AND " + SingleGroupMatcher.class.getName() ).parse();

        assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof AndGroupMatcher );
        assertFalse( matcher.enabled( GroupMatcherParser.class ) );
        assertTrue( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) );
    }
View Full Code Here

    }

    public void testParseBareORedPair()
        throws ParseException
    {
        GroupMatcher matcher = new GroupMatcherParser(
            GroupMatcherParser.class.getName() + " OR " + SingleGroupMatcher.class.getName() ).parse();

        assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof OrGroupMatcher );
        assertTrue( matcher.enabled( GroupMatcherParser.class ) );
        assertTrue( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.surefire.group.match.GroupMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.