This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | IllegalArgumentException: run.single.method | ||
---|---|---|---|
Product: | projects | Reporter: | ricktw <ricktw> |
Component: | Ant Freeform | Assignee: | Tomas Stupka <tstupka> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | jglick |
Priority: | P3 | Keywords: | RANDOM |
Version: | 7.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 184501 |
Attachments: | stacktrace |
Description
ricktw
2012-01-18 09:32:59 UTC
Created attachment 114986 [details]
stacktrace
Not sure what is going on here, and cannot reproduce. Either nbproject/project.xml binds run.single.method or it does not. The only thing I can think of is a race condition between when TestMethodAction.performAction calls ap.getSupportedActions or ap.isActionEnabled and when it calls ap.invokeAction, during which time the binding is removed. That could be solved by quietly returning from iAE/iA rather than throwing IAE (probably best done as an API change in ActionProvider), but this seems an unlikely explanation. The only other clue is [Fatal Error] :1:1: Content is not allowed in prolog. which suggests a parse error in project.xml. BTW ant.freeform should probably be using LookupProviderSupport.createActionProviderMerger rather than using its own implementation. I've did some research and found a workaround. The reason this error occurs is because there is no action names "run.single.method" in project.xml. This is what I did to get "run Focused test" to work: 1) create new "run.single.method" action in project.xml file (copy "run.single" action and change target). === project.xml EXAMPLE === <action name="run.single.method"> <script>nbproject/ide-file-targets.xml</script> <target>run.single.method</target> <context> <property>run.class</property> <folder>test/src</folder> <pattern>\.java$</pattern> <format>java-name</format> <arity> <one-file-only/> </arity> </context> </action> ========================== 2) create new "run.single.method" target in ide-file-targets.xml (copy "run-selected-file-in-src") and make sure the test tag has a parameter "methods" using the property "${method}". === ide-file-targets.xml EXAMPLE === <target name="run.single.method" depends="compile"> <fail unless="run.class">Must set property 'run.class'</fail> <junit maxmemory="256m" fork="true" haltonerror="true" haltonfailure="true" printsummary="on" jvm="${jdk.dir}/bin/java" showoutput="true"> <sysproperty key="build.basedir" value="${basedir}"/> <test name="${run.class}" methods="${method}"/> <formatter type="plain" usefile="false"/> <classpath refid="CLASSPATH"/> </junit> </target> ==================================== Now you can use the right mouse menu "Run focused test". Maybe these actions/targets can be automatically created in the two files mentioned above? - Rick (In reply to comment #3) > The reason this error occurs is because there is no action names > "run.single.method" in project.xml. I do not think that is it. If there is no such action name in project.xml, Run Focused Test should simply be disabled, not throw an error. That was what I observed in a sample freeform project with no such action binding (from JDK demos). > Maybe these actions/targets can be automatically created in the two files > mentioned above? Sure, that would be a useful RFE, but this bug is separate. Reported for 7.3.x or earlier, no new info since then -> closing as worksforme, please reopen in case you see it. |