Michael Hanl | 55191d9 | 2013-12-05 11:53:10 +0000 | [diff] [blame^] | 1 | import de.ids_mannheim.korap.query.serialize.MetaCollectionSerializer; |
| 2 | import de.ids_mannheim.korap.query.serialize.MetaQuerySerializer; |
| 3 | import org.junit.Test; |
| 4 | import org.junit.runner.RunWith; |
| 5 | import org.junit.runners.JUnit4; |
| 6 | |
| 7 | import java.io.IOException; |
| 8 | import java.util.HashMap; |
| 9 | import java.util.Map; |
| 10 | |
| 11 | /** |
| 12 | * @author hanl |
| 13 | * @date 04/12/2013 |
| 14 | */ |
| 15 | |
| 16 | @RunWith(JUnit4.class) |
| 17 | public class MetaQuerySerializationTest { |
| 18 | |
| 19 | private MetaQuerySerializer serializer; |
| 20 | |
| 21 | public MetaQuerySerializationTest() { |
| 22 | serializer = new MetaQuerySerializer(); |
| 23 | } |
| 24 | |
| 25 | @Test |
| 26 | public void test() throws IOException { |
| 27 | Map<String, String> j = new HashMap(); |
| 28 | j.put("author", "Goethe"); |
| 29 | j.put("pubPLace", "Erfurt"); |
| 30 | j.put("textClass", "wissenschaft"); |
| 31 | String s = serializer.stringify(j); |
| 32 | // System.out.println("value reference " + s); |
| 33 | } |
| 34 | |
| 35 | @Test |
| 36 | public void testSingle() throws IOException { |
| 37 | Map<String, String> j = new HashMap(); |
| 38 | j.put("textClass", "wissenschaft"); |
| 39 | String s = serializer.stringify(j); |
| 40 | // System.out.println("value reference test single " + s); |
| 41 | } |
| 42 | |
| 43 | @Test |
| 44 | public void testResourceMeta() throws IOException { |
| 45 | MetaCollectionSerializer ser = new MetaCollectionSerializer(); |
| 46 | String s = ser.serialize("25"); |
| 47 | System.out.println(" --- RESULT JSON " + s); |
| 48 | |
| 49 | |
| 50 | } |
| 51 | } |