Skip to content

Commit

Permalink
fixes [#2155] and hence PR playframework#1138 and PR playframework#1144
Browse files Browse the repository at this point in the history
  • Loading branch information
flybyray authored and xael-fry committed Apr 8, 2019
1 parent ea7661a commit 28336b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions framework/test-src/play/plugins/PluginCollectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static org.mockito.Mockito.when;

import java.io.File;
import java.net.URL;
import java.util.Collection;

import org.junit.Before;
Expand Down Expand Up @@ -80,8 +81,10 @@ protected boolean isLoadedByApplicationClassloader(PlayPlugin plugin) {
@Test
public void skipsDuplicatePlugins() {
PluginCollection pc = spy(new PluginCollection());
when(pc.loadPlayPluginDescriptors())
.thenReturn(asList(getClass().getResource("custom-play.plugins"), getClass().getResource("custom-play.plugins.duplicate")));
URL resource1 = getClass().getResource("custom-play.plugins");
URL resource2 = getClass().getResource("custom-play.duplicate.plugins");
assertThat(resource2).isNotNull();
when(pc.loadPlayPluginDescriptors()).thenReturn(asList(resource1, resource2));
pc.loadPlugins();
assertThat(pc.getAllPlugins()).containsExactly(pc.getPluginInstance(EnhancerPlugin.class), pc.getPluginInstance(TestPlugin.class));
}
Expand Down
2 changes: 2 additions & 0 deletions framework/test-src/play/plugins/custom-play.duplicate.plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0:play.plugins.EnhancerPlugin
1:play.plugins.TestPlugin
2 changes: 0 additions & 2 deletions framework/test-src/play/plugins/custom-play.plugins.duplicate

This file was deleted.

0 comments on commit 28336b6

Please sign in to comment.