You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by kgyrtkirk <gi...@git.apache.org> on 2016/05/24 20:39:05 UTC

[GitHub] maven-surefire pull request: SUREFIRE-1250: add exceptions to desc...

GitHub user kgyrtkirk opened a pull request:

    https://github.com/apache/maven-surefire/pull/113

    SUREFIRE-1250: add exceptions to describe usage rules of %regex

    @Tibor17 i've cleaned it up a bit; and added exception for multiple hashmarks too. tests have passed on my machine.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kgyrtkirk/maven-surefire SUREFIRE-1250

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-surefire/pull/113.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #113
    
----
commit 09e33b88e82266a3118b9db260496f30a8861e58
Author: Haindrich Zolt�n (kirk) <ki...@rxd.hu>
Date:   2016-05-24T20:28:11Z

    SUREFIRE-1250: add exceptions to describe usage rules of %regex

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire pull request #113: SUREFIRE-1250: add exceptions to describe ...

Posted by kgyrtkirk <gi...@git.apache.org>.
Github user kgyrtkirk closed the pull request at:

    https://github.com/apache/maven-surefire/pull/113


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire pull request: SUREFIRE-1250: add exceptions to desc...

Posted by kgyrtkirk <gi...@git.apache.org>.
Github user kgyrtkirk commented on the pull request:

    https://github.com/apache/maven-surefire/pull/113#issuecomment-222059866
  
    i've moved the check into `ResolvedTest`.
    I now use the `MatchedPattern`...to check for exceptions.
    
    I've squashed my changes into one commit; because of the sidetrip to `TestListResolver`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire issue #113: SUREFIRE-1250: add exceptions to describe usage r...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on the issue:

    https://github.com/apache/maven-surefire/pull/113
  
    @kgyrtkirk Please close the PR. The code was merged with master. Thx for contributing!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire pull request: SUREFIRE-1250: add exceptions to desc...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/113#discussion_r64666590
  
    --- Diff: surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java ---
    @@ -479,6 +481,27 @@ else if ( hasMethod )
                 updatedFilters( isExcluded, test, patterns, includedFilters, excludedFilters );
             }
         }
    +    
    +    private static void regexSanityCheck( String request, String classNameExpr, String methodNameExpr )
    +    {
    +        // this will emit any exception if the regex is not valid at all
    +        Pattern.compile( request );
    +        try
    +        {
    +            Pattern.compile( classNameExpr );
    +            Pattern.compile( methodNameExpr );
    +            if ( methodNameExpr.indexOf( "#" ) != -1 )
    --- End diff --
    
    I thought you would use `String.contains` in both constructors of `ResolvedTest`.
    I think we do not need to use `Pattern.compile` here because this is already done by `maven-shared-utils` anyway.
    Lets use the sanity check if the `isRegex` is set, because I do not know how Cucumber would use JUnit Description of method or class name without regex. Cucumber is different runner from most of the other.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire pull request: SUREFIRE-1250: add exceptions to desc...

Posted by kgyrtkirk <gi...@git.apache.org>.
Github user kgyrtkirk commented on the pull request:

    https://github.com/apache/maven-surefire/pull/113#issuecomment-221739676
  
    I've used `Pattern.compile` to keep the regexp's problem description; i thinked it makes it more clear how it will be used eventually.
    
    I picked `TestListResolver` as it's place; because this is the first point where the deconstruction logic is used.
    plus: I wanted to keep all the generic exceptions of Pattern prior to these construction exceptions - without reassembling the original regex - but maybe this dosen't matter.
    
    I might be able to move it to `ResolvedTest`...tomorrow i will look at it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org