diff options
author | mkersten | 2007-06-05 01:20:37 +0000 |
---|---|---|
committer | mkersten | 2007-06-05 01:20:37 +0000 |
commit | 77b03f518715908344326384e6f585a84cf3d243 (patch) | |
tree | 7ffaa26a88bca40928cfa1bf8791dd7f4ecae50a /org.eclipse.mylyn.bugzilla.tests | |
parent | 8a2bb7d31f69655928880ac393b1d39cdd3aac84 (diff) | |
download | org.eclipse.mylyn.tasks-77b03f518715908344326384e6f585a84cf3d243.tar.gz org.eclipse.mylyn.tasks-77b03f518715908344326384e6f585a84cf3d243.tar.xz org.eclipse.mylyn.tasks-77b03f518715908344326384e6f585a84cf3d243.zip |
NEW - bug 186070: [api] make IAttachmentHandler API stream-based
https://bugs.eclipse.org/bugs/show_bug.cgi?id=186070
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java index 8e8e85f17..0952ef045 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java @@ -338,15 +338,15 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { attachment.setPatch(false); attachment.setReport(taskData); attachment.setComment("Automated JUnit attachment test"); // optional - + /* Test attempt to upload a non-existent file */ attachment.setFilePath("/this/is/not/a/real-file"); + attachment.setFile(new File(attachment.getFilePath())); // IAttachmentHandler attachmentHandler = // connector.getAttachmentHandler(); BugzillaClient client = connector.getClientManager().getClient(repository); try { - client.postAttachment(attachment.getReport().getId(), attachment.getComment(), attachment.getDescription(), - new File(attachment.getFilePath()), attachment.getContentType(), attachment.isPatch()); + client.postAttachment(attachment.getReport().getId(), attachment.getComment(), attachment); fail(); } catch (Exception e) { } @@ -365,12 +365,12 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { File attachFile = new File(fileName); attachment.setFilePath(attachFile.getAbsolutePath()); BufferedWriter write = new BufferedWriter(new FileWriter(attachFile)); + attachment.setFile(new File(attachment.getFilePath())); // assertFalse(attachmentHandler.uploadAttachment(attachment, // repository.getUserName(), repository.getPassword(), // Proxy.NO_PROXY)); try { - client.postAttachment(attachment.getReport().getId(), attachment.getComment(), attachment.getDescription(), - new File(attachment.getFilePath()), attachment.getContentType(), attachment.isPatch()); + client.postAttachment(attachment.getReport().getId(), attachment.getComment(), attachment); fail(); } catch (Exception e) { } @@ -386,9 +386,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { // assertTrue(attachmentHandler.uploadAttachment(attachment, // repository.getUserName(), repository.getPassword(), // Proxy.NO_PROXY)); - - client.postAttachment(attachment.getReport().getId(), attachment.getComment(), attachment.getDescription(), - new File(attachment.getFilePath()), attachment.getContentType(), attachment.isPatch()); + attachment.setFile(new File(attachment.getFilePath())); + client.postAttachment(attachment.getReport().getId(), attachment.getComment(), attachment); task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, new NullProgressMonitor()); TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); |