Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ public DefaultResult visitControl(
childResult.applyTo(control);
} else {
// remove this control and promote any needed children

if (SelectionStatus.SELECTED.equals(index.getSelectionStatus(parent))) {
retval.removeControl(control);
}
retval.removeControl(control);
retval.appendPromoted(ObjectUtils.notNull(childResult));
index.removeItem(entity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ void performTest(String profileName) throws IOException, SaxonApiException {
StringWriter writer = new StringWriter();
serializer.serialize(catalog, writer);

// OscalBindingContext.instance().newSerializer(Format.YAML, Catalog.class).serialize(catalog,
// OscalBindingContext.instance().newSerializer(Format.YAML,
// Catalog.class).serialize(catalog,
// System.out);

// System.out.println("Pre scrub: " + writer.getBuffer().toString());
Expand Down Expand Up @@ -256,4 +257,13 @@ void testArsModerateProfile() throws IOException, ProfileResolutionException, UR

assertNotNull(resolvedCatalog);
}

@Test
void testIssue106Profile() throws IOException, ProfileResolutionException, URISyntaxException {
Path profileFile = Paths.get(JUNIT_TEST_PATH, "content/issue106-profile.xml");
assert profileFile != null;
Catalog catalog = resolveProfile(profileFile);
assertNotNull(catalog);
assertEquals("1.1.1", catalog.getMetadata().getOscalVersion());
}
}
16 changes: 16 additions & 0 deletions src/test/resources/content/issue106-catalog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://github.com/usnistgov/OSCAL/releases/download/v1.1.1/oscal_complete_schema.xsd" schematypens="http://www.w3.org/2001/XMLSchema" title="OSCAL complete schema" ?>
<catalog xmlns="http://csrc.nist.gov/ns/oscal/1.0" uuid="37b7acd4-ab3f-4217-99d1-2ab9e490db49">
<metadata>
<title />
<last-modified>2023-02-18T13:06:18Z</last-modified>
<version>2023-02-18T13:06:18Z</version>
<oscal-version>1.1.1</oscal-version>
</metadata>
<control id="c1">
<title />
<control id="c1.1">
<title />
</control>
</control>
</catalog>
15 changes: 15 additions & 0 deletions src/test/resources/content/issue106-profile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://github.com/usnistgov/OSCAL/releases/download/v1.1.1/oscal_complete_schema.xsd" schematypens="http://www.w3.org/2001/XMLSchema" title="OSCAL complete schema" ?>
<profile xmlns="http://csrc.nist.gov/ns/oscal/1.0" uuid="3353e8e1-3eef-42ef-8163-1f71616bafca">
<metadata>
<title />
<last-modified>2023-02-18T13:06:18Z</last-modified>
<version>2023-02-18T13:06:18Z</version>
<oscal-version>1.1.1</oscal-version>
</metadata>
<import href="issue106-catalog.xml">
<include-controls>
<with-id>c1.1</with-id>
</include-controls>
</import>
</profile>