• 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.

  • 相关阅读:
    高阶LOOP
    C 语言常用方法技巧
    Linux内存压力测试memtester工具
    Matrix computations in C
    代码整洁之道语句摘录
    Ubuntu Mysql 常用指令
    linux 汇编 函数调用
    技术有待改进,知识需要更新
    原来那些网络协议都是这么回事啊!!!
    谢谢老乡们的关注……
  • 原文地址:https://www.cnblogs.com/rosepotato/p/3123969.html
Copyright © 2020-2023  润新知