1554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe/*
2554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * Copyright (C) 2015 The Android Open Source Project
3554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe *
4554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * Licensed under the Apache License, Version 2.0 (the "License");
5554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * you may not use this file except in compliance with the License.
6554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * You may obtain a copy of the License at
7554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe *
8554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe *      http://www.apache.org/licenses/LICENSE-2.0
9554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe *
10554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * Unless required by applicable law or agreed to in writing, software
11554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * distributed under the License is distributed on an "AS IS" BASIS,
12554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * See the License for the specific language governing permissions and
14554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe * limitations under the License.
15554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe */
16554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
17554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampepackage com.android.preload.classdataretrieval.jdwp;
18554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
19554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport com.android.ddmlib.Client;
20554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport com.android.preload.classdataretrieval.ClassDataRetriever;
21554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
22554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket;
23554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport org.apache.harmony.jpda.tests.framework.jdwp.JDWPCommands;
24554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport org.apache.harmony.jpda.tests.framework.jdwp.JDWPConstants;
25554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket;
26554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase;
27554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper;
28554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport org.apache.harmony.jpda.tests.share.JPDALogWriter;
29554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport org.apache.harmony.jpda.tests.share.JPDATestOptions;
30554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
31554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport java.util.HashMap;
32554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampeimport java.util.Map;
33554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
34554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampepublic class JDWPClassDataRetriever extends JDWPTestCase implements ClassDataRetriever {
35554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
36554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    private final Client client;
37554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
38554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    public JDWPClassDataRetriever() {
39554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        this(null);
40554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
41554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
42554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    public JDWPClassDataRetriever(Client client) {
43554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        this.client = client;
44554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
45554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
46554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
47554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    @Override
48554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    protected String getDebuggeeClassName() {
49554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        return "<unset>";
50554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
51554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
52554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    @Override
53554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    public Map<String, String> getClassData(Client client) {
54554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        return new JDWPClassDataRetriever(client).retrieve();
55554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
56554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
57554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    private Map<String, String> retrieve() {
58554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        if (client == null) {
59554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            throw new IllegalStateException();
60554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        }
61554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
62554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        settings = createTestOptions("localhost:" + String.valueOf(client.getDebuggerListenPort()));
63554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        settings.setDebuggeeSuspend("n");
64554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
65554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        logWriter = new JPDALogWriter(System.out, "", false);
66554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
67554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        try {
68554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            internalSetUp();
69554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
70554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            return retrieveImpl();
71554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        } catch (Exception e) {
72554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            e.printStackTrace();
73554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            return null;
74554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        } finally {
75554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            internalTearDown();
76554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        }
77554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
78554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
79554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    private Map<String, String> retrieveImpl() {
80554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        try {
81554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            // Suspend the app.
82554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            {
83554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                CommandPacket packet = new CommandPacket(
84554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                        JDWPCommands.VirtualMachineCommandSet.CommandSetID,
85554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                        JDWPCommands.VirtualMachineCommandSet.SuspendCommand);
86554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
87554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                if (reply.getErrorCode() != JDWPConstants.Error.NONE) {
88554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                    return null;
89554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                }
90554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            }
91554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
92554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            // List all classes.
93554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            CommandPacket packet = new CommandPacket(
94554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                    JDWPCommands.VirtualMachineCommandSet.CommandSetID,
95554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                    JDWPCommands.VirtualMachineCommandSet.AllClassesCommand);
96554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
97554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
98554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            if (reply.getErrorCode() != JDWPConstants.Error.NONE) {
99554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                return null;
100554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            }
101554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
102554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            int classCount = reply.getNextValueAsInt();
103554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            System.out.println("Runtime reported " + classCount + " classes.");
104554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
105554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            Map<Long, String> classes = new HashMap<Long, String>();
106554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            Map<Long, String> arrayClasses = new HashMap<Long, String>();
107554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
108554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            for (int i = 0; i < classCount; i++) {
109554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                byte refTypeTag = reply.getNextValueAsByte();
110554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                long typeID = reply.getNextValueAsReferenceTypeID();
111554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                String signature = reply.getNextValueAsString();
112554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                /* int status = */ reply.getNextValueAsInt();
113554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
114554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                switch (refTypeTag) {
115554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                    case JDWPConstants.TypeTag.CLASS:
116554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                    case JDWPConstants.TypeTag.INTERFACE:
117554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                        classes.put(typeID, signature);
118554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                        break;
119554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
120554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                    case JDWPConstants.TypeTag.ARRAY:
121554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                        arrayClasses.put(typeID, signature);
122554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                        break;
123554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                }
124554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            }
125554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
126554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            Map<String, String> result = new HashMap<String, String>();
127554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
128554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            // Parse all classes.
129554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            for (Map.Entry<Long, String> entry : classes.entrySet()) {
130554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                long typeID = entry.getKey();
131554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                String signature = entry.getValue();
132554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
133554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                if (!checkClass(typeID, signature, result)) {
134554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                    System.err.println("Issue investigating " + signature);
135554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                }
136554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            }
137554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
138554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            // For arrays, look at the leaf component type.
139554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            for (Map.Entry<Long, String> entry : arrayClasses.entrySet()) {
140554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                long typeID = entry.getKey();
141554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                String signature = entry.getValue();
142554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
143554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                if (!checkArrayClass(typeID, signature, result)) {
144554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                    System.err.println("Issue investigating " + signature);
145554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                }
146554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            }
147554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
148554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            return result;
149554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        } finally {
150554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            // Resume the app.
151554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            {
152554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                CommandPacket packet = new CommandPacket(
153554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                        JDWPCommands.VirtualMachineCommandSet.CommandSetID,
154554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                        JDWPCommands.VirtualMachineCommandSet.ResumeCommand);
155554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                /* ReplyPacket reply = */ debuggeeWrapper.vmMirror.performCommand(packet);
156554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            }
157554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        }
158554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
159554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
160554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    private boolean checkClass(long typeID, String signature, Map<String, String> result) {
161554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        CommandPacket packet = new CommandPacket(
162554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
163554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                JDWPCommands.ReferenceTypeCommandSet.ClassLoaderCommand);
164554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        packet.setNextValueAsReferenceTypeID(typeID);
165554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
166554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        if (reply.getErrorCode() != JDWPConstants.Error.NONE) {
167554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            return false;
168554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        }
169554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
170554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        long classLoaderID = reply.getNextValueAsObjectID();
171554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
172554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        // TODO: Investigate the classloader to have a better string?
173554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        String classLoaderString = (classLoaderID == 0) ? null : String.valueOf(classLoaderID);
174554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
175554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        result.put(getClassName(signature), classLoaderString);
176554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
177554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        return true;
178554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
179554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
180554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    private boolean checkArrayClass(long typeID, String signature, Map<String, String> result) {
181554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        // Classloaders of array classes are the same as the component class'.
182554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        CommandPacket packet = new CommandPacket(
183554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
184554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe                JDWPCommands.ReferenceTypeCommandSet.ClassLoaderCommand);
185554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        packet.setNextValueAsReferenceTypeID(typeID);
186554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
187554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        if (reply.getErrorCode() != JDWPConstants.Error.NONE) {
188554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe            return false;
189554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        }
190554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
191554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        long classLoaderID = reply.getNextValueAsObjectID();
192554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
193554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        // TODO: Investigate the classloader to have a better string?
194554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        String classLoaderString = (classLoaderID == 0) ? null : String.valueOf(classLoaderID);
195554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
196554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        // For array classes, we *need* the signature directly.
197554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        result.put(signature, classLoaderString);
198554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
199554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        return true;
200554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
201554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
202554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    private static String getClassName(String signature) {
203554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        String withoutLAndSemicolon = signature.substring(1, signature.length() - 1);
204554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        return withoutLAndSemicolon.replace('/', '.');
205554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
206554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
207554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
208554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    private static JPDATestOptions createTestOptions(String address) {
209554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        JPDATestOptions options = new JPDATestOptions();
210554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        options.setAttachConnectorKind();
211554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        options.setTimeout(1000);
212554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        options.setWaitingTime(1000);
213554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        options.setTransportAddress(address);
214554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        return options;
215554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
216554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe
217554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    @Override
218554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    protected JDWPUnitDebuggeeWrapper createDebuggeeWrapper() {
219554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe        return new PreloadDebugeeWrapper(settings, logWriter);
220554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe    }
221554d7ee0f5d177b6c0bce805f5a5917b6b211978Andreas Gampe}
222