Skip to content

Commit

Permalink
[NOISSUE]
Browse files Browse the repository at this point in the history
fix tests
update marshalling server and classes to wipe cache
  • Loading branch information
jj committed Aug 29, 2018
1 parent 86956a6 commit 88825d3
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1,048 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,19 @@ public List<XMLObject> getOrderedChildren() {
return null;
}

@Transient
private transient XMLObject parent;
@Nullable
public XMLObject getParent() {
return null;
return parent;
}

public void setParent(@Nullable XMLObject xmlObject) {
parent = xmlObject;
}

public boolean hasParent() {
return getParent() != null;
}

@Nullable
Expand All @@ -143,23 +153,34 @@ public void setSchemaType(QName schemaType) {
}

public boolean hasChildren() {
return false;
}

public boolean hasParent() {
return false;
List children = getOrderedChildren();
return children != null && children.size() > 0;
}

public void releaseChildrenDOM(boolean b) {

if (getOrderedChildren() != null) {
for (XMLObject child : getOrderedChildren()) {
if (child != null) {
child.releaseDOM();
if (b) {
child.releaseChildrenDOM(b);
}
}
}
}
}

public void releaseDOM() {

this.setDOM(null);
}

public void releaseParentDOM(boolean b) {

if (hasParent()) {
getParent().releaseDOM();
if (b) {
getParent().releaseParentDOM(b);
}
}
}

@Nullable
Expand All @@ -176,10 +197,6 @@ public void setNoNamespaceSchemaLocation(@Nullable String s) {

}

public void setParent(@Nullable XMLObject xmlObject) {

}

public void setSchemaLocation(@Nullable String s) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public void init() throws ComponentInitializationException {

public String marshalToXmlString(XMLObject ed, boolean includeXMLDeclaration) throws MarshallingException {
Marshaller marshaller = this.marshallerFactory.getMarshaller(ed);
ed.releaseDOM();
ed.releaseChildrenDOM(true);
String entityDescriptorXmlString = null;
if (marshaller != null) {
try (StringWriter writer = new StringWriter()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class EntitiesControllerIntegrationTests extends Specification {
</saml:Attribute>
</mdattr:EntityAttributes>
</md:Extensions>
<md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://test.scaldingspoon.org/test1/acs" index="1"/>
</md:SPSSODescriptor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class EntitiesControllerTests extends Specification {
</saml:Attribute>
</mdattr:EntityAttributes>
</md:Extensions>
<md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://test.scaldingspoon.org/test1/acs" index="1"/>
</md:SPSSODescriptor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class JPAMetadataResolverServiceImplTests extends Specification {
</saml2:Attribute>
</mdattr:EntityAttributes>
</md:Extensions>
<md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://test.scaldingspoon.org/test1/acs" index="1"/>
</md:SPSSODescriptor>
Expand Down
Loading

0 comments on commit 88825d3

Please sign in to comment.