File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
src/test/java/org/scijava/display Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .scijava .display ;
2+
3+ import org .scijava .Priority ;
4+ import org .scijava .plugin .Plugin ;
5+
6+ @ Plugin (type = Display .class , priority = Priority .HIGH )
7+ public class CustomTextDisplay extends AbstractDisplay <String > implements
8+ TextDisplay
9+ {
10+
11+ public CustomTextDisplay () {
12+ super (String .class );
13+ }
14+
15+ @ Override
16+ public void append (final String text ) {
17+ add (text );
18+ }
19+
20+ }
Original file line number Diff line number Diff line change @@ -132,4 +132,14 @@ public void testText() {
132132 assertEquals (value , result );
133133 }
134134
135+ @ Test
136+ public void testMultipleDisplaysPriorityMatch () {
137+ final Context context = new Context (DisplayService .class );
138+ final DisplayService displayService =
139+ context .getService (DisplayService .class );
140+ final String name = "Text" ;
141+ final String value = "Hello" ;
142+ Display <?> display = displayService .createDisplay (name , value );
143+ assertEquals (CustomTextDisplay .class , display .getClass ());
144+ }
135145}
You can’t perform that action at this time.
0 commit comments