Skip to content

Commit

Permalink
Add IT test for issue #4653
Browse files Browse the repository at this point in the history
Add license header

Add license header

Add license header

(cherry picked from commit 69f9754)
  • Loading branch information
zladdi authored and eclipse-tycho-bot committed Feb 8, 2025
1 parent 8226066 commit 5d4e258
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: dependee
Bundle-SymbolicName: dependee
Bundle-Version: 0.0.1.qualifier
Export-Package: dependee,
org.apache.commons.lang3
Bundle-ClassPath: .,
lib/commons-lang3.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source.. = src/
output.. = classes/
bin.includes = META-INF/,\
.,\
lib/commons-lang3.jar
45 changes: 45 additions & 0 deletions tycho-its/projects/target.eagerResolver/dependee/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tycho-its-project.osgitools.artifactsWithKnownLocation</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dependee</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<commons-lang3.version>3.17.0</commons-lang3.version>
</properties>
<!-- Taken and adapted from https://stackoverflow.com/questions/28542595/how-to-embed-a-library-jar-in-an-osgi-bundle-using-tycho/30872071#30872071 -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-libraries</id>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<item>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</item>
</artifactItems>
<outputDirectory>lib</outputDirectory>
<stripVersion>true</stripVersion>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* 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
*******************************************************************************/
package dependee;

import org.apache.commons.lang3.BitField;
import org.apache.commons.lang3.StringUtils;

public class DependeeExample {

public DependeeExample() { }

public boolean isStringBlank(String s) {
return StringUtils.isBlank(s);
}

public BitField getBitField() {
return new BitField(0xFFFFFF);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: dependent
Bundle-SymbolicName: dependent
Bundle-Version: 0.0.1.qualifier
Require-Bundle: dependee
Bundle-ClassPath: .
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source.. = src/
output.. = classes/
bin.includes = META-INF/,\
.,\
11 changes: 11 additions & 0 deletions tycho-its/projects/target.eagerResolver/dependent/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tycho-its-project.osgitools.artifactsWithKnownLocation</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dependent</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*******************************************************************************
* 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
*******************************************************************************/
import org.apache.commons.lang3.StringUtils;
import dependee.DependeeExample;

public class DependentExample {

public static void main(String[] args) {
DependeeExample dependeeEx = new DependeeExample();
String s = " ";
boolean sIsBlank = StringUtils.isBlank(s);

System.out.println("s is blank: " + sIsBlank);
System.out.println("bitfield is: " + dependeeEx.getBitField());
}
}
33 changes: 33 additions & 0 deletions tycho-its/projects/target.eagerResolver/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>tycho-its-project.osgitools.artifactsWithKnownLocation</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>dependee</module>
<module>dependent</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<requireEagerResolve>true</requireEagerResolve>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* 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
*******************************************************************************/
package org.eclipse.tycho.test.target;

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.junit.Test;

import java.util.List;

// See issue https://github.com/eclipse-tycho/tycho/issues/4653
public class TargetPlatformEagerResolverTest extends AbstractTychoIntegrationTest {
@Test
public void testTargetPlatformForJUnit5() throws Exception {
Verifier verifier = getVerifier("target.eagerResolver", false, true);
verifier.executeGoals(List.of("clean", "verify"));
verifier.verifyErrorFreeLog();
}
}

0 comments on commit 5d4e258

Please sign in to comment.