Package mireka.address.parser

Source Code of mireka.address.parser.ReversePathTest

package mireka.address.parser;

import static org.junit.Assert.*;
import mireka.address.parser.ast.NullReversePathAST;
import mireka.address.parser.ast.RealReversePathAST;
import mireka.address.parser.ast.ReversePathAST;

import org.junit.Test;

public class ReversePathTest {
    @Test
    public void testNullReversePath() throws Exception {
        ReversePathAST reversePathAST = new ReversePathParser("<>").parse();
        assertTrue(reversePathAST instanceof NullReversePathAST);
    }

    @Test
    public void testNonNullReversePath() throws Exception {
        ReversePathAST reversePathAST =
                new ReversePathParser("<john@example.com>").parse();
        assertTrue(reversePathAST instanceof RealReversePathAST);
        assertEquals(
                "john",
                ((RealReversePathAST) reversePathAST).pathAST.mailboxAST.localPartAST.spelling);

    }
}
TOP

Related Classes of mireka.address.parser.ReversePathTest

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.