1
|
/**
|
2
|
* Copyright (C) 2017 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.vaadin.mvp;
|
10
|
|
11
|
import java.lang.reflect.InvocationTargetException;
|
12
|
|
13
|
import org.apache.log4j.Logger;
|
14
|
import org.unitils.dbunit.annotation.DataSet;
|
15
|
import org.unitils.spring.annotation.SpringBean;
|
16
|
import org.unitils.spring.annotation.SpringBeanByType;
|
17
|
import org.vaadin.spring.events.EventBus.ViewEventBus;
|
18
|
|
19
|
import com.vaadin.ui.NativeSelect;
|
20
|
|
21
|
import eu.etaxonomy.cdm.api.application.CdmRepository;
|
22
|
import eu.etaxonomy.cdm.model.agent.Institution;
|
23
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
24
|
import eu.etaxonomy.cdm.vaadin.component.common.FilterableAnnotationsField;
|
25
|
import eu.etaxonomy.cdm.vaadin.component.common.TeamOrPersonField;
|
26
|
import eu.etaxonomy.cdm.vaadin.view.reference.ReferenceEditorPresenter;
|
27
|
import eu.etaxonomy.cdm.vaadin.view.reference.ReferencePopupEditorView;
|
28
|
import eu.etaxonomy.vaadin.component.ToOneRelatedEntityCombobox;
|
29
|
|
30
|
/**
|
31
|
* @author a.kohlbecker
|
32
|
* @since Jun 2, 2017
|
33
|
*
|
34
|
*/
|
35
|
// @RunWith(SpringJUnit4ClassRunner.class)
|
36
|
// @ContextConfiguration(classes = { CdmVaadinTestConfiguration.class })
|
37
|
// @VaadinAppConfiguration
|
38
|
public class CdmEditorPresenterTest {
|
39
|
|
40
|
private static final Logger logger = Logger.getLogger(CdmEditorPresenterTest.class);
|
41
|
|
42
|
@SpringBeanByType
|
43
|
protected ViewEventBus viewEventBus;
|
44
|
|
45
|
@SpringBeanByType
|
46
|
private ReferenceEditorPresenter referencePresenter;
|
47
|
|
48
|
@SpringBean("cdmRepository")
|
49
|
private CdmRepository repo;
|
50
|
|
51
|
@DataSet
|
52
|
// @Test test setup not jet working :(
|
53
|
public void testSaveReference() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
54
|
|
55
|
|
56
|
TestReferenceEditorView testView = new TestReferenceEditorView();
|
57
|
referencePresenter.init(testView);
|
58
|
|
59
|
}
|
60
|
|
61
|
class TestReferenceEditorView implements ReferencePopupEditorView {
|
62
|
|
63
|
/**
|
64
|
* {@inheritDoc}
|
65
|
*/
|
66
|
@Override
|
67
|
public NativeSelect getTypeSelect() {
|
68
|
return null;
|
69
|
}
|
70
|
|
71
|
/**
|
72
|
* {@inheritDoc}
|
73
|
*/
|
74
|
@Override
|
75
|
public ToOneRelatedEntityCombobox<Reference> getInReferenceCombobox() {
|
76
|
return null;
|
77
|
}
|
78
|
|
79
|
/**
|
80
|
* {@inheritDoc}
|
81
|
*/
|
82
|
@Override
|
83
|
public TeamOrPersonField getAuthorshipField() {
|
84
|
return null;
|
85
|
}
|
86
|
|
87
|
/**
|
88
|
* {@inheritDoc}
|
89
|
*/
|
90
|
@Override
|
91
|
public FilterableAnnotationsField getAnnotationsField() {
|
92
|
return null;
|
93
|
}
|
94
|
|
95
|
/**
|
96
|
* {@inheritDoc}
|
97
|
*/
|
98
|
@Override
|
99
|
public ToOneRelatedEntityCombobox<Institution> getInstitutionCombobox() {
|
100
|
return null;
|
101
|
}
|
102
|
|
103
|
/**
|
104
|
* {@inheritDoc}
|
105
|
*/
|
106
|
@Override
|
107
|
public ToOneRelatedEntityCombobox<Institution> getSchoolCombobox() {
|
108
|
return null;
|
109
|
}
|
110
|
|
111
|
|
112
|
|
113
|
}
|
114
|
|
115
|
}
|