Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit af806f7

Browse files
committed
Split integration test into two #127 and #377
1 parent 06b39e0 commit af806f7

File tree

7 files changed

+38
-13
lines changed

7 files changed

+38
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"rswk" : [ {
3+
"subjectTopicName" : "Nonprofit organizations"
4+
}, {
5+
"subjectTopicName" : "Nonprofit organizations",
6+
"subjectGenre" : "Case studies"
7+
} ]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<collection xmlns="http://www.loc.gov/MARC21/slim">
3+
<record>
4+
<datafield tag="650" ind1=" " ind2=" ">
5+
<subfield code="a">Nonprofit organizations</subfield>
6+
<subfield code="x">Management.</subfield>
7+
</datafield>
8+
<datafield tag="650" ind1=" " ind2=" ">
9+
<subfield code="a">Nonprofit organizations</subfield>
10+
<subfield code="x">Management</subfield>
11+
<subfield code="v">Case studies.</subfield>
12+
</datafield>
13+
</record>
14+
</collection>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
do list(path: "650??", "var": "$i")
2+
copy_field("$i.a", "rswk[].$append.subjectTopicName")
3+
copy_field("$i.v", "rswk[].$last.subjectGenre")
4+
end
5+
replace_all("rswk[].*.subjectGenre", "[.]$", "")
6+
7+
retain("rswk[]")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FLUX_DIR + "input.xml"
2+
|open-file
3+
|decode-xml
4+
|handle-marcxml
5+
|fix(FLUX_DIR + "test.fix")
6+
|encode-json(prettyPrinting="true")
7+
|write(FLUX_DIR + "output-metafix.json")
8+
;

metafix/src/test/resources/org/metafacture/metafix/integration/method/fromXml/toJson/replace_allInOptionalSubfieldOfRepeatedObjectsWithAsterisk/expected.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,5 @@
44
}, {
55
"subjectTopicName" : "Nonprofit organizations",
66
"subjectGenre" : "Case studies"
7-
} ],
8-
"rswk" : [ {
9-
"subjectTopicName" : "Nonprofit organizations"
10-
}, {
11-
"subjectTopicName" : "Nonprofit organizations",
12-
"subjectGenre" : "Case studies"
137
} ]
148
}

metafix/src/test/resources/org/metafacture/metafix/integration/method/fromXml/toJson/replace_allInOptionalSubfieldOfRepeatedObjectsWithAsterisk/test.fix

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,4 @@ do list(path: "650??", "var": "$i")
55
end
66
replace_all("RSWK[].*.subjectGenre", "[.]$", "")
77

8-
do list(path: "650??", "var": "$i")
9-
copy_field("$i.a", "rswk[].$append.subjectTopicName")
10-
copy_field("$i.v", "rswk[].$last.subjectGenre")
11-
end
12-
replace_all("rswk[].*.subjectGenre", "[.]$", "")
13-
14-
retain("RSWK[]","rswk[]")
8+
retain("RSWK[]")

0 commit comments

Comments
 (0)