diff options
author | John Arthorne | 2009-08-20 17:36:44 +0000 |
---|---|---|
committer | John Arthorne | 2009-08-20 17:36:44 +0000 |
commit | e397006abe0d2cf4c0eff2c2575654ce35f16aac (patch) | |
tree | 2eebc6be2ea6d2230974c810de544af7031753b2 /bundles/org.eclipse.equinox.frameworkadmin.test | |
parent | be01dc12f57603ec40a8eb42659f8503c523fcdf (diff) | |
download | rt.equinox.p2-e397006abe0d2cf4c0eff2c2575654ce35f16aac.tar.gz rt.equinox.p2-e397006abe0d2cf4c0eff2c2575654ce35f16aac.tar.xz rt.equinox.p2-e397006abe0d2cf4c0eff2c2575654ce35f16aac.zip |
Tests for Bug 285935 [frameworkadmin] Index out of bounds when eclipse.ini contains blank lines
Diffstat (limited to 'bundles/org.eclipse.equinox.frameworkadmin.test')
4 files changed, 61 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/conf/config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/conf/config.ini new file mode 100644 index 000000000..c9f0304f6 --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/conf/config.ini @@ -0,0 +1 @@ +foo=bar
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/eclipse.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/eclipse.ini new file mode 100644 index 000000000..06e5db00b --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug285935/eclipse.ini @@ -0,0 +1,5 @@ +-startup + +plugins/org.eclipse.equinox.launcher_1.0.300.v20090720.jar +-configuration +conf
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java index 4029aab97..b6ab89d9c 100644 --- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/AllTests.java @@ -23,7 +23,9 @@ public class AllTests extends TestCase { suite.addTestSuite(Bug196525.class); suite.addTestSuite(Bug258370.class); suite.addTestSuite(CleanupTest.class); + suite.addTestSuite(FrameworkExtensionTest.class); suite.addTestSuite(LauncherConfigLocationTest.class); + suite.addTestSuite(LauncherDataTest.class); suite.addTestSuite(ManipulatorTests.class); suite.addTestSuite(NoConfigurationValueInEclipseIni.class); suite.addTestSuite(NoRenamingLauncherIni.class); @@ -33,6 +35,8 @@ public class AllTests extends TestCase { suite.addTestSuite(ReaderTest3.class); suite.addTestSuite(ReaderTest4.class); suite.addTestSuite(ReaderTest5.class); + suite.addTestSuite(ReaderTestBug267850.class); + suite.addTestSuite(ReaderTestBug285935.class); suite.addTestSuite(RelativePathTest.class); suite.addTestSuite(RemovingABundle.class); suite.addTestSuite(RemovingAllBundles.class); @@ -43,10 +47,7 @@ public class AllTests extends TestCase { suite.addTestSuite(TestEclipseDataArea.class); suite.addTestSuite(TestRunningInstance.class); suite.addTestSuite(TestVMArg.class); - suite.addTestSuite(ManipulatorTests.class); suite.addTestSuite(UtilsTest.class); - suite.addTestSuite(LauncherDataTest.class); - suite.addTestSuite(FrameworkExtensionTest.class); return suite; } diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java new file mode 100644 index 000000000..eed733a57 --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/ReaderTestBug285935.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.frameworkadmin.tests; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import org.eclipse.equinox.internal.provisional.frameworkadmin.*; +import org.osgi.framework.BundleException; + +public class ReaderTestBug285935 extends AbstractFwkAdminTest { + private File installFolder = null; + private String launcherName = "eclipse"; + + public ReaderTestBug285935(String name) { + super(name); + } + + + public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException, URISyntaxException { + startSimpleConfiguratormManipulator(); + + FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin(); + Manipulator manipulator = fwkAdmin.getManipulator(); + + installFolder = getTestData(ReaderTestBug285935.class.getName(),"dataFile/readerTestBug285935"); + + LauncherData launcherData = manipulator.getLauncherData(); + launcherData.setLauncher(new File(installFolder, launcherName)); + try { + manipulator.load(); + } catch (IllegalStateException e) { + //TODO We ignore the framework JAR location not set exception + } + assertEquals(new File(installFolder, "conf"), manipulator.getLauncherData().getFwConfigLocation()); + assertEquals("bar", manipulator.getConfigData().getProperty("foo")); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + +} |