/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.mail;

import static org.junit.Assert.*;

import java.net.MalformedURLException;
import java.net.URL;

import org.junit.Before;
import org.junit.Test;

/**
 * JUnit test case for EmailAttachment Class.
 *
 * @since 1.0
 * @version $Id$
 */
public class EmailAttachmentTest extends AbstractEmailTest
{
    private EmailAttachment attachment;

    @Before
    public void setUpAttachmentTest()
    {
        this.attachment = new EmailAttachment();
    }

    @Test
    public void testGetSetDescription()
    {
        for (int i = 0; i < testCharsValid.length; i++)
        {
            this.attachment.setDescription(testCharsValid[i]);
            assertEquals(testCharsValid[i], this.attachment.getDescription());
        }
    }

    @Test
    public void testGetSetName()
    {
        for (int i = 0; i < testCharsValid.length; i++)
        {
            this.attachment.setName(testCharsValid[i]);
            assertEquals(testCharsValid[i], this.attachment.getName());
        }
    }

    @Test
    public void testGetSetPath()
    {
        for (int i = 0; i < testCharsValid.length; i++)
        {
            this.attachment.setPath(testCharsValid[i]);
            assertEquals(testCharsValid[i], this.attachment.getPath());
        }
    }

    @Test
    public void testGetSetURL() throws Exception
    {
        String[] tests =
            {
                "http://localhost/",
                "http://www.apache.org/",
                "http://foo.notexisting.org" };

        for (int i = 0; i < tests.length; i++)
        {
            URL testURL = new URL(tests[i]);
            this.attachment.setURL(testURL);
            assertEquals(testURL, this.attachment.getURL());
        }
    }

    @Test
    public void testGetSetDisposition()
    {
        for (int i = 0; i < testCharsValid.length; i++)
        {
            this.attachment.setDisposition(testCharsValid[i]);
            assertEquals(testCharsValid[i], this.attachment.getDisposition());
        }
    }

}

@@ -1220,37 +1220,32 @@
 )%0A    %7B%0A        
-this.
 attachment = new
@@ -1264,16 +1264,16 @@
 ment();%0A
+
     %7D%0A%0A 
@@ -1397,37 +1397,32 @@
   %7B%0A            
-this.
 attachment.setDe
@@ -1487,37 +1487,32 @@
 tCharsValid%5Bi%5D, 
-this.
 attachment.getDe
@@ -1661,37 +1661,32 @@
   %7B%0A            
-this.
 attachment.setNa
@@ -1744,37 +1744,32 @@
 tCharsValid%5Bi%5D, 
-this.
 attachment.getNa
@@ -1911,37 +1911,32 @@
   %7B%0A            
-this.
 attachment.setPa
@@ -1994,37 +1994,32 @@
 tCharsValid%5Bi%5D, 
-this.
 attachment.getPa
@@ -2380,37 +2380,32 @@
 %5D);%0A            
-this.
 attachment.setUR
@@ -2450,21 +2450,16 @@
 estURL, 
-this.
 attachme
@@ -2623,21 +2623,16 @@
         
-this.
 attachme
@@ -2717,13 +2717,8 @@
 i%5D, 
-this.
 atta

Remove unnecessary this qualifier