mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-12 04:23:13 +00:00
[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
This commit is contained in:
@@ -290,6 +290,8 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
DCValue[] dc = it.getMetadata(schema, element, qualifier, lang);
|
||||||
assertThat("testGetMetadata_4args 0",dc,notNullValue());
|
assertThat("testGetMetadata_4args 0",dc,notNullValue());
|
||||||
assertTrue("testGetMetadata_4args 1",dc.length == 0);
|
assertTrue("testGetMetadata_4args 1",dc.length == 0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -314,6 +316,23 @@ public class ItemTest extends AbstractDSpaceObjectTest
|
|||||||
assertTrue("testGetMetadata_String 5",dc.length == 0);
|
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.
|
* Test of addDC method, of class Item.
|
||||||
*/
|
*/
|
||||||
|
@@ -549,7 +549,7 @@
|
|||||||
<schema>dc</schema>
|
<schema>dc</schema>
|
||||||
<element>subject</element>
|
<element>subject</element>
|
||||||
<qualifier>mesh</qualifier>
|
<qualifier>mesh</qualifier>
|
||||||
<scope_note>MEdical Subject Headings</scope_note>
|
<scope_note>Medical Subject Headings</scope_note>
|
||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
<dc-type>
|
<dc-type>
|
||||||
@@ -584,4 +584,18 @@
|
|||||||
<scope_note>Nature or genre of content.</scope_note>
|
<scope_note>Nature or genre of content.</scope_note>
|
||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- A second test schema for testing purposes. -->
|
||||||
|
<dc-schema>
|
||||||
|
<name>test</name>
|
||||||
|
<namespace>http://example.com/test/</namespace>
|
||||||
|
</dc-schema>
|
||||||
|
|
||||||
|
<dc-type>
|
||||||
|
<schema>test</schema>
|
||||||
|
<element>type</element>
|
||||||
|
<!-- unqualified -->
|
||||||
|
<scope_note>A second test schema type element.</scope_note>
|
||||||
|
</dc-type>
|
||||||
|
|
||||||
</dspace-dc-types>
|
</dspace-dc-types>
|
||||||
|
Reference in New Issue
Block a user