Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 39536 invoked from network); 11 May 2005 05:17:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 May 2005 05:17:14 -0000 Received: (qmail 8509 invoked by uid 500); 11 May 2005 05:20:49 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 8457 invoked by uid 500); 11 May 2005 05:20:49 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 8443 invoked by uid 99); 11 May 2005 05:20:48 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 10 May 2005 22:20:48 -0700 Received: (qmail 39492 invoked by uid 65534); 11 May 2005 05:17:10 -0000 Message-ID: <20050511051710.39491.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r169587 - in /webservices/axis/trunk/java/modules/core: src/org/apache/axis/engine/SimplePhase.java test/org/apache/axis/deployment/BuildWithAddressingTest.java Date: Wed, 11 May 2005 05:17:09 -0000 To: axis-cvs@ws.apache.org From: deepal@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: deepal Date: Tue May 10 22:17:08 2005 New Revision: 169587 URL: http://svn.apache.org/viewcvs?rev=3D169587&view=3Drev Log: fix addressing module bug :) Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Sim= plePhase.java webservices/axis/trunk/java/modules/core/test/org/apache/axis/deploymen= t/BuildWithAddressingTest.java Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engi= ne/SimplePhase.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core= /src/org/apache/axis/engine/SimplePhase.java?rev=3D169587&r1=3D169586&r2=3D= 169587&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Sim= plePhase.java (original) +++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Sim= plePhase.java Tue May 10 22:17:08 2005 @@ -1,18 +1,18 @@ /* - * Copyright 2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= . - * See the License for the specific language governing permissions and - * limitations under the License. - */ +* Copyright 2004,2005 The Apache Software Foundation. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ package org.apache.axis.engine; =20 import java.util.ArrayList; @@ -48,7 +48,7 @@ * Field NAME */ public static final QName NAME =3D new QName("http://axis.ws.apache.or= g", - "Phase"); + "Phase"); =20 /** * Field phaseName @@ -64,7 +64,7 @@ * Field log */ private Log log =3D LogFactory.getLog(getClass()); - =20 + private int indexOfHandlerToExecute =3D 0; =20 /** @@ -75,7 +75,7 @@ public SimplePhase(String phaseName) { handlers =3D new ArrayList(); this.phaseName =3D phaseName; - =20 + } =20 /** @@ -86,7 +86,7 @@ */ public void addHandler(Handler handler, int index) { log.info("Handler " + handler.getName() + "Added to place " + 1 - + " At the Phase " + phaseName); + + " At the Phase " + phaseName); handlers.add(index, handler); } =20 @@ -97,7 +97,7 @@ */ public void addHandler(Handler handler) { log.info("Handler " + handler.getName() + " Added to the Phase " - + phaseName); + + phaseName); handlers.add(handler); } =20 @@ -108,7 +108,7 @@ * @throws AxisFault */ public void invoke(MessageContext msgctx) throws AxisFault { - // Stack executionStack =3D new Stack(); + // Stack executionStack =3D new Stack(); try { while (indexOfHandlerToExecute < handlers.size() ) { if(msgctx.isPaused()){ @@ -117,18 +117,18 @@ Handler handler =3D (Handler) handlers.get(indexOfHand= lerToExecute); if (handler !=3D null) { log.info("Invoke the Handler " + handler.getName() - + "with in the Phase " + phaseName= ); + + "with in the Phase " + phaseName); handler.invoke(msgctx); //This line should be after the invoke as if the i= nvocation failed this handlers is takn care of and=20 //no need to revoke agien - // executionStack.push(handler); + // executionStack.push(handler); indexOfHandlerToExecute++; } } } } catch (Exception e) { log.info("Phase " + phaseName + " failed with the " - + e.getMessage()); + + e.getMessage()); // while (!executionStack.isEmpty()) { // Handler handler =3D (Handler) executionStack.pop(); // log.info("revoke the Handler " + handler.getName() @@ -180,5 +180,10 @@ // // TODO Auto-generated method stub // // } + =20 + + public int getHandlerCount(){ + return handlers.size(); + } =20 } Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/dep= loyment/BuildWithAddressingTest.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core= /test/org/apache/axis/deployment/BuildWithAddressingTest.java?rev=3D169587&= r1=3D169586&r2=3D169587&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- webservices/axis/trunk/java/modules/core/test/org/apache/axis/deploymen= t/BuildWithAddressingTest.java (original) +++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/deploymen= t/BuildWithAddressingTest.java Tue May 10 22:17:08 2005 @@ -45,26 +45,25 @@ } =20 public void testDeployment() throws Exception { - //TODO fix this test case -// String filename =3D "./target/test-resources/deployment"; -// EngineContextFactory builder =3D new EngineContextFactory(); -// SystemContext er =3D builder.buildEngineContext(filename); -// ArrayList phases =3D er.getPhases(AxisSystem.INFLOW); -// AxisModule modeule =3D er.getEngineConfig().getModule(new QName(= "addressing")); -// assertNotNull(modeule); -// if (phases.size() <=3D 0) { -// fail("this must failed Since there are addressing handlers "= ); -// } -// for (int i =3D 0; i < phases.size(); i++) { -// SimplePhase metadata =3D (SimplePhase) phases.get(i); -// if ("pre-dispatch".equals(metadata.getPhaseName())) { -// if (metadata.getHandlerCount() <=3D 0) { -// fail("this must failed Since there are addressing ha= ndlers "); -// } else { -// System.out.println("Found pre-dispatch handlers"); -// } -// } -// } + String filename =3D "./target/test-resources/deployment"; + EngineContextFactory builder =3D new EngineContextFactory(); + SystemContext er =3D builder.buildEngineContext(filename); + ArrayList phases =3D er.getPhases(AxisSystem.INFLOW); + AxisModule modeule =3D er.getEngineConfig().getModule(new QName("a= ddressing")); + assertNotNull(modeule); + if (phases.size() <=3D 0) { + fail("this must failed Since there are addressing handlers "); + } + for (int i =3D 0; i < phases.size(); i++) { + SimplePhase metadata =3D (SimplePhase) phases.get(i); + if ("pre-dispatch".equals(metadata.getPhaseName())) { + if (metadata.getHandlerCount() <=3D 0) { + fail("this must failed Since there are addressing hand= lers "); + } else { + System.out.println("Found pre-dispatch handlers"); + } + } + } =20 } }