You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ru...@apache.org on 2005/10/18 16:39:09 UTC
svn commit: r326115 - in /webservices/axis2/trunk/java/modules:
addressing/src/org/apache/axis2/handlers/addressing/
codegen/src/org/apache/axis2/databinding/
codegen/src/org/apache/axis2/databinding/utils/
core/src/org/apache/axis2/deployment/ core/sr...
Author: ruchithf
Date: Tue Oct 18 07:37:12 2005
New Revision: 326115
URL: http://svn.apache.org/viewcvs?rev=326115&view=rev
Log:
Changed OMAttribute.setValue to OMAttribute.setAttributeValue \n completed (almost-one DOM Attr method left) the AttrImpl \n Added a few basic test cases for DocumentImpl, ElementImpl,TextImpl and OMDOMFactory-a lot more to come
Added:
webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/
webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java
webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/ElementImplTest.java
webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/OMDOMFactoryTest.java
webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/TextImplTest.java
Modified:
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/utils/ADBPullParser.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java
webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMAttribute.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttributeMap.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMMessageFormatter.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMUtil.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMAttributeImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java
webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestUtils.java
webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Tue Oct 18 07:37:12 2005
@@ -105,7 +105,7 @@
}
/**
- * WSA 1.0 specification mandates all the reference parameters to have a attribute as wsa:Type=�parameter�. So
+ * WSA 1.0 specification mandates all the reference parameters to have a attribute as wsa:Type=???parameter???. So
* here this will check for header blocks with the above attribute and will put them in message information header collection
*
* @param header
@@ -125,7 +125,7 @@
new QName(
Final.WSA_NAMESPACE,
Final.WSA_IS_REFERENCE_PARAMETER_ATTRIBUTE))
- .getValue())) {
+ .getAttributeValue())) {
messageInformationHeaders.addReferenceParameter(soapHeaderBlock);
}
}
@@ -222,7 +222,7 @@
address,
relationshipType == null
? relationshipTypeDefaultValue
- : relationshipType.getValue());
+ : relationshipType.getAttributeValue());
messageInformationHeaders.setRelatesTo(relatesTo);
soapHeaderBlock.setProcessed();
@@ -237,7 +237,7 @@
while (headerBlocks.hasNext()) {
SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) headerBlocks.next();
OMAttribute isRefParamAttr = soapHeaderBlock.getAttribute(new QName(addressingNamespace, "IsReferenceParameter"));
- if (isRefParamAttr != null && "true".equals(isRefParamAttr.getValue())) {
+ if (isRefParamAttr != null && "true".equals(isRefParamAttr.getAttributeValue())) {
toEPR.addReferenceParameter(soapHeaderBlock.getQName(), soapHeaderBlock.getText());
}
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/DeserializationContext.java Tue Oct 18 07:37:12 2005
@@ -118,7 +118,7 @@
OMAttribute idAttr =
((OMElement)nextElement).getAttribute(new QName("id"));
if (idAttr != null) {
- idFound(idAttr.getValue(), (OMElement)nextElement);
+ idFound(idAttr.getAttributeValue(), (OMElement)nextElement);
}
}
nextElement = nextElement.getNextOMSibling();
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/utils/ADBPullParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/utils/ADBPullParser.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/utils/ADBPullParser.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/databinding/utils/ADBPullParser.java Tue Oct 18 07:37:12 2005
@@ -308,7 +308,7 @@
if (testLocalName && localName.equals(attrQName.getLocalPart())) {
isLocalNameMatch = true;
}
- if (isLocalNameMatch && isNSUriMatch) return attributes[i].getValue();
+ if (isLocalNameMatch && isNSUriMatch) return attributes[i].getAttributeValue();
}
return null;
}
@@ -359,7 +359,7 @@
if (accessingChildPullParser) {
return childPullParser.getAttributeValue(i);
} else if (attributes != null && attributes.length >= i) {
- return attributes[i].getValue();
+ return attributes[i].getAttributeValue();
}
return null;
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java Tue Oct 18 07:37:12 2005
@@ -70,7 +70,7 @@
Thread.currentThread().getContextClassLoader(),msgRev);
OMAttribute mepAtt = msgRev.getAttribute(new QName(MEP));
((AxisConfigurationImpl)axisConfiguration).addMessageReceiver(
- mepAtt.getValue(),msgrecivere);
+ mepAtt.getAttributeValue(),msgrecivere);
}
//processing Dispatching Order
@@ -128,7 +128,7 @@
while (dispatchers.hasNext()) {
foundDiaptcher = true;
OMElement dispchter = (OMElement) dispatchers.next();
- String clssName = dispchter.getAttribute(new QName(CLASSNAME)).getValue();
+ String clssName = dispchter.getAttribute(new QName(CLASSNAME)).getAttributeValue();
AbstractDispatcher disptachClas;
Class classInstance;
try {
@@ -163,7 +163,7 @@
if(className== null){
throw new DeploymentException("Invalid Storage Class defintion , class name missing");
} else {
- String classNameStr =className.getValue();
+ String classNameStr =className.getAttributeValue();
Class stoarge ;
if (classNameStr != null &&!"".equals(classNameStr)) {
try {
@@ -223,7 +223,7 @@
PhasesInfo info = engine.getPhasesinfo();
while (phaserders.hasNext()) {
OMElement phaseOrders = (OMElement) phaserders.next();
- String flowType = phaseOrders.getAttribute(new QName(TYPE)).getValue();
+ String flowType = phaseOrders.getAttribute(new QName(TYPE)).getAttributeValue();
if(INFLOWST.equals(flowType)){
info.setINPhases(getPhaseList(phaseOrders));
} else if (IN_FAILTFLOW.equals(flowType)){
@@ -243,7 +243,7 @@
Iterator phases = phaseOrders.getChildrenWithName(new QName(PHASE));
while (phases.hasNext()) {
OMElement phase = (OMElement) phases.next();
- phaselist.add(phase.getAttribute(new QName(ATTNAME)).getValue());
+ phaselist.add(phase.getAttribute(new QName(ATTNAME)).getAttributeValue());
}
return phaselist;
}
@@ -258,7 +258,7 @@
OMAttribute trsName = transport.getAttribute(
new QName(ATTNAME));
if(trsName !=null){
- String name = trsName.getValue();
+ String name = trsName.getAttributeValue();
transportout = new TransportOutDescription(new QName(name));
//tranport impl class
@@ -268,7 +268,7 @@
throw new DeploymentException("TransportSEnder Implementation class is required " +
"for the transport" + name);
}
- String clasName = trsClas.getValue();
+ String clasName = trsClas.getAttributeValue();
Class sender;
try {
sender =Class.forName(clasName,true,
@@ -341,14 +341,14 @@
OMAttribute trsName = transport.getAttribute(
new QName(ATTNAME));
if(trsName !=null){
- String name = trsName.getValue();
+ String name = trsName.getAttributeValue();
transportIN = new TransportInDescription(new QName(name));
//tranport impl class
OMAttribute trsClas = transport.getAttribute(new QName(CLASSNAME));
if(trsClas !=null) {
try {
- String clasName = trsClas.getValue();
+ String clasName = trsClas.getAttributeValue();
Class receiverClass =Class.forName(clasName,true,
Thread.currentThread()
.getContextClassLoader());
@@ -422,7 +422,7 @@
new QName(CLASSNAME));
String clasName;
if (trsClas !=null) {
- clasName = trsClas.getValue();
+ clasName = trsClas.getAttributeValue();
} else {
throw new DeploymentException("Observer Implementation Class is requird");
}
@@ -460,7 +460,7 @@
OMElement moduleref = (OMElement) moduleRefs.next();
OMAttribute moduleRefAttribute = moduleref.getAttribute(
new QName(REF));
- String refName = moduleRefAttribute.getValue();
+ String refName = moduleRefAttribute.getAttributeValue();
engine.addModule(new QName(refName));
}
}
@@ -475,7 +475,7 @@
if(moduleName_att == null){
throw new DeploymentException("Invalid module configuration");
} else {
- String module = moduleName_att.getValue();
+ String module = moduleName_att.getAttributeValue();
ModuleConfiguration moduleConfiguration =
new ModuleConfiguration(new QName(module),parent);
Iterator paramters= moduleConfig.getChildrenWithName(new QName(PARAMETERST));
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java Tue Oct 18 07:37:12 2005
@@ -111,7 +111,7 @@
if(name_attribute == null){
throw new DeploymentException("Invalid Handler");
} else {
- handler.setName(new QName(name_attribute.getValue()));
+ handler.setName(new QName(name_attribute.getAttributeValue()));
}
//Setting Handler Class name
@@ -120,7 +120,7 @@
if(class_attribute == null){
throw new DeploymentException("Invalid Handler");
} else {
- handler.setClassName(class_attribute.getValue());
+ handler.setClassName(class_attribute.getAttributeValue());
}
//processing phase Rules (order)
@@ -133,7 +133,7 @@
while (order_itr.hasNext()) {
OMAttribute orderAttribut = (OMAttribute) order_itr.next();
String name = orderAttribut.getQName().getLocalPart();
- String value = orderAttribut.getValue();
+ String value = orderAttribut.getAttributeValue();
if (AFTER.equals(name)) {
handler.getRules().setAfter(value);
} else if (BEFORE.equals(name)) {
@@ -189,7 +189,7 @@
throw new DeploymentException(
Messages.getMessage(DeploymentErrorMsgs.BAD_PARA_ARGU));
}
- paramter.setName(paraName.getValue());
+ paramter.setName(paraName.getAttributeValue());
//setting paramter Value (the chiled elemnt of the paramter)
OMElement paraValue = paramterElement.getFirstElement();
@@ -210,7 +210,7 @@
parentpara = parent.getParameter(paramter.getName());
}
if (paraLocked !=null) {
- String lockedValue = paraLocked.getValue();
+ String lockedValue = paraLocked.getAttributeValue();
if("true".equals(lockedValue)){
//if the parameter is locked at some levle paramer value replace by that
if(parent!=null && parent.isParamterLocked(paramter.getName())){
@@ -247,7 +247,7 @@
OMAttribute moduleRefAttribute = moduleref.getAttribute(
new QName(REF));
if (moduleRefAttribute !=null) {
- String refName = moduleRefAttribute.getValue();
+ String refName = moduleRefAttribute.getAttributeValue();
if(engine.getModule(new QName(refName)) == null) {
throw new DeploymentException(Messages.getMessage(
DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
@@ -265,7 +265,7 @@
throws DeploymentException {
OMAttribute recieverName = reciverElement.getAttribute(
new QName(CLASSNAME));
- String className = recieverName.getValue();
+ String className = recieverName.getAttributeValue();
MessageReceiver receiver = null;
try{
Class messageReceiver ;
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java Tue Oct 18 07:37:12 2005
@@ -58,7 +58,7 @@
OMAttribute moduleNameAtt = moduleElement.getAttribute(
new QName(ATTNAME));
if(moduleNameAtt != null){
- String moduleName = moduleNameAtt.getValue();
+ String moduleName = moduleNameAtt.getAttributeValue();
if (moduleName != null && !"".equals(moduleName)) {
module.setName(new QName(moduleName));
} else {
@@ -74,7 +74,7 @@
OMAttribute moduleClassAtt = moduleElement.getAttribute(
new QName(CLASSNAME));
if(moduleClassAtt !=null){
- String moduleClass = moduleClassAtt.getValue();
+ String moduleClass = moduleClassAtt.getAttributeValue();
if(moduleClass !=null && !"".equals(moduleClass)){
if (engine !=null) {
engine.getCurrentFileItem().setModuleClass(moduleClass);
@@ -145,7 +145,7 @@
String mepURL =null;
OperationDescription op_descrip;
if(op_mep_att !=null){
- mepURL= op_mep_att.getValue();
+ mepURL= op_mep_att.getAttributeValue();
}
if(mepURL == null){
@@ -158,7 +158,7 @@
throw new DeploymentException("Error in processing operation " + axisFault);
}
}
- String opname = op_name_att.getValue();
+ String opname = op_name_att.getAttributeValue();
// OperationDescription op_descrip = new OperationDescription();
op_descrip.setName(new QName(opname));
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java Tue Oct 18 07:37:12 2005
@@ -163,13 +163,13 @@
new QName(MEP));
String mepurl =null;
if(op_mep_att !=null){
- mepurl = op_mep_att.getValue();
+ mepurl = op_mep_att.getAttributeValue();
//todo value has to be validate
//todo
// op_descrip.setMessageExchangePattern(mep);
}
- String opname = op_name_att.getValue();
+ String opname = op_name_att.getAttributeValue();
WSDLOperation wsdlOperation =service.getWSDLOPOperation(new QName(opname));
// OperationDescription op_descrip = service.getOperation(new QName(opname));
OperationDescription op_descrip = null;
@@ -245,7 +245,7 @@
if(moduleName_att == null){
throw new DeploymentException("Invalid module configuration");
} else {
- String module = moduleName_att.getValue();
+ String module = moduleName_att.getAttributeValue();
ModuleConfiguration moduleConfiguration =
new ModuleConfiguration(new QName(module),parent);
Iterator paramters= moduleConfig.getChildrenWithName(new QName(PARAMETERST));
@@ -265,7 +265,7 @@
if(moduleName_att == null){
throw new DeploymentException("Invalid module configuration");
} else {
- String module = moduleName_att.getValue();
+ String module = moduleName_att.getAttributeValue();
ModuleConfiguration moduleConfiguration =
new ModuleConfiguration(new QName(module),parent);
Iterator paramters= moduleConfig.getChildrenWithName(new QName(PARAMETERST));
@@ -287,7 +287,7 @@
OMAttribute moduleRefAttribute = moduleref.getAttribute(
new QName(REF));
if(moduleRefAttribute !=null){
- String refName = moduleRefAttribute.getValue();
+ String refName = moduleRefAttribute.getAttributeValue();
if(engine.getModule(new QName(refName)) == null) {
throw new DeploymentException(Messages.getMessage(
DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceGroupBuilder.java Tue Oct 18 07:37:12 2005
@@ -57,7 +57,7 @@
OMAttribute serviceNameatt = service.getAttribute(
new QName(ATTNAME));
- String serviceName = serviceNameatt.getValue();
+ String serviceName = serviceNameatt.getAttributeValue();
if(serviceName == null){
throw new DeploymentException("Service Name required");
} else {
@@ -93,7 +93,7 @@
if(moduleName_att == null){
throw new DeploymentException("Invalid module configuration");
} else {
- String module = moduleName_att.getValue();
+ String module = moduleName_att.getAttributeValue();
ModuleConfiguration moduleConfiguration =
new ModuleConfiguration(new QName(module),parent);
Iterator paramters= moduleConfig.getChildrenWithName(new QName(PARAMETERST));
@@ -116,7 +116,7 @@
OMAttribute moduleRefAttribute = moduleref.getAttribute(
new QName(REF));
if(moduleRefAttribute !=null){
- String refName = moduleRefAttribute.getValue();
+ String refName = moduleRefAttribute.getAttributeValue();
if(engine.getModule(new QName(refName)) == null) {
throw new DeploymentException(Messages.getMessage(
DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Tue Oct 18 07:37:12 2005
@@ -780,10 +780,10 @@
while (ite.hasNext()) {
OMAttribute att = (OMAttribute)ite.next();
if (att.getLocalName().equalsIgnoreCase(PROXY_HOST_NAME)){
- proxyHostName = att.getValue();
+ proxyHostName = att.getAttributeValue();
}
if (att.getLocalName().equalsIgnoreCase(PROXY_PORT)) {
- proxyPort = new Integer(att.getValue()).intValue();
+ proxyPort = new Integer(att.getAttributeValue()).intValue();
}
}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java Tue Oct 18 07:37:12 2005
@@ -44,7 +44,7 @@
public OMElement echoAttachment(OMElement omEle) {
OMElement child = (OMElement)omEle.getFirstOMChild();
OMAttribute attr = child.getFirstAttribute(new QName("href"));
- String contentID = attr.getValue();
+ String contentID = attr.getAttributeValue();
MIMEHelper attachment = (MIMEHelper)msgcts.getProperty(MTOMConstants.ATTACHMENTS);
contentID = contentID.trim();
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java Tue Oct 18 07:37:12 2005
@@ -97,7 +97,7 @@
* @return String
*/
public String getValue() {
- return omAttr.getValue();
+ return omAttr.getAttributeValue();
}
/**
@@ -109,7 +109,7 @@
* @return
*/
public void setValue(String value) {
- omAttr.setValue(value);
+ omAttr.setAttributeValue(value);
setSpecified(true);
}
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java Tue Oct 18 07:37:12 2005
@@ -157,7 +157,7 @@
private String validateHref(OMAttribute attr) {
String contentId;
if(attr!=null) {
- contentId = attr.getValue();
+ contentId = attr.getAttributeValue();
} else {
return null;
}
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java Tue Oct 18 07:37:12 2005
@@ -158,7 +158,7 @@
throws SOAPException {
//TODO:
//The fragment rooted in element is either added as a whole or not at all, if there was an error.
- //The fragment rooted in element cannot contain elements named Envelope, Header or Body
+ //The fragment rooted in element cannot contain elements named ?Envelope?, ?Header? or ?Body?
//and in the SOAP namespace. Any namespace prefixes present in the fragment should be fully
//resolved using appropriate namespace declarations within the fragment itself.
@@ -234,7 +234,7 @@
new QName(name.getURI(),
name.getLocalName(),
name.getPrefix()))
- .getValue();
+ .getAttributeValue();
}
/**
@@ -548,7 +548,7 @@
while (attrIter.hasNext()) {
org.apache.axis2.om.OMAttribute omAttr = (org.apache.axis2.om.OMAttribute) (attrIter.next());
if (omAttr.getLocalName().equals(name)) {
- return omAttr.getValue();
+ return omAttr.getAttributeValue();
}
}
return null;
@@ -743,7 +743,7 @@
org.apache.axis2.om.OMAttribute omAttr = (org.apache.axis2.om.OMAttribute) (attrIter.next());
if (omAttr.getLocalName().equals(localName) &&
omAttr.getNamespace().getName().equals(namespaceURI)) {
- return omAttr.getValue();
+ return omAttr.getAttributeValue();
}
}
return null;
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMAttribute.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMAttribute.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMAttribute.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMAttribute.java Tue Oct 18 07:37:12 2005
@@ -35,12 +35,12 @@
/**
* @return
*/
- public String getValue();
+ public String getAttributeValue();
/**
* @param value
*/
- public void setValue(String value);
+ public void setAttributeValue(String value);
/**
* @param omNamespace
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java Tue Oct 18 07:37:12 2005
@@ -28,7 +28,6 @@
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
/**
* @author Ruchith Fernando (ruchith.fernando@gmail.com)
@@ -42,10 +41,25 @@
private boolean used;
+ private ParentNode parent;
+
protected AttrImpl(DocumentImpl ownerDocument) {
super(ownerDocument);
}
+ public AttrImpl(DocumentImpl ownerDocument, String localName, OMNamespace ns, String value) {
+ super(ownerDocument);
+ this.attrName = localName;
+ this.attrValue = new TextImpl(value);
+ this.namespace = (NamespaceImpl)ns;
+ }
+
+ public AttrImpl(DocumentImpl ownerDocument, String name, String value) {
+ super(ownerDocument);
+ this.attrName = name;
+ this.attrValue = new TextImpl(value);
+ }
+
public AttrImpl(String localName, OMNamespace ns, String value) {
this.attrName = localName;
this.attrValue = new TextImpl(value);
@@ -56,6 +70,11 @@
this.attrName = name;
this.attrValue = new TextImpl(value);
}
+
+ public AttrImpl(DocumentImpl ownerDocument, String name) {
+ super(ownerDocument);
+ this.attrName = name;
+ }
///
///org.w3c.dom.Node methods
@@ -71,6 +90,10 @@
return (this.attrName==null)?"":this.attrValue.getData();
}
+ public String getValue() {
+ return (this.attrValue == null)? null:this.attrValue.getText();
+ }
+
///
///org.w3c.dom.Attr methods
///
@@ -88,13 +111,11 @@
}
public OMNode detach() throws OMException {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ throw new UnsupportedOperationException("Not supported");
}
public void discard() throws OMException {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ throw new UnsupportedOperationException("Not supported");
}
public int getType() {
@@ -102,23 +123,11 @@
}
public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
- //TODO
- throw new UnsupportedOperationException("TODO");
- }
-
- public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ throw new UnsupportedOperationException("Not supported");
}
public void serializeAndConsume(OMOutputImpl omOutput) throws XMLStreamException {
- //TODO
- throw new UnsupportedOperationException("TODO");
- }
-
- public void serializeAndConsume(XMLStreamWriter xmlWriter) throws XMLStreamException {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ throw new UnsupportedOperationException("Not supported");
}
public OMNamespace getNamespace() {
@@ -126,38 +135,38 @@
}
public QName getQName() {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ return (this.namespace == null) ? new QName(this.attrName) :
+ new QName(this.namespace.getName(), this.attrName, this.namespace
+ .getPrefix());
+
}
- public String getValue() {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ public String getAttributeValue() {
+ return this.attrValue.getText();
}
public void setLocalName(String localName) {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ this.attrName = localName;
}
public void setOMNamespace(OMNamespace omNamespace) {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ this.namespace = (NamespaceImpl)omNamespace;
}
- public void setValue(String value) {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ public void setAttributeValue(String value) {
+ if(isReadonly()) {
+ String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null);
+ throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
+ }
+ this.attrValue = (TextImpl)this.getOwnerDocument().createTextNode(value);
}
public void setParent(OMContainer element) {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ this.parent = (ParentNode)element;
}
public void setType(int nodeType) throws OMException {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ //not necessary ???
}
/**
@@ -174,7 +183,26 @@
this.used = used;
}
-
-
+ public void setValue(String value) throws DOMException {
+ this.attrValue = (TextImpl) this.getOwnerDocument().createTextNode(
+ value);
+ }
+
+ public OMContainer getParent() {
+ return this.parent;
+ }
+
+ public String getLocalName()
+ {
+ return this.attrName;
+ }
+
+ public String getNamespaceURI() {
+ if(this.namespace != null) {
+ return namespace.getName();
+ }
+
+ return null;
+ }
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttributeMap.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttributeMap.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttributeMap.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttributeMap.java Tue Oct 18 07:37:12 2005
@@ -78,7 +78,7 @@
}
- attr.ownerNode = this.ownerNode; //Set the owner node
+ attr.ownerNode = (DocumentImpl)this.ownerNode.getOwnerDocument(); //Set the owner node
attr.isOwned(true); //To indicate that this attr belong to an element
attr.setUsed(true); //Setting used to true
@@ -88,7 +88,7 @@
if (i >= 0) { //There's an attribute already with this attr's name
previous = (AttrImpl) nodes.elementAt(i);
nodes.setElementAt(attr,i);
- previous.ownerNode = this.ownerNode;
+ previous.ownerNode = (DocumentImpl)this.ownerNode.getOwnerDocument();
previous.isOwned(false);
// make sure it won't be mistaken with defaults in case it's reused
@@ -141,7 +141,7 @@
return attr; //No point adding the 'same' attr again to the same element
}
- attr.ownerNode = this.ownerNode; //Set the owner node
+ attr.ownerNode = (DocumentImpl)this.ownerNode.getOwnerDocument(); //Set the owner node
attr.isOwned(true); //To indicate that this attr belong to an element
int i = findNamePoint(attr.getNamespaceURI(), attr.getLocalName());
@@ -150,7 +150,7 @@
if (i >= 0) {
previous = (AttrImpl) nodes.elementAt(i);
nodes.setElementAt(attr,i);
- previous.ownerNode = this.ownerNode;
+ previous.ownerNode = (DocumentImpl)this.ownerNode.getOwnerDocument();
previous.isOwned(false);
// make sure it won't be mistaken with defaults in case it's reused
previous.isSpecified(true);
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMMessageFormatter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMMessageFormatter.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMMessageFormatter.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMMessageFormatter.java Tue Oct 18 07:37:12 2005
@@ -122,13 +122,13 @@
*/
public static void init(){
if (locale != null) {
- domResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.dom.msg.DOMMessages", locale);
- serResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.dom.msg.XMLSerializerMessages", locale);
- xmlResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.dom.msg.XMLMessages", locale);
+ domResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.om.impl.dom.msg.DOMMessages", locale);
+ serResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.om.impl.dom.msg.XMLSerializerMessages", locale);
+ xmlResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.om.impl.dom.msg.XMLMessages", locale);
}else{
- domResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.dom.msg.DOMMessages");
- serResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.dom.msg.XMLSerializerMessages");
- xmlResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.dom.msg.XMLMessages");
+ domResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.om.impl.dom.msg.DOMMessages");
+ serResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.om.impl.dom.msg.XMLSerializerMessages");
+ xmlResourceBundle = PropertyResourceBundle.getBundle("org.apache.axis2.om.impl.dom.msg.XMLMessages");
}
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMUtil.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMUtil.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DOMUtil.java Tue Oct 18 07:37:12 2005
@@ -24,7 +24,8 @@
public static boolean isValidChras(String value) {
// TODO check for valid characters
- throw new UnsupportedOperationException("TODO");
+ //throw new UnsupportedOperationException("TODO");
+ return true;
}
public static boolean isValidNamespace(String namespaceURI, String qualifiedname) {
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java Tue Oct 18 07:37:12 2005
@@ -117,12 +117,15 @@
///org.w3c.dom.Document methods
///
- public Attr createAttribute(String arg0) throws DOMException {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ public Attr createAttribute(String name) throws DOMException {
+ if(!DOMUtil.isValidChras(name)) {
+ String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null);
+ throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
+ }
+ return new AttrImpl(this,name);
}
- public Attr createAttributeNS(String arg0, String arg1) throws DOMException {
+ public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException {
//TODO
throw new UnsupportedOperationException("TODO");
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java Tue Oct 18 07:37:12 2005
@@ -23,7 +23,7 @@
import org.apache.axis2.om.OMText;
import org.apache.axis2.om.OMXMLParserWrapper;
import org.apache.axis2.om.impl.OMOutputImpl;
-import org.apache.axis2.om.impl.llom.OMNamespaceImpl;
+import org.apache.axis2.om.impl.llom.OMSerializerUtil;
import org.apache.axis2.om.impl.llom.OMStAXWrapper;
import org.apache.axis2.om.impl.llom.traverse.OMChildElementIterator;
import org.apache.axis2.om.impl.llom.util.EmptyIterator;
@@ -367,7 +367,7 @@
if(attributeNode != null) {
AttrImpl tempAttr = ((AttrImpl)attributeNode);
tempAttr.setOMNamespace(new NamespaceImpl(namespaceURI,DOMUtil.getPrefix(qualifiedName)));
- tempAttr.setValue(value);
+ tempAttr.setAttributeValue(value);
return tempAttr;
} else {
NamespaceImpl ns = new NamespaceImpl(namespaceURI, DOMUtil.getPrefix(qualifiedName));
@@ -449,7 +449,7 @@
* @see org.apache.axis2.om.OMElement#declareNamespace(java.lang.String, java.lang.String)
*/
public OMNamespace declareNamespace(String uri, String prefix) {
- OMNamespaceImpl ns = new OMNamespaceImpl(uri, prefix);
+ NamespaceImpl ns = new NamespaceImpl(uri, prefix);
return declareNamespace(ns);
}
@@ -598,7 +598,7 @@
OMText textNode;
while (child != null) {
- if (child.getType() == OMNode.TEXT_NODE) {
+ if (child.getType() == Node.TEXT_NODE) {
textNode = (OMText) child;
if (textNode.getText() != null
&& !"".equals(textNode.getText())) {
@@ -663,15 +663,50 @@
* @see org.apache.axis2.om.OMNode#serialize(org.apache.axis2.om.OMOutput)
*/
public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ serialize(omOutput, true);
}
public void serializeAndConsume(OMOutputImpl omOutput) throws XMLStreamException {
- //TODO
- throw new UnsupportedOperationException("TODO");
+ this.serialize(omOutput, false);
}
+
+ protected void serialize(org.apache.axis2.om.impl.OMOutputImpl omOutput, boolean cache) throws XMLStreamException {
+
+ if (cache) {
+ //in this case we don't care whether the elements are built or not
+ //we just call the serializeAndConsume methods
+ OMSerializerUtil.serializeStartpart(this, omOutput);
+ //serilize children
+ Iterator children = this.getChildren();
+ while (children.hasNext()) {
+ ((OMNode) children.next()).serialize(omOutput);
+ }
+ OMSerializerUtil.serializeEndpart(omOutput);
+
+ } else {
+ //Now the caching is supposed to be off. However caching been switched off
+ //has nothing to do if the element is already built!
+ if (this.done) {
+ OMSerializerUtil.serializeStartpart(this, omOutput);
+ //serializeAndConsume children
+ Iterator children = this.getChildren();
+ while (children.hasNext()) {
+ //A call to the Serialize or the serializeAndConsume wont make a difference here
+ ((OMNode) children.next()).serializeAndConsume(omOutput);
+ }
+ OMSerializerUtil.serializeEndpart(omOutput);
+ } else {
+ //take the XMLStream reader and feed it to the stream serilizer.
+ //todo is this right ?????
+ OMSerializerUtil.serializeByPullStream(this, omOutput, cache);
+ }
+
+
+ }
+ }
+
+
/* (non-Javadoc)
* @see org.apache.axis2.om.OMElement#getXMLStreamReaderWithoutCaching()
*/
@@ -748,4 +783,10 @@
//TODO Create a new AttrIterator and return it
throw new UnsupportedOperationException("TODO");
}
+
+ public String getLocalName()
+ {
+ return this.tagName;
+ }
+
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java Tue Oct 18 07:37:12 2005
@@ -54,7 +54,7 @@
- protected NodeImpl ownerNode;
+ protected DocumentImpl ownerNode;
// data
@@ -73,6 +73,7 @@
this.ownerNode = ownerDocument;
this.isOwned(true);
+
}
protected NodeImpl() {
@@ -135,13 +136,7 @@
* whose context the Node was created). The Node may or may not
*/
public Document getOwnerDocument() {
- // if we have an owner simply forward the request
- // otherwise ownerNode is our ownerDocument
- if (isOwned()) {
- return ownerNode.getOwnerDocument();
- } else {
- return (Document) this.ownerNode;
- }
+ return (Document) this.ownerNode;
}
/**
@@ -451,7 +446,7 @@
* sets the owner document
* @param document
*/
- protected void SetOwnerDocument(DocumentImpl document) {
+ protected void setOwnerDocument(DocumentImpl document) {
this.ownerNode = document;
this.isOwned(true);
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java Tue Oct 18 07:37:12 2005
@@ -125,7 +125,7 @@
"HIERARCHY_REQUEST_ERR", null));
}
- if(!this.ownerNode.equals(newDomChild.ownerNode)) {
+ if(!(this.ownerNode == newDomChild.getOwnerDocument())) {
throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
@@ -140,10 +140,16 @@
}
if(refChild == null) { //Append the child to the end of the list
- this.lastChild.nextSibling = newDomChild;
- newDomChild.previousSubling = this.lastChild;
+ //if there are no children
+ if(this.lastChild == null && firstChild == null ) {
+ this.lastChild = newDomChild;
+ this.firstChild = newDomChild;
+ } else {
+ this.lastChild.nextSibling = newDomChild;
+ newDomChild.previousSubling = this.lastChild;
- this.lastChild = newDomChild;
+ this.lastChild = newDomChild;
+ }
return newChild;
} else {
Iterator children = this.getChildren();
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java Tue Oct 18 07:37:12 2005
@@ -428,13 +428,13 @@
namespaceName = ns.getName();
if (prefix != null) {
writer.writeAttribute(prefix, namespaceName, attr
- .getLocalName(), attr.getValue());
+ .getLocalName(), attr.getAttributeValue());
} else {
writer.writeAttribute(namespaceName, attr.getLocalName(), attr
- .getValue());
+ .getAttributeValue());
}
} else {
- writer.writeAttribute(attr.getLocalName(), attr.getValue());
+ writer.writeAttribute(attr.getLocalName(), attr.getAttributeValue());
}
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java Tue Oct 18 07:37:12 2005
@@ -45,12 +45,17 @@
*/
public class OMDOMFactory implements OMFactory {
+ private DocumentImpl document;
+
public OMDocument createOMDocument() {
- return new DocumentImpl();
+ if(this.document == null)
+ this.document = new DocumentImpl();
+
+ return this.document;
}
public OMElement createOMElement(String localName, OMNamespace ns) {
- return new ElementImpl(new DocumentImpl(), localName, (NamespaceImpl)ns);
+ return new ElementImpl((DocumentImpl)this.createOMDocument(), localName, (NamespaceImpl)ns);
}
public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent) throws OMDOMException{
@@ -60,6 +65,7 @@
ElementImpl elem = new ElementImpl((DocumentImpl)parentElem.getOwnerDocument(),localName,(NamespaceImpl)ns);
parentElem.appendChild(elem);
return elem;
+
case Node.DOCUMENT_NODE :
DocumentImpl docImpl = (DocumentImpl) parent;
ElementImpl elem2 = new ElementImpl(docImpl,localName,(NamespaceImpl)ns);
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMAttributeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMAttributeImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMAttributeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMAttributeImpl.java Tue Oct 18 07:37:12 2005
@@ -49,7 +49,7 @@
*/
public OMAttributeImpl(String localName, OMNamespace ns, String value) {
setLocalName(localName);
- setValue(value);
+ setAttributeValue(value);
setOMNamespace(ns);
}
@@ -90,7 +90,7 @@
*
* @return value
*/
- public String getValue() {
+ public String getAttributeValue() {
return value;
}
@@ -99,7 +99,7 @@
*
* @param value
*/
- public void setValue(String value) {
+ public void setAttributeValue(String value) {
this.value = value;
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java Tue Oct 18 07:37:12 2005
@@ -648,7 +648,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
- protected void serialize(org.apache.axis2.om.impl.OMOutputImpl omOutput, boolean cache) throws XMLStreamException {
+ protected void serialize(OMOutputImpl omOutput, boolean cache) throws XMLStreamException {
if (cache) {
//in this case we don't care whether the elements are built or not
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMSerializerUtil.java Tue Oct 18 07:37:12 2005
@@ -17,15 +17,17 @@
package org.apache.axis2.om.impl.llom;
import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.OMNamespace;
import org.apache.axis2.om.OMNode;
import org.apache.axis2.om.impl.OMOutputImpl;
import org.apache.axis2.om.impl.llom.serialize.StreamingOMSerializer;
+import java.util.Iterator;
+
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
-import java.util.Iterator;
public class OMSerializerUtil {
@@ -63,13 +65,13 @@
namespaceName = ns.getName();
if (prefix != null) {
writer.writeAttribute(prefix, namespaceName,
- attr.getLocalName(), attr.getValue());
+ attr.getLocalName(), attr.getAttributeValue());
} else {
writer.writeAttribute(namespaceName, attr.getLocalName(),
- attr.getValue());
+ attr.getAttributeValue());
}
} else {
- writer.writeAttribute(attr.getLocalName(), attr.getValue());
+ writer.writeAttribute(attr.getLocalName(), attr.getAttributeValue());
}
}
@@ -101,16 +103,16 @@
* @param omOutput
* @throws XMLStreamException
*/
- public static void serializeStartpart(OMElementImpl element, OMOutputImpl omOutput)
+ public static void serializeStartpart(OMElement element, OMOutputImpl omOutput)
throws XMLStreamException {
String nameSpaceName = null;
String writer_prefix = null;
String prefix = null;
XMLStreamWriter writer = omOutput.getXmlStreamWriter();
- if (element.ns != null) {
- nameSpaceName = element.ns.getName();
+ if (element.getNamespace() != null) {
+ nameSpaceName = element.getNamespace().getName();
writer_prefix = writer.getPrefix(nameSpaceName);
- prefix = element.ns.getPrefix();
+ prefix = element.getNamespace().getPrefix();
if (nameSpaceName != null) {
if (writer_prefix != null) {
writer.writeStartElement(nameSpaceName,
@@ -138,7 +140,7 @@
serializeAttributes(element, omOutput);
}
- public static void serializeNamespaces(OMElementImpl element,
+ public static void serializeNamespaces(OMElement element,
org.apache.axis2.om.impl.OMOutputImpl omOutput) throws XMLStreamException {
Iterator namespaces = element.getAllDeclaredNamespaces();
if (namespaces != null) {
@@ -148,7 +150,7 @@
}
}
- public static void serializeAttributes(OMElementImpl element,
+ public static void serializeAttributes(OMElement element,
org.apache.axis2.om.impl.OMOutputImpl omOutput) throws XMLStreamException {
if (element.getAllAttributes() != null) {
Iterator attributesList = element.getAllAttributes();
@@ -167,7 +169,7 @@
* @param cache
* @throws XMLStreamException
*/
- public static void serializeNormal(OMElementImpl element, OMOutputImpl omOutput, boolean cache)
+ public static void serializeNormal(OMElement element, OMOutputImpl omOutput, boolean cache)
throws XMLStreamException {
if (cache) {
@@ -175,7 +177,7 @@
}
serializeStartpart(element, omOutput);
- OMNode firstChild = element.firstChild;
+ OMNode firstChild = element.getFirstOMChild();
if (firstChild != null) {
if (cache) {
firstChild.serialize(omOutput);
@@ -186,11 +188,11 @@
serializeEndpart(omOutput);
}
- public static void serializeByPullStream(OMElementImpl element, org.apache.axis2.om.impl.OMOutputImpl omOutput) throws XMLStreamException {
+ public static void serializeByPullStream(OMElement element, org.apache.axis2.om.impl.OMOutputImpl omOutput) throws XMLStreamException {
serializeByPullStream(element,omOutput,false);
}
- public static void serializeByPullStream(OMElementImpl element, org.apache.axis2.om.impl.OMOutputImpl omOutput,boolean cache) throws XMLStreamException {
+ public static void serializeByPullStream(OMElement element, org.apache.axis2.om.impl.OMOutputImpl omOutput,boolean cache) throws XMLStreamException {
StreamingOMSerializer streamingOMSerializer = new StreamingOMSerializer();
if (cache){
streamingOMSerializer.serialize(element.getXMLStreamReader(),
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMStAXWrapper.java Tue Oct 18 07:37:12 2005
@@ -482,7 +482,7 @@
if (isStartElement() || (currentEvent == ATTRIBUTE)) {
OMAttribute attrib = getAttribute((OMElement) lastNode, i);
if (attrib != null) {
- returnString = attrib.getValue();
+ returnString = attrib.getAttributeValue();
}
} else {
throw new IllegalStateException(
@@ -647,7 +647,7 @@
QName qname = new QName(s, s1);
OMAttribute attrib = ((OMElement) lastNode).getAttribute(qname);
if (attrib != null) {
- returnString = attrib.getValue();
+ returnString = attrib.getAttributeValue();
}
} else {
throw new IllegalStateException(
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMTextImpl.java Tue Oct 18 07:37:12 2005
@@ -385,13 +385,13 @@
namespaceName = ns.getName();
if (prefix != null) {
writer.writeAttribute(prefix, namespaceName, attr
- .getLocalName(), attr.getValue());
+ .getLocalName(), attr.getAttributeValue());
} else {
writer.writeAttribute(namespaceName, attr.getLocalName(), attr
- .getValue());
+ .getAttributeValue());
}
} else {
- writer.writeAttribute(attr.getLocalName(), attr.getValue());
+ writer.writeAttribute(attr.getLocalName(), attr.getAttributeValue());
}
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/traverse/OMChildrenWithSpecificAttributeIterator.java Tue Oct 18 07:37:12 2005
@@ -83,7 +83,7 @@
((OMElement) currentChild).getFirstAttribute(
attributeName);
if ((attr != null)
- && attr.getValue().equalsIgnoreCase(attributeValue)) {
+ && attr.getAttributeValue().equalsIgnoreCase(attributeValue)) {
isMatchingNodeFound = true;
needToMoveForward = false;
} else {
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/xpath/DocumentNavigator.java Tue Oct 18 07:37:12 2005
@@ -249,7 +249,7 @@
* @return the string-value of the node
*/
public String getAttributeStringValue(Object object) {
- return ((OMAttribute) object).getValue();
+ return ((OMAttribute) object).getAttributeValue();
}
/**
@@ -711,12 +711,12 @@
attribute.setLocalName(localName);
}
- public String getValue() {
- return attribute.getValue();
+ public String getAttributeValue() {
+ return attribute.getAttributeValue();
}
- public void setValue(String value) {
- attribute.setValue(value);
+ public void setAttributeValue(String value) {
+ attribute.setAttributeValue(value);
}
public void setOMNamespace(OMNamespace omNamespace) {
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultTextImpl.java Tue Oct 18 07:37:12 2005
@@ -64,6 +64,6 @@
SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX));
}
- return langAttr == null ? null : langAttr.getValue();
+ return langAttr == null ? null : langAttr.getAttributeValue();
}
}
Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPHeaderBlockImpl.java Tue Oct 18 07:37:12 2005
@@ -71,7 +71,7 @@
OMAttribute omAttribute = this.getFirstAttribute(
new QName(soapEnvelopeNamespaceURI, attributeName));
if (omAttribute != null) {
- omAttribute.setValue(attrValue);
+ omAttribute.setAttributeValue(attrValue);
} else {
OMAttribute attribute = new OMAttributeImpl(attributeName,
new OMNamespaceImpl(soapEnvelopeNamespaceURI,
@@ -92,7 +92,7 @@
OMAttribute omAttribute = this.getFirstAttribute(
new QName(soapEnvelopeNamespaceURI, attrName));
return (omAttribute != null)
- ? omAttribute.getValue()
+ ? omAttribute.getAttributeValue()
: null;
}
Modified: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestUtils.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestUtils.java (original)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestUtils.java Tue Oct 18 07:37:12 2005
@@ -89,7 +89,7 @@
if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
Attr attr = (Attr) node;
TestCase.assertEquals(attr.getValue(),
- omattribute.getValue());
+ omattribute.getAttributeValue());
} else {
throw new OMException("return type is not a Attribute");
}
Added: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java?rev=326115&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java (added)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/DocumentImplTest.java Tue Oct 18 07:37:12 2005
@@ -0,0 +1,64 @@
+/*
+ * 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.axis2.om.impl.dom;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+import junit.framework.TestCase;
+
+public class DocumentImplTest extends TestCase {
+
+
+
+
+ public DocumentImplTest() {
+ super();
+ }
+
+ public DocumentImplTest(String name) {
+ super(name);
+ }
+
+ public void testCreateElement() {
+ String tagName = "LocalName";
+ String namespace = "http://ws.apache.org/axis2/ns";
+ DocumentImpl doc = new DocumentImpl();
+ Element elem = doc.createElement(tagName);
+
+ assertEquals("Local name misnatch",tagName,elem.getLocalName());
+
+ elem = doc.createElementNS(tagName,namespace);
+ assertEquals("Local name misnatch",tagName,elem.getLocalName());
+ assertEquals("Namespace misnatch",namespace,elem.getNamespaceURI());
+
+ }
+
+ public void testCreateAttribute() {
+ String attrName = "attrIdentifier";
+ String attrValue = "attrValue";
+
+ DocumentImpl doc = new DocumentImpl();
+ Attr attr = doc.createAttribute(attrName);
+
+ assertEquals("Attr name mismatch",attrName,attr.getLocalName());
+ assertNull("Namespace value should be null", attr.getNamespaceURI());
+
+ attr.setValue(attrValue);
+
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/ElementImplTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/ElementImplTest.java?rev=326115&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/ElementImplTest.java (added)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/ElementImplTest.java Tue Oct 18 07:37:12 2005
@@ -0,0 +1,80 @@
+/*
+ * 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.axis2.om.impl.dom;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMText;
+import org.apache.axis2.om.impl.OMOutputImpl;
+import org.apache.axis2.om.impl.dom.factory.OMDOMFactory;
+import org.w3c.dom.Text;
+
+import java.io.ByteArrayOutputStream;
+
+import junit.framework.TestCase;
+
+public class ElementImplTest extends TestCase {
+
+ public ElementImplTest() {
+ super();
+ }
+
+ public ElementImplTest(String name) {
+ super(name);
+ }
+
+ public void testSetText() {
+ OMDOMFactory factory = new OMDOMFactory();
+ String localName = "TestLocalName";
+ String namespace = "http://ws.apache.org/axis2/ns";
+ String prefix = "axis2";
+ OMElement elem = factory.createOMElement(localName,namespace,prefix);
+
+ String text = "The quick brown fox jumps over the lazy dog";
+
+ elem.setText(text);
+
+ assertEquals("Text value mismatch", text, elem.getText());
+
+ }
+
+ public void testSerialize() {
+ OMDOMFactory factory = new OMDOMFactory();
+ String localName = "TestLocalName";
+ String namespace = "http://ws.apache.org/axis2/ns";
+ String prefix = "axis2";
+ String tempText = "The quick brown fox jumps over the lazy dog";
+ String textToAppend = " followed by another";
+
+ OMElement elem = factory.createOMElement(localName,namespace,prefix);
+ elem.getLocalName();
+ OMText textNode = factory.createText(elem,tempText);
+
+ ((Text)textNode).appendData(textToAppend);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try {
+ OMOutputImpl output = new OMOutputImpl(baos, false);
+ elem.serialize(output);
+ output.flush();
+ System.out.println(new String(baos.toByteArray()));
+ //TODO TEMPORARY: remove this
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
+
+}
Added: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/OMDOMFactoryTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/OMDOMFactoryTest.java?rev=326115&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/OMDOMFactoryTest.java (added)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/OMDOMFactoryTest.java Tue Oct 18 07:37:12 2005
@@ -0,0 +1,48 @@
+/*
+ * 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.axis2.om.impl.dom;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.impl.dom.factory.OMDOMFactory;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+public class OMDOMFactoryTest extends TestCase{
+
+ public OMDOMFactoryTest() {
+ super();
+ }
+
+ public OMDOMFactoryTest(String name) {
+ super(name);
+ }
+
+ public void testCreateElement() {
+ OMDOMFactory factory = new OMDOMFactory();
+ String localName = "TestLocalName";
+ String namespace = "http://ws.apache.org/axis2/ns";
+ String prefix = "axis2";
+ OMElement elem = factory.createOMElement(localName,namespace,prefix);
+ QName qname = elem.getQName();
+
+ assertEquals("Localname mismatch",localName,qname.getLocalPart());
+ assertEquals("Namespace mismatch",namespace,qname.getNamespaceURI());
+ assertEquals("namespace prefix mismatch", prefix, qname.getPrefix());
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/TextImplTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/TextImplTest.java?rev=326115&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/TextImplTest.java (added)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/dom/TextImplTest.java Tue Oct 18 07:37:12 2005
@@ -0,0 +1,66 @@
+/*
+ * 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.axis2.om.impl.dom;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMText;
+import org.apache.axis2.om.impl.dom.factory.OMDOMFactory;
+import org.w3c.dom.Text;
+
+import junit.framework.TestCase;
+
+public class TextImplTest extends TestCase {
+
+ public TextImplTest() {
+ super();
+ }
+
+ public TextImplTest(String name) {
+ super(name);
+ }
+
+ public void testSetText() {
+ OMDOMFactory factory = new OMDOMFactory();
+ String localName = "TestLocalName";
+ String namespace = "http://ws.apache.org/axis2/ns";
+ String prefix = "axis2";
+ String tempText = "The quick brown fox jumps over the lazy dog";
+
+ OMElement elem = factory.createOMElement(localName,namespace,prefix);
+ OMText textNode = factory.createText(elem,tempText);
+
+ assertEquals("Text value mismatch", tempText, textNode.getText());
+ }
+
+ public void testAppendText() {
+ OMDOMFactory factory = new OMDOMFactory();
+ String localName = "TestLocalName";
+ String namespace = "http://ws.apache.org/axis2/ns";
+ String prefix = "axis2";
+ String tempText = "The quick brown fox jumps over the lazy dog";
+ String textToAppend = " followed by another fox";
+
+ OMElement elem = factory.createOMElement(localName,namespace,prefix);
+ OMText textNode = factory.createText(elem,tempText);
+
+ ((Text)textNode).appendData(textToAppend);
+
+ assertEquals("Text value mismatch", tempText+textToAppend, textNode.getText());
+ }
+
+
+
+}
Modified: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java?rev=326115&r1=326114&r2=326115&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java (original)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java Tue Oct 18 07:37:12 2005
@@ -151,7 +151,7 @@
assertTrue("SOAP 1.2 :- Role value mismatch",
- roleAttribute.getValue().trim().equals(
+ roleAttribute.getAttributeValue().trim().equals(
SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI + "/" +
SOAP12Constants.SOAP_ROLE +
"/" +
@@ -165,7 +165,7 @@
mustUnderstandAttribute.getLocalName().equals(
SOAPConstants.ATTR_MUSTUNDERSTAND));
assertTrue("SOAP 1.2 :- Mustunderstand value mismatch",
- mustUnderstandAttribute.getValue().equals(
+ mustUnderstandAttribute.getAttributeValue().equals(
SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE));
assertTrue(
"SOAP 1.2 :- Mustunderstand attribute namespace uri mismatch",
@@ -332,7 +332,7 @@
attributeInMaxTime.getNamespace().getName().equals(
"http:www.sample.org"));
assertTrue("SOAP 1.2 :- Attribute value mismatch",
- attributeInMaxTime.getValue().trim().equals("This is only a test"));
+ attributeInMaxTime.getAttributeValue().trim().equals("This is only a test"));
iteratorInDetail.next();
OMElement element2 = (OMElement) iteratorInDetail.next();
@@ -395,7 +395,7 @@
mustUnderstandAttribute.getLocalName().equals(
SOAPConstants.ATTR_MUSTUNDERSTAND));
assertTrue("SOAP 1.1 :- Mustunderstand value mismatch",
- mustUnderstandAttribute.getValue().equals(
+ mustUnderstandAttribute.getAttributeValue().equals(
SOAPConstants.ATTR_MUSTUNDERSTAND_1));
assertTrue(
"SOAP 1.1 :- Mustunderstand attribute namespace uri mismatch",
@@ -407,7 +407,7 @@
actorAttribute.getLocalName().equals(
SOAP11Constants.ATTR_ACTOR));
assertTrue("SOAP 1.1 :- Actor value mismatch",
- actorAttribute.getValue().trim().equals(
+ actorAttribute.getAttributeValue().trim().equals(
"http://schemas.xmlsoap.org/soap/" +
SOAP11Constants.ATTR_ACTOR +
"/" +
@@ -495,7 +495,7 @@
attributeInMaxTime.getNamespace().getName().equals(
"http:www.sample.org"));
assertTrue("SOAP 1.1 :- Attribute value mismatch",
- attributeInMaxTime.getValue().equals("This is only a test"));
+ attributeInMaxTime.getAttributeValue().equals("This is only a test"));
iteratorInDetail.next();
element2 = (OMElement) iteratorInDetail.next();