-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a unit test to validate BOMInputStream object fixes the issue in all …
…cases Signed-off-by: Gregory Anne <ganne@effisoft-group.com>
- Loading branch information
Gregory Anne
committed
Aug 17, 2021
1 parent
619933f
commit 64d10a7
Showing
4 changed files
with
164 additions
and
2 deletions.
There are no files selected for viewing
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
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
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,57 @@ | ||
package org.cyclonedx.maven; | ||
|
||
import io.takari.maven.testing.TestResources; | ||
import io.takari.maven.testing.executor.MavenRuntime; | ||
import io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder; | ||
import io.takari.maven.testing.executor.MavenVersions; | ||
import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.Properties; | ||
import org.apache.commons.io.FileUtils; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(MavenJUnitTestRunner.class) | ||
@MavenVersions({"3.6.3"}) | ||
public class Issue117Test { | ||
|
||
@Rule | ||
public final TestResources resources = new TestResources( | ||
"target/test-classes", | ||
"target/test-classes/transformed-projects" | ||
); | ||
|
||
public final MavenRuntime verifier; | ||
|
||
public Issue117Test(MavenRuntimeBuilder runtimeBuilder) | ||
throws Exception { | ||
this.verifier = runtimeBuilder.build(); //.withCliOptions(opts) // // | ||
} | ||
|
||
@Test | ||
public void testPluginWithActiviti() throws IOException, Exception { | ||
File projectDirTransformed = new File( | ||
"target/test-classes/transformed-projects/issue-117" | ||
); | ||
if (projectDirTransformed.exists()) { | ||
FileUtils.cleanDirectory(projectDirTransformed); | ||
projectDirTransformed.delete(); | ||
} | ||
|
||
File projDir = resources.getBasedir("issue-117"); | ||
|
||
Properties props = new Properties(); | ||
|
||
props.load(Issue117Test.class.getClassLoader().getResourceAsStream("test.properties")); | ||
String projectVersion = String.class.cast(props.get("project.version")); | ||
verifier | ||
.forProject(projDir) // | ||
.withCliOption("-Dtest.input.version=" + projectVersion) // debug | ||
.withCliOption("-X") // debug | ||
.withCliOption("-B") | ||
.execute("clean", "package") | ||
.assertErrorFreeLog(); | ||
} | ||
} |
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,66 @@ | ||
<?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/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>issue-117</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0.0</version> | ||
|
||
<name>Issue-117</name> | ||
|
||
<licenses> | ||
<license> | ||
<name>Apache-2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.activiti</groupId> | ||
<artifactId>activiti-engine</artifactId> | ||
<version>5.14</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.cyclonedx</groupId> | ||
<artifactId>cyclonedx-maven-plugin</artifactId> | ||
<version>${test.input.version}</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>makeAggregateBom</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<projectType>library</projectType> | ||
<schemaVersion>1.3</schemaVersion> | ||
<includeBomSerialNumber>true</includeBomSerialNumber> | ||
<includeCompileScope>true</includeCompileScope> | ||
<includeProvidedScope>true</includeProvidedScope> | ||
<includeRuntimeScope>true</includeRuntimeScope> | ||
<includeSystemScope>true</includeSystemScope> | ||
<includeTestScope>true</includeTestScope> | ||
<includeLicenseText>true</includeLicenseText> | ||
<outputFormat>all</outputFormat> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |