Code drop from //branches/cupcake/...@124589

This commit is contained in:
The Android Open Source Project
2008-12-17 18:04:04 -08:00
parent 5c11852110
commit e943f2fd8e
659 changed files with 47382 additions and 9976 deletions

View File

@@ -2,18 +2,17 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Android Plugin Tests
Bundle-SymbolicName: com.android.ide.eclipse.tests
Bundle-Version: 0.8.1.qualifier
Bundle-Version: 0.9.0.qualifier
Bundle-Activator: com.android.ide.eclipse.tests.AndroidTestPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
com.android.ide.eclipse.adt,
org.junit,
com.android.ide.eclipse.common,
com.android.ide.eclipse.editors,
org.eclipse.jdt.core,
org.eclipse.jdt.launching,
org.eclipse.ui.views
org.eclipse.ui.views,
com.android.ide.eclipse.ddms
Eclipse-LazyStart: true
Bundle-Vendor: The Android Open Source Project
Bundle-ClassPath: kxml2-2.3.0.jar,

View File

@@ -1,11 +1,11 @@
/*
* Copyright (C) 20078The Android Open Source Project
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
* http://www.eclipse.org/org/documents/epl-v10.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@@ -13,9 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.android.ide.eclipse.adt.project.internal;
import com.android.ide.eclipse.adt.project.internal.NewProjectCreationPage;
package com.android.ide.eclipse.adt.wizards.newproject;
import java.io.File;

View File

@@ -5,7 +5,7 @@
* may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.eclipse.org/org/documents/epl-v10.php
* http://www.eclipse.org/org/documents/epl-v10.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@@ -13,10 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.android.ide.eclipse.adt.project.internal;
import com.android.ide.eclipse.adt.project.internal.NewProjectCreationPage;
import com.android.ide.eclipse.adt.project.internal.NewProjectWizard;
package com.android.ide.eclipse.adt.wizards.newproject;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

View File

@@ -5,7 +5,7 @@
* may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.eclipse.org/org/documents/epl-v10.php
* http://www.eclipse.org/org/documents/epl-v10.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@@ -16,10 +16,9 @@
package com.android.ide.eclipse.tests.functests.sampleProjects;
import com.android.ide.eclipse.adt.project.ProjectHelper;
import com.android.ide.eclipse.adt.project.internal.StubSampleProjectWizard;
import com.android.ide.eclipse.adt.wizards.newproject.StubSampleProjectWizard;
import com.android.ide.eclipse.tests.FuncTestCase;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;

View File

@@ -14,21 +14,19 @@
* limitations under the License.
*/
package com.android.ide.eclipse.adt.resources;
package com.android.ide.eclipse.adt.sdk;
import com.android.ide.eclipse.adt.resources.LayoutParamsParser.IClass;
import com.android.ide.eclipse.adt.sdk.IAndroidClassLoader.IClassDescriptor;
import com.android.ide.eclipse.tests.AdtTestData;
import junit.framework.TestCase;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import junit.framework.TestCase;
/**
* Unit Test for {@link FrameworkClassLoader}.
*
@@ -51,7 +49,7 @@ public class AndroidJarLoaderTest extends TestCase {
/** Preloads classes. They should load just fine. */
public final void testPreLoadClasses() throws Exception {
mFrameworkClassLoader.preLoadClasses("jar.example.", null); //$NON-NLS-1$
mFrameworkClassLoader.preLoadClasses("jar.example.", null, null); //$NON-NLS-1$
HashMap<String, Class<?>> map = getPrivateClassCache();
assertEquals(0, map.size());
HashMap<String,byte[]> data = getPrivateEntryCache();
@@ -64,7 +62,7 @@ public class AndroidJarLoaderTest extends TestCase {
/** Preloads a class not in the JAR. Preloading does nothing in this case. */
public final void testPreLoadClasses_classNotFound() throws Exception {
mFrameworkClassLoader.preLoadClasses("not.a.package.", null); //$NON-NLS-1$
mFrameworkClassLoader.preLoadClasses("not.a.package.", null, null); //$NON-NLS-1$
HashMap<String, Class<?>> map = getPrivateClassCache();
assertEquals(0, map.size());
HashMap<String,byte[]> data = getPrivateEntryCache();
@@ -108,7 +106,7 @@ public class AndroidJarLoaderTest extends TestCase {
}
public final void testFindClassesDerivingFrom() throws Exception {
HashMap<String, ArrayList<IClass>> found =
HashMap<String, ArrayList<IClassDescriptor>> found =
mFrameworkClassLoader.findClassesDerivingFrom("jar.example.", new String[] { //$NON-NLS-1$
"jar.example.Class1", //$NON-NLS-1$
"jar.example.Class2" }); //$NON-NLS-1$

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package com.android.ide.eclipse.adt.resources;
package com.android.ide.eclipse.adt.sdk;
import com.android.ide.eclipse.adt.resources.AndroidJarLoader.ClassWrapper;
import com.android.ide.eclipse.adt.resources.LayoutParamsParser.IClass;
import com.android.ide.eclipse.adt.sdk.AndroidJarLoader.ClassWrapper;
import com.android.ide.eclipse.adt.sdk.IAndroidClassLoader.IClassDescriptor;
import com.android.ide.eclipse.common.resources.AttrsXmlParser;
import com.android.ide.eclipse.common.resources.ViewClassInfo;
import com.android.ide.eclipse.common.resources.ViewClassInfo.LayoutParamsInfo;
@@ -32,7 +32,7 @@ import java.util.TreeMap;
import junit.framework.TestCase;
/**
* Test the inner private methods of FrameworkResourceParser.
* Test the inner private methods of PlatformDataParser.
*
* Convention: method names that start with an underscore are actually local wrappers
* that call private methods from {@link FrameworkResourceParser} using reflection.
@@ -47,9 +47,9 @@ public class LayoutParamsParserTest extends TestCase {
}
@Override
public HashMap<String, ArrayList<IClass>> findClassesDerivingFrom(
public HashMap<String, ArrayList<IClassDescriptor>> findClassesDerivingFrom(
String rootPackage, String[] superClasses) throws ClassFormatError {
return new HashMap<String, ArrayList<IClass>>();
return new HashMap<String, ArrayList<IClassDescriptor>>();
}
}
@@ -70,8 +70,8 @@ public class LayoutParamsParserTest extends TestCase {
mTopGroupClass = new ClassWrapper(mock_android.view.ViewGroup.class);
mTopLayoutParamsClass = new ClassWrapper(mock_android.view.ViewGroup.LayoutParams.class);
mViewList = new ArrayList<IClass>();
mGroupList = new ArrayList<IClass>();
mViewList = new ArrayList<IClassDescriptor>();
mGroupList = new ArrayList<IClassDescriptor>();
mViewMap = new TreeMap<String, ExtViewClassInfo>();
mGroupMap = new TreeMap<String, ExtViewClassInfo>();
mLayoutParamsMap = new HashMap<String, LayoutParamsInfo>();
@@ -131,16 +131,16 @@ public class LayoutParamsParserTest extends TestCase {
//---- access to private methods
/** Calls the private constructor of the parser */
private FrameworkResourceParser _Constructor(String osJarPath) throws Exception {
Constructor<FrameworkResourceParser> constructor =
FrameworkResourceParser.class.getDeclaredConstructor(String.class);
private AndroidTargetParser _Constructor(String osJarPath) throws Exception {
Constructor<AndroidTargetParser> constructor =
AndroidTargetParser.class.getDeclaredConstructor(String.class);
constructor.setAccessible(true);
return constructor.newInstance(osJarPath);
}
/** calls the private getLayoutClasses() of the parser */
private void _getLayoutClasses() throws Exception {
Method method = FrameworkResourceParser.class.getDeclaredMethod("getLayoutClasses"); //$NON-NLS-1$
Method method = AndroidTargetParser.class.getDeclaredMethod("getLayoutClasses"); //$NON-NLS-1$
method.setAccessible(true);
method.invoke(mParser);
}
@@ -148,7 +148,7 @@ public class LayoutParamsParserTest extends TestCase {
/** calls the private addGroup() of the parser */
private ViewClassInfo _addGroup(Class<?> groupClass) throws Exception {
Method method = LayoutParamsParser.class.getDeclaredMethod("addGroup", //$NON-NLS-1$
IClass.class);
IClassDescriptor.class);
method.setAccessible(true);
return (ViewClassInfo) method.invoke(mParser, new ClassWrapper(groupClass));
}
@@ -156,7 +156,7 @@ public class LayoutParamsParserTest extends TestCase {
/** calls the private addLayoutParams() of the parser */
private LayoutParamsInfo _addLayoutParams(Class<?> groupClass) throws Exception {
Method method = LayoutParamsParser.class.getDeclaredMethod("addLayoutParams", //$NON-NLS-1$
IClass.class);
IClassDescriptor.class);
method.setAccessible(true);
return (LayoutParamsInfo) method.invoke(mParser, new ClassWrapper(groupClass));
}
@@ -164,17 +164,17 @@ public class LayoutParamsParserTest extends TestCase {
/** calls the private getLayoutParamsInfo() of the parser */
private LayoutParamsInfo _getLayoutParamsInfo(Class<?> layoutParamsClass) throws Exception {
Method method = LayoutParamsParser.class.getDeclaredMethod("getLayoutParamsInfo", //$NON-NLS-1$
IClass.class);
IClassDescriptor.class);
method.setAccessible(true);
return (LayoutParamsInfo) method.invoke(mParser, new ClassWrapper(layoutParamsClass));
}
/** calls the private findLayoutParams() of the parser */
private IClass _findLayoutParams(Class<?> groupClass) throws Exception {
private IClassDescriptor _findLayoutParams(Class<?> groupClass) throws Exception {
Method method = LayoutParamsParser.class.getDeclaredMethod("findLayoutParams", //$NON-NLS-1$
IClass.class);
IClassDescriptor.class);
method.setAccessible(true);
return (IClass) method.invoke(mParser, new ClassWrapper(groupClass));
return (IClassDescriptor) method.invoke(mParser, new ClassWrapper(groupClass));
}
}

View File

@@ -216,9 +216,6 @@ public class UiElementPullParserTest extends TestCase {
} catch (XmlPullParserException e) {
e.printStackTrace();
assertTrue(false);
} catch (IOException e) {
e.printStackTrace();
assertTrue(false);
}
}