Project

General

Profile

Revision d2dc1d6d

IDd2dc1d6d0a517fa19d446fc43870f833dc9498bf
Parent dd75251b
Child 2c27cbc7

Added by Andreas Müller about 1 year ago

ref #7074 fix mediaCreated test data schema

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/SetSubtreePartitioner.java
1
/**
2
* Copyright (C) 2018 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.cdm.persistence.dao.hibernate.taxon;
10

  
11
import java.util.HashSet;
12
import java.util.Set;
13

  
14
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
15
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
16

  
17
/**
18
 * @author a.mueller
19
 * @since 03.05.2018
20
 *
21
 */
22
public class SetSubtreePartitioner {
23

  
24
    public <T extends TaxonBase<?>>  void execute(String queryStr, IProgressMonitor monitor){
25
        Set<T> result = new HashSet<>();
26
//        Query query = getSession().createQuery(String queryStr, IProgressMonitor monitor);
27

  
28
    }
29
}
cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/function/TestModelUpdate.java
9 9

  
10 10
package eu.etaxonomy.cdm.test.function;
11 11

  
12
import java.util.List;
13

  
12 14
import org.apache.log4j.Logger;
13 15

  
14 16
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
......
20 22
import eu.etaxonomy.cdm.database.ICdmDataSource;
21 23
import eu.etaxonomy.cdm.database.update.CdmUpdater;
22 24
import eu.etaxonomy.cdm.database.update.SchemaUpdateResult;
25
import eu.etaxonomy.cdm.model.media.Media;
26
import eu.etaxonomy.cdm.model.reference.Reference;
23 27

  
24 28
/**
25 29
 * This class is meant for functional testing of model changes. It is not meant
26 30
 * for running in maven.
27 31
 *
32
 * For testing
33
 *
34
 * 1. First run with CREATE first against H2, than MySQL, PostGreSQL, (SQLServer)
35
 * 2. Save old schema databases
36
 * 3. Run with VALIDATE
37
 *
38
 *
28 39
 * @author a.mueller
29 40
 * @since 22.05.2015
30 41
 * @see CdmUpdater
......
37 48
	private void testSelectedDb(){
38 49
		DbSchemaValidation schema = DbSchemaValidation.VALIDATE;
39 50

  
40
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
51
		DatabaseTypeEnum dbType = DatabaseTypeEnum.H2;
41 52

  
42 53

  
43
		String database = (schema == DbSchemaValidation.VALIDATE  ? "cdm41" : "cdm47");
44
//		database = "cdm36";
54
		String database = (schema == DbSchemaValidation.VALIDATE  ? "cdm47" : "cdm50");
45 55
		CdmDataSource dataSource = getDatasource(dbType, database);
46 56

  
47 57

  
......
73 83
    		    appCtr.getCommonService().createFullSampleData();
74 84
    		    appCtr.getNameService().list(null, null, null, null, null);
75 85
    		}
86
    		List<Media> medias = appCtr.getMediaService().list(null, null, null, null, null);
87
    		for (Media media: medias){
88
    		    if (media.getMediaCreated() != null){
89
    		        System.out.println(media.getMediaCreated().toString());
90
    		    }
91
    		}
92
    		List<Reference> references = appCtr.getReferenceService().list(null, null, null, null, null);
93
            for (Reference reference: references){
94
                if (reference.getDatePublished() != null){
95
                    System.out.println(reference.getDatePublished().toString());
96
                }
97
            }
76 98

  
77 99

  
78 100
    		appCtr.close();
cdmlib-test/src/main/resources/dbscripts/001-cdm.h2.sql
2766 2766
    LSID_REVISION VARCHAR(255),
2767 2767
    PROTECTEDTITLECACHE BOOLEAN NOT NULL,
2768 2768
    TITLECACHE VARCHAR(255),
2769
    MEDIACREATED TIMESTAMP,
2769
    MEDIACREATED_END VARCHAR(255),
2770
    MEDIACREATED_FREETEXT VARCHAR(255),
2771
    MEDIACREATED_START VARCHAR(255),
2770 2772
    CITATIONMICROREFERENCE VARCHAR(255),
2771 2773
    CREATEDBY_ID INTEGER,
2772 2774
    UPDATEDBY_ID INTEGER,
......
2906 2908
    LSID_REVISION VARCHAR(255),
2907 2909
    PROTECTEDTITLECACHE BOOLEAN,
2908 2910
    TITLECACHE VARCHAR(255),
2909
    MEDIACREATED TIMESTAMP,
2911
    MEDIACREATED_END VARCHAR(255),
2912
    MEDIACREATED_FREETEXT VARCHAR(255),
2913
    MEDIACREATED_START VARCHAR(255),
2910 2914
    CREATEDBY_ID INTEGER,
2911 2915
    UPDATEDBY_ID INTEGER,
2912 2916
    ARTIST_ID INTEGER,
cdmlib-test/src/main/resources/eu/etaxonomy/cdm/database/schema/dataset.dtd
1896 1896
    CREATED CDATA #IMPLIED
1897 1897
    UUID CDATA #IMPLIED
1898 1898
    UPDATED CDATA #IMPLIED
1899
    MEDIACREATED CDATA #IMPLIED
1899
    MEDIACREATED_START CDATA #IMPLIED
1900
    MEDIACREATED_END CDATA #IMPLIED
1901
    MEDIACREATED_FREETEXT CDATA #IMPLIED
1900 1902
    CITATIONMICROREFERENCE CDATA #IMPLIED
1901 1903
    CREATEDBY_ID CDATA #IMPLIED
1902 1904
    UPDATEDBY_ID CDATA #IMPLIED
......
2004 2006
    CREATED CDATA #IMPLIED
2005 2007
    UUID CDATA #IMPLIED
2006 2008
    UPDATED CDATA #IMPLIED
2007
    MEDIACREATED CDATA #IMPLIED
2009
    MEDIACREATED_START CDATA #IMPLIED
2010
    MEDIACREATED_END CDATA #IMPLIED
2011
    MEDIACREATED_FREETEXT CDATA #IMPLIED
2008 2012
    CREATEDBY_ID CDATA #IMPLIED
2009 2013
    UPDATEDBY_ID CDATA #IMPLIED
2010 2014
    ARTIST_ID CDATA #IMPLIED

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)