Package org.geotools.ml

Examples of org.geotools.ml.Mail


        BigInteger id = (BigInteger) node.getAttributeValue("id");

        List atts = node.getChildValues("attachment");
        Attachment[] attachments = (Attachment[]) atts.toArray(new Attachment[atts.size()]);

        return new Mail(id, body, envelope, attachments);
    }
View Full Code Here


        return new Mail(id, body, envelope, attachments);
    }
   
    @Override
    public Object getProperty(Object object, QName name) throws Exception {
        Mail m = (Mail) object;
        if ( "envelope".equals( name.getLocalPart() ) ) {
            return m.getEnvelope();
        }
       
        return null;
    }
View Full Code Here

        List mails = (List) parser.parse(MLSchemaLocationResolver.class.getResourceAsStream(
                    "mails.xml"));

        assertEquals(2, mails.size());

        Mail mail = (Mail) mails.get(0);
        assertEquals(0, mail.getId().intValue());

        mail = (Mail) mails.get(1);
        assertEquals(1, mail.getId().intValue());
    }
View Full Code Here

        List mails = (List) parser.parse(MLSchemaLocationResolver.class.getResourceAsStream("null-mail.xml"));

        assertEquals(0, parser.getValidationErrors().size());
        assertEquals(1, mails.size());
       
        Mail mail = (Mail) mails.get(0);
        assertNull(mail.getBody());
    }
View Full Code Here

    public void testParse() throws Exception {
        PullParser parser = new PullParser(new MLConfiguration(),
            ML.class.getResourceAsStream("mails.xml"), new QName(ML.NAMESPACE, "mail"));
       
        Mail m = (Mail) parser.parse();
        assertNotNull(m);
        assertEquals(0, m.getId().intValue());

        m = (Mail) parser.parse();
        assertNotNull(m);
        assertEquals(1, m.getId().intValue());

        assertNull(parser.parse());
    }
View Full Code Here

import junit.framework.TestCase;

public class EncoderTest extends TestCase {

    public void testIndent() throws Exception {
        Mail ml = new Mail(BigInteger.valueOf(10), "hi", new Envelope("me@me.org", "you@you.org",
            Calendar.getInstance(), "hey", null), null);
        Encoder e = new Encoder(new MLConfiguration());
        //e.setIndenting(true);
        //e.setIndentSize(4);
View Full Code Here

TOP

Related Classes of org.geotools.ml.Mail

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.