phases.add(p1);
Phase p2 = new Phase("PhaseB");
phases.add(p2);
PhaseHolder ph = new PhaseHolder(phases);
HandlerDescription hm = new HandlerDescription();
hm.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
PhaseRuleHandler h1 = new PhaseRuleHandler();
h1.init(hm);
h1.setName("First");
hm.setHandler(h1);
hm.setName("H1");
PhaseRule rule = new PhaseRule();
rule.setPhaseName("PhaseA");
hm.setRules(rule);
ph.addHandler(hm);
HandlerDescription hm1 = new HandlerDescription();
hm1.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
Handler h2 = new PhaseRuleHandler();
((PhaseRuleHandler) h2).setName("Forth");
h2.init(hm1);
hm1.setHandler(h2);
hm1.setName("H2");
PhaseRule rule1 = new PhaseRule();
rule1.setPhaseName("PhaseA");
hm1.setRules(rule1);
ph.addHandler(hm1);
HandlerDescription hm3 = new HandlerDescription();
hm3.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
Handler h3 = new PhaseRuleHandler();
((PhaseRuleHandler) h3).setName("Second");
h3.init(hm3);
hm3.setHandler(h3);
hm3.setName("H3");
PhaseRule rule3 = new PhaseRule();
rule3.setPhaseName("PhaseA");
rule3.setAfter("H1");
hm3.setRules(rule3);
ph.addHandler(hm3);
HandlerDescription hm4 = new HandlerDescription();
hm4.setClassName("org.apache.axis2.phaserule.PhaseRuleHandler");
Handler h4 = new PhaseRuleHandler();
((PhaseRuleHandler) h4).setName("Third");
h4.init(hm4);
hm4.setHandler(h4);
hm4.setName("H4");
PhaseRule rule4 = new PhaseRule();
rule4.setPhaseName("PhaseA");
rule4.setAfter("H1");
rule4.setBefore("H2");
hm4.setRules(rule4);
ph.addHandler(hm4);
List handlers = p1.getHandlers();
boolean foundH1 = false;
boolean foundH4 = false;