> tl;dr
> Is it possible to write a test that validates a project has all its
dependencies correct in the project.xml ?

Interesting topic!

I can write a test that launches NetBeans, opens some projects, uses
[JavaSource](
https://bits.netbeans.org/12.0/javadoc/org-netbeans-modules-java-source-base/org/netbeans/api/java/source/JavaSource.html)
to iterate through the sources and check for errors. I have done that in
the past. Use [NbModuleSuite](
https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-nbjunit/org/netbeans/junit/NbModuleSuite.html)
to launch NetBeans IDE in a test.

Or you can use [Jackpot](https://netbeans.apache.org/jackpot/index.html)!
It's primary goal is to search and perform advanced refactorings and watch
for code quality. However while doing so, it has to also check for errors.
Unless I am mistaken it understands NetBeans Ant (hopefully also free form)
projects. It can be invoked from a command line[1]. It may be ideal for
validating project setup from a NetBeans IDE perspective in a CI system. I
am CCing Jan Lahoda to guide you through that journey as the documentation
may not fully cover this way of using the tool.

If we could use Jackpot for validating project structure, then it'd be
clearly amazing! It is something everyone needs and at the end, I could
also delete my test that does that manually.
-jt

[1] Jan integrated Jackpot into GraalVM build infrastructure with this
commit
https://github.com/graalvm/mx/commit/58540336f1a583c0c2058f0faa30e27bfb99839d#diff-3c2ada2edc0aef357c3874192df806717735257b625b509a48b7d13a45a75adcR29

pá 6. 11. 2020 v 9:03 odesílatel Michael Semb Wever <[email protected]> napsal:

> -- bumping to dev@ --
>
> tl;dr
>  Is it possible to write a test that validates a project has all its
> dependencies correct in the project.xml ?
>
>
>
> The Apache Cassandra project has a netbeans project file
>  ref: https://github.com/apache/cassandra/tree/trunk/ide/nbproject
>
> When the project adds/removes/updates dependencies in its ant build.xml
> file, we don't always remember to also update the netbeans project file.
> (Freeform projects don't support classpath wildcards afaik.)
>
> I'd like to write a simple unit test that ensures the netbeans project
> file is kept up to date, specifically that no error badges will exist on
> packages or files when opening the project in netbeans.
> I don't care if this is done via a command line script, or
> programmatically in a java unit test.
>
> regards,
> Mick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Reply via email to