Package org.neo4j.batchimport

Source Code of org.neo4j.batchimport.RelTest

package org.neo4j.batchimport;

import org.junit.Before;
import org.junit.Test;
import org.neo4j.batchimport.structs.Relationship;

import static org.junit.Assert.assertEquals;

public class RelTest {

    public static final boolean OUTGOING = true;
    public static final boolean INCOMING = false;
    public static final int NODE_ZERO = 0;
    public static final int TYPE = 11;
    public static final int NODE_ONE = 1;
    private Relationship rel;

    @Before
    public void setUp() throws Exception {
        rel = new Relationship(0);
    }

    @Test
    public void testOutgoingZero() throws Exception {
        rel.init(NODE_ZERO, OUTGOING, TYPE);
        assertEquals(0,rel.other);
        assertEquals(OUTGOING,rel.outgoing());
        assertEquals(NODE_ZERO,rel.other());
    }
    @Test
    public void testIncomingZero() throws Exception {
        rel.init(NODE_ZERO, INCOMING, TYPE);
        assertEquals(INCOMING,rel.outgoing());
        assertEquals(NODE_ZERO,rel.other());
    }
    @Test
    public void testOutgoingOne() throws Exception {
        rel.init(NODE_ONE, OUTGOING, TYPE);
        assertEquals(OUTGOING,rel.outgoing());
        assertEquals(NODE_ONE,rel.other());
    }
    @Test
    public void testIncomingOne() throws Exception {
        rel.init(NODE_ONE, INCOMING, TYPE);
        assertEquals(INCOMING,rel.outgoing());
        assertEquals(NODE_ONE,rel.other());
    }
}
TOP

Related Classes of org.neo4j.batchimport.RelTest

TOP
Copyright © 2018 www.massapi.com. 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.