Project

General

Profile

« Previous | Next » 

Revision f588e53b

Added by Andreas Müller over 3 years ago

cleanup

View differences:

cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/specimen/excel/in/ExcelSpecimenImportExampleTest.java
6 6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
 * See LICENSE.TXT at the top of this package for the full license terms.
8 8
 */
9

  
10 9
package eu.etaxonomy.cdm.io.specimen.excel.in;
11 10

  
12 11
import static org.junit.Assert.assertEquals;
......
46 45
		CdmTransactionalIntegrationTest {
47 46

  
48 47
	@SpringBeanByName
49
	CdmApplicationAwareDefaultImport<?> defaultImport;
48
	private CdmApplicationAwareDefaultImport<?> defaultImport;
50 49

  
51 50
	@SpringBeanByType
52
	INameService nameService;
51
	private INameService nameService;
53 52

  
54 53
	@SpringBeanByType
55
	IOccurrenceService occurrenceService;
54
	private IOccurrenceService occurrenceService;
56 55

  
57 56
	private IImportConfigurator configurator;
58 57
	private IImportConfigurator configuratorXslx;
......
84 83
			e.printStackTrace();
85 84
			Assert.fail("Xslx configurator could not be created");
86 85
		}
87

  
88

  
89

  
90

  
91

  
92 86
	}
93 87

  
94 88
	@Test
......
98 92
		assertNotNull("occurence service should not be null", occurrenceService);
99 93
	}
100 94

  
101

  
102 95
	 @Test
103 96
//	 @Ignore  //does not run together with testResultSet or others
104 97
	 @DataSets({
......
166 159
//		} catch (FileNotFoundException e) {
167 160
//			Assert.fail(e.getLocalizedMessage());
168 161
//		}
169

  
170 162
	}
171 163

  
172 164
    @Override
173
    public void createTestDataSet() throws FileNotFoundException {
174
        // TODO Auto-generated method stub
175
    }
176

  
165
    public void createTestDataSet() throws FileNotFoundException {}
177 166
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/MediaRepresentation.java
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
9

  
10 9
package eu.etaxonomy.cdm.model.media;
11 10

  
12

  
13 11
import java.lang.reflect.Constructor;
14 12
import java.util.ArrayList;
15 13
import java.util.List;
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/media/MediaRepresentationPartDaoImplTest.java
106 106
			representation.addRepresentationPart(part1);
107 107
			dao.save(part1);
108 108
			commit();
109

  
110 109
		} catch (URISyntaxException e) {
111 110
			Assert.fail("URI should be ok");
112 111
		}
113

  
114 112
	}
115 113

  
116 114
    @Override
cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/persistence/dao/hibernate/media/MediaRepresentationPartDaoImplTest.testSave-result.xml
1 1
<?xml version='1.0' encoding='UTF-8'?>
2
<dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../dataset.xsd">
2
<dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../database/schema/dataset.xsd">
3 3
  <MEDIAREPRESENTATIONPART DTYPE="ImageFile" URI="http://www.test.de" HEIGHT="22" WIDTH="25" SIZE="333" DURATION="[null]"/>
4 4
  <MEDIAREPRESENTATIONPART DTYPE="AudioFile" URI="http://www.test2.de" HEIGHT="[null]" WIDTH="[null]" SIZE="[null]" DURATION="55"/>
5 5
  <MEDIAREPRESENTATIONPART DTYPE="AudioFile" URI="http:\\www.fail.de" HEIGHT="[null]" WIDTH="[null]" SIZE="[null]" DURATION="55"/>
cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/persistence/dao/hibernate/media/MediaRepresentationPartDaoImplTest.xml
1 1
<?xml version='1.0' encoding='UTF-8'?>
2
<dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../dataset.xsd">
3
  <MEDIAREPRESENTATIONPART DTYPE="ImageFile" ID="1" URI="http://www.test.de" UUID="e06a0f29-ef82-4ce3-8a94-dd98feae8f9e" HEIGHT="22" WIDTH="25" SIZE="333" DURATION="[null]"/>
4
  <MEDIAREPRESENTATIONPART DTYPE="AudioFile" ID="2" URI="http://www.test2.de" UUID="a07a0f29-ef82-3ce3-8a94-dd98feae8f9e" HEIGHT="[null]" WIDTH="[null]" SIZE="[null]" DURATION="55"/>
5
  <MEDIAREPRESENTATIONPART DTYPE="AudioFile" ID="3" URI="http:\\www.fail.de" UUID="b48a0f26-2f42-3ce3-8a04-dd98feaa8e98" HEIGHT="[null]" WIDTH="[null]" SIZE="[null]" DURATION="55"/>
2
<dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../database/schema/dataset.xsd">
3
  <MEDIAREPRESENTATIONPART DTYPE="ImageFile" ID="1" URI="http://www.test.de" UUID="e06a0f29-ef82-4ce3-8a94-dd98feae8f9e" HEIGHT="22" WIDTH="25" SIZE="333"/>
4
  <MEDIAREPRESENTATIONPART DTYPE="AudioFile" ID="2" URI="http://www.test2.de" UUID="a07a0f29-ef82-3ce3-8a94-dd98feae8f9e" DURATION="55"/>
5
  <MEDIAREPRESENTATIONPART DTYPE="AudioFile" ID="3" URI="http:\\www.fail.de" UUID="b48a0f26-2f42-3ce3-8a04-dd98feaa8e98" DURATION="55"/>
6 6
</dataset>
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/assembler/converter/DefaultRelatedPageConverter.java
12 12
 * Default page converter implementation that makes a gross assumption that
13 13
 * the metadata are being served on the same server as the human-readable page,
14 14
 * and that the urls map to {relatedPagePrefix}{param}/{uuid}
15
 * 
16
 * @author ben.clark
17 15
 *
16
 * @author ben.clark
18 17
 */
19 18
public class DefaultRelatedPageConverter implements ConfigurableCustomConverter  {
20 19

  
21 20
	private String relatedPagePrefix = "/";
22
	
21

  
23 22
	public void setRelatedPagePrefix(String relatedPagePrefix) {
24 23
		this.relatedPagePrefix = relatedPagePrefix;
25 24
	}
26
	
25

  
27 26
	String parameter = null;
28
	
29
	/* (non-Javadoc)
30
	 * @see org.dozer.ConfigurableCustomConverter#setParameter(java.lang.String)
31
	 */
27

  
32 28
	@Override
33 29
	public void setParameter(String parameter) {
34 30
		this.parameter = parameter;
35
		
36 31
	}
37 32

  
38
	public Object convert(Object existingDestinationFieldValue,	Object sourceFieldValue, Class<?> destinationClass, Class<?> sourceClass) {
33
	@Override
34
    public Object convert(Object existingDestinationFieldValue,	Object sourceFieldValue, Class<?> destinationClass, Class<?> sourceClass) {
39 35
		if(sourceFieldValue == null) {
40 36
			return null;
41 37
		}
42 38
		StringBuffer stringBuffer = new StringBuffer();
43
		
39

  
44 40
		stringBuffer.append(relatedPagePrefix);
45
		
41

  
46 42
		stringBuffer.append(parameter + "/");
47 43
		stringBuffer.append(((UUID)sourceFieldValue).toString());
48
		
44

  
49 45
		Relation relation = new Relation();
50 46
		try {
51 47
			relation.setResource(new URI(stringBuffer.toString()));
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/dc/Relation.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/BaseThing.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
48 48
	    "publishedInCitation"
49 49
})
50 50
public abstract class BaseThing {
51
	
51

  
52 52
	@XmlElement(namespace = "http://purl.org/dc/elements/1.1/")
53 53
	private String title;
54
	
54

  
55 55
	@XmlElement(namespace = "http://www.w3.org/2002/07/owl#")
56 56
	private String sameAs;
57
	
57

  
58 58
	@XmlElement(namespace = "http://purl.org/dc/elements/1.1/")
59 59
	private URI identifier;
60
	
60

  
61 61
	@XmlElement(namespace = "http://purl.org/dc/terms/")
62 62
	@XmlJavaTypeAdapter(DateTimeAdapter.class)
63 63
	private DateTime created;
64
	
64

  
65 65
	@XmlElement(namespace = "http://purl.org/dc/terms/")
66 66
	@XmlJavaTypeAdapter(DateTimeAdapter.class)
67 67
	private DateTime date;
68 68

  
69 69
	@XmlElement(namespace = "http://purl.org/dc/elements/1.1/")
70 70
	private String creator;
71
	
71

  
72 72
	@XmlElement(namespace = "http://purl.org/dc/elements/1.1/")
73 73
	private String contributor;
74
	
74

  
75 75
	@XmlElement(name = "relation", namespace = "http://purl.org/dc/elements/1.1/")
76 76
	private Relation relation;
77
	
77

  
78 78
	@XmlElement
79 79
	private String abcdEquivalence;
80
	
80

  
81 81
	@XmlElement
82 82
	private String berlinModelEquivalence;
83
	
83

  
84 84
	@XmlElement
85 85
	private String darwinCoreEquivalence;
86
	
86

  
87 87
	@XmlElement(name = "isDeprecated")
88 88
	private Boolean deprecated;
89
	
89

  
90 90
	@XmlElement(name = "isRestricted")
91 91
	private Boolean restricted;
92
	
92

  
93 93
	@XmlElement
94 94
	private String microReference;
95
	
95

  
96 96
	@XmlElement
97 97
	private Set<String> notes;
98
	
98

  
99 99
	@XmlElement
100 100
	private String publishedIn;
101 101

  
......
110 110

  
111 111
	@XmlElement(name = "publishedInCitation")
112 112
	private PublishedInCitation publishedInCitation;
113
	
113

  
114 114
	public DateTime getDate() {
115 115
		return date;
116 116
	}
......
118 118
	public void setDate(DateTime date) {
119 119
		this.date = date;
120 120
	}
121
	
121

  
122 122
	public String getCreator() {
123 123
		return creator;
124 124
	}
......
134 134
	public void setContributor(String contributor) {
135 135
		this.contributor = contributor;
136 136
	}
137
	
137

  
138 138
	public String getAbcdEquivalence() {
139 139
		return abcdEquivalence;
140 140
	}
141
	
141

  
142 142
	public String getBerlinModelEquivalence() {
143 143
		return berlinModelEquivalence;
144 144
	}
145
	
145

  
146 146
	//dcterms:created
147 147
	public DateTime getCreated() {
148 148
		return created;
......
151 151
	public String getDarwinCoreEquivalence() {
152 152
		return darwinCoreEquivalence;
153 153
	}
154
	
154

  
155 155
	//dc:identifier
156 156
	public URI getIdentifier() {
157 157
		return identifier;
158 158
	}
159
	
159

  
160 160
	public String getMicroReference() {
161 161
		return microReference;
162 162
	}
......
198 198
	public Boolean isRestricted() {
199 199
		return restricted;
200 200
	}
201
	
201

  
202 202
	public void setDeprecated(Boolean deprecated) {
203 203
		this.deprecated = deprecated;
204 204
	}
205
	
205

  
206 206
	public void setIdentifier(URI identifier) {
207 207
		this.identifier = identifier;
208 208
	}
209
	
209

  
210 210
	public void setMicroReference(String microReference) {
211 211
		this.microReference = microReference;
212 212
	}
213
	
213

  
214 214
	public void setNotes(Set<String> notes) {
215 215
		this.notes = notes;
216 216
	}
217
	
217

  
218 218
	public void setPublishedIn(String publishedIn) {
219 219
		this.publishedIn = publishedIn;
220 220
	}
221
	
221

  
222 222
	public void setRestricted(Boolean restricted) {
223 223
		this.restricted = restricted;
224
	} 
225
	
224
	}
225

  
226 226
	public void setSameAs(String sameAs) {
227 227
		this.sameAs = sameAs;
228 228
	}
229
	
229

  
230 230
	public void setTaxonomicPlacementFormal(String taxonomicPlacementFormal) {
231 231
		this.taxonomicPlacementFormal = taxonomicPlacementFormal;
232 232
	}
233
	
233

  
234 234
	public void setTaxonomicPlacementInformal(String taxonomicPlacementInformal) {
235 235
		this.taxonomicPlacementInformal = taxonomicPlacementInformal;
236 236
	}
......
250 250
	public void setPublishedInCitation(PublicationCitation publicationCitation) {
251 251
		this.publishedInCitation = new PublishedInCitation(publicationCitation, false);
252 252
	}
253
	
253

  
254 254
	public PublicationCitation getPublishedInCitation() {
255 255
		return publishedInCitation != null ? publishedInCitation.getPublicationCitation() : null;
256 256
	}
257
	
257

  
258 258
	public void setPublishedInCitationRelation(PublicationCitation publicationCitation) {
259 259
		this.publishedInCitation = new PublishedInCitation(publicationCitation, true);
260 260
	}
261
	
261

  
262 262
	public PublicationCitation getPublishedInCitationRelation() {
263 263
		return publishedInCitation != null ? publishedInCitation.getPublicationCitation() : null;
264 264
	}
......
270 270
	public Relation getRelation() {
271 271
		return relation;
272 272
	}
273
	
273

  
274 274
	@XmlAccessorType(XmlAccessType.FIELD)
275 275
    @XmlType(name = "", propOrder = {
276 276
        "publicationCitation"
277 277
    })
278 278
	public static class PublishedInCitation extends LinkType {
279
		
279

  
280 280
		@XmlElement(name = "PublicationCitation", namespace = "http://rs.tdwg.org/ontology/voc/PublicationCitation#")
281 281
		private PublicationCitation publicationCitation;
282
		
282

  
283 283
		protected PublishedInCitation() {}
284
		
284

  
285 285
		protected PublishedInCitation(PublicationCitation publicationCitation, boolean useRelation) {
286 286
			if(useRelation) {
287 287
			    if(publicationCitation != null && publicationCitation.getIdentifier() != null) {
......
301 301
		protected PublicationCitation getPublicationCitation() {
302 302
			return publicationCitation;
303 303
		}
304

  
305 304
	}
306
}
305
}
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voc/LinkType.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/OaiPmhViewTest.java
79 79
        XMLUnit.setSAXParserFactory("org.apache.xerces.jaxp.SAXParserFactoryImpl");
80 80
        XMLUnit.setIgnoreWhitespace(true);
81 81

  
82
        model = new HashMap<String,Object>();
82
        model = new HashMap<>();
83 83
        identifyView = new IdentifyView();
84 84
        identifyView.setMarshaller(marshaller);
85 85

  
cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/RdfViewTest.java
77 77
		taxonConcept.setTitle("Lorem ipsum");
78 78
		taxonConcept.setCreated(new DateTime(2004, 12, 25, 12, 0, 0, 0,DateTimeZone.UTC));
79 79

  
80

  
81 80
		Relation relation = new Relation();
82 81
		relation.setResource(new URI("http://www.example.org/"));
83 82
		taxonConcept.setRelation(relation);
......
117 116
		StringType englishDescription = new StringType();
118 117
		englishDescription.setLang("en");
119 118
		englishDescription.setValue("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tincidunt pretium quam, id tristique sem iaculis vitae. Vestibulum pharetra eros in ligula rutrum imperdiet. In lorem dui, cursus a suscipit in, pulvinar eget nisl. Phasellus ut nunc eu mauris adipiscing luctus non vel lorem. Suspendisse volutpat faucibus ante, nec bibendum libero consectetur sed. Nullam non posuere neque. Nulla egestas ullamcorper mauris nec tincidunt. Duis id nibh justo. Mauris vel felis et mi eleifend auctor a ac dui. Morbi in urna leo, eu varius lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mollis nunc eget purus ullamcorper eget pulvinar sapien bibendum. Donec et velit augue, eu pretium mauris. Maecenas lorem leo, malesuada vitae tempor a, gravida quis dolor. Pellentesque lacus velit, sagittis quis posuere ac, rutrum a lacus. Cras dolor ligula, hendrerit at porta sed, posuere euismod mi. Sed sit amet velit turpis.");
120
		Map<Object,StringType> hasContent = new HashMap<Object,StringType>();
119
		Map<Object,StringType> hasContent = new HashMap<>();
121 120
		hasContent.put(englishDescription.getValue(),englishDescription);
122 121
		infoItem.setHasContent(hasContent);
123
		Set<InfoItem> infoItems = new HashSet<InfoItem>();
122
		Set<InfoItem> infoItems = new HashSet<>();
124 123
		infoItems.add(infoItem);
125 124
		speciesProfileModel.setHasInformation(infoItems);
126 125
	}
......
135 134

  
136 135
		String resource = "/eu/etaxonomy/cdm/remote/view/RdfViewTest.rdf";
137 136
		System.out.println(new String(outputStream.toByteArray()));
138
		XMLAssert.assertXMLEqual(new InputStreamReader(this.getClass().getResourceAsStream(resource)),new StringReader(new String(outputStream.toByteArray())));
137

  
138
		XMLAssert.assertXMLEqual(
139
		        new InputStreamReader(this.getClass().getResourceAsStream(resource)),
140
		        new StringReader(new String(outputStream.toByteArray())));
139 141
	}
140 142

  
141 143
	@Test
......
155 157
	@Test
156 158
	public void testNameInformationRdf() throws Exception {
157 159

  
158
		Map model = new HashMap<String,List<NameInformation>>();
159
		List niList = new ArrayList();
160
		Map<String,List<NameInformation>> model = new HashMap<>();
161
		List<NameInformation> niList = new ArrayList<>();
160 162
		NameInformation ni = new NameInformation();
161 163
		ni.setRequest("64cf8cf8-f56a-4411-8f49-c3dc95ea257a");
162 164
		ni.setResponse("Platalea leucorodia Linnaeus, 1758",
163 165
				"Platalea leucorodia",
164 166
				"Species",
165
				new HashSet(),
167
				new HashSet<>(),
166 168
				null,
167
				new HashSet(),
168
				new HashSet(),
169
				new HashSet());
169
				new HashSet<>(),
170
				new HashSet<>(),
171
				new HashSet<>());
170 172
		ni.getResponse().addToTaxonUuids("1a5bcb42-146f-42e5-9136-1b21d170163e");
171 173
		niList.add(ni);
172 174
		model.put("64cf8cf8-f56a-4411-8f49-c3dc95ea257a", niList);
......
184 186
		String resource = "/eu/etaxonomy/cdm/remote/view/NameInformationTest.rdf";
185 187
		XMLAssert.assertXMLEqual(new InputStreamReader(this.getClass().getResourceAsStream(resource)),new StringReader(new String(outputStream.toByteArray())));
186 188
	}
187

  
188

  
189

  
190
}
189
}

Also available in: Unified diff