Is there a way to use JUnit 4.6's new MaxCore runner from the ant task?
As of 4.6, unfortunately no. You'd need to create your own custom Ant task in order to take advantage of the MaxCore functionality.
Related
I have a scenario where there are several independent jmx files, each of them has their own threadgroup etc. Using JMeter Ant script I can fire them all in sequence and collect the result in a jtl file. My challenge here is to do the same thing but fire off the tests in parallel. Please note that Include Controller is not an option since I want to use(or honor) the ThreadGroup and User Defined Variables in each jmx files.
Thanks for your help
Perhaps Parallel Ant Task is what you're looking for.
However <parallel> directive is not thread safe so I wouldn't recommend to use it with JMeter Ant task and consider using i.e. command-line mode, maven plugin or custom Java class which will spawn individual JMeter tests with it.
See 5 Ways To Launch a JMeter Test without Using the JMeter GUI guide for details of the approaches, hope this helps to find the one which matches your environment.
Yes, Ant parallel solves this problem.
I have a build process in Java where I need to use the Ant exec task to launch an external program. That external program will then create some sources based on an abstract specification, i.e. a kind of code generation.
How can I get the exec task to execute only if the input to the code generation is newer than the output? I.e. when the input has been modified after the output was last created?
Use the Uptodate task to set a property and add an if or unless with that property to the target which contains your exec task.
Since I wanted to specify an arbitrary set of target files (which is cumbersome or impossible with Uptodate that only uses the Ant mapper element for multiple target files), I ended up using the ant-contrib OutOfDate task which supported what I wanted more intuitively.
In build.xml: the testng target has attributes like "testname" and "suitename". But these do not seem to activate or deactivate the corresponding tests or suites within the testng.xml file
Is this the right way to use these?
How can I control which tests or suites are run from within build.xml that references testng.xml?
Thanks.
I found this post to solve a similar problem:
http://www.nullin.com/2009/12/23/running-single-test-or-class-using-testng-and-ant/
As long as you can fit whichever parameters you want in the template (or make them replaceable), you can get most of the benefits from both approaches.
You can't select a testng.xml and tell TestNG which tests to pick from that testng.xml. Use a different testng.xml file to do that.
The command line and ant/maven allow you to do some rudimentary selection too, but then you can't specify a testng.xml.
In TFS build I call to a nant script using a custom activity InvokeProcess (we use NANT till we will be able to move to "TFS language")
I want to fail the build if NANT fails. I guess I should use the Result property of the InvokeProcess.
How I do that?
Thanks
I think you can find what you need here.
I am using ant externally, i.e. I construct org.apache.tools.ant.Project dynamically
in my program: setup its Tasks, Targets etc., then I want to create build.xml file. How is possible? How possible export this project into ordinal ant build.xml?
I've been working with the ant codebase a lot recently, and I'm afraid I don't think this is possible.
Since you're the one generating the project in the first place, it might be easier if you generate the XML at the same time.