From c33c01c4de2c601980e676f2f5fe262ba63d9702 Mon Sep 17 00:00:00 2001 From: Stuart Lewis Date: Thu, 27 Jan 2011 00:22:26 +0000 Subject: [PATCH] [DS-806] junit test - should cause bamboo to report a test failure. Patch to fix this to be applied shortly. git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6050 9c30dcfa-912a-0410-8fc2-9e0234be79fd --- .../java/org/dspace/content/ItemTest.java | 19 +++++++++++++++++++ .../config/registries/dublin-core-types.xml | 16 +++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/test/java/org/dspace/content/ItemTest.java b/dspace-api/src/test/java/org/dspace/content/ItemTest.java index eb0acfb47c..590d4ae663 100644 --- a/dspace-api/src/test/java/org/dspace/content/ItemTest.java +++ b/dspace-api/src/test/java/org/dspace/content/ItemTest.java @@ -290,6 +290,8 @@ public class ItemTest extends AbstractDSpaceObjectTest DCValue[] dc = it.getMetadata(schema, element, qualifier, lang); assertThat("testGetMetadata_4args 0",dc,notNullValue()); assertTrue("testGetMetadata_4args 1",dc.length == 0); + + } /** @@ -314,6 +316,23 @@ public class ItemTest extends AbstractDSpaceObjectTest assertTrue("testGetMetadata_String 5",dc.length == 0); } + /** + * A test for DS-806: Item.match() incorrect logic for schema testing + */ + @Test + public void testDS806() + { + // Set the item to have two pieces of metadata for dc.type and dc2.type + String dcType = "DC-TYPE"; + String testType = "TEST-TYPE"; + it.addMetadata("dc", "type", null, null, dcType); + it.addMetadata("test", "type", null, null, testType); + + // Check that only one is returned when we ask for all dc.type values + DCValue[] values = it.getMetadata("dc", "type", null, null); + assertTrue("Return results", values.length == 1); + } + /** * Test of addDC method, of class Item. */ diff --git a/dspace-api/src/test/resources/dspaceFolder/config/registries/dublin-core-types.xml b/dspace-api/src/test/resources/dspaceFolder/config/registries/dublin-core-types.xml index 29c296ee4e..ccd9ceeb89 100644 --- a/dspace-api/src/test/resources/dspaceFolder/config/registries/dublin-core-types.xml +++ b/dspace-api/src/test/resources/dspaceFolder/config/registries/dublin-core-types.xml @@ -549,7 +549,7 @@ dc subject mesh - MEdical Subject Headings + Medical Subject Headings @@ -584,4 +584,18 @@ Nature or genre of content. + + + + test + http://example.com/test/ + + + + test + type + + A second test schema type element. + +