Last active
August 29, 2015 14:25
-
-
Save Tembrel/778a180412ef36f13572 to your computer and use it in GitHub Desktop.
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
package org.jukito.example.bindmany; | |
import org.jukito.*; | |
import org.junit.*; | |
import org.junit.runner.*; | |
interface TestInterface { | |
void foo(); | |
} | |
class ImplOne implements TestInterface { | |
public void foo() { | |
System.out.println("ImplOne"); | |
} | |
} | |
class ImplTwo implements TestInterface { | |
public void foo() { | |
System.out.println("ImplTwo"); | |
} | |
} | |
@RunWith(JukitoRunner.class) | |
public class BindManyTest { | |
public static class Module extends JukitoModule { | |
@Override | |
protected void configureTest() { | |
bindMany(TestInterface.class, ImplOne.class, ImplTwo.class); | |
} | |
} | |
public void setup(TestInterface test) { | |
test.foo(); | |
} | |
@Test | |
public void testGetFlight(@All TestInterface test) { | |
setup(test); | |
test.foo(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Produces this output: