-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductProgramArgsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2011 Sonatype Inc. and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Sonatype Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.test.product; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.io.File; | ||
import java.nio.file.Files; | ||
import java.util.List; | ||
|
||
import org.apache.maven.it.Verifier; | ||
import org.eclipse.tycho.test.AbstractTychoIntegrationTest; | ||
import org.junit.Test; | ||
|
||
public class ProductProgramArgsTest extends AbstractTychoIntegrationTest { | ||
@Test | ||
public void test() throws Exception { | ||
Verifier verifier = getVerifier("/product.programArgs", true); | ||
verifier.executeGoals(List.of("clean", "verify")); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
File basedir = new File(verifier.getBasedir()); | ||
File productDir = new File(basedir, "target/products/ppa.product/win32/win32/x86"); | ||
|
||
assertFileExists(productDir, "eclipse.ini"); | ||
|
||
File initFile = new File(productDir, "eclipse.ini"); | ||
|
||
List<String> lines = Files.readAllLines(initFile.toPath()); | ||
assertTrue(lines.indexOf("-blah1") >= 0); | ||
assertTrue(lines.indexOf("-blah2") >= 0); | ||
|
||
int configurationLineIndex = lines.indexOf("-configuration"); | ||
assertTrue(configurationLineIndex >= 0); | ||
assertEquals(configurationLineIndex + 1, lines.indexOf("@user.dir/configuration")); | ||
} | ||
|
||
} |