Package com.semagia.atomico.dm

Examples of com.semagia.atomico.dm.IAuthor


            return true;
        }
        if (!(obj instanceof IAuthor)) {
            return false;
        }
        final IAuthor other = (IAuthor) obj;
        return _name.equals(other.getName())
                && (_email == null ? other.getEmail() == null
                                   : _email.equals(other.getEmail()))
                && (_iri == null ? other.getIRI() == null
                                 : _iri.equals(other.getIRI()));
    }
View Full Code Here


        final String authorIRI = "iri";
        feed = new Feed(id, title, updated);
        feed.addAuthor(createAuthor(authorName, authorEmail, authorIRI));
        final Set<IAuthor> authors = feed.getAuthors();
        assertEquals(1, authors.size());
        final IAuthor author = authors.iterator().next();
        assertEquals(authorName, author.getName());
        assertEquals(authorEmail, author.getEmail());
        assertEquals(authorIRI, author.getIRI());
        try {
            feed.addAuthor(null);
            fail("addAuthor(null) is not allowed");
        }
        catch (IllegalArgumentException ex) {
View Full Code Here

        assertTrue(info.getAuthors().isEmpty());
        assertNull(info.getSummary());
        final String summary = "Summary";
        entity._summary = summary;
        assertEquals(summary, info.getSummary());
        final IAuthor author = createAuthor();
        entity._authors = Collections.singleton(author);
        assertEquals(1, info.getAuthors().size());
        assertEquals(author, info.getAuthors().iterator().next());
    }
View Full Code Here

* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
*/
public class TestAuthor extends TestCase {

    public void testNotEquals() {
        final IAuthor author = new Author();
        assertFalse(author.equals(new Object()));
        assertFalse(author.equals(null));
    }
View Full Code Here

        assertFalse(author.equals(null));
    }

    public void testDefaultConstructor() {
        final String name = "[unknown]";
        final IAuthor author = new Author();
        assertEquals(name, author.getName());
        assertNull(author.getEmail());
        assertNull(author.getIRI());
        assertEquals(author, author);
    }
View Full Code Here

        assertEquals(author, author);
    }

    public void testNameConstructor() {
        final String name = "name";
        final IAuthor author = new Author(name);
        assertEquals(name, author.getName());
        assertNull(author.getEmail());
        assertNull(author.getIRI());
        assertEquals(author.hashCode(), new Author(name).hashCode());
    }
View Full Code Here

    }

    public void testNameEmailConstructor() {
        final String name = "name";
        final String email = "john@example.org";
        final IAuthor author = new Author(name, email);
        assertEquals(name, author.getName());
        assertEquals(email, author.getEmail());
        assertNull(author.getIRI());
        assertEquals(author, new Author(name, email));
        assertEquals(author.hashCode(), new Author(name, email).hashCode());
    }
View Full Code Here

    }

    public void testNameEmailConstructor2() {
        final String name = "name";
        final String email = null;
        final IAuthor author = new Author(name, email);
        assertEquals(name, author.getName());
        assertEquals(email, author.getEmail());
        assertNull(author.getIRI());
    }
View Full Code Here

    public void testNameEmailIRIConstructor() {
        final String name = "name";
        final String email = "john@example.org";
        final String iri = "http://www.semagia.com/";
        final IAuthor author = new Author(name, email, iri);
        assertEquals(name, author.getName());
        assertEquals(email, author.getEmail());
        assertEquals(iri, author.getIRI());
        final IAuthor author2 = new Author(name, email, iri);
        assertEquals(author, author2);
        assertEquals(author.hashCode(), author2.hashCode());
    }
View Full Code Here

    public void testNameEmailIRIConstructor2() {
        final String name = "name";
        final String email = null;
        final String iri = "http://www.semagia.com/";
        final IAuthor author = new Author(name, email, iri);
        assertEquals(name, author.getName());
        assertEquals(email, author.getEmail());
        assertEquals(iri, author.getIRI());
    }
View Full Code Here

TOP

Related Classes of com.semagia.atomico.dm.IAuthor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.