This project has retired. For details please refer to its Attic page.
MockWebServiceContext xref
View Javadoc
1   /*
2    * Copyright 2013 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.juddi.auth;
17  
18  import java.security.Principal;
19  import javax.xml.ws.EndpointReference;
20  import javax.xml.ws.WebServiceContext;
21  import javax.xml.ws.handler.MessageContext;
22  import org.w3c.dom.Element;
23  
24  /**
25   *
26   * @author Alex O'Ree
27   */
28  public class MockWebServiceContext implements WebServiceContext {
29  
30      public MockWebServiceContext(String ipaddress) {
31          ctx.put(MessageContext.SERVLET_REQUEST, new MockHttpServletRequest(ipaddress));
32      }
33      private MockMessageContext ctx = new MockMessageContext();
34  
35      @Override
36      public MessageContext getMessageContext() {
37          return ctx;
38      }
39  
40      @Override
41      public Principal getUserPrincipal() {
42          return null;
43      }
44  
45      @Override
46      public boolean isUserInRole(String role) {
47          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
48      }
49  
50      @Override
51      public EndpointReference getEndpointReference(Element... referenceParameters) {
52          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
53      }
54  
55      @Override
56      public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters) {
57          throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
58      }
59  }