Author: tolusha
Date: 2009-12-17 09:00:47 -0500 (Thu, 17 Dec 2009)
New Revision: 1121
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueDataSpooling.java
Log:
EXOJCR-324: test fix
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueDataSpooling.java
===================================================================
---
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueDataSpooling.java 2009-12-17
12:55:35 UTC (rev 1120)
+++
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/value/TestTransientValueDataSpooling.java 2009-12-17
14:00:47 UTC (rev 1121)
@@ -97,6 +97,9 @@
{
File tmpFile = createBLOBTempFile(250);
+ System.gc();
+ Thread.sleep(2000);
+
String[] countBefore = tmpdir.list(new FilenameFilter()
{
public boolean accept(File dir, String name)
@@ -109,6 +112,9 @@
node.setProperty("testProp", new FileInputStream(tmpFile));
root.save();
+ System.gc();
+ Thread.sleep(2000);
+
String[] countAfter = tmpdir.list(new FilenameFilter()
{
public boolean accept(File dir, String name)
@@ -130,6 +136,9 @@
{
File tmpFile = createBLOBTempFile(250);
+ System.gc();
+ Thread.sleep(2000);
+
String[] countBefore = tmpdir.list(new FilenameFilter()
{
public boolean accept(File dir, String name)
@@ -143,6 +152,9 @@
node.getProperty("testProp").getStream().close();
root.save();
+ System.gc();
+ Thread.sleep(2000);
+
String[] countAfter = tmpdir.list(new FilenameFilter()
{
public boolean accept(File dir, String name)
@@ -183,24 +195,27 @@
{
cLog = (TransactionChangesLog)itemStates;
}
-
- private boolean isSpooling(String[] before, String[] after) {
- int newFilecount = 0;
-
- List<String> lBefore = new ArrayList<String>();
- for (String sBefore : before)
- lBefore.add(sBefore);
-
- for (String sAfter : after) {
- if (!lBefore.contains(sAfter)) {
- if (haveValueStorage && newFilecount == 0 || newFilecount == 0)
- newFilecount++;
- else
- return true;
+
+ private boolean isSpooling(String[] before, String[] after)
+ {
+ int newFilecount = 0;
+
+ List<String> lBefore = new ArrayList<String>();
+ for (String sBefore : before)
+ lBefore.add(sBefore);
+
+ for (String sAfter : after)
+ {
+ if (!lBefore.contains(sAfter))
+ {
+ if (haveValueStorage && newFilecount == 0 || newFilecount == 0)
+ newFilecount++;
+ else
+ return true;
+ }
+
}
-
- }
-
- return false;
+
+ return false;
}
}
Show replies by date