axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hawk...@apache.org
Subject cvs commit: ws-axis/c/build executeTest.xml
Date Fri, 11 Feb 2005 18:45:33 GMT
hawkeye     2005/02/11 10:45:33

  Modified:    c/src/cbindings IHeaderBlockC.cpp IAttributeC.cpp
               c/src/soap Attribute.h HeaderBlock.cpp HeaderBlock.h
                        Attribute.cpp
               c/include/axis IAttribute.hpp IHeaderBlock.hpp
               c/build  executeTest.xml
  Log:
  Updated IAttribute and IHeaderBlock so that they check a little more for
  Invalid NULL's coming in
  
  Revision  Changes    Path
  1.3       +13 -2     ws-axis/c/src/cbindings/IHeaderBlockC.cpp
  
  Index: IHeaderBlockC.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/cbindings/IHeaderBlockC.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IHeaderBlockC.cpp	9 Feb 2005 11:30:53 -0000	1.2
  +++ IHeaderBlockC.cpp	11 Feb 2005 18:45:33 -0000	1.3
  @@ -87,9 +87,15 @@
   	return hdr->addChild((BasicNode*)pBasicNode);
   }
   
  -AXISC_STORAGE_CLASS_INFO void axiscSetLocalNameIHeaderBlock(AXISCHANDLE headerBlock, const
AxiscChar * localname) {
  +AXISC_STORAGE_CLASS_INFO int axiscSetLocalNameIHeaderBlock(AXISCHANDLE headerBlock, const
AxiscChar * localname) 
  +{
  +	if(0==localname)
  +	{
  +		return AXIS_FAIL;
  +	}
   	IHeaderBlock *hdr = (IHeaderBlock*)headerBlock;
   	hdr->setLocalName(localname);
  +	return AXIS_SUCCESS;
   }
   
   AXISC_STORAGE_CLASS_INFO const AxiscChar * axiscGetLocalNameIHeaderBlock(AXISCHANDLE headerBlock)
{
  @@ -102,9 +108,14 @@
   	hdr->setURI(uri);
   }
   
  -AXISC_STORAGE_CLASS_INFO void axiscSetPrefixIHeaderBlock(AXISCHANDLE headerBlock, const
AxiscChar * prefix) {
  +AXISC_STORAGE_CLASS_INFO int axiscSetPrefixIHeaderBlock(AXISCHANDLE headerBlock, const
AxiscChar * prefix) {
  +	if(0==prefix)
  +	{
  +		return AXIS_FAIL;
  +	}
   	IHeaderBlock *hdr = (IHeaderBlock*)headerBlock;
   	hdr->setPrefix(prefix);
  +	return AXIS_SUCCESS;
   }
   
   AXISC_STORAGE_CLASS_INFO AXISCHANDLE axiscCloneHeaderBlockIHeaderBlock(AXISCHANDLE headerBlock)
{
  
  
  
  1.3       +27 -4     ws-axis/c/src/cbindings/IAttributeC.cpp
  
  Index: IAttributeC.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/cbindings/IAttributeC.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IAttributeC.cpp	9 Feb 2005 11:30:53 -0000	1.2
  +++ IAttributeC.cpp	11 Feb 2005 18:45:33 -0000	1.3
  @@ -26,24 +26,47 @@
   	delete attr;
   }
   
  -AXISC_STORAGE_CLASS_INFO void axiscSetValueIAttribute(AXISCHANDLE attribute, const AxiscChar
* value) {
  +AXISC_STORAGE_CLASS_INFO int axiscSetValueIAttribute(AXISCHANDLE attribute, const AxiscChar
* value) {
  +	if(NULL==value)
  +	{
  +		return AXIS_FAIL;
  +	}
   	IAttribute *attr = (IAttribute*)attribute;
   	attr->setValue(value);
  +	
  +	return AXIS_SUCCESS;
   }
   
  -AXISC_STORAGE_CLASS_INFO void axiscSetUriIAttribute(AXISCHANDLE attribute, const AxiscChar
* uri) {
  +AXISC_STORAGE_CLASS_INFO int axiscSetUriIAttribute(AXISCHANDLE attribute, const AxiscChar
* uri) {
  +	if(NULL==uri)
  +	{
  +		return AXIS_FAIL;
  +	}
   	IAttribute *attr = (IAttribute*)attribute;
   	attr->setURI(uri);
  +	return AXIS_SUCCESS;
   }
   
  -AXISC_STORAGE_CLASS_INFO void axiscSetPrefixIAttribute(AXISCHANDLE attribute, const AxiscChar
* prefix) {
  +
  +AXISC_STORAGE_CLASS_INFO int axiscSetPrefixIAttribute(AXISCHANDLE attribute, const AxiscChar
* prefix) {
  +	if(NULL==prefix)
  +	{
  +		return AXIS_FAIL;
  +	}
  +	
   	IAttribute *attr = (IAttribute*)attribute;
   	attr->setPrefix(prefix);
  +	return AXIS_SUCCESS;
   }
   
  -AXISC_STORAGE_CLASS_INFO void axiscSetLocalNameIAttribute(AXISCHANDLE attribute, const
AxiscChar * localname) {
  +AXISC_STORAGE_CLASS_INFO int axiscSetLocalNameIAttribute(AXISCHANDLE attribute, const AxiscChar
* localname) {
  +	if(NULL==localname)
  +	{
  +		return AXIS_FAIL;
  +	}
   	IAttribute *attr = (IAttribute*)attribute;
   	attr->setLocalName(localname);
  +	return AXIS_SUCCESS;
   }
   
   AXISC_STORAGE_CLASS_INFO const AxiscChar * axiscGetValueIAttribute(AXISCHANDLE attribute)
{
  
  
  
  1.12      +4 -4      ws-axis/c/src/soap/Attribute.h
  
  Index: Attribute.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/Attribute.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Attribute.h	9 Feb 2005 11:30:53 -0000	1.11
  +++ Attribute.h	11 Feb 2005 18:45:33 -0000	1.12
  @@ -61,10 +61,10 @@
       Attribute* clone(); 
       virtual ~Attribute();
   
  -    void setValue(const AxisChar* value);
  -    void setURI(const AxisChar* uri);
  -    void setPrefix(const AxisChar* prefix);
  -    void setLocalName(const AxisChar* localname);    
  +    int setValue(const AxisChar* value);
  +    int setURI(const AxisChar* uri);
  +    int setPrefix(const AxisChar* prefix);
  +    int setLocalName(const AxisChar* localname);
   
       const AxisChar* getValue();
       const AxisChar* getURI();
  
  
  
  1.47      +37 -14    ws-axis/c/src/soap/HeaderBlock.cpp
  
  Index: HeaderBlock.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/HeaderBlock.cpp,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- HeaderBlock.cpp	9 Feb 2005 11:30:53 -0000	1.46
  +++ HeaderBlock.cpp	11 Feb 2005 18:45:33 -0000	1.47
  @@ -149,9 +149,14 @@
       m_children.clear();
   }
   
  -void HeaderBlock::setLocalName(const AxisChar* localname)
  +int HeaderBlock::setLocalName(const AxisChar* localname)
   {
  -    m_localname= localname;
  +	if(localname==NULL)
  +	{
  +		return AXIS_FAIL;
  +	}
  +    m_localname=localname;
  +    return AXIS_SUCCESS;
   }
   
   const AxisChar * HeaderBlock::getLocalName()
  @@ -166,26 +171,34 @@
    * on the mailing list agreed to add back in this method.
    * Jira issue AXISCPP-135
    */
  -void HeaderBlock::setPrefix(const AxisChar* prefix)
  +int HeaderBlock::setPrefix(const AxisChar* prefix)
   {
       m_sPrefix= prefix;
  +    return AXIS_SUCCESS;
   }
   
  -void HeaderBlock::setURI(const AxisChar* uri)
  +int HeaderBlock::setURI(const AxisChar* uri)
   {
       m_uri= uri;
  +    return AXIS_SUCCESS;
   }
   
  -void HeaderBlock::addAttribute(Attribute* pAttr)
  +int HeaderBlock::addAttribute(Attribute* pAttr)
   {
       if (pAttr)
       {
           m_attributes.push_back(pAttr);
  +        return AXIS_SUCCESS;
  +    }
  +    else
  +    {
  +    	return AXIS_FAIL;
       }
   }
   
   int HeaderBlock::serialize(SoapSerializer& pSZ)
   {
  +	
       /*
        *In the code we don't look whether the m_sPrefix is available or
        *    not. Instead directly insert it. The reason is that the SOAP
  @@ -299,7 +312,7 @@
   
   bool HeaderBlock::isSerializable()
   {
  -    bool bStatus= true;    
  +    bool bStatus= true;
   
       if(m_localname.length() == 0)
       {
  @@ -344,6 +357,7 @@
   int HeaderBlock::serializeChildren(SoapSerializer& pSZ,
                                      list<AxisChar*>& lstTmpNameSpaceStack)
   {
  +	// soapserialiser does not have an == operator so can't check it
       list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();
   
       while(itCurrBasicNode != m_children.end())
  @@ -366,6 +380,10 @@
   INamespace* HeaderBlock::createNamespaceDecl(const AxisChar *prefix,
           const AxisChar *uri) 
   {
  +	if(prefix==NULL || uri==NULL)
  +	{
  +		return NULL;
  +	}
       Namespace* pNamespace = new Namespace(prefix, uri);
       m_namespaceDecls.push_back(pNamespace);
   
  @@ -508,6 +526,7 @@
   
   BasicNode* HeaderBlock::createImmediateChild(NODE_TYPE eNODE_TYPE)
   {
  +	
       BasicNode* pBasicNode = NULL;
   
       do
  @@ -528,7 +547,6 @@
           m_children.push_back(pBasicNode);
           iNoOFChildren++;
       } while (0);
  -
       return pBasicNode;
   }
   
  @@ -536,7 +554,7 @@
                                           const AxisChar *prefix,
                                           const AxisChar *value)
   {
  -    Attribute* pAttribute = 0;
  +    Attribute* pAttribute = NULL;
   
       if (localname)
       {
  @@ -553,8 +571,12 @@
                                           const AxisChar *uri,
                                           const AxisChar *value)
   {
  -    Attribute* pAttribute = new Attribute(localname, prefix, uri, value);
  -    m_attributes.push_back(pAttribute);
  +	Attribute* pAttribute=NULL;
  +	if(localname)
  +	{
  +	    pAttribute = new Attribute(localname, prefix, uri, value);
  +	    m_attributes.push_back(pAttribute);
  +	}
   
       return pAttribute;
   }
  @@ -655,17 +677,18 @@
   const AxisChar* HeaderBlock::getAttributeValue(const AxisChar *localname,
                                            const AxisChar *prefix)
   {
  -     list<Attribute*>::iterator itAttr = m_attributes.begin();
  +   	list<Attribute*>::iterator itAttr = m_attributes.begin();
    	while (itAttr != m_attributes.end()) 
    	{
    		Attribute* pAttribute = *itAttr;
    		if (!strcmp(pAttribute->getLocalName(),localname) &&
    			!strcmp(pAttribute->getPrefix(),prefix)) 
  - 			return pAttribute->getValue();
  + 			{
  + 				return pAttribute->getValue();
  + 			}
    		itAttr++;
    	}
  - 
  -     return NULL;
  +    return NULL;
   }
    
   
  
  
  
  1.26      +18 -10    ws-axis/c/src/soap/HeaderBlock.h
  
  Index: HeaderBlock.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/HeaderBlock.h,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- HeaderBlock.h	9 Feb 2005 11:30:53 -0000	1.25
  +++ HeaderBlock.h	11 Feb 2005 18:45:33 -0000	1.26
  @@ -102,11 +102,14 @@
         * @param prefix The prefix of the attribute. 
         * @param uri The namespace uri of the attribute. 
         * 
  -      * @return A pointer to the created Attribute will be returned. 
  +      * @return A pointer to the created Attribute will be returned. or NULL if unsuccessful
         */
       INamespace* createNamespaceDecl(const AxisChar *prefix, 
               const AxisChar *uri); 
   
  +	/**
  +	 * return the first child of this headerblock or NULL if there isn't one.
  +	 */
       BasicNode* getFirstChild();
   
       /**
  @@ -181,8 +184,9 @@
         * Adds a Attribute to this Header Block.
         *
         * @param attr The Attribute to be added.
  +      * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
         */
  -    void addAttribute(Attribute* attr);
  +    int addAttribute(Attribute* attr);
   
       /**
        * A user can use this method to create a standard HeaderBlock attribute. 
  @@ -211,13 +215,13 @@
        * The vallues which could be
        * passes are SOAP_VER_1_1 and SOAP_VER_1_2.
        *
  -     * @return A pointer to the created standard Attribute will be returned.
  +     * @return A pointer to the created standard Attribute will be returned. or NULL if
unsuccessful
        */
       IAttribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, 
           SOAP_VERSION eSOAP_VERSION);
   
       /**
  -      * Creates a Attribute and adds it to this Header Block. This method might
  +      * Creates a Attribute and adds it to this Header Block. This method will return 
         *  null to indicate unsuccessfull operation. The caller of this method 
         *  should check for the return NULL value.
         *
  @@ -239,7 +243,7 @@
         * @param prefix The prefix of the attribute.
         * @param value The value of the attribute.
         *
  -      * @return A pointer to the created Attribute will be returned.
  +      * @return A pointer to the created Attribute will be returned. or NULL if not successful
         */
       IAttribute* createAttribute(const AxisChar* localname, 
           const AxisChar* prefix, const AxisChar* value);
  @@ -251,7 +255,7 @@
         * @param localname The local name of the attribute.
         * @param prefix The prefix of the attribute.
         *
  -      * @return the value of the attribute
  +      * @return the value of the attribute or NULL if not successful
         */
        virtual const AxisChar* getAttributeValue(const AxisChar* localname,
            const AxisChar* prefix);
  @@ -311,7 +315,7 @@
         * Adds a child node to the Header Block.
         *
         * @param pBasicNode The child node pointer which is to be added.
  -      * @return AXIS_SUCCESS to indicate successfull operation.
  +      * @return AXIS_SUCCESS to indicate successfull operation, AXIS_FAIL Otherwise
         */
       int addChild(BasicNode* pBasicNode);
   
  @@ -319,15 +323,18 @@
         * Sets the local name of this Header Block.
         *
         * @param localname The localname to set in.
  +      * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
         */
  -    void setLocalName(const AxisChar* localname);
  +    int setLocalName(const AxisChar* localname);
  +    
       const AxisChar * getLocalName();
       /**
         * Sets the namespace uri of this Header Block.
         *
         * @param uri The namespace uri to set in.
  +      * @return AXIS_SUCCESS if succcesful, AXIS_FAIL otherwise
         */
  -    void setURI(const AxisChar* uri);
  +    int setURI(const AxisChar* uri);
   
   	/* 
   	 * Commented by Susantha - 21/06/2004
  @@ -341,8 +348,9 @@
         * Sets the prefix of this Header Block.
         *
         * @param prefix The prefix to set in.
  +      * @return AXIS_SUCCESS if successful,  AXIS_FAIL otherwuse,
         */
  -    void setPrefix(const AxisChar* prefix);
  +    int setPrefix(const AxisChar* prefix);
   
       /**
         * Sets the namespace declaration of the Header Block.
  
  
  
  1.31      +25 -4     ws-axis/c/src/soap/Attribute.cpp
  
  Index: Attribute.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/Attribute.cpp,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Attribute.cpp	9 Feb 2005 11:30:53 -0000	1.30
  +++ Attribute.cpp	11 Feb 2005 18:45:33 -0000	1.31
  @@ -52,24 +52,45 @@
   
   }
   
  -void Attribute::setLocalName(const AxisChar* localname)
  +int Attribute::setLocalName(const AxisChar* localname)
   {
  +	if(NULL==localname)
  +	{
  +		return AXIS_FAIL;
  +	}
       m_localname= localname;
  +    return AXIS_SUCCESS;
   }
   
  -void Attribute::setPrefix(const AxisChar* prefix)
  +int Attribute::setPrefix(const AxisChar* prefix)
   {
  +	if(NULL==prefix)
  +	{
  +		return AXIS_FAIL;
  +	}
  +	
       m_prefix= prefix;
  +    return AXIS_SUCCESS;
   }
   
  -void Attribute::setURI(const AxisChar* uri)
  +int Attribute::setURI(const AxisChar* uri)
   {
  +	if(NULL==uri)
  +	{
  +		return AXIS_FAIL;
  +	}
       m_uri= uri;
  +    return AXIS_SUCCESS;
   }
   
  -void Attribute::setValue(const AxisChar* value)
  +int Attribute::setValue(const AxisChar* value)
   {
  +	if(NULL==value)
  +	{
  +		return AXIS_FAIL;
  +	}
       m_value= value;
  +    return AXIS_SUCCESS;
   }
   
   
  
  
  
  1.7       +25 -5     ws-axis/c/include/axis/IAttribute.hpp
  
  Index: IAttribute.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/IAttribute.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- IAttribute.hpp	9 Feb 2005 11:30:53 -0000	1.6
  +++ IAttribute.hpp	11 Feb 2005 18:45:33 -0000	1.7
  @@ -40,11 +40,31 @@
   public:        
   
       virtual ~IAttribute() {};
  -
  -    virtual void setValue(const AxisChar* value) = 0;
  -    virtual void setURI(const AxisChar* uri) = 0;
  -    virtual void setPrefix(const AxisChar* prefix) = 0;
  -    virtual void setLocalName(const AxisChar* localname) = 0;    
  +	/**
  +	 * try to set theattribute with given value
  +	 * @param AxisChar* the value to set the value to 
  +	 * @return AXIS_SUCCESS if succeeded, AXIS_Fail otherwise. NOTE: Passing NULL will result
in a AXIS_FAIL
  +	 */
  +    virtual int setValue(const AxisChar* value) = 0;
  +    
  +	/**
  +	 * try to set the URI
  +	 * @param AxisChar* the value to set the URI to 
  +	 * @return AXIS_SUCCESS if succeeded, AXIS_Fail otherwise. NOTE: Passing NULL will result
in a AXIS_FAIL
  +	 */
  +    virtual int setURI(const AxisChar* uri) = 0;
  +	/**
  +	 * try to set the prefix with given value
  +	 * @param AxisChar* the prefix to set to 
  +	 * @return AXIS_SUCCESS if succeeded, AXIS_Fail otherwise. NOTE: Passing NULL will result
in a AXIS_FAIL
  +	 */
  +    virtual int setPrefix(const AxisChar* prefix) = 0;
  +	/**
  +	 * try to set the attribute with given value
  +	 * @param AxisChar* the value to set the local name to 
  +	 * @return AXIS_SUCCESS if succeeded, AXIS_Fail otherwise. NOTE: Passing NULL will result
in a AXIS_FAIL
  +	 */
  +    virtual int setLocalName(const AxisChar* localname) = 0;    
       virtual const AxisChar* getValue() = 0;
       virtual const AxisChar* getURI() = 0;
       virtual const AxisChar* getPrefix() = 0;
  
  
  
  1.8       +8 -4      ws-axis/c/include/axis/IHeaderBlock.hpp
  
  Index: IHeaderBlock.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/IHeaderBlock.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- IHeaderBlock.hpp	9 Feb 2005 11:30:53 -0000	1.7
  +++ IHeaderBlock.hpp	11 Feb 2005 18:45:33 -0000	1.8
  @@ -255,7 +255,7 @@
         * Adds a child node to the Header Block.
         *
         * @param pBasicNode The child node pointer which is to be added.
  -      * @return AXIS_SUCCESS to indicate successfull operation.
  +      * @return AXIS_SUCCESS to indicate successfull operation.AXIS_FAIL otherwise
         */
       virtual int addChild(BasicNode* pBasicNode)=0;
   
  @@ -263,8 +263,9 @@
         * Sets the local name of this Header Block.
         *
         * @param localname The localname to set in.
  +      * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
         */
  -    virtual void setLocalName(const AxisChar* localname)=0;
  +    virtual int setLocalName(const AxisChar* localname)=0;
       
       /**
         * Gets the local name of this Header Block.
  @@ -276,9 +277,11 @@
         * Sets the namespace uri of this Header Block.
         *
         * @param uri The namespace uri to set in.
  +      * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
  +      * 
         */
   
  -    virtual void setURI(const AxisChar* uri)=0;
  +    virtual int setURI(const AxisChar* uri)=0;
   
   	/* 
   	 * Commented by Susantha - 21/06/2004
  @@ -292,8 +295,9 @@
         * Sets the prefix of this Header Block.
         *
         * @param prefix The prefix to set in.
  +      * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
         */
  -    virtual void setPrefix(const AxisChar* prefix)=0;
  +    virtual int setPrefix(const AxisChar* prefix)=0;
   
   #ifdef UNIT_TESTING_ON
       /**
  
  
  
  1.15      +1 -1      ws-axis/c/build/executeTest.xml
  
  Index: executeTest.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/executeTest.xml,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- executeTest.xml	9 Feb 2005 17:00:00 -0000	1.14
  +++ executeTest.xml	11 Feb 2005 18:45:33 -0000	1.15
  @@ -134,7 +134,7 @@
   				</parallel>
   			</try>
   			<catch>
  -				<echo message="Exception in Ant try/catch block"/>
  +				<echo message="Exception in monitor caught it in Ant try/catch block while trying
to run test ${testName}"/>
   				<antcall target="stopMonitor" inheritall="true"/>
   			</catch>
   			<finally>
  
  
  

Mime
View raw message