diff options
author | Raphael Moll <ralf@android.com> | 2011-02-08 16:05:24 -0800 |
---|---|---|
committer | Raphael Moll <ralf@android.com> | 2011-02-08 20:00:12 -0800 |
commit | c3c59ef4edf2f49071bf1a9e5de4e99dcc07e582 (patch) | |
tree | 96399f3da427036d85425d1a8939d43a3103e433 /sdkmanager/app | |
parent | 472b6bc529e4870723cd6a515794f24407bd683f (diff) | |
download | sdk-c3c59ef4edf2f49071bf1a9e5de4e99dcc07e582.zip sdk-c3c59ef4edf2f49071bf1a9e5de4e99dcc07e582.tar.gz sdk-c3c59ef4edf2f49071bf1a9e5de4e99dcc07e582.tar.bz2 |
Add unit test to SdkUiLib UpdaterData.installArchives.
This adds or changes no functionality.
It just exhibits the bug from issue 14393 which will
be fixed in the next CL.
Change-Id: Icff2023120014b422c002efde8f20175ff52e266
Diffstat (limited to 'sdkmanager/app')
3 files changed, 2 insertions, 54 deletions
diff --git a/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java b/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java index bb1ba75..4ae107c 100644 --- a/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java +++ b/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java @@ -23,6 +23,7 @@ import com.android.sdklib.SdkManager; import com.android.sdklib.internal.avd.AvdManager; import com.android.sdklib.internal.project.ProjectProperties; import com.android.sdklib.io.FileWrapper; +import com.android.sdklib.mock.MockLog; import java.io.File; import java.util.Map; diff --git a/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java b/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java index f6e3bbe..29516e3 100644 --- a/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java +++ b/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java @@ -22,6 +22,7 @@ import static java.io.File.createTempFile; import com.android.sdklib.IAndroidTarget; import com.android.sdklib.SdkManager; import com.android.sdklib.internal.avd.AvdManager; +import com.android.sdklib.mock.MockLog; import java.io.File; diff --git a/sdkmanager/app/tests/com/android/sdkmanager/MockLog.java b/sdkmanager/app/tests/com/android/sdkmanager/MockLog.java deleted file mode 100644 index 7925709..0000000 --- a/sdkmanager/app/tests/com/android/sdkmanager/MockLog.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdkmanager; - -import com.android.sdklib.ISdkLog; - -import java.util.ArrayList; -import java.util.Formatter; - -public class MockLog implements ISdkLog { - private ArrayList<String> mMessages = new ArrayList<String>(); - - private void add(String code, String format, Object... args) { - mMessages.add(new Formatter().format(code + format, args).toString()); - } - - public void warning(String format, Object... args) { - add("W ", format, args); - } - - public void printf(String format, Object... args) { - add("P ", format, args); - } - - public void error(Throwable t, String format, Object... args) { - if (t != null) { - add("T", "%s", t.toString()); - } - add("E ", format, args); - } - - @Override - public String toString() { - return mMessages.toString(); - } - - public void clear() { - mMessages.clear(); - } -} |