Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 215967 - "unsupported element customize" in build-impl.xml running test after openning project with NetBeans IDE 7.2
"unsupported element customize" in build-impl.xml running test after openning...
Status: RESOLVED INCOMPLETE
Product: java
Classification: Unclassified
Component: JUnit
7.2
PC Linux
: P1 with 2 votes (vote)
: 7.2.1
Assigned To: Theofanis Oikonomou
junit-issues@java
http://wiki.netbeans.org/ProjectJunit...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-25 20:04 UTC by netmackan
Modified: 2013-01-28 10:53 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Output from running ant test (153.27 KB, text/plain)
2012-07-25 20:04 UTC, netmackan
Details
Diff with changes done to the project after opening it with 7.2 (49.80 KB, patch)
2012-07-25 20:06 UTC, netmackan
Details | Diff
Patch of SignServer-Test-System/build.xml (165 bytes, patch)
2012-08-28 16:41 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description netmackan 2012-07-25 20:04:58 UTC
Created attachment 122376 [details]
Output from running ant test

Opening a previously working project with NetBeans IDE 7.2 updates build-impl.xml and "ant test" compilation fails with error message:
BUILD FAILED
/home/markus/VersionControlled/signserver/branch32-2/signserver/modules/SignServer-Test-System/nbproject/build-impl.xml:1439: The following error occurred while executing this line:
/home/markus/VersionControlled/signserver/branch32-2/signserver/modules/SignServer-Test-System/nbproject/build-impl.xml:525: The following error occurred while executing this line:
/home/markus/VersionControlled/signserver/branch32-2/signserver/modules/SignServer-Test-System/nbproject/build-impl.xml:498: unsupported element customize

The project was working fine with NetBeans IDE 7.1 but after openning it with 7.2 the build-script got changed automagically by the IDE and the build fails when trying to run the tests.
Comment 1 netmackan 2012-07-25 20:06:29 UTC
Created attachment 122377 [details]
Diff with changes done to the project after opening it with 7.2

Attaching diff with the changes NB 7.2 performed wich broke "ant test".
Comment 2 netmackan 2012-07-25 20:11:22 UTC
Link to issue in the affected open source project:
https://jira.primekey.se/browse/DSS-511
Comment 3 netmackan 2012-07-29 14:44:45 UTC
I got an idea that the issue could have been because all required projects by the project SignServer-Test-System wasn't opened with NB 7.2 yet and thus not upgraded and that could be the reason why the test build fails. However, I now tried opening all projects and cleaning and building but after that I am still getting the same results :(
Comment 4 sberthiaume 2012-08-16 22:06:20 UTC
Same issue here.

Migrating from NB 6.9.1, right of the bat all my build-impl.xml gets changed, but when I try to run tests I get that error. So eager to move away from NB 6.9.1, this bursts by bubble big time  :(
Comment 5 Tomas Zezula 2012-08-17 07:00:27 UTC
Caused by TestNG integration. Seems that the macros are using implicit attribute in definition which is wrong.
I will download the SignServer 3.4, try to reproduce and fix it.
Comment 6 netmackan 2012-08-23 12:00:41 UTC
Great (I assume you meant SignServer 3.2, but I suppose the same issue is also for trunk). You can download the latest release or checkout from SVN, see the SourceForge page (http://sourceforge.net/projects/signserver/) or signserver.org.

Let me know if you need any assistance.
Comment 7 Tomas Zezula 2012-08-28 13:13:01 UTC
I've downloaded the signserver and test it.
I've found the problem, the Test NG integration has broken API compatibility and incompatibly changed the junit macro. People should care about API compatibility even it's not java.
Comment 8 Jaroslav Tulach 2012-08-28 14:04:53 UTC
I am sure Lukáš did not want to introduce incompatibility. Too bad it sneaked through our review.
Comment 9 Tomas Zezula 2012-08-28 16:40:46 UTC
Unfortunately the incompatible API change causes that the problem is unfixable.
There are 2 different signatures of junit macro with the same version (namespace). If I do the compatible change now (the change that should be done when the Test-NG was added) I will break the other (the NB 7.2) signature.

I am at least attaching the patch of SignServer-Test-System/build.xml which resolves the problem for netmackan.
Comment 10 Tomas Zezula 2012-08-28 16:41:35 UTC
Created attachment 123671 [details]
Patch of SignServer-Test-System/build.xml
Comment 11 Tomas Zezula 2012-08-28 16:54:17 UTC
Reassigning to the owner to realize that incompatible changes are evil :-)
In fact you need to close the issue as it has no solution because it's already part of released product. It will be good to create a migration wiki page on netbeans.org as people will need to update the customized junit macrodef.
Comment 12 netmackan 2012-08-29 05:31:02 UTC
Thank you Tomas!
I will try patching my build xml.
Comment 13 Lukas Jungmann 2012-09-12 09:11:55 UTC
incompatible change has not really been intentional :-(

Apart from documenting this, just an idea - would fixing this by changing junit macro to become compatible and increasing its version to '4' help?
Comment 14 Tomas Zezula 2012-09-12 11:00:08 UTC
It will not help, as the existing dependencies are for version 3.
Comment 15 Lukas Jungmann 2012-09-14 10:24:03 UTC
ok, so I tried to document it in http://wiki.netbeans.org/ProjectJunitMigrationToNB72

Can you please check it, so I can eventually make it a bit more verbose etc.?
Thanks
Comment 16 Tomas Zezula 2012-09-14 11:44:10 UTC
Lukas, I think it's perfect.
Comment 17 Antonin Nebuzelsky 2012-09-14 12:39:11 UTC
Lukasi, I have included a link to your wiki page in FAQs at
http://wiki.netbeans.org/NetBeansUserFAQ#Ant

Closing wontfix now.

Thanks.
Comment 18 harleyjw 2013-01-06 18:38:37 UTC
Please fix this. I have the same problem preventing me from running tests in various project using NB 7.2, including one with a completely empty, non-customised build.xml

We don't use TestNG and we don't have any "customized junit macro definition" as far as I know. I don't understand the linked wiki page which doesn't offer any explanation of what a "customized junit macro definition" is, nor where it would be found if we had one.

If there is a work-around that we can use, could you please elaborate EXACTLY what we need to change in WHICH file/s to run our tests.
Comment 19 Lukas Jungmann 2013-01-07 12:22:57 UTC
(In reply to comment #18)
> Please fix this. I have the same problem preventing me from running tests in
> various project using NB 7.2, including one with a completely empty,
> non-customised build.xml

can you attach your project (or at least minimal project to reproduce the issue you're seeing) to this issue, please?

thanks.

> 
> We don't use TestNG and we don't have any "customized junit macro definition"
> as far as I know. I don't understand the linked wiki page which doesn't offer
> any explanation of what a "customized junit macro definition" is, nor where it
> would be found if we had one.
> 
> If there is a work-around that we can use, could you please elaborate EXACTLY
> what we need to change in WHICH file/s to run our tests.
Comment 20 Antonin Nebuzelsky 2013-01-08 11:08:48 UTC
Closing again until the requested information is provided.
Comment 21 harleyjw 2013-01-09 19:13:24 UTC
Our projects are all full of proprietary code which I'm not able to release. However, I can show you the ant target which Netbeans 7.2 keeps inserting in build-impl.xml:

<target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
            <attribute default="${includes}" name="includes"/>
            <attribute default="${excludes}" name="excludes"/>
            <attribute default="**" name="testincludes"/>
            <attribute default="" name="testmethods"/>
            <element implicit="true" name="customize" optional="true"/>
            <sequential>
                <webproject2:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
                    <customize/>
                </webproject2:junit>
            </sequential>
        </macrodef>
    </target>

This results in the error "unsupported element customize", exactly the same problem seen by netmackan and sberthiaume.
Comment 22 harleyjw 2013-01-12 12:53:00 UTC
For further information: this bug is hitting us not only with migrating existing code to Netbeans 7.2, but with NEW projects created from scratch in Netbeans 7.2.

To eliminate the possibility of something broken in the project.xml or properties of existing projects, I created a new Java EE6 Web Project; copied in some Java source code; set some jars as dependencies (mostly Spring 3.2 and OpenJPA 2.2.1); tried to run the tests and immediately got the error above.

So this isn't just a migration problem, it's a problem for starting new projects in Netbeans as well.
Comment 23 Theofanis Oikonomou 2013-01-16 10:52:44 UTC
(In reply to comment #22)
> it's a problem for starting new
> projects in Netbeans as well.

I tried to reproduce it by creating a NEW web project, actually used the one from this tutorial: http://netbeans.org/kb/docs/javaee/javaee-entapp-junit.html, but it worked as expected for me both in 7.2 and 7.2.1

So please reopen stating the exact steps you are using to help me reproduce. Thank you
Comment 24 harleyjw 2013-01-16 17:09:27 UTC
The steps were: I created a new Java EE6 Web Project; copied
in some Java source code; set some jars as dependencies (mostly Spring 3.2 and
OpenJPA 2.2.1); tried to run the tests and immediately got the error above.

That's literally all. Surely you don't need me to go into the level of detail of "I clicked on the New Project Icon in the top left hand corner".

As I said, the code itself is proprietary so I can't share that, but in case it helps, I can tell you the jars the project uses: Apache Commons logging, Apache OpenJPA, GWT, most of Spring, aopalliance, mailapi, smtp. And Junit 4 for compiling tests.

If you read all the comments for this issue, you should also be able to reproduce the problem by downloading the sources for SignServer. I have asked for more information about the workaround which worked for them but nobody has answered my question yet.
Comment 25 Theofanis Oikonomou 2013-01-17 09:32:32 UTC
(In reply to comment #24)
> The steps were: I created a new Java EE6 Web Project; copied
> in some Java source code; set some jars as dependencies (mostly Spring 3.2 and
> OpenJPA 2.2.1); tried to run the tests and immediately got the error above.

well since I cannot tell what is added/modified I cannot reproduce as it works for me as I described in comment 23

> 
> That's literally all. Surely you don't need me to go into the level of detail
> of "I clicked on the New Project Icon in the top left hand corner".

of course not

> 
> As I said, the code itself is proprietary so I can't share that, but in case it
> helps, I can tell you the jars the project uses: Apache Commons logging, Apache
> OpenJPA, GWT, most of Spring, aopalliance, mailapi, smtp. And Junit 4 for
> compiling tests.
> 
> If you read all the comments for this issue, you should also be able to
> reproduce the problem by downloading the sources for SignServer. I have asked
> for more information about the workaround which worked for them but nobody has
> answered my question yet.

You described another situation which is that the issue is there even for new projects created in 7.2, which as I stated before I could not reproduce. 

From the other comments I concluded that the issue (opening projects created with older versions of netbeans with 7.2) is fixed if you modify your build script. For example you can see how this was done for the SignServer case here: http://signserver.svn.sourceforge.net/viewvc/signserver/trunk/signserver/modules/SignServer-Test-System/build.xml?r1=2061&r2=2839, which is what is described in the wiki page. Have you modified your build script in such a way? Please reopen if you have and the problem still exists. Thank you
Comment 26 harleyjw 2013-01-19 14:44:13 UTC
What do you mean by "in such a way"?

I have seen the diff, but there's no indication of what was there before.

I have downloaded SignServer, but the diff did not appear to apply to build.xml.

For the third time, could someone please explain EXACTLY what worked for SignServer so that I can try the same thing?

And please stop repeatedly closing this issue while I (and probably others) still have a problem.
Comment 27 netmackan 2013-01-19 21:26:17 UTC
(In reply to comment #26)
> What do you mean by "in such a way"?
> 
> I have seen the diff, but there's no indication of what was there before.
> 
> I have downloaded SignServer, but the diff did not appear to apply to
> build.xml.
> 
> For the third time, could someone please explain EXACTLY what worked for
> SignServer so that I can try the same thing?
> 
> And please stop repeatedly closing this issue while I (and probably others)
> still have a problem.

Hi harleyjw,

In SignServer I had overridden the "-init-macrodef-junit" target because I wanted to change it slightly. When posting this bug report, at first, I did not realize that it was the problem. 

After following the suggestions made here and updating the target as now showned in th diff from revision 2061 to 2839 as posted by theofanis in posting #25 running the tests in SignServer works fine.

If you are saying that you have not modified any Ant script then your issue seems to be slightly different. In order to troubleshoot this I think you should do as Lucas says and create a minimal project showing the problem. I don't think you would have to include any proprietary source code to do that, right?

Best regards,
Markus
Comment 28 harleyjw 2013-01-27 17:22:09 UTC
The problem doesn't occur when I create a minimal project, only when I add some of our existing source code and the jars needed to compile it.

So I guess the problem is somewhere in our sources (which all compile without warning) or dependencies (all standard OSS jars). All of which worked fine until we upgraded to Netbeans 7.2.
Comment 29 Theofanis Oikonomou 2013-01-28 08:40:12 UTC
(In reply to comment #28)
> The problem doesn't occur when I create a minimal project, only when I add some
> of our existing source code and the jars needed to compile it.

this seems to be the exact opposite from what you stated in comment 22.

> 
> So I guess the problem is somewhere in our sources (which all compile without
> warning) or dependencies (all standard OSS jars). All of which worked fine
> until we upgraded to Netbeans 7.2.

you have repeatedly asked for "EXACT" directions on how to solve this. I believe this was done, eg comment 25 and comment 27. There is no answer from your part if you have tried the suggestions and/or what went wrong or something.

I guess that you have modified a junit macrodef in your build script because otherwise you wouldn't have an issue when upgrading to 7.2, so please stop reopening unless you tried to apply the work-around and then report back. Thank you
Comment 30 harleyjw 2013-01-28 09:56:50 UTC
If you read the second paragraph of comment 22, and not just the first, you will see that it says exactly the same as I said in comment 28.

If you read comment 18 you will see that I have not modified a junit macrodef. I listed the steps I took in comment 24 and it did not include modifying any build scripts. Just to be 100% clear, I get this problem in a newly created project (with no modifications whatsoever to build.xml or any other file under nbproject) as soon as I copy in some actual Java test code to run.

And as I said in comment 26, please stop closing this issue while I have an ongoing problem. Since I still have this problem, I am open to further suggestions how to approach it. But please note, providing a suggestion for me to try is not the same as fixing this bug.
Comment 31 Lukas Jungmann 2013-01-28 10:53:16 UTC
second paragraph of comment 22:

"To eliminate the possibility of something broken in the project.xml or
properties of existing projects, I created a new Java EE6 Web Project; copied
in some Java source code; set some jars as dependencies (mostly Spring 3.2 and
OpenJPA 2.2.1); tried to run the tests and immediately got the error above."

what do you mean by 'some Java source code' or by 'set some jars as dependencies'? to which folder do you copy them? how exactly do you set up your dependencies - do you use add jar or add library?

How is your description different from 'I have a class which I added to the project and the project does not compile even though it compile if I do same steps in previous version'? Unfortunately in this case nobody can read anyone else mind.


Perhaps the only relevant piece of information you gave us in this issue was in one sentence in comment 24 which got completely lost to all of us: 'And Junit 4 for compiling tests.'

Can you, please, start describing steps from creating new project through adding JUnit 4 library (which version exactly? does it include JUnit 3 classes?) to failed test execution? Did you allow NB to download/install its own JUnit or not? Did you create some test using New Test wizard in NB? Are junit or testng classes included directly in any of your dependencies? Can you execute Ant in debug mode (Tools->Options->Java->Ant->Verbosity Level) and attach the output to this issue (feel free to obfuscate proprietary info from there)?

I also believe that if there really is an issue, you will be able to find some test in your sources which does not require any Spring 3.2 and OpenJPA 2.2.1 and you will have some really simple AND reproducible test case...

Till then, since noone else knows how to reproduce the issue => INCOMPLETE


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