@@ -0,0 +1,2240 @@
+/**%0A * Copyright 2005 The Apache Software Foundation%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.nutch.protocol;%0A%0Aimport org.apache.nutch.io.TestWritable;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class TestContentProperties extends TestCase %7B%0A%0A    public void testOneValue() throws Exception %7B%0A        ContentProperties properties = new ContentProperties();%0A        String value = %22aValue%22;%0A        properties.setProperty(%22aKey%22, value);%0A        assertEquals(value, properties.get(%22aKey%22));%0A        assertEquals(value, properties.get(%22akey%22));%0A    %7D%0A%0A    public void testMultiValue() throws Exception %7B%0A        ContentProperties properties = new ContentProperties();%0A        String value = %22aValue%22;%0A        for (int i = 0; i %3C 100; i++) %7B%0A            properties.setProperty(%22aKey%22, value + i);%0A%0A        %7D%0A        assertEquals(value + 99, properties.get(%22aKey%22));%0A        assertEquals(value + 99, properties.getProperty(%22aKey%22));%0A        String%5B%5D propertie = properties.getProperties(%22aKey%22);%0A        for (int i = 0; i %3C 100; i++) %7B%0A            assertEquals(value + i, propertie%5Bi%5D);%0A%0A        %7D%0A    %7D%0A%0A    public void testSerialization() throws Exception %7B%0A        ContentProperties properties = new ContentProperties();%0A        for (int i = 0; i %3C 10; i++) %7B%0A            properties.setProperty(%22key%22, %22%22 + i);%0A        %7D%0A        TestWritable.testWritable(properties);%0A        Content content = new Content(%22url%22, %22url%22, new byte%5B0%5D, %22text/html%22,%0A                new ContentProperties());%0A        ContentProperties metadata = content.getMetadata();%0A        for (int i = 0; i %3C 100; i++) %7B%0A            metadata.setProperty(%22aKey%22, %22%22 + i);%0A        %7D%0A        TestWritable.testWritable(content);%0A    %7D%0A%0A%7D%0A

NUTCH-3, Add some missing unit tests