use of org.talend.esb.policy.samenabling.SamEnablingPolicy in project tesb-rt-se by Talend.
the class SamEnablingAssertionTest method testEqual.
@Test
public void testEqual() {
SamEnablingPolicy sep = new SamEnablingPolicy(generateStubElement());
assertFalse(sep.equal(null));
assertTrue(sep.equal(sep));
}
use of org.talend.esb.policy.samenabling.SamEnablingPolicy in project tesb-rt-se by Talend.
the class SamEnablingInterceptorProviderTest method createSamlAssertion.
public List<Assertion> createSamlAssertion(String appliesTo) throws Exception {
List<Assertion> assertions = new ArrayList<Assertion>();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbf.newDocumentBuilder();
Document doc = builder.newDocument();
Element element = doc.createElement("root");
doc.appendChild(element);
element.setAttribute("appliesTo", appliesTo);
assertions.add(new SamEnablingPolicy(element));
return assertions;
}
use of org.talend.esb.policy.samenabling.SamEnablingPolicy in project tesb-rt-se by Talend.
the class SamEnablingAssertionTest method testIgnorable.
@Test
public void testIgnorable() {
SamEnablingPolicy sep = new SamEnablingPolicy(generateStubElement());
assertFalse(sep.isIgnorable());
}
use of org.talend.esb.policy.samenabling.SamEnablingPolicy in project tesb-rt-se by Talend.
the class SamEnablingAssertionTest method testSerialization.
@Test
public void testSerialization() throws Exception {
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
// $NON-NLS-1$
outputFactory.setProperty(// $NON-NLS-1$
"javax.xml.stream.isRepairingNamespaces", Boolean.TRUE);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLStreamWriter writer = outputFactory.createXMLStreamWriter(baos, "UTF-8");
SamEnablingPolicy sep = new SamEnablingPolicy(generateStubElement());
sep.serialize(writer);
writer.flush();
writer.close();
assertTrue(baos.toString().equalsIgnoreCase("<tpa:ServiceActivityMonitoring xmlns:tpa=\"http://types.talend.com/policy/assertion/1.0\" appliesTo=\"none\"/>"));
}
Aggregations