Hi, all...
Can anybody give me a hint as to why the following doesn't work? It goes away for a long period of time before coming back with:
The code apes the Bugzilla headless Mylyn API sample pretty closely and actually works without incident against a few other repositories like the Bugzilla landfill 3.0 test repository and the
2.18 test repository. It's only attempting to retrieve a single bug so it puzzles me that something is going memory crazy down within...
public void test_PoC_Bugzilla_fetch_single_bug_on_redhat() throws Exception
{
final String URL = "" href="https://bugzilla.redhat.com">https://bugzilla.redhat.com";
final String BUG_ID = "6740";
TaskRepository repository =
new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND,
URL);
AuthenticationCredentials credentials =
new AuthenticationCredentials("
jerrykuch@xxxxxxxxx",
"wawawa");
repository.setCredentials(AuthenticationType.REPOSITORY,
credentials,
false);
BugzillaRepositoryConnector connector =
new BugzillaRepositoryConnector();
try
{
// Get a bug report from Bugzilla...
TaskData taskData = connector.getTaskData(repository, BUG_ID, null);
// Get the information on the bug report...
ITaskMapping taskMapping = connector.getTaskMapping(taskData);
// Is the task information what we expected it to be?
System.out.println("Summary: " + taskMapping.getSummary());
System.out.println("Priority: " + taskMapping.getPriority());
// Try to access bug report data via attributes...
TaskAttribute descriptionAttribute =
taskData.getRoot().getMappedAttribute(TaskAttribute.COMPONENT);
System.out.println("Component: "
+ descriptionAttribute.getValue());
// ...or by Bugzilla keys
TaskAttribute severityAttribute =
taskData.getRoot().getAttribute(
BugzillaAttribute.BUG_SEVERITY.getKey()
);
System.out.println("Severity: " + severityAttribute.getValue());
}
catch (CoreException e)
{
throw new Exception(e);
}
finally
{
/* This is worth remembering, but really shouldn't be done here
since it shuts down a common global piece of Mylyn infrastructure
which will make subsequent tests fail!
CommonsNetPlugin.getExecutorService().shutdown();
*/
assertTrue(true); // Don't complain about empty finally!
}
}