Again thanks you William

I said that custom action cannot provide workaround : that's false

Here is workaround to run all tests from on integration test class:

   1. right click in editor of you integration test file
   2. select "Run Maven >" then "Goals..."
   3. as Goals, enter "integration-test" or "verify", I select verify
   because I expect post-integration-test to be run after test
   4. as Properties, enter like in integration-test default action:
   test=DummyToSkipUnitTests
   failIfNoTests=false
   it.test=${packageClassName}
   5. check "Remember as" and enter a name, I choose "Run IT test"

Et voila, tests of your integration test class run.
Thanks to point 5, now, you can run an integration test class by selectin
"Run IT test" at point 2.

At the end, you should have in nbactions.xml file in your project on action
likes:
        <action>
            <actionName>CUSTOM-Run IT test</actionName>
            <displayName>Run IT test</displayName>
            <recursive>false</recursive>
            <goals>
                <goal>verify</goal>
            </goals>
            <properties>
                <test>DummyYoSkipUnitTests</test>
                <failIfNoTests>false</failIfNoTests>
                <it.test>${packageClassName}</it.test>
            </properties>
        </action>

Regards,

Arnaud

Le jeu. 13 janv. 2022 à 14:04, Arnaud bourree <arnaud.bour...@gmail.com> a
écrit :

> Thank you William.
>
> I never use Gradle, I suppose you are right.
>
> With Maven's project, we can also add custom actions,That could be a good
> workaround.
> But actions are not contextual actions such as "Test File" or "Run Focused
> Test Method", they work at project level not file level, or I don't
> understand how they work.
>
> Regards,
>
> Arnaud
>
> Le jeu. 13 janv. 2022 à 00:48, * William <william.full.m...@gmail.com> a
> écrit :
>
>> Hi Arnaud,
>>
>> I am able to run integration tests from the netbeans project tree using
>> Gradle, may be there is something similar with Maven.  Under each project
>> you want to use a Gradle task you can set-=up an entry in the project's "
>> gradle.properties" file, so:
>>
>> ##      Netbeans Actions
>> ##
>> ##        * Gradle tasks
>> ##
>>     action.custom-1=intTest
>>     action.custom-1.args=--configure-on-demand -w -x check intTest
>>     action.custom-2=intTest_debug
>>     action.custom-2.args=--configure-on-demand -w -x check intTest
>> --debug-jvm
>>
>> I am not sure if there is a Gradle plugin required to achieve this
>> though, it just worked when I did it after reading a stackoverflow post.
>>
>> It is well worth checking for a Maven equivalent to the custom actions.
>> Another approach is to convert from Maven to Gradle which has a learning
>> curve of course.
>>
>> Good luck there.  I'm for any thing that advances testing.
>>
>> --
>> aloha,
>>          \_w_/
>>  ___________________________________
>>
>> On Tue, 4 Jan 2022 at 23:44, Arnaud bourree <arnaud.bour...@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I use Netbeans 12.6 on Windows server 2016 with OpenJDK 11 and Maven
>>> 3.6.3
>>>
>>> I've some integration tests written with JUnit that Maven knows how to
>>> launch with failsafe.
>>> I'd like to run integration tests like unitary tests from Netbeans.
>>> I saw that there are project actions "Integration test file" and "Debug
>>> integration test".
>>> I expect Netbeans to propose to me something like "Test Integration
>>> File" instead of "Test File" on JUnit tests matching failsafe configuration
>>> : it doesn't.
>>>
>>> I didn't find any web pages explaining how to nor any limitation?
>>>
>>> Any idea how to?
>>>
>>> Regards,
>>>
>>> Arnaud
>>>
>>
>>

Reply via email to