From: Samuel Félix
[mailto:felixcomputer@xxxxxxxxx]
Sent: Wednesday, November 22, 2006
6:08 AM
To: Mik Kersten
Subject: Re: FW: [mylar-dev]
Username and Password Mylar Test
Hello Mik,
I found this page inside the Mylar source code, I'm trying to connect
with Trac through Mylar, but when i was reading the source code, in the
TracRepositoryConnectorTest class, i needed a username and password, look:
Credentials credentials =
MylarTestUtils.readCredentials();
String kind =
TracCorePlugin.REPOSITORY_KIND;
repository = new TaskRepository(kind,
"
http://trac.edgewall.org");
//This line i have some problems****
repository.setAuthenticationCredentials(credentials.username,
credentials.password);
repository.setTimeZoneId
(ITracClient.TIME_ZONE);
repository.setCharacterEncoding(ITracClient.CHARSET);
//repository.setVersion(version.name());
manager.addRepository(repository,
TasksUiPlugin.getDefault ().getRepositoriesFilePath());
AbstractRepositoryConnector
abstractConnector = manager.getRepositoryConnector(kind);
System.out.println(abstractConnector.getRepositoryType());
connector = (TracRepositoryConnector)
abstractConnector;
TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
**** In that line, i suppose that it calls MylarTestUtils, but throws the
Exception "username or password not found in <plug-in dir>/credentials.properties,
make sure file is valid");
When i put the username and password in the code, i have a NullPointerException
Exception in thread "main" java.lang.NullPointerException
at
org.eclipse.core.internal.runtime.auth.AuthorizationHandler.loadKeyring
(AuthorizationHandler.java:42)
at
org.eclipse.core.internal.runtime.auth.AuthorizationHandler.getAuthorizationInfo(AuthorizationHandler.java:175)
at
org.eclipse.core.runtime.Platform.getAuthorizationInfo(Platform.java :608)
at org.eclipse.mylar.tasks.core.TaskRepository.getAuthInfo(TaskRepository.java:172)
at
org.eclipse.mylar.tasks.core.TaskRepository.setAuthenticationCredentials(TaskRepository.java:134)
at trac.TracRepositorySamuel
.<init>(TracRepositorySamuel.java:88)
at
trac.TracRepositorySamuel.main(TracRepositorySamuel.java:144)
Samuel
2006/11/21, Mik Kersten
< beatmik@xxxxxxx >:
I was
reading the Mylar FAQ and I'd like an username and a password to put them in credentials.properties to make some tests
with Mylar,
Thanks
Each
component has it's own All<Component>Tests suite, and all can be run via
org.eclipse.mylar.tests.AllTests.
- Add the following to the test configuration under
Arguments -> VM Arguments: -enableassertions -Xmx384M
- Add a credentials.properties
file to org.eclipse.mylar.bugzilla.tests, and define "username:
xxx" and "password: yyy" in it. Email mylar-dev@xxxxxxxxxx
for a username and password.
--
Samuel Félix de Sousa
Júnior
Graduando em Ciência
da Computação
http://www.samuelfelix.cjb.net