Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358321 - Record => XML conversion in javascript is not producing the right results.
Summary: Record => XML conversion in javascript is not producing the right results.
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Joseph Vincens CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 20:24 EDT by Jing Qian CLA
Modified: 2017-02-23 14:15 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jing Qian CLA 2011-09-20 20:24:10 EDT
With the following record definitions


Record TestDescription
	rootDir String;		//source root directory 
	pkgName String;		//package name
	name String;		//test library part name
	title String;
	description String;
	testcases String;
	expCnt int;			//expected test variation count
	sources String;  //list of the runTestMethod names, delimted by whitespace. 
	keywords String; //list of tag names, delimited by ,	
end

Record TestResult {@xmlrootelement {}}
	td TestDescription;
	stat Status;
	log Log;
end

Record ResultSummary
	pkgName String {@XMLAttribute{}};	//package name
	name String{@XMLAttribute{}};		//test library part name
	code int{@XMLAttribute{}};			//test result code value
	tCnt int{@XMLAttribute{}};			//test variation count, one runTestMethod is one variation
	expCnt int{@XMLAttribute{}};		//expected test variation count for one test library
	passCnt int{@XMLAttribute{}};
	failCnt int{@XMLAttribute{}};
	errCnt int{@XMLAttribute{}};
	badCnt int{@XMLAttribute{}};
	skipCnt int{@XMLAttribute{}};	
end


Record ResultSummaryRoot {@xmlrootelement {}}
	expCnt int{@XMLAttribute{}};					//expected total number of test variation count
	trSum ResultSummary[]{};
end

//call the following to get xml string
xmlStr String = XMLLib.convertToXML(resultRootSum, true);
SysLib.writeStdOut(xmlStr);

the expected result should be: (which is what java currently generates)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><resultSummaryRoot expCnt="4"><trSum tCnt="2" skipCnt="0" pkgName="a" passCnt="1" name="myLib" failCnt="1" expCnt="2" errCnt="0" code="1" badCnt="0"/><trSum tCnt="2" skipCnt="0" pkgName="a" passCnt="1" name="myLib2" failCnt="1" expCnt="2" errCnt="0" code="1" badCnt="0"/></resultSummaryRoot>

the actual result is: (which is what javascript currently generates)
<?xml version="1.0" encoding="UTF-8"?><ResultSummaryRoot expCnt="4"><trSum><item pkgName="a" name="myLib" code="0" tCnt="2" expCnt="2" passCnt="2" failCnt="0" errCnt="0" badCnt="0" skipCnt="0"></item><item pkgName="a" name="myLib2" code="0" tCnt="2" expCnt="2" passCnt="2" failCnt="0" errCnt="0" badCnt="0" skipCnt="0"></item></trSum></ResultSummaryRoot>

This bug is marked as critical, because it's blocking the EUnit test framework to produce readable results.
Comment 1 Joseph Vincens CLA 2011-09-22 12:14:59 EDT
fixed
Comment 2 Jing Qian CLA 2011-10-14 15:02:18 EDT
verified on 20111009's build, close