@@ -0,0 +1,2383 @@
+package es.tid.cosmos.base.data;%0A%0Aimport java.util.Set;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A/**%0A *%0A * @author dmicol%0A */%0Apublic class MessageDescriptorTest %7B%0A    private MessageDescriptor instance;%0A    %0A    @Before%0A    public void setUp() %7B%0A        this.instance = new MessageDescriptor();%0A        this.instance.setMetaFieldValue(MessageDescriptor.MetaFields.TYPE,%0A                                        %22weblog%22);%0A        this.instance.setMetaFieldValue(MessageDescriptor.MetaFields.DELIMITER,%0A                                        %22%5Ct%22);%0A        this.instance.setMetaFieldValue(MessageDescriptor.MetaFields.ANONYMISE,%0A                                        %22user_id,date%22);%0A        this.instance.setFieldColumnIndex(%22user_id%22, 0);%0A        this.instance.setFieldColumnIndex(%22url%22, 2);%0A        this.instance.setFieldColumnIndex(%22date%22, 1);%0A    %7D%0A%0A    @Test%0A    public void testShouldAnonymiseField() %7B%0A        assertTrue(this.instance.shouldAnonymiseField(%22user_id%22));%0A        assertFalse(this.instance.shouldAnonymiseField(%22url%22));%0A        assertTrue(this.instance.shouldAnonymiseField(%22date%22));%0A    %7D%0A%0A    @Test%0A    public void testGetFieldColumnIndex() %7B%0A        assertEquals(0, this.instance.getFieldColumnIndex(%22user_id%22));%0A        assertEquals(2, this.instance.getFieldColumnIndex(%22url%22));%0A        assertEquals(1, this.instance.getFieldColumnIndex(%22date%22));%0A    %7D%0A%0A    @Test(expected=IllegalArgumentException.class)%0A    public void testGetFieldColumnIndexForMissingField() %7B%0A        this.instance.getFieldColumnIndex(%22fake_field%22);%0A    %7D%0A%0A    @Test%0A    public void testGetFieldNames() %7B%0A        Set%3CString%3E fieldNames = this.instance.getFieldNames();%0A        assertEquals(3, fieldNames.size());%0A        assertTrue(fieldNames.contains(%22user_id%22));%0A        assertTrue(fieldNames.contains(%22url%22));%0A        assertTrue(fieldNames.contains(%22date%22));%0A    %7D%0A%0A    @Test%0A    public void testSetFieldColumnIndex() %7B%0A        this.instance.setFieldColumnIndex(%22fake_field%22, 3);%0A        assertEquals(3, this.instance.getFieldColumnIndex(%22fake_field%22));%0A    %7D%0A    %0A    @Test(expected=IllegalArgumentException.class)%0A    public void testSetFieldColumnIndexForRepeatedField() %7B%0A        this.instance.setFieldColumnIndex(%22date%22, 2);%0A    %7D    %0A%7D%0A

Add MessageDescriptorTest.