1 /******************************************************************************* 2 * Copyright (c) 2009, 2017 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 *******************************************************************************/ 14 package org.eclipse.equinox.frameworkadmin.tests; 15 16 import static org.junit.Assert.assertEquals; 17 18 import java.io.File; 19 import java.io.IOException; 20 import org.eclipse.equinox.internal.provisional.frameworkadmin.*; 21 import org.junit.Test; 22 import org.osgi.framework.BundleException; 23 24 public class ReaderTestBug267850 extends AbstractFwkAdminTest { 25 private File installFolder = null; 26 private String launcherName = "eclipse"; 27 28 @Test testConfigContent()29 public void testConfigContent() throws IllegalStateException, FrameworkAdminRuntimeException, IOException, BundleException { 30 startSimpleConfiguratorManipulator(); 31 32 FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin(); 33 Manipulator manipulator = fwkAdmin.getManipulator(); 34 35 installFolder = getTestData(ReaderTestBug267850.class.getName(),"dataFile/readerTestBug267850"); 36 37 LauncherData launcherData = manipulator.getLauncherData(); 38 launcherData.setLauncher(new File(installFolder, launcherName)); 39 try { 40 manipulator.load(); 41 } catch (IllegalStateException e) { 42 //TODO We ignore the framework JAR location not set exception 43 } 44 LauncherData data = manipulator.getLauncherData(); 45 String[] args = data.getProgramArgs(); 46 assertEquals("-startup", args[0]); 47 // assertEquals("file:/C:/1target/provmiddle/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/plugins/org.eclipse.equinox.launcher_1.0.200.v20090306-1900.jar", args[1]); 48 assertEquals("--launcher.library", args[2]); 49 // assertEquals("file:/C:/1target/provmiddle/org.eclipse.equinox.frameworkadmin.test/dataFile/readerTestBug267850/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090306-1900", args[3]); 50 assertEquals("-showsplash", args[4]); 51 assertEquals("org.eclipse.platform", args[5]); 52 assertEquals("--launcher.XXMaxPermSize", args[6]); 53 assertEquals("256m", args[7]); 54 } 55 56 } 57