Skip to content

Package: DeployedService

DeployedService

nameinstructionbranchcomplexitylinemethod
DeployedService(DeploymentContext, TestService)
M: 46 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
getResources()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
prepare()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2019 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: package com.sun.xml.ws.test.container;
12:
13: import com.sun.istack.NotNull;
14: import com.sun.xml.ws.test.model.TestService;
15:
16: import java.io.File;
17: import java.net.URL;
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: /**
22: * Information about running {@link TestService}.
23: *
24: * @author Kohsuke Kawaguchi
25: */
26: public final class DeployedService {
27:
28: /**
29: * The {@link DeploymentContext} that owns this service.
30: */
31: public final @NotNull DeploymentContext parent;
32:
33: /**
34: * Service that was deployed.
35: */
36: public final @NotNull TestService service;
37:
38: /**
39: * {@link Application} that represents the currently deployed service
40: * on the container.
41: *
42: * <p>
43: * This field is set when a service is deployed.
44: */
45: public Application app;
46:
47: /**
48: * Root of the working directory to store things related to this service.
49: */
50: public final @NotNull File workDir;
51:
52: /**
53: * Directory to store a war file image.
54: */
55: public final @NotNull File warDir;
56:
57: /**
58: * Classpaths to load client artifacts for this service.
59: */
60: public final List<URL> clientClasspaths = new ArrayList<URL>();
61:
62: /**
63: * The classes that represents the generated <code>Service</code> classes.
64: *
65: * This field is populated when the service is deployed
66: * and client artifacts are generated.
67: *
68: * In fromjava tests with multiple <code>@WebService</code>, you may actually
69: * get multiple service classes for one deployed service (argh!)
70: */
71: public final List<Class> serviceClass = new ArrayList<Class>();
72:
73: /*package*/ DeployedService(DeploymentContext parent, TestService service) {
74: this.parent = parent;
75: this.service = service;
76:
77: // create work directory
78: String rel = "services";
79:• if(service.name.length()>0)
80: rel += '/' + service.name;
81: this.workDir = new File(parent.workDir,rel);
82:
83: this.warDir = new File(workDir,"war");
84: }
85:
86: /**
87: * Creates working directory
88: */
89: /*package*/ void prepare() {
90: warDir.mkdirs();
91: }
92:
93: public File getResources() {
94: return parent.getResources();
95: }
96: }