Project

General

Profile

Revision d5994c61

IDd5994c61eaefa9a373e13cdb1b5bbd82b5d10ace
Parent a2cc9f8d
Child 754d57e3

Added by Andreas Kohlbecker over 2 years ago

ref #6169 first attempt to impement prester tests - not working yet

View differences:

pom.xml
460 460
       <artifactId>viritin</artifactId>
461 461
       <version>1.61</version>
462 462
    </dependency>
463
    <!-- 
464
    <dependency>
465
        <groupId>org.vaadin.spring.extensions</groupId>
466
        <artifactId>vaadin-spring-ext-test</artifactId>
467
        <version>0.0.8-SNAPSHOT</version>
468
        <scope>test</scope>
469
    </dependency>
470
     -->
463 471
    <!--     <dependency>
464 472
        only in the edit repo
465 473
      <groupId>org.vaadin.addons</groupId>
src/test/java/eu/etaxonomy/vaadin/mvp/CdmEditorPresenterTest.java
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
}
src/test/resources/eu/etaxonomy/vaadin/mvp/CdmEditorPresenterTest.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
    
3
<dataset>
4
  <REFERENCE ID="1" CREATED="2008-12-10 09:56:07.0" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" UPDATED="2008-12-10 09:56:07.253" REFTYPE="BK" TITLECACHE="Proceedings of Testing Vol. 1"   PROTECTEDTITLECACHE="true" PROTECTEDABBREVTITLECACHE="false" ABBREVTITLECACHE="Sp. Pl." ABBREVTITLE="Sp. Pl." NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" INREFERENCE_ID="4" />
5
 </dataset>

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)