/** * Testing whether synapse exception is thrown when the membership handler cannot be found. * The given membership handler is a false one. * @throws Exception */ @Test(expected = SynapseException.class) public void test() throws Exception { String inputXml = "<endpoint xmlns=\"http://ws.apache.org/ns/synapse\">" + "<dynamicLoadbalance policy=\"roundRobin\" failover=\"true\">" + " <membershipHandler class=\"org.apache.synapse.core.LoadBalanceMembershipHandler\">" + " <property name=\"name\" value=\"value\"/>" + " </membershipHandler>" + " </dynamicLoadbalance>" + "</endpoint>"; OMElement inputElement = AXIOMUtil.stringToOM(inputXml); DynamicLoadbalanceEndpoint endpoint = (DynamicLoadbalanceEndpoint) DynamicLoadbalanceEndpointFactory .getEndpointFromElement(inputElement, true, null); } }
sessionTimeout.getText().trim())); } catch (NumberFormatException nfe) { handleException("Invalid session timeout value : " + sessionTimeout.getText()); XMLConfigConstants.NULL_NAMESPACE, "class")); if (clazz == null) { handleException("class attribute is required on the membershipHandler element"); } else { clazz = clazz.trim(); String msg = "Could not instantiate " + "LoadBalanceMembershipHandler implementation " + clazz; handleException(msg, e); handleException("membershipHandler element is required"); processProperties(loadbalanceEndpoint, epConfig);
if (dlbElement != null) { return DynamicLoadbalanceEndpointFactory.getInstance();
(new QName(SynapseConstants.SYNAPSE_NAMESPACE, "dynamicLoadbalance")); if (dlbElement != null) { return DynamicLoadbalanceEndpointFactory.getInstance();
sessionTimeout.getText().trim())); } catch (NumberFormatException nfe) { handleException("Invalid session timeout value : " + sessionTimeout.getText()); processProperties(loadbalanceEndpoint, epConfig);