JBossWS SVN: r8285 - common/trunk/src/main/java/org/jboss/wsf/common.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-29 09:23:16 -0400 (Mon, 29 Sep 2008)
New Revision: 8285
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
Log:
[JBWS-2325] fixing issue
Modified: common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2008-09-29 11:55:34 UTC (rev 8284)
+++ common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2008-09-29 13:23:16 UTC (rev 8285)
@@ -157,6 +157,10 @@
{
throw new IOException(se.toString());
}
+ finally
+ {
+ xmlStream.close();
+ }
}
/** Parse the given input source and return the root Element
@@ -171,6 +175,19 @@
{
throw new IOException(se.toString());
}
+ finally
+ {
+ InputStream is = source.getByteStream();
+ if (is != null)
+ {
+ is.close();
+ }
+ Reader r = source.getCharacterStream();
+ if (r != null)
+ {
+ r.close();
+ }
+ }
}
/** Create an Element for a given name
16 years, 3 months
JBossWS SVN: r8284 - in stack/native/trunk/modules/core/src/main/java/org/jboss: wsf/stack/jbws and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-29 07:55:34 -0400 (Mon, 29 Sep 2008)
New Revision: 8284
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
Log:
[JBWS-2325] fixing issue
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2008-09-29 11:01:57 UTC (rev 8283)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2008-09-29 11:55:34 UTC (rev 8284)
@@ -138,8 +138,14 @@
appendDefinitions(builder, namespace);
appendBody(builder, namespace);
- writeBuilder(builder, resolved.writer, resolved.charset);
- resolved.writer.close();
+ try
+ {
+ writeBuilder(builder, resolved.writer, resolved.charset);
+ }
+ finally
+ {
+ resolved.writer.close();
+ }
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-09-29 11:01:57 UTC (rev 8283)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2008-09-29 11:55:34 UTC (rev 8284)
@@ -347,6 +347,14 @@
// clear thread local storage
ThreadLocalAssociation.clear();
DOMUtils.clearThreadLocals();
+ try
+ {
+ outStream.close();
+ }
+ catch (IOException ex)
+ {
+ WSException.rethrow(ex);
+ }
}
}
@@ -384,8 +392,15 @@
SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
DOMDocumentSerializer serializer = new DOMDocumentSerializer();
- serializer.setOutputStream(output);
- serializer.serialize(soapEnv);
+ try
+ {
+ serializer.setOutputStream(output);
+ serializer.serialize(soapEnv);
+ }
+ finally
+ {
+ output.close();
+ }
}
// JSON support
else if (epMetaData.isFeatureEnabled(JsonEncodingFeature.class) && resMessage instanceof SOAPMessage)
@@ -400,7 +415,14 @@
}
else
{
- resMessage.writeTo(output);
+ try
+ {
+ resMessage.writeTo(output);
+ }
+ finally
+ {
+ output.close();
+ }
}
}
}
@@ -583,6 +605,7 @@
{
log.debug("handleWSDLRequest: " + endpoint.getName());
+ InputStream inStream = null;
try
{
if (context instanceof ServletRequestContext)
@@ -596,7 +619,7 @@
throw new IllegalArgumentException("Invalid endpoint address: " + epAddress);
URL wsdlUrl = new URL(epAddress + "?wsdl");
- InputStream inStream = wsdlUrl.openStream();
+ inStream = wsdlUrl.openStream();
IOUtils.copyStream(outStream, inStream);
}
}
@@ -608,6 +631,31 @@
{
throw new WSException(ex);
}
+ finally
+ {
+ try
+ {
+ outStream.close();
+ }
+ catch (IOException ioe)
+ {
+ throw new WSException(ioe);
+ }
+ finally
+ {
+ if (inStream != null)
+ {
+ try
+ {
+ inStream.close();
+ }
+ catch (IOException ioe)
+ {
+ throw new WSException(ioe);
+ }
+ }
+ }
+ }
}
private void handleWSDLRequestFromServletContext(Endpoint endpoint, OutputStream outputStream, InvocationContext context) throws MalformedURLException, IOException
@@ -635,8 +683,16 @@
WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
Document document = wsdlRequestHandler.getDocumentForPath(reqURL, wsdlHost, resPath);
- OutputStreamWriter writer = new OutputStreamWriter(outputStream);
- new DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
+ OutputStreamWriter writer = null;
+ try
+ {
+ writer = new OutputStreamWriter(outputStream);
+ new DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
+ }
+ finally
+ {
+ writer.close();
+ }
}
private void handleException(Exception ex) throws ServletException
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2008-09-29 11:01:57 UTC (rev 8283)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2008-09-29 11:55:34 UTC (rev 8284)
@@ -104,9 +104,10 @@
wsdlFile.getParentFile().mkdirs();
// Get the wsdl definition and write it to the wsdl publish location
+ Writer fWriter = null;
try
{
- Writer fWriter = IOUtils.getCharsetFileWriter(wsdlFile, Constants.DEFAULT_XML_CHARSET);
+ fWriter = IOUtils.getCharsetFileWriter(wsdlFile, Constants.DEFAULT_XML_CHARSET);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
new WSDLWriter(wsdlDefinitions).write(fWriter, Constants.DEFAULT_XML_CHARSET);
@@ -140,6 +141,13 @@
{
throw new WSException("Cannot publish wsdl to: " + wsdlFile, e);
}
+ finally
+ {
+ if (fWriter != null)
+ {
+ fWriter.close();
+ }
+ }
}
}
@@ -242,16 +250,37 @@
if (is == null)
throw new IllegalArgumentException("Cannot find schema import in deployment: " + resourcePath);
- FileOutputStream fos = new FileOutputStream(targetFile);
- IOUtils.copyStream(fos, is);
- fos.close();
- is.close();
+ FileOutputStream fos = null;
+ try
+ {
+ fos = new FileOutputStream(targetFile);
+ IOUtils.copyStream(fos, is);
+ }
+ finally
+ {
+ try
+ {
+ if (fos != null) fos.close();
+ }
+ finally
+ {
+ is.close();
+ }
+ }
log.debug("XMLSchema import published to: " + xsdURL);
- // recursivly publish imports
- Element subdoc = DOMUtils.parse(xsdURL.openStream());
- publishSchemaImports(xsdURL, subdoc, published);
+ // recursively publish imports
+ InputStream xsdStream = xsdURL.openStream();
+ try
+ {
+ Element subdoc = DOMUtils.parse(xsdStream);
+ publishSchemaImports(xsdURL, subdoc, published);
+ }
+ finally
+ {
+ xsdStream.close();
+ }
}
}
}
16 years, 3 months
JBossWS SVN: r8283 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws: core/jaxws and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-09-29 07:01:57 -0400 (Mon, 29 Sep 2008)
New Revision: 8283
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/Constants.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/ObjectContent.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
Log:
[JBPAPP-919] Porting fixes for JBWS-2270 and JBWS-2207
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/Constants.java 2008-09-29 06:14:54 UTC (rev 8282)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/Constants.java 2008-09-29 11:01:57 UTC (rev 8283)
@@ -315,4 +315,6 @@
static final String WSDL20_PATTERN_OUT_OPT_IN = "http://www.w3.org/2004/08/wsdl/out-opt-in";
static final String ASYNC_METHOD_SUFFIX = "Async";
+
+ static final String EAGER_INITIALIZE_JAXB_CONTEXT_CACHE = "org.jboss.ws.eagerInitializeJAXBContextCache";
}
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2008-09-29 06:14:54 UTC (rev 8282)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2008-09-29 11:01:57 UTC (rev 8283)
@@ -23,18 +23,6 @@
// $Id$
-import org.jboss.ws.extensions.xop.jaxws.AttachmentUnmarshallerImpl;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.TypeMappingImpl;
-import org.jboss.ws.core.binding.ComplexTypeDeserializer;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.binding.BindingCustomization;
-
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
@@ -42,6 +30,14 @@
import javax.xml.transform.Source;
import javax.xml.ws.WebServiceException;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.ComplexTypeDeserializer;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.binding.TypeMappingImpl;
+import org.jboss.ws.extensions.xop.jaxws.AttachmentUnmarshallerImpl;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+
/**
* A Deserializer that can handle complex types by delegating to JAXB.
*
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2008-09-29 06:14:54 UTC (rev 8282)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2008-09-29 11:01:57 UTC (rev 8283)
@@ -23,14 +23,8 @@
// $Id$
-import org.jboss.logging.Logger;
-import org.jboss.ws.extensions.xop.jaxws.AttachmentMarshallerImpl;
-import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.binding.ComplexTypeSerializer;
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.binding.BufferedStreamResult;
-import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.w3c.dom.NamedNodeMap;
+import java.util.Arrays;
+import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
@@ -40,6 +34,15 @@
import javax.xml.transform.Result;
import javax.xml.ws.WebServiceException;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.binding.BindingException;
+import org.jboss.ws.core.binding.BufferedStreamResult;
+import org.jboss.ws.core.binding.ComplexTypeSerializer;
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.extensions.xop.jaxws.AttachmentMarshallerImpl;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.w3c.dom.NamedNodeMap;
+
/**
* A Serializer that can handle complex types by delegating to JAXB.
*
@@ -63,11 +66,9 @@
Result result = null;
try
{
- // The serialization context contains the base type, which is needed for JAXB to marshall xsi:type correctly.
- // This should be more efficient and accurate than searching the type mapping
Class expectedType = serContext.getJavaType();
- Class actualType = value.getClass();
- Class[] types = shouldFilter(actualType) ? new Class[]{expectedType} : new Class[]{expectedType, actualType};
+ Class[] types = getClassesForContextCreation(serContext, value);
+
JAXBContext jaxbContext = getJAXBContext(types);
Marshaller marshaller = jaxbContext.createMarshaller();
@@ -91,6 +92,26 @@
}
/**
+ * Selects the array of classes to use to create the JAXBContext, as
+ * using the array of types registered for the current endpoint saves time.
+ *
+ * @param serContext
+ * @param value
+ * @return
+ */
+ private Class[] getClassesForContextCreation(SerializationContext serContext, Object value)
+ {
+ // The serialization context contains the base type, which is needed for JAXB to marshall xsi:type correctly.
+ // This should be more efficient and accurate than searching the type mapping
+ Class expectedType = serContext.getJavaType();
+ Class actualType = value.getClass();
+ Class[] types = shouldFilter(actualType) ? new Class[] { expectedType } : new Class[] { expectedType, actualType };
+ Class[] registeredTypes = (Class[])serContext.getProperty(SerializationContextJAXWS.JAXB_CONTEXT_TYPES);
+ List<Class> typesList = Arrays.asList(registeredTypes);
+ return typesList.containsAll(Arrays.asList(types)) ? registeredTypes : types;
+ }
+
+ /**
* Retrieve JAXBContext from cache or create new one and cache it.
* @param types
* @return JAXBContext
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/ObjectContent.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/ObjectContent.java 2008-09-29 06:14:54 UTC (rev 8282)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/ObjectContent.java 2008-09-29 11:01:57 UTC (rev 8283)
@@ -22,6 +22,7 @@
package org.jboss.ws.core.soap;
import java.lang.reflect.Method;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
@@ -36,6 +37,9 @@
import org.jboss.ws.core.binding.SerializerSupport;
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.jaxrpc.binding.NullValueSerializer;
+import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.wsf.common.JavaUtils;
/**
@@ -140,6 +144,10 @@
SerializationContext serContext = msgContext.getSerializationContext();
serContext.setJavaType(javaType);
+ ParameterMetaData pmd = container.getParamMetaData();
+ OperationMetaData opMetaData = pmd.getOperationMetaData();
+ List<Class> registeredTypes = opMetaData.getEndpointMetaData().getRegisteredTypes();
+ serContext.setProperty(SerializationContextJAXWS.JAXB_CONTEXT_TYPES, registeredTypes.toArray(new Class[0]));
TypeMappingImpl typeMapping = serContext.getTypeMapping();
XMLFragment xmlFragment = null;
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-09-29 06:14:54 UTC (rev 8282)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-09-29 11:01:57 UTC (rev 8283)
@@ -39,6 +39,7 @@
import java.util.Set;
import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.bind.JAXBContext;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.ws.Service.Mode;
@@ -505,6 +506,7 @@
eagerInitializeOperations();
eagerInitializeTypes();
eagerInitializeAccessors();
+ eagerInitializeJAXBContextCache();
}
private void eagerInitializeOperations()
@@ -640,6 +642,30 @@
}
}
+ private void eagerInitializeJAXBContextCache()
+ {
+ // initialize jaxb context cache
+ if ("true".equalsIgnoreCase(System.getProperty(Constants.EAGER_INITIALIZE_JAXB_CONTEXT_CACHE)))
+ {
+ log.debug("Initializing JAXBContext cache...");
+ BindingCustomization bindingCustomization = null;
+ if (this instanceof ServerEndpointMetaData)
+ {
+ bindingCustomization = ((ServerEndpointMetaData)this).getEndpoint().getAttachment(BindingCustomization.class);
+ }
+ try
+ {
+ Class[] classes = getRegisteredTypes().toArray(new Class[0]);
+ JAXBContext context = JAXBContextFactory.newInstance().createContext(classes, bindingCustomization);
+ jaxbCache.add(classes, context);
+ }
+ catch (Exception e)
+ {
+ // ignore
+ }
+ }
+ }
+
private void createAccessor(ParameterMetaData paramMetaData, JAXBRIContext jaxbCtx)
{
AccessorFactoryCreator factoryCreator = paramMetaData.getAccessorFactoryCreator();
16 years, 3 months
JBossWS SVN: r8282 - in common/trunk/src/main/java/org/jboss/wsf: test and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-29 02:14:54 -0400 (Mon, 29 Sep 2008)
New Revision: 8282
Removed:
common/trunk/src/main/java/org/jboss/wsf/common/concurrent/CopyJob.java
Modified:
common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java
Log:
[JBWS-2322] Removing copy thread capability
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/concurrent/CopyJob.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/concurrent/CopyJob.java 2008-09-28 20:19:48 UTC (rev 8281)
+++ common/trunk/src/main/java/org/jboss/wsf/common/concurrent/CopyJob.java 2008-09-29 06:14:54 UTC (rev 8282)
@@ -1,142 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.common.concurrent;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * Sample usage:
- *
- * <blockquote><pre>
- * CopyJob copyJob = new CopyJob( inputStream, printStream );
- * new Thread( copyJob ).start();
- * try
- * {
- * // do some other staff
- * ...
- * }
- * finally
- * {
- * copyJob.kill();
- * }
- * </pre></blockquote>
- *
- * @author richard.opalka(a)jboss.com
- */
-public final class CopyJob implements Runnable
-{
-
- /**
- * Input stream to data read from.
- */
- private final InputStream is;
- /**
- * Output stream to write data to.
- */
- private final OutputStream os;
- /**
- * Whether this job is terminated.
- */
- private boolean terminated;
-
- /**
- * Constructor.
- * @param is input stream to read data from
- * @param os output stream to write data to
- */
- public CopyJob( InputStream is, OutputStream os )
- {
- super();
-
- if ( ( is == null ) || ( os == null ) )
- {
- throw new IllegalArgumentException( "Constructor parameters can't be null" );
- }
-
- this.is = is;
- this.os = os;
- }
-
- /**
- * Copies all data from <b>input stream</b> to <b>output stream</b> (both passed to constructor) until job is killed
- */
- public final void run()
- {
- try
- {
- copy( this.is, this.os );
- }
- catch ( IOException ioe )
- {
- ioe.printStackTrace(System.err);
- }
- finally
- {
- try { this.is.close(); } catch ( IOException ioe ) { ioe.printStackTrace( System.err ); }
- }
- }
-
- /**
- * Copies all data from <b>is</b> to <b>os</b> until job is killed
- * @param is input stream to read data from
- * @param os output stream to write data to
- * @throws IOException if I/O error occurs
- */
- private void copy( final InputStream is, final OutputStream os ) throws IOException
- {
- final byte[] buffer = new byte[ 512 ];
- int countOfBytes = -1;
-
- while ( !this.terminated )
- {
- while ( is.available() <= 0 )
- {
- synchronized( this )
- {
- try
- {
- this.wait( 50 ); // guard
- if ( this.terminated ) return;
- }
- catch ( InterruptedException ie )
- {
- ie.printStackTrace( System.err );
- }
- }
- }
-
- countOfBytes = is.read( buffer, 0, buffer.length );
- os.write( buffer, 0, countOfBytes );
- }
- }
-
- /**
- * Kills this job. Calling this method also ensures that input stream passed to the constructor will be closed properly
- */
- public final void kill()
- {
- this.terminated = true;
- }
-
-}
\ No newline at end of file
Modified: common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2008-09-28 20:19:48 UTC (rev 8281)
+++ common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2008-09-29 06:14:54 UTC (rev 8282)
@@ -41,7 +41,6 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.common.IOUtils;
-import org.jboss.wsf.common.concurrent.CopyJob;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -54,9 +53,7 @@
*/
public abstract class JBossWSTest extends TestCase
{
- // provide logging
protected Logger log = Logger.getLogger(getClass().getName());
-
private JBossWSTestHelper delegate = new JBossWSTestHelper();
public JBossWSTest()
@@ -109,19 +106,23 @@
*/
public void executeCommand(String command, OutputStream os, String message) throws IOException
{
- if ( command == null )
+ if (command == null)
throw new NullPointerException( "Command cannot be null" );
System.out.println("Executing command: " + command);
-
Process p = Runtime.getRuntime().exec(command);
- CopyJob job = new CopyJob(p.getInputStream(), os == null ? System.out : os);
- // unfortunately the following thread is needed (otherwise it will not work on windows)
- new Thread( job ).start();
- int statusCode = -1;
+ System.out.println("Process input stream:");
+ IOUtils.copyStream(os == null ? System.out : os, p.getInputStream());
try
{
- statusCode = p.waitFor();
+ int statusCode = p.waitFor();
+ if (statusCode != 0)
+ {
+ System.err.println("Process error stream:");
+ IOUtils.copyStream(System.err, p.getErrorStream());
+ }
+ String fallbackMessage = "Process did exit with status " + statusCode;
+ assertTrue(message != null ? message : fallbackMessage, statusCode == 0);
}
catch (InterruptedException ie)
{
@@ -129,21 +130,8 @@
}
finally
{
- job.kill();
p.destroy();
}
-
- // check status code
- if (statusCode != 0)
- {
- System.err.println("Error stream");
- System.err.println();
- IOUtils.copyStream(System.err, p.getErrorStream());
- System.err.println();
- }
-
- String fallbackMessage = "Process did exit with status " + statusCode;
- assertTrue(message != null ? message : fallbackMessage, statusCode == 0);
}
public MBeanServerConnection getServer() throws NamingException
@@ -262,7 +250,6 @@
if (expStr.equals(wasStr) == false)
{
System.out.println("\nExp: " + expStr + "\nWas: " + wasStr);
- Logger.getLogger(JBossWSTest.class).error("\nExp: " + expStr + "\nWas: " + wasStr);
}
assertEquals(expStr, wasStr);
}
16 years, 3 months
JBossWS SVN: r8281 - stack/native/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-28 16:19:48 -0400 (Sun, 28 Sep 2008)
New Revision: 8281
Added:
stack/native/branches/dlofthouse/JBWS-1999/
Log:
Branch working area.
Copied: stack/native/branches/dlofthouse/JBWS-1999 (from rev 8280, stack/native/trunk)
16 years, 3 months
JBossWS SVN: r8280 - in framework/trunk/testsuite/test: java/org/jboss/test/ws/projectGenerator and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-28 13:30:49 -0400 (Sun, 28 Sep 2008)
New Revision: 8280
Modified:
framework/trunk/testsuite/test/ant-import/build-testsuite.xml
framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java
Log:
[JBWS-2322] final regression fix
Modified: framework/trunk/testsuite/test/ant-import/build-testsuite.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-testsuite.xml 2008-09-28 14:21:25 UTC (rev 8279)
+++ framework/trunk/testsuite/test/ant-import/build-testsuite.xml 2008-09-28 17:30:49 UTC (rev 8280)
@@ -423,6 +423,7 @@
<sysproperty key="org.jboss.ws.wsse.trustStoreType" value="jks"/>
<sysproperty key="test.archive.directory" value="${tests.output.dir}/test-libs"/>
<sysproperty key="test.resources.directory" value="${tests.output.dir}/test-resources"/>
+ <sysproperty key="binary.distribution" value="true"/>
<classpath>
<path refid="tests.client.classpath"/>
<pathelement location="${tests.output.dir}/test-classes"/>
@@ -483,6 +484,7 @@
<sysproperty key="org.jboss.ws.wsse.trustStoreType" value="jks"/>
<sysproperty key="test.archive.directory" value="${tests.output.dir}/test-libs"/>
<sysproperty key="test.resources.directory" value="${tests.output.dir}/test-resources"/>
+ <sysproperty key="binary.distribution" value="true"/>
<classpath>
<path refid="tests.client.classpath"/>
<pathelement location="${tests.output.dir}/test-classes"/>
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java 2008-09-28 14:21:25 UTC (rev 8279)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java 2008-09-28 17:30:49 UTC (rev 8280)
@@ -22,7 +22,6 @@
package org.jboss.test.ws.projectGenerator;
import java.io.BufferedWriter;
-import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
import java.net.URL;
@@ -31,7 +30,6 @@
import javax.xml.ws.Service;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
/**
* A test case for the user project generator:
@@ -160,20 +158,6 @@
private boolean isDistroTest() throws Exception
{
- if (binDistroDir == null)
- return false;
-
- File build = new File(binDistroDir, "build.xml");
- if (!build.exists())
- {
- String testResDir = JBossWSTestHelper.getTestResourcesDir();
- build = new File(testResDir.substring(0, testResDir.lastIndexOf("modules")) + "build.xml");
- }
- if (!build.exists())
- throw new Exception("Unable to find build.xml!");
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- executeCommand(ANT_SHELL + " -f " + build.getAbsolutePath() + " -p", baos);
- return !(new String(baos.toByteArray()).contains("build-bin-dist"));
+ return Boolean.getBoolean("binary.distribution");
}
}
16 years, 3 months
JBossWS SVN: r8279 - framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-28 10:21:25 -0400 (Sun, 28 Sep 2008)
New Revision: 8279
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java
Log:
[JBWS-2322] fixing hudson regression
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java 2008-09-28 14:20:42 UTC (rev 8278)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java 2008-09-28 14:21:25 UTC (rev 8279)
@@ -50,7 +50,6 @@
private static final String PS = System.getProperty("path.separator"); // ':' on unix, ';' on windows
private static final String ANT_SHELL = ":".equals( PS ) ? "ant" : "ant.bat";
private String jbossHome;
- private File workspaceHome;
private File binDistroDir;
private String projectName = "GeneratorTestProject";
@@ -61,8 +60,7 @@
{
super.setUp();
jbossHome = System.getProperty("jboss.home").replace('\\', '/');
- workspaceHome = new File(".");
- binDistroDir = new File("..");
+ binDistroDir = new File(System.getProperty("user.dir"), "..");
}
public void testGenerator() throws Exception
@@ -78,7 +76,7 @@
String integrationTarget = System.getProperty("jbossws.integration.target");
executeCommand(ANT_SHELL + " -f " + distroBuild.getAbsolutePath() + " -D" + integrationTarget + ".home=" + jbossHome + " -Djbossws.integration.target="
+ integrationTarget + " create-project", "Error while creating the user project!");
- File projectHomeDir = new File(workspaceHome, projectName);
+ File projectHomeDir = new File(binDistroDir, projectName);
File packageDir = new File(projectHomeDir.getCanonicalPath() + FS + "src" + FS + "main" + FS + "java" + FS + "org" + FS + "jboss" + FS + "test" + FS + "ws" + FS + "projectGenerator");
packageDir.mkdirs();
File endpointImpl = new File(packageDir, "EndpointImpl.java");
@@ -151,10 +149,10 @@
StringBuffer sb = new StringBuffer();
sb.append("#JBossWS user project generator test\n");
sb.append("project.name=" + projectName + "\n");
- sb.append("project.jboss.home=" + jbossHome + "\n");
+ sb.append("project.jboss.home=" + jbossHome.replace('\\', '/') + "\n");
sb.append("project.type=jar\n");
sb.append("project.jboss.conf=default\n");
- sb.append("workspace.home=" + workspaceHome.getCanonicalPath().replace('\\', '/') + "\n");
+ sb.append("workspace.home=" + binDistroDir.getAbsolutePath().replace('\\', '/') + "\n");
BufferedWriter out = new BufferedWriter(new FileWriter(file));
out.write(sb.toString());
out.close();
@@ -162,7 +160,10 @@
private boolean isDistroTest() throws Exception
{
- File build = new File(".." + FS + "build.xml");
+ if (binDistroDir == null)
+ return false;
+
+ File build = new File(binDistroDir, "build.xml");
if (!build.exists())
{
String testResDir = JBossWSTestHelper.getTestResourcesDir();
16 years, 3 months
JBossWS SVN: r8278 - common/trunk/src/main/java/org/jboss/wsf/test.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-09-28 10:20:42 -0400 (Sun, 28 Sep 2008)
New Revision: 8278
Modified:
common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java
Log:
[JBWS-2322] fixing hudson regression
Modified: common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2008-09-28 07:17:40 UTC (rev 8277)
+++ common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2008-09-28 14:20:42 UTC (rev 8278)
@@ -21,10 +21,8 @@
*/
package org.jboss.wsf.test;
-import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
-import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
@@ -42,6 +40,7 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.common.concurrent.CopyJob;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -137,17 +136,10 @@
// check status code
if (statusCode != 0)
{
- System.out.println("Error stream");
- System.out.println();
- BufferedReader in = new BufferedReader(new InputStreamReader(p.getErrorStream()));
- StringBuffer buffer = new StringBuffer();
- String line;
- while ((line = in.readLine()) != null) {
- buffer.append(line + "\n");
- }
- System.out.println(buffer.toString());
- System.out.println();
- System.out.println();
+ System.err.println("Error stream");
+ System.err.println();
+ IOUtils.copyStream(System.err, p.getErrorStream());
+ System.err.println();
}
String fallbackMessage = "Process did exit with status " + statusCode;
16 years, 3 months
JBossWS SVN: r8277 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws: jaxrpc/jbws1115 and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-09-28 03:17:40 -0400 (Sun, 28 Sep 2008)
New Revision: 8277
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/addressrewrite/AddressRewriteTestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/JBWS1179TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/wseventing/EventingSupport.java
Log:
[JBPAPP-1194]-Fix Testcase failures against EAP
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/addressrewrite/AddressRewriteTestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/addressrewrite/AddressRewriteTestCase.java 2008-09-28 07:12:00 UTC (rev 8276)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/addressrewrite/AddressRewriteTestCase.java 2008-09-28 07:17:40 UTC (rev 8277)
@@ -54,6 +54,7 @@
{
wsdlLocation = "http://" + getServerHost() + ":8080/jaxrpc-addressrewrite/ValidURL?wsdl";
wsdlLocationSec = "http://" + getServerHost() + ":8080/jaxrpc-addressrewrite-sec/ValidURL?wsdl";
+ login();
modifySOAPAddress = (Boolean)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "ModifySOAPAddress");
webServiceHost = (String)getServer().getAttribute(SERVER_CONFIG_OBJECT_NAME, "WebServiceHost");
}
@@ -62,6 +63,7 @@
{
Attribute attr = new Attribute("ModifySOAPAddress", modifySOAPAddress);
getServer().setAttribute(SERVER_CONFIG_OBJECT_NAME, attr);
+ logout();
}
public void testRewrite() throws Exception
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java 2008-09-28 07:12:00 UTC (rev 8276)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1115/JBWS1115TestCase.java 2008-09-28 07:17:40 UTC (rev 8277)
@@ -41,6 +41,16 @@
{
private final ObjectName manager = ObjectNameFactory.create("jboss.ws:service=ServerConfig");
+ public void setUp() throws Exception
+ {
+ login();
+ }
+
+ public void tearDown() throws Exception
+ {
+ logout();
+ }
+
public void testDiscoverWebServicePort() throws Exception
{
MBeanServerConnection server = getServer();
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/JBWS1179TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/JBWS1179TestCase.java 2008-09-28 07:12:00 UTC (rev 8276)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/jbws1179/JBWS1179TestCase.java 2008-09-28 07:17:40 UTC (rev 8277)
@@ -87,6 +87,10 @@
MBeanServerConnection server = getServer();
ObjectName objectName = new ObjectName("jboss.web:host=localhost,path=/jaxrpc-jbws1179,type=Manager");
- return ((Integer)server.getAttribute(objectName, "activeSessions")).intValue();
+ login();
+ int asessions = ((Integer)server.getAttribute(objectName, "activeSessions")).intValue();
+ logout();
+
+ return asessions;
}
}
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java 2008-09-28 07:12:00 UTC (rev 8276)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java 2008-09-28 07:17:40 UTC (rev 8277)
@@ -55,11 +55,13 @@
{
// Deploy jbpm-bpel.sar if it is not deployed already
JBossWSTestHelper helper = new JBossWSTestHelper();
+ JBossWSTestHelper.login();
if (JBossWSTestHelper.getServer().isRegistered(oname) == false)
{
helper.deploy("jbpm-bpel.sar");
undeployOnTearDown = true;
}
+ JBossWSTestHelper.logout();
for (int i = 0; i < processFiles.length; i++)
{
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2008-09-28 07:12:00 UTC (rev 8276)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2008-09-28 07:17:40 UTC (rev 8277)
@@ -61,6 +61,7 @@
protected void setUp() throws Exception
{
MBeanServerConnection server = JBossWSTestHelper.getServer();
+ JBossWSTestHelper.login();
useJBossWebLoader = (Boolean)server.getAttribute(new ObjectName("jboss.web:service=WebServer"), "UseJBossWebLoader");
server.setAttribute(new ObjectName("jboss.web:service=WebServer"), new Attribute("UseJBossWebLoader", Boolean.TRUE));
super.setUp();
@@ -71,6 +72,7 @@
super.tearDown();
MBeanServerConnection server = JBossWSTestHelper.getServer();
server.setAttribute(new ObjectName("jboss.web:service=WebServer"), new Attribute("UseJBossWebLoader", useJBossWebLoader));
+ JBossWSTestHelper.logout();
}
};
}
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2008-09-28 07:12:00 UTC (rev 8276)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2008-09-28 07:17:40 UTC (rev 8277)
@@ -57,6 +57,7 @@
public void setUp() throws Exception
{
+ login();
// Setting the WebServiceHost to an empty string, causes the request host to be used.
// This must be done before deploy time.
webServiceHost = (String)getServer().getAttribute(objectName, "WebServiceHost");
@@ -68,6 +69,8 @@
{
super.tearDown();
getServer().setAttribute(objectName, new Attribute("WebServiceHost", webServiceHost));
+ logout();
+
}
};
return testSetup;
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/wseventing/EventingSupport.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/wseventing/EventingSupport.java 2008-09-28 07:12:00 UTC (rev 8276)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/wseventing/EventingSupport.java 2008-09-28 07:17:40 UTC (rev 8277)
@@ -92,6 +92,7 @@
protected void setUp() throws Exception
{
+ login();
if (eventSourcePort == null)
{
eventSourceURI = new URI(EVENT_SOURCE_NAME);
@@ -115,6 +116,7 @@
/*ObjectName oname = EventingConstants.getSubscriptionManagerName();
getServer().invoke(oname, "removeEventSource", new Object[] { new URI(eventSourceURI) }, new String[] { "java.net.URI" });
*/
+ logout();
}
// ----------------------------------------------------------------------------
16 years, 3 months
JBossWS SVN: r8276 - in framework/branches/jbossws-framework-2.0.1.GA_CP/src/test: etc and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-09-28 03:12:00 -0400 (Sun, 28 Sep 2008)
New Revision: 8276
Added:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/etc/auth.conf
Modified:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/ant-import/build-testsuite.xml
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/JaxrBaseTest.java
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/publish/JaxrDeleteOrganizationTestCase.java
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/publish/JaxrSaveOrganizationTestCase.java
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/query/JaxrBusinessQueryTestCase.java
Log:
[JBPAPP-1194]-Fix Testcase failures against EAP
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/ant-import/build-testsuite.xml
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/ant-import/build-testsuite.xml 2008-09-28 07:10:57 UTC (rev 8275)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/ant-import/build-testsuite.xml 2008-09-28 07:12:00 UTC (rev 8276)
@@ -294,6 +294,7 @@
<include name="jndi.properties"/>
<include name="tst.policy"/>
<include name="log4j.xml"/>
+ <include name="auth.conf"/>
</fileset>
<filterset>
<filter token="jboss.bind.address" value="${node0}"/>
@@ -407,6 +408,7 @@
<sysproperty key="jbossws.integration.target" value="${jbossws.integration.target}"/>
<sysproperty key="jmx.authentication.username" value="${jmx.authentication.username}"/>
<sysproperty key="jmx.authentication.password" value="${jmx.authentication.password}"/>
+ <sysproperty key="java.security.auth.login.config" value="${tests.output.dir}/classes/auth.conf"/>
<sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.keystore"/>
<sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.truststore"/>
<sysproperty key="org.jboss.ws.wsse.keyStorePassword" value="jbossws"/>
@@ -446,6 +448,7 @@
<sysproperty key="jbossws.integration.target" value="${jbossws.integration.target}"/>
<sysproperty key="jmx.authentication.username" value="${jmx.authentication.username}"/>
<sysproperty key="jmx.authentication.password" value="${jmx.authentication.password}"/>
+ <sysproperty key="java.security.auth.login.config" value="${tests.output.dir}/classes/auth.conf"/>
<!--
http://jira.jboss.com/jira/browse/JBWS-917
<sysproperty key="javax.net.ssl.keyStore" value="${tests.output.dir}/resources/jaxrpc/samples/wssecurity/wsse.keystore"/>
Added: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/etc/auth.conf
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/etc/auth.conf (rev 0)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/etc/auth.conf 2008-09-28 07:12:00 UTC (rev 8276)
@@ -0,0 +1,9 @@
+other {
+ // Put your login modules that work without jBoss here
+
+ // jBoss LoginModule
+ org.jboss.security.ClientLoginModule required;
+
+ // Put your login modules that need jBoss here
+
+};
\ No newline at end of file
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/JaxrBaseTest.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/JaxrBaseTest.java 2008-09-28 07:10:57 UTC (rev 8275)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/JaxrBaseTest.java 2008-09-28 07:12:00 UTC (rev 8276)
@@ -91,10 +91,12 @@
{
//Change the createonstart setting for juddi service and restart it
server = getServer();
+ login();
server.invoke(OBJECT_NAME, "setCreateOnStart", new Object[] { Boolean.TRUE }, new String[] { Boolean.TYPE.getName() });
server.invoke(OBJECT_NAME, "stop", null, null);
server.invoke(OBJECT_NAME, "start", null, null);
-
+ logout();
+
//Ensure that the Jaxr Connection Factory class is setup
String factoryString = "javax.xml.registry.ConnectionFactoryClass";
String factoryClass = System.getProperty(factoryString);
@@ -127,16 +129,18 @@
{
if (connection != null)
connection.close();
-
+
+ login();
//stop the juddi service so that all the tables are dropped
server.invoke(OBJECT_NAME, "setCreateOnStart", new Object[] { Boolean.FALSE }, new String[] { Boolean.TYPE.getName() });
server.invoke(OBJECT_NAME, "stop", null, null);
+ logout();
}
/**
* Does authentication with the uddi registry
*/
- protected void login() throws JAXRException
+ protected void jaxrLogin() throws JAXRException
{
PasswordAuthentication passwdAuth = new PasswordAuthentication(userid, passwd.toCharArray());
Set creds = new HashSet();
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/publish/JaxrDeleteOrganizationTestCase.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/publish/JaxrDeleteOrganizationTestCase.java 2008-09-28 07:10:57 UTC (rev 8275)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/publish/JaxrDeleteOrganizationTestCase.java 2008-09-28 07:12:00 UTC (rev 8276)
@@ -45,7 +45,7 @@
public String saveOrg(String orgname) throws JAXRException
{
String keyid = "";
- login();
+ jaxrLogin();
getJAXREssentials();
Collection orgs = new ArrayList();
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/publish/JaxrSaveOrganizationTestCase.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/publish/JaxrSaveOrganizationTestCase.java 2008-09-28 07:10:57 UTC (rev 8275)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/publish/JaxrSaveOrganizationTestCase.java 2008-09-28 07:12:00 UTC (rev 8276)
@@ -47,7 +47,7 @@
public void testSaveOrg() throws JAXRException
{
String keyid = "";
- login();
+ jaxrLogin();
rs = connection.getRegistryService();
Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/query/JaxrBusinessQueryTestCase.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/query/JaxrBusinessQueryTestCase.java 2008-09-28 07:10:57 UTC (rev 8275)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/jaxr/scout/query/JaxrBusinessQueryTestCase.java 2008-09-28 07:12:00 UTC (rev 8276)
@@ -48,7 +48,7 @@
{
super.setUp();
String keyid = "";
- login();
+ jaxrLogin();
getJAXREssentials();
Collection orgs = new ArrayList();
16 years, 3 months