Skip to content

Commit e8a3f83

Browse files
committed
Add test about consideration of properties in maven.config
1 parent dea2df6 commit e8a3f83

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extensions>
3+
<extension>
4+
<groupId>org.eclipse.tycho</groupId>
5+
<artifactId>tycho-build</artifactId>
6+
<version>${tycho-version-for-extension-test}</version>
7+
</extension>
8+
</extensions>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Dtycho-version-for-extension-test=4.0.6
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: Bundle
4+
Bundle-SymbolicName: my.bundle3
5+
Bundle-Version: 1.0.0.qualifier
6+
Automatic-Module-Name: my.bundle
7+
Bundle-RequiredExecutionEnvironment: JavaSE-17
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source.. = src/
2+
output.. = bin/
3+
bin.includes = META-INF/,\
4+
.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>test</groupId>
4+
<artifactId>tycho-pomless</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<packaging>pom</packaging>
7+
<modules>
8+
<module>bundle</module>
9+
</modules>
10+
<build>
11+
<plugins>
12+
<plugin>
13+
<groupId>org.eclipse.tycho</groupId>
14+
<artifactId>tycho-maven-plugin</artifactId>
15+
<version>${tycho-version-for-extension-test}</version>
16+
<extensions>true</extensions>
17+
</plugin>
18+
</plugins>
19+
</build>
20+
</project>

org.eclipse.m2e.core.tests/src/org/eclipse/m2e/core/ExtensionsTest.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2022 Christoph Läubrich and others.
2+
* Copyright (c) 2022, 2023 Christoph Läubrich and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License 2.0
55
* which accompanies this distribution, and is available at
@@ -73,15 +73,25 @@ public void testLoadSameExtensionFromMultipleLocations() throws Exception {
7373

7474
@Test
7575
public void testReloadExtensionAfterDeletion() throws Exception {
76-
IProject project1 = importPomlessProject("pomless", "bundle/pom.xml");
76+
IProject project = importPomlessProject("pomless", "bundle/pom.xml");
77+
7778
waitForJobsToComplete(monitor);
78-
assertEquals("my.bundle", project1.getName());
79+
assertEquals("my.bundle", project.getName());
7980

8081
WorkspaceHelpers.cleanWorkspace();
8182

82-
project1 = importPomlessProject("pomless", "bundle/pom.xml");
83+
project = importPomlessProject("pomless", "bundle/pom.xml");
8384
waitForJobsToComplete(monitor);
84-
assertEquals("my.bundle", project1.getName());
85+
assertEquals("my.bundle", project.getName());
86+
}
87+
88+
@Test
89+
public void testMavenConfigWithCoreExtension() throws Exception {
90+
IProject project = importPomlessProject("mavenConfig", "bundle/pom.xml");
91+
92+
assertEquals("my.bundle3", project.getName());
93+
assertTrue(project.hasNature("org.eclipse.m2e.core.maven2Nature"));
94+
assertNoErrors(project);
8595
}
8696

8797
@Test

0 commit comments

Comments
 (0)