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.ListSelect;
|
20
|
|
21
|
import eu.etaxonomy.cdm.api.application.CdmRepository;
|
22
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
23
|
import eu.etaxonomy.cdm.vaadin.component.common.FilterableAnnotationsField;
|
24
|
import eu.etaxonomy.cdm.vaadin.component.common.TeamOrPersonField;
|
25
|
import eu.etaxonomy.cdm.vaadin.view.reference.ReferenceEditorPresenter;
|
26
|
import eu.etaxonomy.cdm.vaadin.view.reference.ReferencePopupEditorView;
|
27
|
import eu.etaxonomy.vaadin.component.ToOneRelatedEntityCombobox;
|
28
|
|
29
|
/**
|
30
|
* @author a.kohlbecker
|
31
|
* @since Jun 2, 2017
|
32
|
*
|
33
|
*/
|
34
|
// @RunWith(SpringJUnit4ClassRunner.class)
|
35
|
// @ContextConfiguration(classes = { CdmVaadinTestConfiguration.class })
|
36
|
// @VaadinAppConfiguration
|
37
|
public class CdmEditorPresenterTest {
|
38
|
|
39
|
private static final Logger logger = Logger.getLogger(CdmEditorPresenterTest.class);
|
40
|
|
41
|
@SpringBeanByType
|
42
|
protected ViewEventBus viewEventBus;
|
43
|
|
44
|
@SpringBeanByType
|
45
|
private ReferenceEditorPresenter referencePresenter;
|
46
|
|
47
|
@SpringBean("cdmRepository")
|
48
|
private CdmRepository repo;
|
49
|
|
50
|
@DataSet
|
51
|
// @Test test setup not jet working :(
|
52
|
public void testSaveReference() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
53
|
|
54
|
|
55
|
TestReferenceEditorView testView = new TestReferenceEditorView();
|
56
|
referencePresenter.init(testView);
|
57
|
|
58
|
}
|
59
|
|
60
|
class TestReferenceEditorView implements ReferencePopupEditorView {
|
61
|
|
62
|
/**
|
63
|
* {@inheritDoc}
|
64
|
*/
|
65
|
@Override
|
66
|
public ListSelect getTypeSelect() {
|
67
|
return null;
|
68
|
}
|
69
|
|
70
|
/**
|
71
|
* {@inheritDoc}
|
72
|
*/
|
73
|
@Override
|
74
|
public ToOneRelatedEntityCombobox<Reference> getInReferenceCombobox() {
|
75
|
return null;
|
76
|
}
|
77
|
|
78
|
/**
|
79
|
* {@inheritDoc}
|
80
|
*/
|
81
|
@Override
|
82
|
public TeamOrPersonField getAuthorshipField() {
|
83
|
return null;
|
84
|
}
|
85
|
|
86
|
/**
|
87
|
* {@inheritDoc}
|
88
|
*/
|
89
|
@Override
|
90
|
public FilterableAnnotationsField getAnnotationsField() {
|
91
|
return null;
|
92
|
}
|
93
|
|
94
|
|
95
|
|
96
|
}
|
97
|
|
98
|
}
|