Revision f588e53b
Added by Andreas Müller over 3 years ago
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
cleanup