jtulach@198
|
1 |
/*
|
jtulach@198
|
2 |
* To change this template, choose Tools | Templates
|
jtulach@198
|
3 |
* and open the template in the editor.
|
jtulach@198
|
4 |
*/
|
jtulach@198
|
5 |
|
jtulach@198
|
6 |
package impl;
|
jtulach@198
|
7 |
|
jtulach@198
|
8 |
import api.Lookup;
|
jtulach@198
|
9 |
import api.Lookups;
|
jtulach@198
|
10 |
import org.junit.Test;
|
jtulach@198
|
11 |
import static org.junit.Assert.*;
|
jtulach@198
|
12 |
|
jtulach@198
|
13 |
|
jtulach@198
|
14 |
/**
|
jtulach@198
|
15 |
*
|
jtulach@198
|
16 |
* @author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
|
jtulach@198
|
17 |
*/
|
jtulach@198
|
18 |
public class LookupFixedTest {
|
jtulach@198
|
19 |
|
jtulach@198
|
20 |
@Test public void checkConsistency() throws Exception {
|
jtulach@198
|
21 |
|
jtulach@198
|
22 |
Lookup lkp = Lookups.fixed("Hello", 1, 1.0, "World");
|
jtulach@198
|
23 |
|
jtulach@198
|
24 |
assertEquals("1", 1, lkp.lookup(Number.class));
|
jtulach@198
|
25 |
assertEquals("two elements", 2, lkp.lookupAll(Number.class).size());
|
jtulach@198
|
26 |
assertEquals("two classes", 2, lkp.lookupAllClasses(Number.class).size());
|
jtulach@198
|
27 |
|
jtulach@198
|
28 |
assertEquals("Hello", lkp.lookup(String.class));
|
jtulach@198
|
29 |
assertEquals("two strings", 2, lkp.lookupAll(String.class).size());
|
jtulach@198
|
30 |
assertEquals("one string type", 1, lkp.lookupAllClasses(String.class).size());
|
jtulach@198
|
31 |
}
|
jtulach@198
|
32 |
|
jtulach@198
|
33 |
}
|