Skip to content

Commit

Permalink
Removing jcr:content instead of changing to fcr:metadata (and using c…
Browse files Browse the repository at this point in the history
…onstant)
  • Loading branch information
escowles committed Oct 23, 2014
1 parent 560b815 commit a4ee3a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Expand Up @@ -16,6 +16,7 @@
package org.fcrepo.jms.headers;

import static org.fcrepo.kernel.RdfLexicon.REPOSITORY_NAMESPACE;
import static org.modeshape.jcr.api.JcrConstants.JCR_CONTENT;
import static org.slf4j.LoggerFactory.getLogger;

import java.util.Set;
Expand Down Expand Up @@ -95,8 +96,8 @@ public Message getMessage(final FedoraEvent jcrEvent,
final Message message = jmsSession.createMessage();
message.setLongProperty(TIMESTAMP_HEADER_NAME, jcrEvent.getDate());
String path = jcrEvent.getPath();
if ( path.endsWith("jcr:content") ) {
path = path.replaceAll("jcr:content","fcr:metadata");
if ( path.endsWith("/" + JCR_CONTENT) ) {
path = path.replaceAll("/" + JCR_CONTENT,"");
}
message.setStringProperty(IDENTIFIER_HEADER_NAME, path);
message.setStringProperty(EVENT_TYPE_HEADER_NAME, getEventURIs( jcrEvent
Expand Down
Expand Up @@ -26,6 +26,7 @@
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
import static org.modeshape.jcr.api.JcrConstants.JCR_CONTENT;

import java.util.Set;

Expand Down Expand Up @@ -81,9 +82,8 @@ public void testBuildMessageNullUrl() throws RepositoryException, JMSException {
@Test
public void testBuildMessageContent() throws RepositoryException, JMSException {
final String testPath = "/path/to/resource";
final Message msg = doTestBuildMessage("base-url", testPath + "/jcr:content");
assertEquals("Got wrong identifier in message!", testPath + "/fcr:metadata",
msg.getStringProperty(IDENTIFIER_HEADER_NAME));
final Message msg = doTestBuildMessage("base-url", testPath + "/" + JCR_CONTENT);
assertEquals("Got wrong identifier in message!", testPath, msg.getStringProperty(IDENTIFIER_HEADER_NAME));
}

private Message doTestBuildMessage(final String baseUrl, final String id) throws RepositoryException, JMSException {
Expand Down

0 comments on commit a4ee3a6

Please sign in to comment.