package org.sameas.sameas4j;

import java.net.URI;
import java.net.URISyntaxException;

import junit.framework.TestCase;

import org.sameas.sameas4j.core.Equivalence;

/**
 * Reference test class for {@link org.sameas.sameas4j.SameAsServiceImpl}.
 *
 * @author Davide Palmisano (dpalmisano@gmail.com)
 * @version $Id$
 */
public class SameAsServiceImplTestClass extends TestCase {

    private SameAsService service = null;

    @Override
    protected void setUp() throws Exception {
        this.service = DefaultSameAsServiceFactory.getSingletonInstance();
    }

    @Override
    protected void tearDown() throws Exception {
        this.service = null;
    }

    public void testGetDuplicates() throws URISyntaxException, SameAsServiceException {
        Equivalence equivalence;
        equivalence = service
                .getDuplicates(new URI("http://www.bbc.co.uk/music/" +
                        "artists/e9dfc148-d5f6-425e-b80b-f99ed2bd7c09"));
        assertNotNull(equivalence);
        assertEquals(10, equivalence.getAmount());
    }

}

@@ -47,44 +47,8 @@
 URI;
-%0Aimport java.net.URISyntaxException;
 %0A%0Aim
@@ -669,28 +669,8 @@
 rows
- URISyntaxException,
  Sam
@@ -746,16 +746,21 @@
 lence = 
+this.
 service%0A
@@ -794,15 +794,18 @@
 tes(
-new URI
+URI.create
 (%22ht
@@ -833,37 +833,8 @@
 sic/
-%22 +%0A                        %22
 arti

test URI doesn't throw URISyntaxException