Examples of UploadFileSpec


Examples of com.meterware.httpunit.UploadFileSpec

        }
    }

    private void addAttachmentInformationInNote(String filename) {
        UploadFileSpec[] testUploads = {
            new UploadFileSpec(filename.substring(filename.lastIndexOf("/")),
                    this.getClass().getClassLoader().getResourceAsStream(filename),
                    "text/plain")
        };
        HttpUnitDialog dialog = getDialog();
        WebForm form = dialog.getForm();
View Full Code Here

Examples of com.meterware.httpunit.protocol.UploadFileSpec

        request.setParameter("myparam", new String[] { "hello",
                "中华人民共和国" });

        try {
            request.setParameter("myfile", new UploadFileSpec[] { //
                    new UploadFileSpec(new File(srcdir, "smallfile.txt")), //
                            new UploadFileSpec(new File(srcdir, "smallfile_.JPG")), //
                            new UploadFileSpec(new File(srcdir, "smallfile.gif")), //
                            new UploadFileSpec(new File(srcdir, "smallfile")), //
                    });
        } catch (IllegalRequestParameterException e) {
        }

        client.putCookie("mycookie", "mycookievalue");
View Full Code Here

Examples of com.meterware.httpunit.protocol.UploadFileSpec

                    File[] files = value instanceof File ? new File[] { (File) value } : (File[]) value;
                    UploadFileSpec[] specs = new UploadFileSpec[files.length];

                    for (int i = 0; i < files.length; i++) {
                        if (files[i].getName().contains(".")) {
                            specs[i] = new UploadFileSpec(files[i]);
                        } else {
                            specs[i] = new UploadFileSpec(files[i], ""); // 对于无后缀的文件,不设contentType
                        }
                    }

                    wr.setParameter(name, specs);
                } else {
View Full Code Here

Examples of com.meterware.httpunit.protocol.UploadFileSpec

                post.selectFile(key, (File) value);
            } else if (value instanceof File[]) {
                UploadFileSpec[] specs = new UploadFileSpec[((File[]) value).length];

                for (int j = 0; j < ((File[]) value).length; j++) {
                    specs[j] = new UploadFileSpec(((File[]) value)[j]);
                }

                post.setParameter(key, specs);
            } else {
                post.setParameter(key, (String) value);
View Full Code Here

Examples of com.meterware.httpunit.protocol.UploadFileSpec

        request.setParameter("myparam", new String[] { "hello",
                                                       "&#20013;&#21326;&#20154;&#27665;&#20849;&#21644;&#22269;" });

        try {
            request.setParameter("myfile", new UploadFileSpec[] { //
                                                                  new UploadFileSpec(new File(srcdir, "smallfile.txt")), //
                                                                  new UploadFileSpec(new File(srcdir, "smallfile_.JPG")), //
                                                                  new UploadFileSpec(new File(srcdir, "smallfile.gif")), //
                                                                  new UploadFileSpec(new File(srcdir, "smallfile")), //
            });
        } catch (IllegalRequestParameterException e) {
        }

        client.putCookie("mycookie", "mycookievalue");
View Full Code Here

Examples of com.meterware.httpunit.protocol.UploadFileSpec

        request.setParameter("myparam", new String[] { "hello",
                                                       "&#20013;&#21326;&#20154;&#27665;&#20849;&#21644;&#22269;" });

        try {
            request.setParameter("myfile", new UploadFileSpec[] { //
                                                                  new UploadFileSpec(new File(srcdir, "smallfile.txt")), //
                                                                  new UploadFileSpec(new File(srcdir, "smallfile_.JPG")), //
                                                                  new UploadFileSpec(new File(srcdir, "smallfile.gif")), //
                                                                  new UploadFileSpec(new File(srcdir, "smallfile")), //
            });
        } catch (IllegalRequestParameterException e) {
        }

        client.putCookie("mycookie", "mycookievalue");
View Full Code Here

Examples of com.meterware.httpunit.protocol.UploadFileSpec

                post.selectFile(key, (File) value);
            } else if (value instanceof File[]) {
                UploadFileSpec[] specs = new UploadFileSpec[((File[]) value).length];

                for (int j = 0; j < ((File[]) value).length; j++) {
                    specs[j] = new UploadFileSpec(((File[]) value)[j]);
                }

                post.setParameter(key, specs);
            } else {
                post.setParameter(key, (String) value);
View Full Code Here

Examples of com.meterware.httpunit.protocol.UploadFileSpec

                    File[] files = value instanceof File ? new File[] { (File) value } : (File[]) value;
                    UploadFileSpec[] specs = new UploadFileSpec[files.length];

                    for (int i = 0; i < files.length; i++) {
                        if (files[i].getName().contains(".")) {
                            specs[i] = new UploadFileSpec(files[i]);
                        } else {
                            specs[i] = new UploadFileSpec(files[i], ""); // 对于无后缀的文件,不设contentType
                        }
                    }

                    wr.setParameter(name, specs);
                } else {
View Full Code Here
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.