Package org.springframework.data.neo4j.aspects

Examples of org.springframework.data.neo4j.aspects.Person


public class PropertyTests extends EntityTestBase {

    @Test
    @Transactional
    public void testSetPropertyEnum() {
        Person p = persistedPerson("Michael", 35);
        p.setPersonality(Personality.EXTROVERT);
        assertEquals("Wrong enum serialization.", "EXTROVERT", getNodeState(p).getProperty("personality"));
    }
View Full Code Here


    }

    @Test
    @Transactional
    public void testGetPropertyEnum() {
        Person p = persistedPerson("Michael", 35);
        getNodeState(p).setProperty("personality", "EXTROVERT");
        assertEquals("Did not deserialize property value properly.", Personality.EXTROVERT, p.getPersonality());
    }
View Full Code Here

    }

    @Test(expected = NotFoundException.class)
    @Transactional
    public void testSetTransientPropertyFieldNotManaged() {
        Person p = persistedPerson("Michael", 35);
        p.setThought("food");
        getNodeState(p).getProperty("thought");
    }
View Full Code Here

     * @see DATAGRAPH-368
     * */
    @Test
    @Transactional
    public void testSetTransientPropertyBeforePersist() {
        Person p = new Person();
        p.setThought("detached");
        p.persist();
        // test asserts that no NPE is thrown
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testSetTransientPropertyAfterPersist() {
        Person p = persistedPerson("Michael", 35);
        p.setThought("attached");
        assertEquals("Transient property should be saved in the entity", "attached", p.getThought());
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testGetTransientPropertyFieldNotManaged() {
        Person p = persistedPerson("Michael", 35);
        p.setThought("food");
        getNodeState(p).setProperty("thought", "sleep");
        assertEquals("Should not have read transient value from graph.", "food", p.getThought());
    }
View Full Code Here

    }
    @Test
    @Transactional
    @Rollback(false)
    public void testRelationshipSetPropertyDate() {
        Person p = persistedPerson("Michael", 35);
        Person p2 = persistedPerson("David", 25);
        Friendship f = p.knows(p2);
        f.setFirstMeetingDate(new Date(3));
        assertEquals("Date not serialized properly.", "3", getRelationshipState(f).getProperty("Friendship.firstMeetingDate"));
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testRelationshipGetPropertyDate() {
        Person p = persistedPerson("Michael", 35);
        Person p2 = persistedPerson("David", 25);
        Friendship f = p.knows(p2);
        getRelationshipState(f).setProperty("Friendship.firstMeetingDate", "3");
        assertEquals("Date not deserialized properly.", new Date(3), f.getFirstMeetingDate());
    }
View Full Code Here

    }

    @Test(expected = NotFoundException.class)
    @Transactional
    public void testRelationshipSetTransientPropertyFieldNotManaged() {
        Person p = persistedPerson("Michael", 35);
        Person p2 = persistedPerson("David", 25);
        Friendship f = p.knows(p2);
        f.setLatestLocation("Menlo Park");
        getRelationshipState(f).getProperty("Friendship.latestLocation");
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testRelationshipGetTransientPropertyFieldNotManaged() {
        Person p = persistedPerson("Michael", 35);
        Person p2 = persistedPerson("David", 25);
        Friendship f = p.knows(p2);
        f.setLatestLocation("Menlo Park");
        getRelationshipState(f).setProperty("Friendship.latestLocation", "Palo Alto");
        assertEquals("Should not have read transient value from graph.", "Menlo Park", f.getLatestLocation());
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.neo4j.aspects.Person

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.