zoukankan      html  css  js  c++  java
  • How to send mail by java mail in Android uiautomator testing?

    1. Go to link

    http://www.cnblogs.com/rosepotato/admin/Files.aspx to download the libs_javamail_jars.7z which contains activation.jar,additionnal.jar and mail.jar and java file Mail.7z.

    2. put the activation.jar,additionnal.jar and mail.jar into libs directory.

    3. copy

        <property name="jar.libs.dir" value="libs" />
        <property name="jar.libs.absolute.dir" location="${jar.libs.dir}" />
        <path id="classpath">
            <fileset dir="${jar.libs.absolute.dir}">
                <include name="activation.jar"/>
                <include name="additionnal.jar"/>
                <include name="mail.jar"/>
            </fileset>
        </path>

    before the line

        <!-- version-tag: VERSION_TAG -->
        <import file="${sdk.dir}/tools/ant/uibuild.xml" />
    

     in build.xml.

    4. put

        <!-- overwrite the compile target in uibuild.xml to include to external jars -->
        <target name="compile" depends="-build-setup, -pre-compile">
            <javac encoding="${java.encoding}"
                    source="${java.source}" target="${java.target}"
                    debug="true" extdirs="" includeantruntime="false"
                    destdir="${out.classes.absolute.dir}"
                    bootclasspathref="project.target.class.path"
                    verbose="${verbose}"
                    fork="${need.javac.fork}">
                    <src path="${source.absolute.dir}" />
                    <classpath refid="classpath"/>
                    <compilerarg line="${java.compilerargs}" />
            </javac>
        </target>
    
        <!-- overwrite the -dex target in uibuild.xml to include external jar files into the target dex file. -->
        <target name="-dex" depends="compile, -post-compile">
            <dex executable="${dx}"
                    output="${intermediate.dex.file}"
                    nolocals="@{nolocals}"
                    verbose="${verbose}">
                <fileset dir="${jar.libs.absolute.dir}">
                     <include name="activation.jar"/>
                     <include name="additionnal.jar"/>
                     <include name="mail.jar"/>
                </fileset>
                <path path="${out.classes.absolute.dir}"/>
            </dex>
        </target>

    after the line

        <!-- version-tag: VERSION_TAG -->
        <import file="${sdk.dir}/tools/ant/uibuild.xml" />

    then, everything is ok.

  • 相关阅读:
    curl命令学习笔记
    IOS安全测试思维导图
    Hello World
    Hive SQL使用和数据加载的一点总结
    采用最低松弛度优先调度的实时系统调度程序
    MongoDB Map Reduce速度提升20倍的优化宝典
    释放时间不同可中断平行机问题在线算法
    RPC框架系列——Avro
    Solr 3.6.2索引MySQL数据库配置过程
    IKAnalyzer 独立使用 配置扩展词库
  • 原文地址:https://www.cnblogs.com/rosepotato/p/3123969.html
Copyright © 2011-2022 走看看