MessageContext msg = new MessageContext();
msg.setConfigurationContext(
new ConfigurationContext(new AxisConfiguration()));
PhaseHolder ph = new PhaseHolder(phases);
HandlerDescription hm = new HandlerDescription();
hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandlers");
Handler h1 = new PhaseRuleHandlers();
h1.init(hm);
((PhaseRuleHandlers) h1).setName(new QName("PhaseFirstHnadler"));
hm.setHandler(h1);
hm.setName(new QName("H1"));
PhaseRule rule = new PhaseRule();
rule.setPhaseName("PhaseA");
rule.setPhaseFirst(true);
hm.setRules(rule);
ph.addHandler(hm);
HandlerDescription hm1 = new HandlerDescription();
hm1.setClassName("org.apache.axis2.phaserule.PhaseRuleHandlers");
Handler h2 = new PhaseRuleHandlers();
((PhaseRuleHandlers) h2).setName(new QName("Second Handler"));
h2.init(hm1);
hm1.setHandler(h2);
hm1.setName(new QName("H2"));
PhaseRule rule1 = new PhaseRule();
rule1.setPhaseName("PhaseA");
rule1.setPhaseFirst(true);
hm1.setRules(rule1);
ph.addHandler(hm1);
fail("This should be faild with PhaseFirst already has been set, cannot have two " +
"phaseFirst Handler for same phase ");
} catch (AxisFault axisFault) {
return;