Package net.sf.redmine_mylyn.api.model

Examples of net.sf.redmine_mylyn.api.model.Configuration


    return new RepositoryResponse(ResponseKind.TASK_CREATED, "" + taskId); //$NON-NLS-1$
  }
 
  public TaskData createTaskDataFromIssue(TaskRepository repository, Issue issue, IProgressMonitor monitor) throws CoreException {

    Configuration configuration = connector.getRepositoryConfiguration(repository);
    try {
      TaskData taskData = new TaskData(getAttributeMapper(repository), RedmineCorePlugin.REPOSITORY_KIND, repository.getRepositoryUrl(), issue.getId() + ""); //$NON-NLS-1$
      createAttributes(repository, taskData, issue, configuration);
      createOperations(taskData, issue, configuration);
View Full Code Here


      return getClientManager().getClient(repository).getConfiguration();
    } catch (RedmineStatusException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return new Configuration();
  }
View Full Code Here

  @Override
  public boolean canCreateNewTask(TaskRepository repository) {
    try {
      IClient client = getClientManager().getClient(repository);
      if (client!=null) {
        Configuration conf = client.getConfiguration();
        if (!conf.getProjects().isEmpty() && !conf.getTrackers().isEmpty()) {
          Project project = conf.getProjects().getAll().get(0);
          List<Tracker> trackers = conf.getTrackers().getById(project.getTrackerIds());
          if (trackers.size()>0) {
            return true;
          }
        }
       
View Full Code Here

    TaskMapper mapper = getTaskMapping(taskData);
    mapper.applyTo(task);

    task.setUrl(getTaskUrl(taskRepository.getUrl(), task.getTaskId()));
   
    Configuration configuration = getRepositoryConfiguration(taskRepository);
    Assert.isNotNull(configuration);
   
    //Set CompletionDate, if Closed-Status
    TaskAttribute attribute = taskData.getRoot().getMappedAttribute(RedmineAttribute.STATUS.getTaskKey());
    IssueStatus issueStatus = configuration.getIssueStatuses().getById(RedmineUtil.parseIntegerId(attribute.getValue()));
    if(issueStatus==null) {
      IStatus status = new Status(IStatus.ERROR, RedmineCorePlugin.PLUGIN_ID, Messages.ERRMSG_MISSING_ISSUE_STATUS+attribute.getValue());
      StatusHandler.log(status);
    } else {
      if(issueStatus.isClosed()) {
View Full Code Here

    assertEquals("50", params.get(2).getValue());
  }

  @Test
  public void testFromNameValuePair() throws Exception {
    Configuration cfg = TestData.cfg;
    Field queryF = QueryFilter.class.getDeclaredField("queryField"); //IQueryField
    queryF.setAccessible(true);
    Field definitionF = QueryFilter.class.getDeclaredField("definition"); //QueryField
    definitionF.setAccessible(true);
    assert(queryF!=null);
    assert(definitionF!=null);
   
    QueryFilter filter;

    assertNull(QueryFilter.fromNameValuePair(new NameValuePair("fields[]", "cf_5"), cfg));
   
    filter = QueryFilter.fromNameValuePair(new NameValuePair("fields[]", "cf_1"), cfg);
    assertSame(cfg.getCustomFields().getById(1), queryF.get(filter));
    assertSame(QueryField.LIST_TYPE, definitionF.get(filter));
   
    filter = QueryFilter.fromNameValuePair(new NameValuePair("fields[]", "cf_9"), cfg);
    assertSame(cfg.getCustomFields().getById(9), queryF.get(filter));
    assertSame(QueryField.DATE_TYPE, definitionF.get(filter));
   
    assertNull(QueryFilter.fromNameValuePair(new NameValuePair("fields[]", "fake"), cfg));

    filter = QueryFilter.fromNameValuePair(new NameValuePair("fields[]", "created_on"), cfg);
View Full Code Here

    assertNotNull(version);
  }
 
  @Test
  public void testUpdateConfiguration() throws Exception {
    Configuration configuration = testee.getConfiguration();
   
    assertNotNull(configuration.getIssueStatuses());
    assertEquals(0, configuration.getIssueStatuses().getAll().size());
   
    assertNotNull(configuration.getIssueCategories());
    assertEquals(0, configuration.getIssueCategories().getAll().size());
   
    assertNotNull(configuration.getIssuePriorities());
    assertEquals(0, configuration.getIssuePriorities().getAll().size());

    assertNotNull(configuration.getTrackers());
    assertEquals(0, configuration.getTrackers().getAll().size());
   
    assertNotNull(configuration.getCustomFields());
    assertEquals(0, configuration.getCustomFields().getAll().size());
   
    assertNotNull(configuration.getUsers());
    assertEquals(0, configuration.getUsers().getAll().size());
   
    assertNotNull(configuration.getQueries());
    assertEquals(0, configuration.getQueries().getAll().size());
   
    assertNotNull(configuration.getProjects());
    assertEquals(0, configuration.getProjects().getAll().size());
   
    assertNotNull(configuration.getVersions());
    assertEquals(0, configuration.getVersions().getAll().size());
   
    assertNull(configuration.getSettings());
   
    testee.updateConfiguration(null);

    assertNotNull(configuration.getIssueStatuses());
    assertEquals(IssueStatusValidator.COUNT, configuration.getIssueStatuses().getAll().size());

    assertNotNull(configuration.getIssueCategories());
    assertEquals(IssueCategoryValidator.COUNT, configuration.getIssueCategories().getAll().size());

    assertNotNull(configuration.getIssuePriorities());
    assertEquals(IssuePriorityValidator.COUNT, configuration.getIssuePriorities().getAll().size());

    assertNotNull(configuration.getTrackers());
    assertEquals(TrackerValidator.COUNT, configuration.getTrackers().getAll().size());

    assertNotNull(configuration.getCustomFields());
    assertEquals(CustomFieldValidator.COUNT, configuration.getCustomFields().getAll().size());
    for (CustomField cf : configuration.getCustomFields().getAll()) {
      assertNotNull(cf.getFieldFormat());
     
      if (cf.isFilter()) {
        assertNotNull("Missing Query-Field for " + cf.getFieldFormat(), cf.getQueryField());
      }
    }

    assertNotNull(configuration.getUsers());
    assertEquals(UserValidator.COUNT, configuration.getUsers().getAll().size());

    assertNotNull(configuration.getQueries());
    assertEquals(QueryValidator.COUNT, configuration.getQueries().getAll().size());

    assertNotNull(configuration.getProjects());
    assertEquals(ProjectValidator.COUNT, configuration.getProjects().getAll().size());

    assertNotNull(configuration.getVersions());
    assertEquals(VersionValidator.COUNT, configuration.getVersions().getAll().size());

    assertNotNull(configuration.getSettings());
  }
View Full Code Here

  IssuesParser testee;
 
  @Before
  public void setUp() throws Exception {
    input = getClass().getResourceAsStream(PartialIssueValidator.RESOURCE_FILE);
    Configuration conf = new ConfigurationMock();
    testee = new IssuesParser(conf);
  }
View Full Code Here

  IssueParser testee;
  IssuesParser testee2;
 
  @Before
  public void setUp() throws Exception {
    Configuration conf = new ConfigurationMock();
    testee = new IssueParser(conf);
    testee2 = new IssuesParser(conf);
  }
View Full Code Here

        AbstractRepositoryConnector reposConn = TasksUi.getRepositoryConnector(taskRepository.getConnectorKind());
        if (reposConn instanceof RedmineRepositoryConnector) {
          RedmineRepositoryConnector redmineReposConnector = (RedmineRepositoryConnector)reposConn;
         
          IClient client = redmineReposConnector.getClientManager().getClient(taskRepository);
          Configuration conf = client.getConfiguration();
          if(conf != null) {
            Project project = conf.getProjects().getById(RedmineUtil.parseIntegerId(product));
            if(project != null) {
              product = ""+project.getIdentifier(); //$NON-NLS-1$
            }
          }
         
View Full Code Here

TOP

Related Classes of net.sf.redmine_mylyn.api.model.Configuration

Copyright © 2018 www.massapicom. 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.