Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
adding -XX:-UseSplitVerifier to surefire CLI args to try and coax cob…
…ertura into instrumenting Java7 better
- Loading branch information
Showing
3 changed files
with
69 additions
and
17 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
fcrepo-jms/src/test/java/org/fcrepo/messaging/legacy/LegacyMethodStaticTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.fcrepo.messaging.legacy; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.mockito.Mockito.*; | ||
|
||
import java.io.IOException; | ||
import java.io.Writer; | ||
import java.util.Arrays; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
import javax.jcr.Node; | ||
import javax.jcr.RepositoryException; | ||
import javax.jcr.nodetype.NodeType; | ||
import javax.jcr.observation.Event; | ||
|
||
import javax.jms.JMSException; | ||
import javax.jms.Message; | ||
|
||
import org.apache.abdera.model.Category; | ||
import org.apache.abdera.model.Entry; | ||
import org.apache.abdera.model.Person; | ||
import org.apache.abdera.model.Text; | ||
import org.fcrepo.utils.FedoraJcrTypes; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.powermock.api.mockito.PowerMockito; | ||
import org.powermock.core.classloader.annotations.PrepareForTest; | ||
import org.powermock.modules.junit4.PowerMockRunner; | ||
|
||
public class LegacyMethodStaticTest { | ||
|
||
@Before | ||
public void setUp() throws RepositoryException { | ||
} | ||
|
||
@Test | ||
public void testCanParse() throws JMSException { | ||
// Should the static tests be broken out into a separate test class, so we can use PowerMock with better scope? | ||
boolean result; | ||
Message mockYes = mock(Message.class); | ||
when(mockYes.getJMSType()).thenReturn(LegacyMethod.FORMAT); | ||
when(mockYes.getStringProperty("methodName")).thenReturn("ingest"); | ||
result = LegacyMethod.canParse(mockYes); | ||
assertEquals(true, result); | ||
Message mockNoFormat = mock(Message.class); | ||
when(mockNoFormat.getJMSType()).thenReturn("crazyType"); | ||
when(mockNoFormat.getStringProperty("methodName")).thenReturn("ingest"); | ||
result = LegacyMethod.canParse(mockNoFormat); | ||
assertEquals(false, result); | ||
Message mockNoMessage = mock(Message.class); | ||
when(mockNoMessage.getJMSType()).thenReturn(LegacyMethod.FORMAT); | ||
when(mockNoMessage.getStringProperty("methodName")).thenReturn("destroyEverything"); | ||
result = LegacyMethod.canParse(mockNoMessage); | ||
assertEquals(false, result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters