From 962653d7b4588216872bc80277e0c14f7410ae41 Mon Sep 17 00:00:00 2001 From: Brett Chabot Date: Wed, 28 Oct 2009 18:22:15 -0700 Subject: [PATCH] ADT test fixes. Temporarily remove SampleProjectTest from continuous, since its failing at every CL. Adjust ApiDemosRenderingTest to use the SDK loaded by ADT. Remove SdkEnvTestCase since it doesn't work in all situations. Fix test data lookup for NinePatchTest and BridgeXmlBlockParserTest. Bugs 2222616, 2218682 --- .../android/ide/eclipse/tests/AdtSdkTestCase.java | 60 --------------- .../com/android/ide/eclipse/tests/AdtTestData.java | 82 +++++++++++++-------- .../com/android/ide/eclipse/tests/FuncTests.java | 4 +- .../android/ide/eclipse/tests/SdkEnvTestCase.java | 45 ----------- .../com/android/ide/eclipse/tests/SdkTestCase.java | 33 ++++++++- .../layoutRendering/ApiDemosRenderingTest.java | 4 +- .../sampleProjects/SampleProjectTest.java | 4 +- .../plugins/com.android.ide.eclipse.tests/test.xml | 2 +- .../unittests/data/button.9.png | Bin 0 -> 3750 bytes .../unittests/data/layout1.xml | 49 ++++++++++++ .../unittests/data}/repository_sample.xml | 0 .../sdklib/repository/TestSdkRepository.java | 7 +- 12 files changed, 140 insertions(+), 150 deletions(-) delete mode 100644 eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtSdkTestCase.java delete mode 100644 eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkEnvTestCase.java create mode 100644 eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png create mode 100644 eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/layout1.xml rename {sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata => eclipse/plugins/com.android.ide.eclipse.tests/unittests/data}/repository_sample.xml (100%) diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtSdkTestCase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtSdkTestCase.java deleted file mode 100644 index d884f3589..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtSdkTestCase.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2009 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 com.android.ide.eclipse.tests; - -import com.android.ide.eclipse.adt.AdtPlugin; -import com.android.ide.eclipse.adt.internal.sdk.LoadStatus; -import com.android.ide.eclipse.adt.internal.sdk.Sdk; - -/** - * A test case which uses the Sdk loaded by the Adt plugin. - */ -public abstract class AdtSdkTestCase extends SdkTestCase { - - protected AdtSdkTestCase() { - } - - /** - * Gets the current Sdk from Adt, waiting if necessary. - */ - @Override - protected Sdk loadSdk() { - AdtPlugin adt = AdtPlugin.getDefault(); - Object sdkLock = adt.getSdkLockObject(); - LoadStatus loadStatus = LoadStatus.LOADING; - // wait for Adt to load the Sdk on a separate thread - // loop max of 600 times * 200 ms = 2 minutes - final int maxWait = 600; - for (int i=0; i < maxWait && loadStatus == LoadStatus.LOADING; i++) { - try { - Thread.sleep(200); - } - catch (InterruptedException e) { - // ignore - } - synchronized(sdkLock) { - loadStatus = adt.getSdkLoadStatus(); - } - } - Sdk sdk = null; - synchronized(sdkLock) { - assertEquals(LoadStatus.LOADED, loadStatus); - sdk = Sdk.getCurrent(); - } - assertNotNull(sdk); - return sdk; - } -} diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java index 6d1373706..2eef828f9 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java @@ -1,12 +1,12 @@ /* * 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 - * + * * 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 @@ -21,14 +21,17 @@ import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Platform; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.util.logging.Logger; /** * Helper class for retrieving test data - * - * All tests which need to retrieve test data files should go through this class + * + * All tests which need to retrieve test data files should go through this class * */ public class AdtTestData { @@ -36,48 +39,48 @@ public class AdtTestData { /** singleton instance */ private static AdtTestData sInstance = null; private static final Logger sLogger = Logger.getLogger(AdtTestData.class.getName()); - - /** the absolute file path to the /data directory in this test - * environment. + + /** the absolute file path to the /data directory in this test + * environment. */ private String mOsRootDataPath; - - + + private AdtTestData() { - // can set test_data env variable to override default behavior of + // can set test_data env variable to override default behavior of // finding data using class loader - // useful when running in plugin environment, where test data is inside - // bundled jar, and must be extracted to temp filesystem location to be + // useful when running in plugin environment, where test data is inside + // bundled jar, and must be extracted to temp filesystem location to be // accessed normally mOsRootDataPath = System.getProperty("test_data"); if (mOsRootDataPath == null) { sLogger.info("Cannot find test_data environment variable, init to class loader"); URL url = this.getClass().getClassLoader().getResource("data"); //$NON-NLS-1$ - if (Platform.isRunning()) { - sLogger.info("Running as an Eclipse Plug-in JUnit test, using FileLocator"); - try { - mOsRootDataPath = FileLocator.resolve(url).getFile(); - } catch (IOException e) { - sLogger.warning("IOException while using FileLocator, reverting to url"); - mOsRootDataPath = url.getFile(); - } - } else { - sLogger.info("Running as an plain JUnit test, using url as-is"); - mOsRootDataPath = url.getFile(); + if (Platform.isRunning()) { + sLogger.info("Running as an Eclipse Plug-in JUnit test, using FileLocator"); + try { + mOsRootDataPath = FileLocator.resolve(url).getFile(); + } catch (IOException e) { + sLogger.warning("IOException while using FileLocator, reverting to url"); + mOsRootDataPath = url.getFile(); } + } else { + sLogger.info("Running as an plain JUnit test, using url as-is"); + mOsRootDataPath = url.getFile(); + } } - + if (mOsRootDataPath.equals(AndroidConstants.WS_SEP + "data")) { sLogger.warning("Resource data not found using class loader!, Defaulting to no path"); } - + if (!mOsRootDataPath.endsWith(File.separator)) { sLogger.info("Fixing test_data env variable (does not end with path separator)"); mOsRootDataPath = mOsRootDataPath.concat(File.separator); } } - + /** Get the singleton instance of AdtTestData */ public static AdtTestData getInstance() { if (sInstance == null) { @@ -85,14 +88,29 @@ public class AdtTestData { } return sInstance; } - - /** Returns the absolute file path to a file located in this plugins - * "data" directory - * @param osRelativePath - string path to file contained in /data. Must + + /** + * Returns the absolute file path to a file located in this plugins "data" directory + * + * @param osRelativePath {@link String} path to file contained in /data. Must * use path separators appropriate to host OS - * @return String + * + * @return absolute OS path to test file */ public String getTestFilePath(String osRelativePath) { return mOsRootDataPath + osRelativePath; } + + /** + * Helper method to get a {@link InputStream} to test data file. + * + * @param osRelativePath {@link String} path to file contained in /data. Must + * use path separators appropriate to host OS + * + * @return {@link InputStream} for test file + * @throws FileNotFoundException if test file could not be found + */ + public InputStream getTestFileStream(String osRelativePath) throws FileNotFoundException { + return new FileInputStream(getTestFilePath(osRelativePath)); + } } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/FuncTests.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/FuncTests.java index 02c9247ed..efa880126 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/FuncTests.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/FuncTests.java @@ -16,7 +16,6 @@ package com.android.ide.eclipse.tests; import com.android.ide.eclipse.tests.functests.layoutRendering.ApiDemosRenderingTest; -import com.android.ide.eclipse.tests.functests.sampleProjects.SampleProjectTest; import junit.framework.TestSuite; @@ -39,7 +38,8 @@ public class FuncTests extends TestSuite { public static TestSuite suite() { TestSuite suite = new TestSuite(); - suite.addTestSuite(SampleProjectTest.class); + // TODO: uncomment this when 'gen' folder error on create is fixed + // suite.addTestSuite(SampleProjectTest.class); suite.addTestSuite(ApiDemosRenderingTest.class); return suite; diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkEnvTestCase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkEnvTestCase.java deleted file mode 100644 index 1039a7f60..000000000 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkEnvTestCase.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2009 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 com.android.ide.eclipse.tests; - -import com.android.ide.eclipse.adt.internal.sdk.Sdk; - - -/** - * A test case that receives a specific Sdk to test via the "sdk_home" environment variable. - */ -public abstract class SdkEnvTestCase extends SdkTestCase { - - protected SdkEnvTestCase() { - } - - /** - * Loads the {@link Sdk}. - *

- * Fails test if environment variable "sdk_home" is not set. - */ - @Override - protected Sdk loadSdk() { - String osSdkLocation = System.getProperty("sdk_home"); - if (osSdkLocation == null) { - osSdkLocation = System.getenv("sdk_home"); - } - if (osSdkLocation == null || osSdkLocation.length() < 1) { - fail("Environment variable sdk_home is not set"); - } - return Sdk.loadSdk(osSdkLocation); - } -} diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java index 322ce3e69..7f2eef670 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java @@ -15,7 +15,9 @@ */ package com.android.ide.eclipse.tests; +import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetParser; +import com.android.ide.eclipse.adt.internal.sdk.LoadStatus; import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.sdklib.IAndroidTarget; @@ -25,7 +27,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; import junit.framework.TestCase; /** - * A test case that needs a reference to a SDK. + * A test case which uses the SDK loaded by the ADT plugin. */ public abstract class SdkTestCase extends TestCase { @@ -47,9 +49,34 @@ public abstract class SdkTestCase extends TestCase { } /** - * Loads the {@link Sdk} to use for test + * Gets the current SDK from ADT, waiting if necessary. */ - protected abstract Sdk loadSdk(); + private Sdk loadSdk() { + AdtPlugin adt = AdtPlugin.getDefault(); + Object sdkLock = adt.getSdkLockObject(); + LoadStatus loadStatus = LoadStatus.LOADING; + // wait for ADT to load the SDK on a separate thread + // loop max of 600 times * 200 ms = 2 minutes + final int maxWait = 600; + for (int i=0; i < maxWait && loadStatus == LoadStatus.LOADING; i++) { + try { + Thread.sleep(200); + } + catch (InterruptedException e) { + // ignore + } + synchronized(sdkLock) { + loadStatus = adt.getSdkLoadStatus(); + } + } + Sdk sdk = null; + synchronized(sdkLock) { + assertEquals(LoadStatus.LOADED, loadStatus); + sdk = Sdk.getCurrent(); + } + assertNotNull(sdk); + return sdk; + } /** * Checks that the provided sdk contains one or more valid targets. diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java index 3b52789ab..1bbce872c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java @@ -39,7 +39,7 @@ import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager; import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData; import com.android.ide.eclipse.adt.internal.sdk.LoadStatus; import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData.LayoutBridge; -import com.android.ide.eclipse.tests.SdkEnvTestCase; +import com.android.ide.eclipse.tests.SdkTestCase; import com.android.layoutlib.api.ILayoutResult; import com.android.layoutlib.api.IProjectCallback; import com.android.layoutlib.api.IResourceValue; @@ -59,7 +59,7 @@ import java.util.Map; import javax.imageio.ImageIO; -public class ApiDemosRenderingTest extends SdkEnvTestCase { +public class ApiDemosRenderingTest extends SdkTestCase { /** * Custom parser that implements {@link IXmlPullParser} (which itself extends diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java index 89421efe8..d33b939cf 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java @@ -17,7 +17,7 @@ package com.android.ide.eclipse.tests.functests.sampleProjects; import com.android.ide.eclipse.adt.AndroidConstants; import com.android.ide.eclipse.adt.wizards.newproject.StubProjectWizard; -import com.android.ide.eclipse.tests.AdtSdkTestCase; +import com.android.ide.eclipse.tests.SdkTestCase; import com.android.sdklib.IAndroidTarget; import org.eclipse.core.resources.IMarker; @@ -44,7 +44,7 @@ import java.util.logging.Logger; * execution there * */ -public class SampleProjectTest extends AdtSdkTestCase { +public class SampleProjectTest extends SdkTestCase { private static final Logger sLogger = Logger.getLogger(SampleProjectTest.class.getName()); diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/test.xml b/eclipse/plugins/com.android.ide.eclipse.tests/test.xml index 7fd3b0d50..e5519b002 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/test.xml +++ b/eclipse/plugins/com.android.ide.eclipse.tests/test.xml @@ -54,7 +54,7 @@ - + diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png new file mode 100644 index 0000000000000000000000000000000000000000..9d52f40d00fd9c6cfd29800e0f0347439c568369 GIT binary patch literal 3750 zcmV;X4q5SuP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4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rnp~ckrK%i);&C}QVz+^d?X`4GPG2wW?0AB>2(Ihl`yPIn zR*gbaU>F95VPaV(Vi-(LU#Gn`!w|4!!B&8w);(N$e{k%n(`S?NN>?McWuba+g&L8( zLQLmyJ&Sh9(O!!iKt6b z@M0$En8~l(VqB;w + + + + + + + + diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/repository_sample.xml similarity index 100% rename from sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample.xml rename to eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/repository_sample.xml diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/TestSdkRepository.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/TestSdkRepository.java index 5d639ecca..7f1d96746 100755 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/TestSdkRepository.java +++ b/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/TestSdkRepository.java @@ -16,6 +16,8 @@ package com.android.sdklib.repository; +import com.android.ide.eclipse.tests.AdtTestData; + import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; @@ -123,9 +125,8 @@ public class TestSdkRepository extends TestCase { /** Validate a valid sample using an InputStream */ public void testValidateLocalRepositoryFile() throws Exception { - InputStream xmlStream = - TestSdkRepository.class.getResourceAsStream( - "/com/android/sdklib/testdata/repository_sample.xml"); + InputStream xmlStream = AdtTestData.getInstance().getTestFileStream( + "repository_sample.xml"); Source source = new StreamSource(xmlStream); CaptureErrorHandler handler = new CaptureErrorHandler(); -- 2.11.0