From: Oliver B. <ob...@us...> - 2017-06-09 18:50:10
|
Update of /cvsroot/patterntesting/PatternTesting10/patterntesting-rt/src/test/java/patterntesting/runtime/monitor In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7375/src/test/java/patterntesting/runtime/monitor Modified Files: ResourcepathMonitorTest.java Log Message: unit test added (which fails) Index: ResourcepathMonitorTest.java =================================================================== RCS file: /cvsroot/patterntesting/PatternTesting10/patterntesting-rt/src/test/java/patterntesting/runtime/monitor/ResourcepathMonitorTest.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- ResourcepathMonitorTest.java 31 May 2017 21:03:21 -0000 1.25 +++ ResourcepathMonitorTest.java 9 Jun 2017 18:50:07 -0000 1.26 @@ -20,9 +20,7 @@ package patterntesting.runtime.monitor; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsNot.not; +import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import java.io.*; @@ -104,7 +102,7 @@ private List<String> getResourcesAsList() { String[] resources = monitor.getResources(); - assertThat(0, is(not(resources.length))); + assertThat(0, not(resources.length)); return Arrays.asList(resources); } @@ -161,10 +159,11 @@ @Test public void testGetDoublets() { String someDoublet = findDoublet(); - String[] doublets = monitor.getDoublets(); - LOG.info(doublets.length + " doublets found"); - assertThat(Arrays.asList(doublets), hasItem(someDoublet)); - assertThat(Arrays.asList(doublets), not(hasItem("/META-INF"))); + List<String> doublets = Arrays.asList(monitor.getDoublets()); + LOG.info(doublets.size() + " doublets found"); + assertThat(doublets, hasItem(someDoublet)); + assertThat(doublets, not(hasItem("/META-INF"))); + assertThat(doublets, not(hasItem("/META-INF/MANIFEST.MF"))); } private String findDoublet() { @@ -208,6 +207,18 @@ assertNotNull(incompatibleResourcepath); LOG.info("{} incompatible classpath entries found.", incompatibleResourcepath.length); } + + /** + * Incompatible resources are also a kind of doublets. So all incompatible + * resources must be part of the doublet path (but not the other way + * around). + */ + @Test + public void testIncompatiblePathInDoubletPath() { + String[] incompatibleResourcepath = monitor.getIncompatibleResourcepath(); + String[] doubletPath = monitor.getDoubletResourcepath(); + assertThat(Arrays.asList(doubletPath), hasItems(incompatibleResourcepath)); + } /** * Test method for {@link ResourcepathMonitor#registerAsMBean()}. |