This is an automated email from the ASF dual-hosted git repository. matthiasblaesing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git
commit b5d5ee4ccce78703d26030c67d3b79a74f4d6a2c Author: Matthias Bläsing <[email protected]> AuthorDate: Sun Jan 14 21:16:44 2018 +0100 ContentProviderTests depended on method execution order The ContentProviderTest was marked as RandomlyFails. The problem depends of method invocation order. The embedded LayerProvider is "cleared" in "testRefreshTheProvider" and then "testCheckAFileFromOurLayer" fails because it expectes the contents to be still present. The fix introduces a "reset" method for the MyProvider, which restores the state after initialization. --- .../src/org/openide/filesystems/ContentProviderTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/openide.filesystems/test/unit/src/org/openide/filesystems/ContentProviderTest.java b/openide.filesystems/test/unit/src/org/openide/filesystems/ContentProviderTest.java index ef5425f..6a2e0e5 100644 --- a/openide.filesystems/test/unit/src/org/openide/filesystems/ContentProviderTest.java +++ b/openide.filesystems/test/unit/src/org/openide/filesystems/ContentProviderTest.java @@ -22,7 +22,6 @@ import java.net.URL; import java.util.Collection; import org.netbeans.junit.MockServices; import org.netbeans.junit.NbTestCase; -import org.netbeans.junit.RandomlyFails; import org.openide.filesystems.Repository.LayerProvider; import org.openide.util.Lookup; @@ -35,7 +34,12 @@ public class ContentProviderTest extends NbTestCase { super(name); } - @RandomlyFails // http://deadlock.netbeans.org/job/NB-Core-Build/9882/testReport/ + @Override + protected void setUp() throws Exception { + super.setUp(); + Lookup.getDefault().lookup(MyProvider.class).reset(); + } + public void testCheckAFileFromOurLayer() { FileObject fo = FileUtil.getConfigFile("foo/bar"); assertNotNull("foo/bar is provided", fo); @@ -69,5 +73,10 @@ public class ContentProviderTest extends NbTestCase { empty = true; refresh(); } + + final void reset() { + empty = false; + refresh(); + } } } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
