-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply the -runbundles+ decorator on the computed RunBundles when resolving #6407
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
invoker.goals=--no-transfer-progress package | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. I am not too happy this testing takes place in the maven sub project. The functional change is in bnd so it should be tested in the normal bnd testing. The biz.aQute.resolve.RunResolutionTest in biz.aQute.resolve contains examples. I know it is more comfortable to stay in your comfort zone but bnd is a shared project. If you change a function in bnd the test must take place as close as possible to the change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense, I will look into adding test case(s) in RunResolutionTest. Do you want to retain these maven sub project test as well for this particular case, or just the tests within biz.aQute.resolve? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is better to test it once in bnd. I consider ANY error that would be detected in a 'driver' (maven, gradle, eclipse, intellij) an error of the highest severity. We rarely have them fortunately. And in this case, the functionality is clearly in bnd, not the driver. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I have removed the integration tests from the maven sub module. |
||
|
||
# Run mvn with --debug for debug logging | ||
#invoker.debug=true | ||
|
||
# Run mvn in debugging mode and wait for a debugger to attach | ||
#invoker.environmentVariables.MAVEN_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<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>biz.aQute.bnd-test</groupId> | ||
<artifactId>resolver-test</artifactId> | ||
<version>0.0.1</version> | ||
<relativePath>../parent</relativePath> | ||
</parent> | ||
|
||
<artifactId>resolve-with-starlevel-and-runbundles-decorator</artifactId> | ||
<version>0.0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>1.7.36</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>1.2.13</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.eventadmin</artifactId> | ||
<version>1.4.8</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.framework</artifactId> | ||
<version>5.4.0</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-resolver-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import aQute.bnd.build.Workspace | ||
import aQute.bnd.build.model.BndEditModel | ||
import aQute.bnd.osgi.Processor | ||
import aQute.bnd.properties.Document | ||
import aQute.lib.io.IO; | ||
|
||
// The resolve-with-starlevel-and-runbundles-decorator case | ||
|
||
// Check the bndrun file exist! | ||
File bndrunFile = new File(basedir, 'test.bndrun') | ||
assert bndrunFile.isFile() | ||
|
||
// Load the BndEditModel of the bndrun file so we can inspect the result | ||
Processor processor = new Processor() | ||
processor.setProperties(bndrunFile) | ||
BndEditModel bem = new BndEditModel(Workspace.createStandaloneWorkspace(processor, bndrunFile.toURI())) | ||
Document doc = new Document(IO.collect(bndrunFile)) | ||
bem.loadFrom(doc) | ||
|
||
// Get the -runbundles. | ||
def bemRunBundles = bem.getRunBundles() | ||
assert bemRunBundles | ||
assert bemRunBundles.size() == 4 | ||
|
||
StringBuilder sb = new StringBuilder() | ||
bemRunBundles.get(0).formatTo(sb) | ||
assert sb.toString() == "org.apache.felix.eventadmin;version='[1.4.8,1.4.9)';startlevel=1000" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(1).formatTo(sb) | ||
assert sb.toString() == "ch.qos.logback.core;version='[1.2.13,1.2.14)';startlevel=1001" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(2).formatTo(sb) | ||
assert sb.toString() == "ch.qos.logback.classic;version='[1.2.13,1.2.14)';startlevel=1002" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(3).formatTo(sb) | ||
assert sb.toString() == "slf4j.api;version='[1.7.36,1.7.37)';startlevel=999" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-runfw: org.apache.felix.framework | ||
-runrequires: \ | ||
osgi.identity;filter:='(osgi.identity=org.apache.felix.eventadmin)',\ | ||
osgi.identity;filter:='(osgi.identity=slf4j.api)' | ||
|
||
-runbundles+: slf4j.api; startlevel=999 | ||
|
||
-runstartlevel: \ | ||
order = leastdependenciesfirst, \ | ||
begin = 1000, \ | ||
step = 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
invoker.goals=--no-transfer-progress package | ||
|
||
# Run mvn with --debug for debug logging | ||
#invoker.debug=true | ||
|
||
# Run mvn in debugging mode and wait for a debugger to attach | ||
#invoker.environmentVariables.MAVEN_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<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>biz.aQute.bnd-test</groupId> | ||
<artifactId>resolver-test</artifactId> | ||
<version>0.0.1</version> | ||
<relativePath>../parent</relativePath> | ||
</parent> | ||
|
||
<artifactId>resolve-with-starlevel</artifactId> | ||
<version>0.0.1</version> | ||
<packaging>pom</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>1.7.36</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>1.2.13</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.eventadmin</artifactId> | ||
<version>1.4.8</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.felix</groupId> | ||
<artifactId>org.apache.felix.framework</artifactId> | ||
<version>5.4.0</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>biz.aQute.bnd</groupId> | ||
<artifactId>bnd-resolver-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import aQute.bnd.build.Workspace | ||
import aQute.bnd.build.model.BndEditModel | ||
import aQute.bnd.osgi.Processor | ||
import aQute.bnd.properties.Document | ||
import aQute.lib.io.IO; | ||
|
||
// The resolve-with-starlevel case | ||
|
||
// Check the bndrun file exist! | ||
File bndrunFile = new File(basedir, 'test.bndrun') | ||
assert bndrunFile.isFile() | ||
|
||
// Load the BndEditModel of the bndrun file so we can inspect the result | ||
Processor processor = new Processor() | ||
processor.setProperties(bndrunFile) | ||
BndEditModel bem = new BndEditModel(Workspace.createStandaloneWorkspace(processor, bndrunFile.toURI())) | ||
Document doc = new Document(IO.collect(bndrunFile)) | ||
bem.loadFrom(doc) | ||
|
||
// Get the -runbundles. | ||
def bemRunBundles = bem.getRunBundles() | ||
assert bemRunBundles | ||
assert bemRunBundles.size() == 4 | ||
|
||
StringBuilder sb = new StringBuilder() | ||
bemRunBundles.get(0).formatTo(sb) | ||
assert sb.toString() == "org.apache.felix.eventadmin;version='[1.4.8,1.4.9)';startlevel=1000" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(1).formatTo(sb) | ||
assert sb.toString() == "ch.qos.logback.core;version='[1.2.13,1.2.14)';startlevel=1001" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(2).formatTo(sb) | ||
assert sb.toString() == "ch.qos.logback.classic;version='[1.2.13,1.2.14)';startlevel=1002" | ||
|
||
sb = new StringBuilder() | ||
bemRunBundles.get(3).formatTo(sb) | ||
assert sb.toString() == "slf4j.api;version='[1.7.36,1.7.37)';startlevel=1003" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-runfw: org.apache.felix.framework | ||
-runrequires: \ | ||
osgi.identity;filter:='(osgi.identity=org.apache.felix.eventadmin)',\ | ||
osgi.identity;filter:='(osgi.identity=slf4j.api)' | ||
|
||
-runstartlevel: \ | ||
order = leastdependenciesfirst, \ | ||
begin = 1000, \ | ||
step = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to change the check if the runbundles are identical before on line 197. The decoration might change the runbundles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the application of decoration above the older/newer check.