auto import from //branches/cupcake/...@125939
This commit is contained in:
@@ -60,8 +60,9 @@ public class ProjectHelperTest extends TestCase {
|
||||
ProjectHelper.fixProjectClasspathEntries(javaProject);
|
||||
|
||||
IClasspathEntry[] fixedEntries = javaProject.getRawClasspath();
|
||||
assertEquals(2, fixedEntries.length);
|
||||
assertEquals(3, fixedEntries.length);
|
||||
assertEquals("Project/src", fixedEntries[0].getPath().toString());
|
||||
assertEquals(CONTAINER_ID, fixedEntries[1].getPath().toString());
|
||||
assertEquals(OLD_CONTAINER_ID, fixedEntries[1].getPath().toString());
|
||||
assertEquals(CONTAINER_ID, fixedEntries[2].getPath().toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ public class AndroidJarLoaderTest extends TestCase {
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
mFrameworkClassLoader = null;
|
||||
System.gc();
|
||||
}
|
||||
|
||||
/** Preloads classes. They should load just fine. */
|
||||
@@ -74,8 +76,9 @@ public class AndroidJarLoaderTest extends TestCase {
|
||||
Class<?> c = _findClass(mFrameworkClassLoader, "jar.example.Class2"); //$NON-NLS-1$
|
||||
assertEquals("jar.example.Class2", c.getName()); //$NON-NLS-1$
|
||||
HashMap<String, Class<?>> map = getPrivateClassCache();
|
||||
assertTrue(map.containsKey("jar.example.Class1")); //$NON-NLS-1$
|
||||
assertTrue(map.containsKey("jar.example.Class2")); //$NON-NLS-1$
|
||||
assertEquals(1, map.size());
|
||||
assertEquals(2, map.size());
|
||||
}
|
||||
|
||||
/** call the protected method findClass */
|
||||
|
||||
@@ -94,6 +94,33 @@ public class AttrsXmlParserTest extends TestCase {
|
||||
assertEquals(Integer.valueOf(0), valueMap.get("horizontal"));
|
||||
assertEquals(Integer.valueOf(1), valueMap.get("vertical"));
|
||||
}
|
||||
|
||||
public final void testDeprecated() throws Exception {
|
||||
mParser.preload();
|
||||
|
||||
DeclareStyleableInfo dep = mParser.getDeclareStyleableList().get("DeprecatedTest");
|
||||
assertNotNull(dep);
|
||||
|
||||
AttributeInfo[] attrs = dep.getAttributes();
|
||||
assertEquals(4, attrs.length);
|
||||
|
||||
assertEquals("deprecated-inline", attrs[0].getName());
|
||||
assertEquals("In-line deprecated.", attrs[0].getDeprecatedDoc());
|
||||
assertEquals("Deprecated comments using delimiters.", attrs[0].getJavaDoc());
|
||||
|
||||
assertEquals("deprecated-multiline", attrs[1].getName());
|
||||
assertEquals("Multi-line version of deprecated that works till the next tag.",
|
||||
attrs[1].getDeprecatedDoc());
|
||||
assertEquals("Deprecated comments on their own line.", attrs[1].getJavaDoc());
|
||||
|
||||
assertEquals("deprecated-not", attrs[2].getName());
|
||||
assertEquals(null, attrs[2].getDeprecatedDoc());
|
||||
assertEquals("This attribute is not deprecated.", attrs[2].getJavaDoc());
|
||||
|
||||
assertEquals("deprecated-no-javadoc", attrs[3].getName());
|
||||
assertEquals("There is no other javadoc here.", attrs[3].getDeprecatedDoc());
|
||||
assertEquals("", attrs[3].getJavaDoc());
|
||||
}
|
||||
|
||||
//---- access to private methods
|
||||
|
||||
|
||||
@@ -99,28 +99,26 @@ public class DescriptorsUtilsTest extends TestCase {
|
||||
ElementDescriptor desc = new ElementDescriptor("application");
|
||||
desc.setSdkUrl(DescriptorsUtils.MANIFEST_SDK_URL + "TagApplication");
|
||||
String docBaseUrl = "http://base";
|
||||
assertEquals("<form><p></p></form>", DescriptorsUtils.formatFormText("", desc, docBaseUrl));
|
||||
assertEquals("<form><li style=\"image\" value=\"image\"></li></form>", DescriptorsUtils.formatFormText("", desc, docBaseUrl));
|
||||
|
||||
assertEquals("<form><p><a href=\"http://base/reference/android/R.styleable.html#TagApplication\">application</a></p></form>",
|
||||
assertEquals("<form><li style=\"image\" value=\"image\"><a href=\"http://base/reference/android/R.styleable.html#TagApplication\">application</a></li></form>",
|
||||
DescriptorsUtils.formatFormText(
|
||||
"<code>application</code>",
|
||||
desc, docBaseUrl));
|
||||
|
||||
assertEquals("<form><p><b>android.content.Intent</b></p></form>",
|
||||
assertEquals("<form><li style=\"image\" value=\"image\"><b>android.content.Intent</b></li></form>",
|
||||
DescriptorsUtils.formatFormText(
|
||||
"{@link android.content.Intent}",
|
||||
desc, docBaseUrl));
|
||||
|
||||
assertEquals("<form><p><a href=\"http://base/reference/android/R.styleable.html#AndroidManifestPermission\">AndroidManifestPermission</a></p></form>",
|
||||
assertEquals("<form><li style=\"image\" value=\"image\"><a href=\"http://base/reference/android/R.styleable.html#AndroidManifestPermission\">AndroidManifestPermission</a></li></form>",
|
||||
DescriptorsUtils.formatFormText(
|
||||
"{@link #AndroidManifestPermission}",
|
||||
desc, docBaseUrl));
|
||||
|
||||
assertEquals("<form><p><a href=\"http://base/reference/android/R.styleable.html#AndroidManifestPermission\">\"permission\"</a></p></form>",
|
||||
assertEquals("<form><li style=\"image\" value=\"image\"><a href=\"http://base/reference/android/R.styleable.html#AndroidManifestPermission\">\"permission\"</a></li></form>",
|
||||
DescriptorsUtils.formatFormText(
|
||||
"{@link #AndroidManifestPermission <permission>}",
|
||||
desc, docBaseUrl));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,11 +54,11 @@ public class TextInputMethodQualifierTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testNoKey() {
|
||||
assertEquals(true, timq.checkAndSet("nokey", config)); //$NON-NLS-1$
|
||||
assertEquals(true, timq.checkAndSet("nokeys", config)); //$NON-NLS-1$
|
||||
assertTrue(config.getTextInputMethodQualifier() != null);
|
||||
assertEquals(TextInputMethodQualifier.TextInputMethod.NOKEY,
|
||||
config.getTextInputMethodQualifier().getValue());
|
||||
assertEquals("nokey", config.getTextInputMethodQualifier().toString()); //$NON-NLS-1$
|
||||
assertEquals("nokeys", config.getTextInputMethodQualifier().toString()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void testFailures() {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ConfigMatchTest extends TestCase {
|
||||
private static final String MISC2_FILENAME = "bar.xml"; //$NON-NLS-1$
|
||||
|
||||
private ProjectResources mResources;
|
||||
private ArrayList<ResourceQualifier> mQualifierList;
|
||||
private ResourceQualifier[] mQualifierList;
|
||||
private FolderConfiguration config4;
|
||||
private FolderConfiguration config3;
|
||||
private FolderConfiguration config2;
|
||||
@@ -60,7 +60,7 @@ public class ConfigMatchTest extends TestCase {
|
||||
qualifierListField.setAccessible(true);
|
||||
|
||||
// get the actual list.
|
||||
mQualifierList = (ArrayList<ResourceQualifier>)qualifierListField.get(manager);
|
||||
mQualifierList = (ResourceQualifier[])qualifierListField.get(manager);
|
||||
|
||||
// create the project resources.
|
||||
mResources = new ProjectResources(false /* isFrameworkRepository */);
|
||||
@@ -191,10 +191,10 @@ public class ConfigMatchTest extends TestCase {
|
||||
FolderConfiguration config = new FolderConfiguration();
|
||||
|
||||
// those must be of the same length
|
||||
assertEquals(qualifierValues.length, mQualifierList.size());
|
||||
assertEquals(qualifierValues.length, mQualifierList.length);
|
||||
|
||||
int index = 0;
|
||||
|
||||
|
||||
for (ResourceQualifier qualifier : mQualifierList) {
|
||||
String value = qualifierValues[index++];
|
||||
if (value != null) {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
-->
|
||||
<resources>
|
||||
<!-- WARNING !!! THIS IS A MOCK FILE. DO NOT USE FOR DOCUMENTATION PURPOSES.
|
||||
This file has been trimmed down to only extract a number of interest cases
|
||||
This file has been trimmed down to only extract a number of interesting cases
|
||||
for unit tests.
|
||||
|
||||
What this contains:
|
||||
@@ -314,5 +314,27 @@
|
||||
<attr name="collapseColumns" format="string" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- Test for deprecated attributes. -->
|
||||
<declare-styleable name="DeprecatedTest">
|
||||
<!-- Deprecated comments using delimiters.
|
||||
Ignored. {@deprecated In-line deprecated.} {@ignore Ignored}.
|
||||
-->
|
||||
<attr name="deprecated-inline" />
|
||||
|
||||
<!-- Deprecated comments on their own line.
|
||||
@deprecated Multi-line version of deprecated
|
||||
that works till the next tag.
|
||||
@ignore This tag must be ignored
|
||||
-->
|
||||
<attr name="deprecated-multiline" />
|
||||
|
||||
<!-- This attribute is not deprecated. -->
|
||||
<attr name="deprecated-not" />
|
||||
|
||||
<!-- {@deprecated There is no other javadoc here. } -->
|
||||
<attr name="deprecated-no-javadoc" format="boolean" />
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2007 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
|
||||
*
|
||||
* 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 jar.example;
|
||||
|
||||
public class Class1 {
|
||||
|
||||
public static final int sStaticField = 1;
|
||||
|
||||
/** constructor */
|
||||
public Class1() {
|
||||
int a = 1;
|
||||
}
|
||||
|
||||
public static class InnerStaticClass1 {
|
||||
|
||||
}
|
||||
|
||||
public class InnerClass2 {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2007 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
|
||||
*
|
||||
* 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 jar.example;
|
||||
|
||||
public class Class2 extends Class1 {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user