Reading xml through Qt - c++

I am new to Qt and XML . Please help me on solving this . I shall be greatful to you .
Here is my XML file format
< SiteSpecific>
< SitesList>LocA;LocB;LocC< /SitesList>
< LocA>
< MaterialList>Material_A;Material_B</MaterialList>
<Material Name="Material_A">
<TemperatureList>-65;70;300;400;1000</TemperatureList>
<Density Value="0.286"/>
<PoissonRatio Value="0.27"/>
<Property tempid="01" temp="-65">
<Modulus Value="32.77E+6"/>
<Alpha Value="8.15E-6"/>
<YieldStrength Value="33.90E+3"/>
</Property>
<Property tempid="02" temp="70">
<Modulus Value="29.00E+6"/>
<Alpha Value="8.55E-6"/>
<YieldStrength Value="30.00E+3"/>
= </Property>
<Property tempid="03" temp="300">
<Modulus Value="27.50E+6"/>
<Alpha Value="9.26E-6"/>
<YieldStrength Value="22.40E+3"/>
</Property>
</Material>
</LocA>
< LocB>
< MaterialList>Material_C;Material_D</MaterialList>
<Material Name="Material_C">
<TemperatureList>-65;70;300;400;1000</TemperatureList>
<Density Value="0.286"/>
<PoissonRatio Value="0.27"/>
<Property tempid="01" temp="-65">
<Modulus Value="32.77E+6"/>
<Alpha Value="8.15E-6"/>
<YieldStrength Value="33.90E+3"/>
</Property>
<Material Name="Material_D">
<TemperatureList>-65;70;300;400;1000</TemperatureList>
<Density Value="0.286"/>
<PoissonRatio Value="0.27"/>
<Property tempid="01" temp="-65">
<Modulus Value="32.77E+6"/>
<Alpha Value="8.15E-6"/>
<YieldStrength Value="33.90E+3"/>
</Property>
</Material>
</LocB>
From the above file format i have to extract Materialist(e.g Material_A , Material_B , Material_C , Material_D) , Temperaturelist(e.g. -65,70,300,400,1000) and all the properties (Modulus , alpha and yieldstrength )based on tempid for LocA and LocB .

QDomDocument and QXmlStreamReader are the two main ways to read XML documents the "Qt way." Read the documentation for examples and instructions.
Personally, I prefer QXmlStreamReader, but it does have a learning curve.
Edit: Here's a little sample code, not compiled, to give you the general idea:
//create some struct to store your data
struct material_t
{
QString name;
QList<MatProp> properties; //a list of your temp-modulus-Alpha-Yield entries
}
QList<material_t> readLocation(QXmlStreamReader& xml)
{
QStringList matnames;
QList<material_t> matlist;
while(xml.readNextStartElement())
{
if(xml.name() == "MaterialList")
matnames = xml.readElementText().split(";");
else if(matnames.contains(xml.name().toString()))
matlist.append(readMaterial(xml)); //write your own reader that returns a material_t
else
xml.skipCurrentElement(); //you must skip every unwanted element
}
return matlist;
}
void readStuff(QXmlStreamReader& xml, QList<material_t>& mats)
{
while(xml.readNextStartElement())
{
QStringList sitelist;
if(xml.name() == "SitesList") //key in on the XML node name
{
sitelist = xml.readElementText().split(";");
} else if(sitelist.contains(xml.name().toString()))
{
mats.append(readLocation(xml));
} else //you have to skip every unwanted element
xml.skipCurrentElement();
}
}
int main()
{
QList<material_t> materialist;
QFile file("your path here");
if(file.open(QIODevice::Text | QIODevice::ReadOnly)) //the QIODevice must be open
{
QXmlStreamReader xml(&file);
readStuff(xml, materiallist);
}
//do stuff with materiallist
}

Related

Parsing nested xml with boost

I have an xml which I like to read into my program, I've seen a lot of exmaples how to read xml using property tree from boost, however I couldn't make it work for the nested xml that I have:
<?xml version="1.0" encoding="UTF-8"?>
<document version="1.3.0">
<chunk>
<sensors>
<sensor id="0" label="unknown" type="frame">
<resolution width="2056" height="2464"/>
<property name="fixed" value="0"/>
<calibration type="frame" class="adjusted">
<resolution width="2056" height="2464"/>
<fx>7349.85579147491</fx>
<fy>7349.85579147491</fy>
<cx>1028</cx>
<cy>1232</cy>
<p1>0.000308132854297239</p1>
<p2>-0.000521332855614243</p2>
</calibration>
</sensor>
</sensors>
<cameras>
<camera id="0" label="img0000.png" sensor_id="0" enabled="1">
<transform>1.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 -1.0000000000000000e+000 -1.2246467991473532e-016 0.0000000000000000e+000 0.0000000000000000e+000 1.2246467991473532e-016 -1.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>
</camera>
<camera id="1" label="img0011.png" sensor_id="0" enabled="1">
<transform>9.8183676675341047e-001 -2.7892274662900951e-002 -1.8766615162393202e-001 1.3502780959894856e+000 -2.8076662610258110e-002 -9.9960436765543659e-001 1.6760611099915072e-003 -8.8020303958543274e-003 -1.8763865398120155e-001 3.6234208013954891e-003 -9.8223144235654503e-001 -1.1015316085201440e-001 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>
</camera>
</cameras>
<reference>LOCAL_CS["Local Coordinates (m)",LOCAL_DATUM["Local Datum",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]</reference>
<region>
<center>-5.1216167685514069e-002 -7.0600760442627708e-001 -6.9904047240845895e+000</center>
<size>2.1074647950629393e+000 1.5533586459855240e+000 1.0253878730038792e+000</size>
<R>-9.6011547075389880e-001 2.7340714563038887e-001 5.8539008680217816e-002 -2.6221584379471408e-001 -9.5313222127937347e-001 1.5093647677772853e-001 9.7062526662174770e-002 1.2956659089939432e-001 9.8680867671533157e-001</R>
</region>
<settings>
<property name="accuracy_tiepoints" value="1"/>
<property name="accuracy_cameras" value="10"/>
<property name="accuracy_cameras_ypr" value="2"/>
<property name="accuracy_markers" value="0.005"/>
<property name="accuracy_scalebars" value="0.001"/>
<property name="accuracy_projections" value="0.1"/>
</settings>
</chunk>
</document>
I'm only interested in reading the cameras node and their attributes, and I've used the following code for that, but it doesn't work:
using namespace std;
using namespace boost;
using namespace boost::property_tree;
const ptree& empty_ptree() {
static ptree t;
return t;
}
int main()
{
ptree tree;
read_xml(XML_PATH1, tree);
tree = tree.get_child("document.chunk", empty_ptree());
const ptree & formats = tree.get_child("cameras.camera", empty_ptree());
BOOST_FOREACH(const ptree::value_type & f, formats)
{
string at = f.first + ".<xmlattr>";
const ptree & attributes = f.second.get_child("<xmlattr>", empty_ptree());
cout << "Extracting attributes from " << at << ":" << endl;
BOOST_FOREACH(const ptree::value_type &v, attributes)
{
cout << "First: " << v.first.data() << " Second: " << v.second.data() << endl;
}
}
}
so, for each camera you want to iterate over each attribute, don't you ?
if yes, then you need to use equal_range() instead of get_child(); the latter returns a single child, the former a range of associative iterators pointing to all childs with the given key.
so, use get_child() to get document.chunk.cameras, use equal_range('camera') to get all cameras and for each camera use equal_range('xmlattr') to traverse its attributes.

QLabel not responding to `setText()` at the time of calling

I am using the QT IDE to make a better looking version of my (once working) command line auto clicker.
Mind you, the clicking still works great... the functionality is not compromised.
However, the problem comes when 'updating' the text fields on the form itself.
In my code, you can see that pressing the 'Q' button, ends the loop. At this point, the text fields become updated (as they should be continuously during the loop). I'm really not sure why they aren't updating until I hit 'Q'. Is there any reason this isn't supposed to work as I think it should, or is there a way to fix it?
Thanks. See my code below. Mind you, I will only include the bits I believe are necessary. Upon request I can post more code.
CODE.cpp
bool running = 1;
float x = 1500;
float interval;
int breakCounter = 0;
float breakSeconds = 0;
int clicks = 0;
Sleep (3000);
while (running == 1)
{
float breakChance = (rand()%650+1);
if (breakChance == 100){
breakCounter++;
float breakTime = (rand()%180+1);
breakTime = (breakTime + 60) * 1000;
breakSeconds = breakSeconds + breakTime/1000;
QString a = QString::number(breakCounter);
QString b = QString::number(breakSeconds/60);
QString c = QString::number(breakTime/1000);
ui->label_6->setText(a);
ui->label_7->setText(b + " mins");
ui->label_8->setText(c);
ui->label_9->setText("N/A");
Sleep (breakTime);
} else {
float variance = (rand()%500+1);
int flip = (rand()%2+1);
if (flip == 1){
interval = x + variance;
} else {
interval = x - variance;
}
QString a = QString::number(breakCounter);
QString b = QString::number(breakSeconds/60);
QString d = QString::number(interval);
ui->label_6->setText(a);
ui->label_7->setText(b + " mins");
ui->label_8->setText("N/A");
ui->label_9->setText(d);
Sleep (interval);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep (100);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
clicks++;
if (GetAsyncKeyState( 'Q' ))
{
running = 0;
}
}
}
CODE.ui
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Current break timer:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>N/A</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Next click time:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>N/A</string>
</property>
</widget>
</item>
</layout>
</item>
Qt's paint messages happen when the application message pump is given a chance to run. What you appear to have here is a loop that keeps your code on the stack and doesn't relinquish control back to the message pump.
If you want delays...the way to do that is with a QTimer. Say how long you want it to be until your code runs next, return out of your code, and give the message pump a chance to run while time passes.

How to delete nested xml element using qt

i have xml file like this
<root>
<element>
<child id = "0"> Some Text </child> <-- Target To Delete
</element>
<element>
<child id = "1"> Some Text </child>
</element>
</root>
how can i delete child element of id "0" ? using Qt library.
QDomDocument doc;
doc.setContent(oldXml);
QDomNodeList nodes = doc.elementsByTagName("element");
for (int i = 0; i < nodes.count(); ++i)
{
QDomNode node = nodes.at(i);
QDomElement child = node.firstChildElement("child");
if (!child.isNull() && child.attribute("id") == "0")
{
node.removeChild(child);
}
}
QString newXml = doc.toString();

Set Tree Store model in glade by code - GTK Glade TreeStore C++

I have read some manual of Glade and I create a GUI in which there is a TreeView which i want to populate by code. The glade file is:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkWindow" id="tree_window">
<property name="can_focus">False</property>
<property name="border_width">3</property>
<property name="title" translatable="yes">Tree Viewer</property>
<property name="default_width">400</property>
<property name="default_height">600</property>
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkTreeView" id="treeview1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkTreeViewColumn" id="aColumn">
<property name="title" translatable="yes">A</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="bColumn">
<property name="title" translatable="yes">B</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
So the idea is populate the "treeview1" with a GtkTreeStore that I define in the code below:
#include <gtk/gtk.h>
enum{
A_COL=0,
B_COL
};
GtkTreeModel * fill_gtk_tree_store_from_xml_file()
{
GtkTreeStore * t_model;
t_model=gtk_tree_store_new(2,G_TYPE_UINT,G_TYPE_UINT);
GtkTreeIter toplevel,childlevel;
gtk_tree_store_append(t_model,&toplevel,NULL);
gtk_tree_store_append(t_model,&toplevel,NULL);
gtk_tree_store_append(t_model,&toplevel,NULL);
gtk_tree_store_set(t_model,&toplevel,A_COL,(guint)12,B_COL,(guint)14,-1);
gtk_tree_store_append(t_model, &childlevel, &toplevel);
gtk_tree_store_set(t_model,&childlevel,0,(guint)20,
1,(guint)22,-1);
gtk_tree_store_append(t_model, &childlevel, &toplevel);
return GTK_TREE_MODEL (t_model);
}
#include <gtk/gtk.h>
#include <stdlib.h>
int launchGUI(GtkBuilder *builder,GError *error=NULL)
{
GtkWidget *ventanaPrincipal;
if( ! gtk_builder_add_from_file( builder,"treeStore.glade", &error ) )
{
g_warning( "%s", error->message );
g_free( error );
return( 1 );
}
ventanaPrincipal = GTK_WIDGET(gtk_builder_get_object(builder, "tree_window"));
GtkTreeModel *model;
GtkWidget *view;
model=fill_gtk_tree_store_from_xml_file();
view=GTK_WIDGET(gtk_builder_get_object(builder, "treeview1"));
gtk_tree_view_set_model (GTK_TREE_VIEW (view), model);
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(view)),
GTK_SELECTION_NONE);
gtk_signal_connect(GTK_OBJECT(ventanaPrincipal), "destroy",
G_CALLBACK(gtk_main_quit), NULL);
gtk_widget_show_all(ventanaPrincipal);
gtk_main();
return 0;
}
int main(int argc,char **argv)
{
GtkBuilder *gtkBuilder;
GError *error = NULL;
gtk_init(&argc, &argv);
gtkBuilder= gtk_builder_new();
launchGUI(gtkBuilder,error);
return EXIT_SUCCESS;
}
I have tried different approaches, using enum, not using enum... The empty rows appear empty (OK), but the rows that should not be empty also appear empty. When I run the code this happens:
image
I don't know what I'm doing wrong, Can anyone help me?
Your code has many construction sides. I will work down a list of those issues that attracted my particular attention.
Don't call it c++ if you stick with gtk+ and use plain c instead
You tagged your question with c++. However you don't use gtkmm but rather gtk+. Therefore you shouldn't intersperse c++ features that are not compatible with standard c.
Related to your code you shouldn't specify default function arguments. That feature is not part of the c programming language and will confuse fellow programmers who work on your code.
Declare variables where you need them and keep your function prototypes clean
Don't unnecessarily pass variables to functions that actually belongs only to the logical scope of the function itself.
For example the function
int launchGUI(GtkBuilder *builder,GError *error=NULL)
uses builder and error only locally so you shouldn't implement them as function arguments.
Furthermore you rarely need the GtkBuilder instance anywhere outside the function that initialize your user interface. So don't mess up functions with unnecessary definitions of local variables.
Check the reference manual not only for function descriptions but also for a conceptual understanding of library features
Don't apply g_free on a GError resource. Structures like GError aren't necessarily flat. Instead use a valid function. With respect to GError you should use g_error_free.
Study the conceptual overview of the GtkTreeModel widget and how to populate it. If you don't do this or study a similar description i see hard times will come upon you.
Don't use deprecated features
Check the code for deprecated features and replace them with the counterparts of the new version of the library.
For example don't use GTK_OBJECT in programs that depends on gtk+-3.0 (I conclude that from your ui definitions file). You can almost always replace gtk_object_ with g_object_ in your code.
Think about what should be defined in the ui definitions file and what should stay in the sources
GtkTreeView is one of the most complex widgets in gtk+ at least in my opinion. It is not enough to set the model of the widgets and create some columns.
At this point it is essential to pack the columns with cell renderers and link colums from your data store/model to specific properties of the particular renderers. Only this way content of the data store will be displayed directly or indirectly on the screen.
That being said you should consider what part of the tree view should be instantiated by methods of GtkBuilder and what should be defined in the code. With respect to your code you have to either get both columns or respectively get the treeview with gtk_builder_get_object or you implement the whole tree view in glade.
To show you a minimal working example of what i guess you want to achieve i decided to delete the columns in glade and just get the instantiated treeview widget in the code. Of course this example is not necessary the last word on the subject. However it displays the tree view with the content of the store on the screen.
I appended a screenshot of the working program and the code.
modfied source code:
#include <gtk/gtk.h>
#include <stdlib.h>
enum
{
A_COL = 0,
B_COL,
COL_NUMBER
};
gchar *title[] = { "Column A", "Column B" };
void
fill_gtk_tree_store (GtkTreeView * view)
{
GtkTreeStore *model;
GtkTreeIter toplevel, childlevel;
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
GtkCellRenderer *renderer;
guint i;
model = gtk_tree_store_new (COL_NUMBER, G_TYPE_UINT, G_TYPE_UINT);
gtk_tree_store_append (model, &toplevel, NULL);
gtk_tree_store_append (model, &toplevel, NULL);
gtk_tree_store_append (model, &toplevel, NULL);
gtk_tree_store_set (model, &toplevel, A_COL, 12, B_COL, 14, -1);
gtk_tree_store_append (model, &childlevel, &toplevel);
gtk_tree_store_set (model, &childlevel, A_COL, 20, B_COL, 22, -1);
gtk_tree_store_append (model, &childlevel, &toplevel);
gtk_tree_view_set_model (view, GTK_TREE_MODEL (model));
selection = gtk_tree_view_get_selection(view);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE);
for (i = 0; i < COL_NUMBER; i++) {
renderer = gtk_cell_renderer_text_new ();
column =
gtk_tree_view_column_new_with_attributes (title[i], renderer,
"text", i, NULL);
gtk_tree_view_append_column (view, column);
}
}
void
launchGUI ()
{
GtkWidget *ventanaPrincipal;
GtkBuilder *builder;
GError *error = NULL;
GtkTreeView *view;
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "treeStoreMod.glade", &error);
if (error != NULL) {
g_warning ("%s", error->message);
g_error_free (error);
exit(1);
}
ventanaPrincipal =
GTK_WIDGET (gtk_builder_get_object (builder, "tree_window"));
view = GTK_TREE_VIEW (gtk_builder_get_object (builder, "treeview1"));
g_object_unref(builder);
fill_gtk_tree_store (view);
g_signal_connect (G_OBJECT (ventanaPrincipal),
"destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show_all (ventanaPrincipal);
gtk_main ();
}
int
main (int argc, char **argv)
{
gtk_init (&argc, &argv);
launchGUI ();
return 0;
}
modified ui definitions file treeStoreMod.glade:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="tree_window">
<property name="can_focus">False</property>
<property name="border_width">3</property>
<property name="title" translatable="yes">Tree Viewer</property>
<property name="default_width">400</property>
<property name="default_height">600</property>
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkTreeView" id="treeview1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

Junit report does not generate report if there is assertion error

Junit report does not generate report if there is assertion error
Class to be tested
public class Math {
static public int add(int a, int b) {
return a + b;
}
static public int multiply ( int a, int b) {
if(a==0&&b==0)
return 0;;
return a * b;
}
}
Junit Test class
import junit.framework.*;
public class TestMath extends TestCase {
protected void setUp() {
// put common setup code in here
}
protected void tearDown() {
// put common cleanup code in here
}
public void testAdd() {
int num1 = 3;
int num2 = 2;
int total = 5;
int sum = 0;
sum = Math.add(num1, num2);
assertEquals(sum, total);
}
public void testMulitply() {
int num1 = 3;
int num2 = 7;
int total = 21;
int sum = 0;
sum = Math.multiply(num1, num2);
assertEquals("Problem with multiply", sum, total);
num1 = 5;
num2 = 4;
total = 20;
sum = Math.multiply(num1, num2);
assertEquals("Problem with multiply", sum, total);
}
public void testv(){
Assert.assertEquals(1, Math.multiply(0, 0));
}
}
I am using junit reporting to generate reports
The problem is if assertion fails the reports are not generate , the Ant Build fails . MY assumption is the if a assertion fails it should be listed in failures rather then error in Build result.
Ant XML
<project name="SampleJUnitTests" default="dist" basedir=".">
<description>
Sample JUnit Tests
</description>
<!-- set global properties for this build -->
<property name="project_name" value="junitSamples"/>
<property name="src" location="src"/>
<property name="build" location="bin"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<property name="res" location="res"/>
<property name="reports" location="reports"/>
<!-- the names of various distributable files -->
<property name="jar_name" value="${project_name}.jar"/>
<property name="war_name" value="${project_name}.war"/>
<!-- top level targets -->
<target name="compile" depends="init" description="compile the source code " >
<javac srcdir="${src}" destdir="${build}">
<classpath>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="compile" description="generate the distributable files " >
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/${jar_name}" basedir="${build}"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${reports}"/>
</target>
<target name="run-tests" depends="compile" description="run your test suite" >
<junit printsummary="yes" haltonfailure="yes" showoutput="yes" >
<classpath>
<pathelement path="${build}"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
<batchtest fork="yes" todir="${reports}/raw/">
<formatter type="xml"/>
<fileset dir="${src}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name ="test" depends="run-tests">
<junitreport todir="${reports}">
<fileset dir="${reports}/raw/">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${reports}/html/"/>
</junitreport>
</target>
<target name ="run" depends="" description="if this project can be run, run it" >
</target>
<!-- supporting targets -->
<target name="init" description="initialize the build environment" >
<!-- Create the time stamp -->
<tstamp/>
<!-- Create directory structures -->
<mkdir dir="${build}"/>
<mkdir dir="${lib}"/>
<mkdir dir="${dist}/lib"/>
<mkdir dir="${reports}"/>
<mkdir dir="${reports}/raw/"/>
<mkdir dir="${reports}/html/"/>
</target>
<target name="all" depends="clean, test">
</target>
</project>
MY requirement is if assertion fails it should show in failure ? What do i need to do ?
This question has been answered by Tharani in the comments... Answering it to make it from unanswered...
Change the value of haltonfailure="no" it will work as expedted ...