Skip to content

Package: LocalApplication

LocalApplication

nameinstructionbranchcomplexitylinemethod
LocalApplication(WAR, URI)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getEndpointAddress(TestEndpoint)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getWSDL()
M: 24 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
undeploy()
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Distribution License v. 1.0, which is available at
6: * http://www.eclipse.org/org/documents/edl-v10.php.
7: *
8: * SPDX-License-Identifier: BSD-3-Clause
9: */
10:
11: /*
12: * LocalApplication.java
13: *
14: * Created on June 28, 2006, 10:03 PM
15: *
16: * To change this template, choose Tools | Template Manager
17: * and open the template in the editor.
18: */
19:
20: package com.sun.xml.ws.test.container.local;
21:
22: import com.sun.istack.NotNull;
23: import com.sun.xml.ws.test.container.Application;
24: import com.sun.xml.ws.test.container.WAR;
25: import com.sun.xml.ws.test.model.TestEndpoint;
26:
27: import java.io.File;
28: import java.net.URI;
29: import java.net.URL;
30: import java.util.ArrayList;
31: import java.util.List;
32:
33: /**
34: * {@link Application} implementation for {@link LocalApplicationContainer}.
35: *
36: * @author ken
37: * @deprecated
38: * To be removed once in-vm transport becomes ready
39: */
40: final class LocalApplication implements Application {
41:
42: private final @NotNull WAR war;
43:
44: /**
45: * "local://path/to/exploded/dir" portion of the endpoint address.
46: * Adding "?portName" makes it the full endpoint address.
47: */
48: private final @NotNull URI baseEndpointAddress;
49:
50: /** Creates a new instance of LocalApplication */
51: LocalApplication(@NotNull WAR war, URI endpointAddress) {
52: this.war = war;
53: this.baseEndpointAddress = endpointAddress;
54: }
55:
56: /**
57: * Returns the actual endpoint address to which the given {@link TestEndpoint}
58: * is deployed.
59: */
60: @NotNull
61: public URI getEndpointAddress(@NotNull TestEndpoint endpoint) throws Exception {
62: return new URI(baseEndpointAddress.toString() + '?' + endpoint.name);
63: }
64:
65: /**
66: * Gets the WSDL of this service.
67: *
68: * <p>
69: * This WSDL will be compiled to generate client artifacts during a test.
70: */
71: @NotNull
72: public List<URL> getWSDL() throws Exception {
73: List<URL> urls = new ArrayList<URL>();
74:• for (File w : war.getWSDL()) {
75: urls.add(w.toURL());
76: }
77: return urls;
78: }
79:
80: /**
81: * Removes this application from the container.
82: */
83: public void undeploy() throws Exception {
84: // no-op. don't clean up artifacts since those are often necessary
85: // to diagnose problems when the user is debugging a problem.
86:
87: // instead, clean up is done in LocalApplicationContainer.deploy()
88: }
89: }