本文整理汇总了Java中com.taskadapter.redmineapi.RedmineManager类的典型用法代码示例。如果您正苦于以下问题:Java RedmineManager类的具体用法?Java RedmineManager怎么用?Java RedmineManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RedmineManager类属于com.taskadapter.redmineapi包,在下文中一共展示了RedmineManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: findNameFor
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see hudson.tasks.UserNameResolver#findNameFor(hudson.model.User)
*/
@Override
public String findNameFor(hudson.model.User u) {
LOGGER.info("Search username for {}", u);
RedmineManager redmineManager = getRedmineManager();
if (redmineManager == null) {
return null;
}
String userId = u.getId();
try {
return redmineManager.getUserByLogin(userId).getFullName();
} catch (RedmineException e) {
LOGGER.info("User {} not found: {}", userId, e.getMessage());
return null;
}
}
开发者ID:cyrilix,项目名称:jenkins-redmine-realm,代码行数:23,代码来源:RedmineUserNameResolver.java
示例2: findMailAddressFor
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see hudson.tasks.MailAddressResolver#findMailAddressFor(hudson.model.User)
*/
@Override
public String findMailAddressFor(hudson.model.User u) {
RedmineManager redmineManager = getRedmineManager();
if (redmineManager == null) {
return null;
}
try {
return redmineManager.getUserByLogin(u.getId()).getMail();
} catch (RedmineException e) {
LOGGER.error("Email not found for {}", u);
return null;
}
}
开发者ID:cyrilix,项目名称:jenkins-redmine-realm,代码行数:21,代码来源:RedmineMailAddressResolver.java
示例3: createRedmineProject
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
private RedmineProject createRedmineProject(RedmineManager redmineManager) {
RedmineProject project = new RedmineProject(redmineManager);
String projectId = getProjectId();
project.setProjectId(projectId);
String currentVersion = getCurrentVersion();
project.setCurrentVersion(currentVersion);
project.addCustomFieldValue(87,"Specializace","Java Developer");
project.setScmUsername("SCM");
project.setStateNew("1");
project.setStateInProgress("4");
project.setStateResolved("6");
project.setStateClosed("7");
/* FG statuses
<option value="1">Nový</option>
<option value="2">Reakce</option>
<option value="3">Ke korektuře</option>
<option value="4" selected="selected">Přiřazený</option>
<option value="5">Schválený</option>
<option value="6">Vyřešený</option>
<option value="7">Uzavřený</option>
*/
return project;
}
开发者ID:francm,项目名称:maven-issuetracking-plugin,代码行数:24,代码来源:RedmineManagerFactory.java
示例4: lookup
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
@Override
public Object lookup(ArquillianResource resource, Annotation... qualifiers) {
final RedmineManager redmineManager = this.redmineManager.get();
if (redmineManager == null) {
throw new IllegalStateException("Redmine manager was not found.");
}
return redmineManager;
}
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:11,代码来源:RedmineClientProvider.java
示例5: isRedmineConnectSuccessful
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
private boolean isRedmineConnectSuccessful() {
ui.message("Checking Redmine connectivity ... ");
try {
RedmineManager redmineManager =
new RedmineManager(redmineUrl, redmineApiKey);
redmineManager.getCurrentUser();
ui.message("[OK]\n");
return true;
} catch (RedmineException e) {
ui.message("*FAILED* (%s)\n", e.toString());
return false;
}
}
开发者ID:cyrilix,项目名称:its-redmine,代码行数:14,代码来源:InitRedmine.java
示例6: RedmineItsFacade
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* Constructor
*
* @param pluginName plugin name
* @param config gerrit configuration
*/
@Inject
public RedmineItsFacade(@PluginName String pluginName,
@GerritServerConfig Config config) {
this.pluginName = pluginName;
this.config = config;
String host = getHost();
String apiAccessKey =
config.getString(pluginName, null, GERRIT_CONFIG_API_KEY);
LOGGER.trace("Initialize redmine-its to {} host", host);
this.redmineManager = new RedmineManager(host, apiAccessKey);
}
开发者ID:cyrilix,项目名称:its-redmine,代码行数:19,代码来源:RedmineItsFacade.java
示例7: testAddRelatedLink
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* Test of method
* {@link RedmineItsFacade#addRelatedLink(String, java.net.URL, String)}
*/
@Test
public void testAddRelatedLink() {
try {
LOGGER.info("------ testAddRelatedLink -------");
IMocksControl control = EasyMock.createStrictControl();
RedmineManager redmineManager = control.createMock(RedmineManager.class);
Issue expectedIssue = new Issue();
expectedIssue.setId(42);
expectedIssue
.setNotes("Related URL: \"description\":http://myredmine.org");
RedmineItsFacade instance = new RedmineItsFacade(redmineManager);
control.reset();
redmineManager.update(expectedIssue);
expectLastCall();
control.replay();
instance.addRelatedLink("42", new URL("http://myredmine.org"),
"description");
control.verify();
} catch (Exception e) {
LOGGER.error("Unexpected error: " + e.getMessage(), e);
fail("Unexpected error: " + e.getMessage());
}
}
开发者ID:cyrilix,项目名称:its-redmine,代码行数:32,代码来源:RedmineItsFacadeTest.java
示例8: init
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* Initialize Redmine connection
* @param rst connection parameters
*/
public static void init(RedmineSourceType rst)
{
if (rst != null)
{
Main.redmineLogger.info("Initialising connection to " + rst.getHost()); //$NON-NLS-1$
redmineManager = new RedmineManager(rst.getHost(), rst.getAccessKey());
}
}
开发者ID:unistra,项目名称:fsp,代码行数:13,代码来源:Connection.java
示例9: join
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
public static String join(String delimToUse, RedmineManager.INCLUDE... include) {
String delim = "";
StringBuilder sb = new StringBuilder();
for (RedmineManager.INCLUDE i : include) {
sb.append(delim).append(i);
delim = delimToUse;
}
return sb.toString();
}
开发者ID:noveogroup,项目名称:android-snitch,代码行数:10,代码来源:Joiner.java
示例10: getRedmineManager
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* Return instance of {@link RedmineManager}
*
* @return
*/
RedmineManager getRedmineManager() {
SecurityRealm realm = Jenkins.getInstance().getSecurityRealm();
if (!(realm instanceof RedmineSecurityRealm)) {
LOGGER.error("Redmine manager not found");
return null;
}
return ((RedmineSecurityRealm) realm).getManager();
}
开发者ID:cyrilix,项目名称:jenkins-redmine-realm,代码行数:15,代码来源:RedmineUserNameResolver.java
示例11: authenticate
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see hudson.security.AbstractPasswordBasedSecurityRealm#authenticate(java.lang.String, java.lang.String)
*/
@Override
protected UserDetails authenticate(String username, String password) throws AuthenticationException {
try {
RedmineManager currentManager = getUserRedmineManager(username, password);
return getUserDetails(currentManager.getCurrentUser());
} catch (RedmineException e) {
LOGGER.error("login failed for user {}: {}", username, e.getMessage(), e);
throw new AuthenticationServiceException("login failed for user " + username, e);
}
}
开发者ID:cyrilix,项目名称:jenkins-redmine-realm,代码行数:16,代码来源:RedmineSecurityRealm.java
示例12: loadUserByUsername
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see hudson.security.AbstractPasswordBasedSecurityRealm#loadUserByUsername(java.lang.String)
*/
@Override
public UserDetails loadUserByUsername(String username) {
try {
RedmineManager redmineManager = getManager();
return getUserDetails(redmineManager.getUserByLogin(username));
} catch (RedmineException e) {
LOGGER.info("User {} not found", username);
throw new UsernameNotFoundException(e.getMessage(), e);
}
}
开发者ID:cyrilix,项目名称:jenkins-redmine-realm,代码行数:16,代码来源:RedmineSecurityRealm.java
示例13: testLoadGroupByGroupname
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* Test de la méthode {@link RedmineSecurityRealm#loadGroupByGroupname}
*/
@Test
public void testLoadGroupByGroupname() {
LOGGER.info("------ testLoadGroupByGroupname -------");
try {
IMocksControl control = createStrictControl();
final RedmineManager redmineManager = control.createMock(RedmineManager.class);
RedmineSecurityRealm instance = new RedmineSecurityRealm(
"url", "key") {
/**
* {@inheritDoc}
*
* @see com.bouygtel.jenkins.redmine.RedmineSecurityRealm#getUserRedmineManager(java.lang.String,
* java.lang.String)
*/
@Override
RedmineManager getUserRedmineManager(String username, String password) {
assertThat(username, is("username"));
assertThat(password, is("password"));
return redmineManager;
}
};
control.reset();
control.replay();
GroupDetails result = instance.loadGroupByGroupname("groupname");
assertThat(result, is((GroupDetails) new RedmineGroupDetails("groupname")));
control.verify();
} catch (Exception e) {
LOGGER.error("Erreur imprévue: " + e.getMessage(), e);
Assert.fail("Erreur imprévue: " + e.getMessage());
}
}
开发者ID:cyrilix,项目名称:jenkins-redmine-realm,代码行数:41,代码来源:RedmineSecurityRealmTest.java
示例14: isUnderDevelopmentSuspect
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
protected boolean isUnderDevelopmentSuspect(Issue issue) {
try {
Integer id = Integer.valueOf(issue.getId());
log.debug("Get issue {}",id);
com.taskadapter.redmineapi.bean.Issue redmineIssue = project.getRedmineManager().getIssueById(id, RedmineManager.INCLUDE.journals);
boolean result = isIssueWithSpentHours(redmineIssue) || isIssueWithDoneRatio(redmineIssue) || isIssueWithCommits(redmineIssue);
if ( result ) {
log.debug("Issue {} is suspect as under development",redmineIssue);
}
return result;
} catch (RedmineException e) {
throw new RuntimeException(e);
}
}
开发者ID:francm,项目名称:maven-issuetracking-plugin,代码行数:15,代码来源:RedmineIssueManager.java
示例15: getRedmineManager
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
public RedmineManager getRedmineManager(Properties properties) {
String uri = properties.getProperty("redmine-uri");
String login = properties.getProperty("redmine-login");
String password = properties.getProperty("redmine-password");
String apiAccessKey = properties.getProperty("redmine-apiAccessKey");
if ( apiAccessKey!=null ) {
return new RedmineManager(uri,apiAccessKey);
}
else {
return new RedmineManager(uri,login,password);
}
}
开发者ID:francm,项目名称:maven-issuetracking-plugin,代码行数:14,代码来源:RedmineManagerFactory.java
示例16: canProvide
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
@Override
public boolean canProvide(Class<?> type) {
return RedmineManager.class.isAssignableFrom(type);
}
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:5,代码来源:RedmineClientProvider.java
示例17: getRedmineManager
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
public RedmineManager getRedmineManager() {
return redmineManager;
}
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:4,代码来源:RedmineGovernorClient.java
示例18: getInstance
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* Gets connection to redmine server
* @return connection
* @throws ParameterException exception
*/
public static RedmineManager getInstance() throws ParameterException
{
if(redmineManager == null) throw new ParameterException("Redmine connection not initialized"); //$NON-NLS-1$
return redmineManager;
}
开发者ID:unistra,项目名称:fsp,代码行数:11,代码来源:Connection.java
示例19: createManager
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
private void createManager() {
redmineManager = new RedmineManager(server);
redmineManager.setLogin(login);
redmineManager.setPassword(password);
}
开发者ID:noveogroup,项目名称:android-snitch,代码行数:6,代码来源:RedMineControllerWrapper.java
示例20: testFindNameFor
import com.taskadapter.redmineapi.RedmineManager; //导入依赖的package包/类
/**
* Test de la méthode {@link RedmineUserNameResolver#findNameFor(hudson.model.User)}
*/
@Test
public void testFindNameFor() {
LOGGER.info("------ testFindNameFor -------");
try {
IMocksControl control = createStrictControl();
final RedmineManager redmineManager = control.createMock(RedmineManager.class);
User user = control.createMock(User.class);
com.taskadapter.redmineapi.bean.User userRedmine = new com.taskadapter.redmineapi.bean.User();
userRedmine.setMail("[email protected]");
userRedmine.setFullName("User fullName");
RedmineUserNameResolver instance = new RedmineUserNameResolver() {
/**
* {@inheritDoc}
*
* @see com.bouygtel.jenkins.redmine.RedmineUserNameResolver#getRedmineManager()
*/
@Override
RedmineManager getRedmineManager() {
return null;
}
};
assertThat(instance.findNameFor(user), nullValue());
// Name matching
instance = new RedmineUserNameResolver() {
/**
* {@inheritDoc}
*
* @see com.bouygtel.jenkins.redmine.RedmineUserNameResolver#getRedmineManager()
*/
@Override
RedmineManager getRedmineManager() {
return redmineManager;
}
};
control.reset();
expect(user.getId()).andReturn("userLogin");
expect(redmineManager.getUserByLogin("userLogin")).andReturn(userRedmine);
control.replay();
assertThat(instance.findNameFor(user), is("User fullName"));
control.verify();
// User not found
control.reset();
expect(user.getId()).andReturn("userLogin");
expect(redmineManager.getUserByLogin("userLogin")).andThrow(
new NotFoundException("User not found for test"));
control.replay();
assertThat(instance.findNameFor(user), nullValue());
control.verify();
} catch (Exception e) {
LOGGER.error("Erreur imprévue: " + e.getMessage(), e);
fail("Erreur imprévue: " + e.getMessage());
}
}
开发者ID:cyrilix,项目名称:jenkins-redmine-realm,代码行数:68,代码来源:RedmineUserNameResolverTest.java
注:本文中的com.taskadapter.redmineapi.RedmineManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论