You are talking about axis 1.x right and
javax.xml.rpc.server.ServiceLifecycle ? If so I can't help too much
since I'm pretty much axis2 only these days. What I can say is that it
is pretty common to do Spring unit tests by creating your own object
factory:

protected static void createBeanFactory() {
       ResourceBundle objFactoryBundle = ResourceBundle.
           getBundle("objectFactory");
       String path = objFactoryBundle.getString("paths");
       String[] paths = path.split(" ");
       ClassPathXmlApplicationContext appContext =
           new ClassPathXmlApplicationContext(paths);
       factory = (BeanFactory) appContext;

   }

Then you get your beans like so:

public static Object getObject(String name) {
       if (factory == null) {
           createBeanFactory();
       }
       Object bean = null;
       try {
           bean = factory.getBean(name);
       } catch (Exception e) {
           log.fatal("can't create bean: " + name, e);
           new IllegalParameterException(IllegalParameterException
                   .APPLICATION_RESOURCE_ERROR_INTERNAL, null, e);
       }
       return bean;
   }

So the unit tests don't actually configure the beans via a servlet.

HTH,
Robert

On 3/22/07, Josh <[EMAIL PROTECTED]> wrote:
Hello,

I am trying to figure out how to write a JUnit test case that can test my
service endpoint outside of the servlet container. My axis service endpoint
extends springs ServletEndpointSupport but I cannot seem to find any mock
objects that will help me initialize this object correctly.

To initialize the servlet, I need to call the init method from the
ServiceLifecycle Interface:

init(Object context)

Trouble is, the context here is of the type
javax.xml.rpc.server.ServletEndpointContext . As I
mentioned earlier, I have been unable to find any Mock objects for this
class. Can someone point me to an example?

Regards,

Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to