blob: a63364ff9b74b35cd47735f2081bdf49f9c60276 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/*******************************************************************************
* Copyright (c) 2012 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.tasks.tests.core;
import junit.framework.TestCase;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
/**
* @author Benjamin Muskalla
*/
public class TaskAttributeMetaDataTest extends TestCase {
private TaskData data;
@Override
protected void setUp() throws Exception {
TaskRepository taskRepository = new TaskRepository("kind", "url");
data = new TaskData(new TaskAttributeMapper(taskRepository), MockRepositoryConnector.CONNECTOR_KIND,
MockRepositoryConnector.REPOSITORY_URL, "taskid");
}
public void testInitialRequiredAttribute() {
TaskAttribute attribute = new TaskAttribute(data.getRoot(), "attributeId");
boolean required = attribute.getMetaData().isRequired();
assertFalse(required);
}
public void testLifecycleRequiredAttribute() {
TaskAttribute attribute = new TaskAttribute(data.getRoot(), "attributeId");
attribute.getMetaData().setRequired(true);
assertTrue(attribute.getMetaData().isRequired());
attribute.getMetaData().setRequired(false);
assertFalse(attribute.getMetaData().isRequired());
}
}
|