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 org.apache.log4j.Logger;
|
12
|
import org.springframework.context.ApplicationEventPublisher;
|
13
|
import org.unitils.dbunit.annotation.DataSet;
|
14
|
import org.unitils.spring.annotation.SpringBean;
|
15
|
import org.unitils.spring.annotation.SpringBeanByType;
|
16
|
|
17
|
import com.vaadin.ui.ListSelect;
|
18
|
|
19
|
import eu.etaxonomy.cdm.api.application.CdmRepository;
|
20
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
21
|
import eu.etaxonomy.cdm.vaadin.view.reference.ReferenceEditorPresenter;
|
22
|
import eu.etaxonomy.cdm.vaadin.view.reference.ReferencePopupEditorView;
|
23
|
import eu.etaxonomy.vaadin.component.ToOneRelatedEntityCombobox;
|
24
|
import eu.etaxonomy.vaadin.ui.view.PopupEditorFactory;
|
25
|
|
26
|
/**
|
27
|
* @author a.kohlbecker
|
28
|
* @since Jun 2, 2017
|
29
|
*
|
30
|
*/
|
31
|
// @RunWith(SpringJUnit4ClassRunner.class)
|
32
|
// @ContextConfiguration(classes = { CdmVaadinTestConfiguration.class })
|
33
|
// @VaadinAppConfiguration
|
34
|
public class CdmEditorPresenterTest {
|
35
|
|
36
|
private static final Logger logger = Logger.getLogger(CdmEditorPresenterTest.class);
|
37
|
|
38
|
@SpringBeanByType
|
39
|
protected ApplicationEventPublisher eventBus;
|
40
|
|
41
|
@SpringBean("cdmRepository")
|
42
|
private CdmRepository repo;
|
43
|
|
44
|
@SpringBeanByType
|
45
|
protected PopupEditorFactory factory;
|
46
|
|
47
|
@DataSet
|
48
|
// @Test test setup not jet working :(
|
49
|
public void testSaveReference() throws IllegalAccessException {
|
50
|
|
51
|
ReferenceEditorPresenter referencePresenter = new ReferenceEditorPresenter();
|
52
|
factory.injectPresenterBeans(ReferenceEditorPresenter.class, referencePresenter);
|
53
|
|
54
|
TestReferenceEditorView testView = new TestReferenceEditorView();
|
55
|
referencePresenter.init(testView);
|
56
|
|
57
|
}
|
58
|
|
59
|
class TestReferenceEditorView implements ReferencePopupEditorView {
|
60
|
|
61
|
/**
|
62
|
* {@inheritDoc}
|
63
|
*/
|
64
|
@Override
|
65
|
public ListSelect getTypeSelect() {
|
66
|
return null;
|
67
|
}
|
68
|
|
69
|
/**
|
70
|
* {@inheritDoc}
|
71
|
*/
|
72
|
@Override
|
73
|
public ToOneRelatedEntityCombobox<Reference> getInReferenceCombobox() {
|
74
|
return null;
|
75
|
}
|
76
|
|
77
|
|
78
|
|
79
|
}
|
80
|
|
81
|
}
|