Skip to content

Commit ab8bb31

Browse files
committed
Test for #62.
1 parent b37f7f8 commit ab8bb31

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

nodejs/scripts/tests/GH62/GH62.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
var Jsonix = require("../../jsonix").Jsonix;
2+
var GH62 = require("./Mappings.js").GH62;
3+
4+
module.exports = {
5+
"MarshallsWithPrefix" : function(test) {
6+
var context = new Jsonix.Context([GH62], {
7+
namespacePrefixes : {
8+
"urn:gh62" : "gh62"
9+
}
10+
});
11+
var marshaller = context.createMarshaller();
12+
var data = {
13+
name : { localPart : "root", namespaceURI : "urn:gh62" },
14+
value : {
15+
toor : "orto"
16+
}
17+
};
18+
var marshalled = marshaller.marshalString(data);
19+
test.equal("<gh62:root xmlns:gh62=\"urn:gh62\"><gh62:toor>orto</gh62:toor></gh62:root>", marshalled);
20+
test.done();
21+
},
22+
"MarshallsWithoutPrefix" : function(test) {
23+
var context = new Jsonix.Context([GH62], {
24+
namespacePrefixes : {
25+
"urn:gh62" : ""
26+
}
27+
});
28+
var marshaller = context.createMarshaller();
29+
var data = {
30+
name : { localPart : "root", namespaceURI : "urn:gh62" },
31+
value : {
32+
toor : "orto"
33+
}
34+
};
35+
var marshalled = marshaller.marshalString(data);
36+
test.equal("<root xmlns:gh62=\"urn:gh62\"><toor>orto</toor></root>", marshalled);
37+
test.done();
38+
}
39+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var GH62 = {
2+
name: "GH62",
3+
dens: "urn:gh62",
4+
typeInfos: [{
5+
type: "classInfo",
6+
localName: "Root",
7+
propertyInfos: [{
8+
name: "toor"
9+
}]
10+
}],
11+
elementInfos: [{
12+
elementName: "root",
13+
typeInfo: ".Root"
14+
}]
15+
16+
};
17+
module.exports.GH62 = GH62;

nodejs/scripts/tests/issues.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
22
"Issues" : {
33
"GH56" : require('./GH56/GH56'),
4-
"GH61" : require('./GH61/GH61')
4+
"GH61" : require('./GH61/GH61'),
5+
"GH62" : require('./GH62/GH62')
56
}
67
};

0 commit comments

Comments
 (0)