polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [3/8] zest-java git commit: preferences-entitystore: properly isolate test
Date Sat, 03 Dec 2016 11:05:59 GMT
preferences-entitystore: properly isolate test


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/d833c4f1
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/d833c4f1
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/d833c4f1

Branch: refs/heads/develop
Commit: d833c4f1b826e66566d72b8f0bd004cbbd03b49b
Parents: c574cd0
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Fri Dec 2 17:59:20 2016 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Fri Dec 2 17:59:20 2016 +0100

----------------------------------------------------------------------
 .../zest/entitystore/PreferencesEntityStoreTest.java      | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/d833c4f1/extensions/entitystore-preferences/src/test/java/org/apache/zest/entitystore/PreferencesEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-preferences/src/test/java/org/apache/zest/entitystore/PreferencesEntityStoreTest.java
b/extensions/entitystore-preferences/src/test/java/org/apache/zest/entitystore/PreferencesEntityStoreTest.java
index 369c1ed..c177381 100644
--- a/extensions/entitystore-preferences/src/test/java/org/apache/zest/entitystore/PreferencesEntityStoreTest.java
+++ b/extensions/entitystore-preferences/src/test/java/org/apache/zest/entitystore/PreferencesEntityStoreTest.java
@@ -26,10 +26,14 @@ import org.apache.zest.entitystore.prefs.PreferencesEntityStoreInfo;
 import org.apache.zest.entitystore.prefs.PreferencesEntityStoreService;
 import org.apache.zest.test.entity.AbstractEntityStoreTest;
 import org.apache.zest.valueserialization.orgjson.OrgJsonValueSerializationAssembler;
+import org.junit.Rule;
+import org.junit.rules.TemporaryFolder;
 
 public class PreferencesEntityStoreTest
     extends AbstractEntityStoreTest
 {
+    @Rule
+    public TemporaryFolder tmpDir = new TemporaryFolder();
 
     @Override
     public void assemble( ModuleAssembly module )
@@ -40,7 +44,11 @@ public class PreferencesEntityStoreTest
         super.assemble( module );
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader( null );
-        PreferencesEntityStoreInfo metaInfo = new PreferencesEntityStoreInfo( Preferences.userNodeForPackage(
getClass() ) );
+        Preferences node = Preferences.userNodeForPackage( getClass() )
+                                      .node( "integtest" )
+                                      .node( tmpDir.getRoot().getName() )
+                                      .node( "PreferencesEntityStoreTest" );
+        PreferencesEntityStoreInfo metaInfo = new PreferencesEntityStoreInfo( node );
         Thread.currentThread().setContextClassLoader( cl );
         module.services( PreferencesEntityStoreService.class ).setMetaInfo( metaInfo ).instantiateOnStartup();
         new OrgJsonValueSerializationAssembler().assemble( module );


Mime
View raw message