Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 168036 - run or debug JUnit class does not use the specified Maven profiles
run or debug JUnit class does not use the specified Maven profiles
Status: VERIFIED FIXED
Product: projects
Classification: Unclassified
Component: Maven
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Milos Kleint
issues@platform
67patch1-verified
:
: 168041 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-02 14:32 UTC by ccronemberger
Modified: 2009-07-20 14:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ccronemberger 2009-07-02 14:32:19 UTC
My JUnit classes can work in two ways and the selected way is defined by specifying a profile or not.
I open the project "properties" page, select "Actions", select the "Test file" action and add a profile, but when I run
the test from menu "Run->Test file (ctrl-f6)" I see in the generated log that the profile is not really active.
Comment 1 ccronemberger 2009-07-02 14:36:35 UTC
I also found that the following plug-in configuration is not being taken into account:

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- redirect log output to files in target/surefire-reports -->
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <systemProperties>
                        <property>
                            <name>my.property.name</name>
                            <value>blablabla</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>

In the test code I found that the system property "my.property.name" is not set.
Comment 2 Milos Kleint 2009-07-03 13:08:42 UTC
first we've done the system properties configuration parsing wrong. And then we've also started caching some models
(weak referencing them) which caused the profiles not to show as activated.

http://hg.netbeans.org/main/rev/87231505d3b5
http://hg.netbeans.org/main/rev/2c8225d219e3

these 2 changeset shall fix both. Please verify in the upcoming dev builds (the exact number will be added to the
issue), we might be able to backport this to 6.7..
Comment 3 Milos Kleint 2009-07-03 13:11:33 UTC
*** Issue 168041 has been marked as a duplicate of this issue. ***
Comment 4 Quality Engineering 2009-07-04 06:27:21 UTC
Integrated into 'main-golden', will be available in build *200907040200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/87231505d3b5
User: Milos Kleint <mkleint@netbeans.org>
Log: #168036 when retrieving properties in plugin configuration consider this pattern <property><key>foo</key><value>bar</bar></property
additionally use a new instance of embedder for use in RunConfig to prevent retrieving a cached instance that might have different profiles activated.
Comment 5 Petr Blaha 2009-07-07 11:20:34 UTC
Reporter, would you verify the fix in the latest trunk build that is available here:
http://bits.netbeans.org/dev/nightly/latest/? We will put the fix in patch1 for Nb 6.7. Thanks
Comment 6 Jaroslav Pospisil 2009-07-09 08:54:23 UTC
v.
Comment 7 pgebauer 2009-07-09 16:46:22 UTC
The fix has been ported into the release67_fixes repository.
http://hg.netbeans.org/release67_fixes/rev/49002777df2c


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo