Re: [Simple-support] Not getting all objects in List
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-04-08 15:32:41
|
Hi,
Works fine for me, the error is in the code that generates your text tree not in the XML serialization.
Whatever code generates this, is broken.
|--Test Case
|--1
|--2
|--3
|--4
|--5
|--Test Case1
|--1
|--2
|--3
|--4
|--5
|--Test Case1,Test Case3
|--Test Case1
|--1
|--2
|--3
|--4
|--5
|--6
|--Test Case2,Test Case4
|--Test Case2
|--1
|--2
|--3
|--4
|--5
|--6
|--7
|--8
|--9
|--10
Niall
--- On Mon, 28/3/11, Kakumanu Brahmananda Reddy <kak...@gm...> wrote:
From: Kakumanu Brahmananda Reddy <kak...@gm...>
Subject: [Simple-support] Not getting all objects in List
To: sim...@li...
Received: Monday, 28 March, 2011, 5:31 AM
Hi All,
Problem here am facing is am not getting list of "TestScenario" objects !!!
Below is my xml file.
<testSuit>
<defaultTestScenario>
<testCase name="Test Case" description="abc">
<step id="1" action="open" target="field id" value="value" />
<step id="2" action="type" target="field id" value="value" />
<step id="3" action="select" target="field id" value="value" />
<step id="4" action="clickAndWait" target="field id" value="value" />
<step id="5" action="assertTrue" target="field id" value="value" />
</testCase>
<testCase name="Test Case1" description="abc">
<step id="1" action="open" target="field id" value="value" />
<step id="2" action="type" target="field id" value="value" />
<step id="3" action="select" target="field id" value="value" />
<step id="4" action="clickAndWait" target="field id" value="value" />
<step id="5" action="assertTrue" target="field id" value="value" />
</testCase>
</defaultTestScenario>
<testScenario name="Test Case1,Test Case3" description="abc"
includeDefault="true">
<testCase name="Test Case1" description="abc">
<step id="1" action="open" target="field id" value="value" />
<step id="2" action="type" target="field id" value="value" />
<step id="3" action="select" target="field id" value="value" />
<step id="4" action="clickAndWait" target="field id" value="value" />
<step id="5" action="assertTrue" target="field id" value="value" />
<step id="6" action="assertTrue" target="field id" value="value" />
</testCase>
<testCase name="Test Case3" description="abc">
<step id="1" action="open" target="field id" value="value" />
<step id="2" action="type" target="field id" value="value" />
<step id="3" action="select" target="field id" value="value" />
<step id="4" action="clickAndWait" target="field id" value="value" />
<step id="5" action="assertTrue" target="field id" value="value" />
<step id="6" action="assertTrue" target="field id" value="value" />
<step id="7" action="assertTrue" target="field id" value="value" />
</testCase>
</testScenario>
<testScenario name="Test Case2,Test Case4" description="abc">
<testCase name="Test Case2" description="">
<step id="1" action="open" target="field id" value="value" />
<step id="2" action="type" target="field id" value="value" />
<step id="3" action="select" target="field id" value="value" />
<step id="4" action="clickAndWait" target="field id" value="value" />
<step id="5" action="assertTrue" target="field id" value="value" />
<step id="6" action="open" target="field id" value="value" />
<step id="7" action="type" target="field id" value="value" />
<step id="8" action="select" target="field id" value="value" />
<step id="9" action="clickAndWait" target="field id" value="value" />
<step id="10" action="assertTrue" target="field id" value="value" />
</testCase>
<testCase name="Test Case4" description="">
<step id="1" action="open" target="field id" value="value" />
<step id="2" action="type" target="field id" value="value" />
<step id="3" action="select" target="field id" value="value" />
<step id="4" action="clickAndWait" target="field id" value="value" />
<step id="5" action="assertTrue" target="field id" value="value" />
</testCase>
</testScenario>
</testSuit>
TestScenario.java
@Root
public class TestScenario {
@Element(required = false)
private String uRLs;
@Attribute
private String name;
@Attribute
private String description;
@ElementList(inline = true)
private List<TestCase> testCases;
@Attribute(required = false)
private String includeDefault = Boolean.toString(false);
public boolean getIncludeDefault() {
return Boolean.parseBoolean(includeDefault);
}
public List<TestCase> getTestCases() {
return testCases;
}
/*
public void setTestCase(List<TestCase> testCase) {
this.testCase.addAll(testCase);
}
*/
public String getURLs() {
return uRLs;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
@Override
public String toString() {
return getName();
}
}
TestCase.java
@Root
public final class TestCase {
@ElementList(inline = true)
private List<Step> steps;
@Attribute
private String name;
@Attribute
private String description;
@Attribute(required = false)
private String addBefore;
public String getAddBefore() {
return addBefore;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public List<Step> getSteps() {
return steps;
}
@Override
public String toString() {
return getName();
}
}
Step.java
@Root
public final class Step {
@Attribute
private int id;
@Attribute
private String action;
@Attribute
private String target;
@Attribute
private String value;
public int getId() {
return id;
}
public String getAction() {
return action;
}
public String getTarget() {
return target;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return Integer.toString(getId());
}
}
TestSuit.java
@Root
public class TestSuit {
@Element
private DefaultTestScenario defaultTestScenario;
@ElementList(inline = true, entry = "testScenario")
private List<TestScenario> testScenario;
public DefaultTestScenario getDefaultTestScenario() {
return defaultTestScenario;
}
public List<TestScenario> getTestScenario() {
return testScenario;
}
/*
* @Commit public void build() { Iterator<TestScenarios> iterator =
* testScenarios.iterator(); while (iterator.hasNext()) { TestScenarios
* testScenarios = iterator.next(); if (testScenarios.getIncludeDefault()) {
* System.out.println("In build: " + defaultTestScenario.getTestCase());
* testScenarios.setTestCase(defaultTestScenario.getTestCase()); } } }
*/
}
Below is the output what i am getting:
|--Test Case
|--1
|--2
|--3
|--4
|--5
|--Test Case1
|--1
|--2
|--3
|--4
|--5
|--Test Case1,Test Case3
|--Test Case1
|--1
|--2
|--3
|--4
|--5
|--6
|--Test Case2,Test Case4
|--Test Case2
|--1
|--2
|--3
|--4
|--5
|--6
|--7
|--8
|--9
|--10
Thanks in advance.
Regards,
Brahma.
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|