-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from ahartwellCpointe/message-suppression-rebase
#59 Added the ability to suppress individual manual action notifications
- Loading branch information
Showing
9 changed files
with
157 additions
and
28 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
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
37 changes: 37 additions & 0 deletions
37
...va/org/technologybrewery/fermenter/mda/generator/TestSuppressedNotificationGenerator.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,37 @@ | ||
package org.technologybrewery.fermenter.mda.generator; | ||
|
||
import org.apache.maven.execution.MavenSession; | ||
import org.apache.maven.project.MavenProject; | ||
import org.technologybrewery.fermenter.mda.notification.Notification; | ||
import org.technologybrewery.fermenter.mda.notification.NotificationCollector; | ||
import org.technologybrewery.fermenter.mda.notification.NotificationService; | ||
import org.technologybrewery.fermenter.mda.notification.VelocityNotification; | ||
|
||
import javax.inject.Inject; | ||
import java.io.File; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class TestSuppressedNotificationGenerator extends TestGenerator { | ||
|
||
private List<String> suppressedMessages; | ||
|
||
private NotificationService notificationService; | ||
|
||
public TestSuppressedNotificationGenerator(List<String> messages, MavenSession session) { | ||
super(1, false); | ||
suppressedMessages = messages; | ||
notificationService = new NotificationService(session); | ||
} | ||
|
||
@Override | ||
public void generate(GenerationContext context) { | ||
MavenProject project = new MavenProject(); | ||
project.setFile(new File("src/test/resources/plugin-testing-harness-pom-files/", "suppress-messages")); | ||
Notification notification = new VelocityNotification("test-message-id", new HashSet<>(), "templates/notifications/sample.notification.vm"); | ||
NotificationCollector.addNotification("test-message-id", notification); | ||
notificationService.recordNotifications(project, suppressedMessages); | ||
} | ||
|
||
} |
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
38 changes: 38 additions & 0 deletions
38
fermenter-mda/src/test/resources/plugin-testing-harness-pom-files/suppress-messages/pom.xml
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,38 @@ | ||
<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> | ||
|
||
<name>Model-Driven Architecture Code Generator::Generate Java Project with Default Configurations Test</name> | ||
<groupId>org.technologybrewery.fermenter</groupId> | ||
<artifactId>java-default-config</artifactId> | ||
<version>1.0.0</version> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.technologybrewery.fermenter</groupId> | ||
<artifactId>fermenter-mda</artifactId> | ||
<version>${project.version}</version> | ||
<configuration> | ||
<basePackage>org.technologybrewery.fermenter</basePackage> | ||
<profile>foo</profile> | ||
<suppressedMessages> | ||
<message>test-message-id</message> | ||
</suppressedMessages> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>test-generate</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>generate-sources</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
|
||
</build> | ||
|
||
</project> |
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