Author: clebert.suconic(a)jboss.com
Date: 2011-11-02 00:15:29 -0400 (Wed, 02 Nov 2011)
New Revision: 11630
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/largemessage/LargeMessageTestBase.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
Fixing windows test
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java 2011-11-02
03:05:57 UTC (rev 11629)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java 2011-11-02
04:15:29 UTC (rev 11630)
@@ -307,6 +307,21 @@
{
return otherPage.getPageId() - this.pageId;
}
+
+ public void finalize()
+ {
+ try
+ {
+ if (file != null && file.isOpen())
+ {
+ file.close();
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn(e.getMessage(), e);
+ }
+ }
/* (non-Javadoc)
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java 2011-11-02
03:05:57 UTC (rev 11629)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/client/LargeMessageTest.java 2011-11-02
04:15:29 UTC (rev 11630)
@@ -74,6 +74,22 @@
return false;
}
+ /**
+ *
+ */
+ public LargeMessageTest()
+ {
+ super();
+ }
+
+ /**
+ * @param test
+ */
+ public LargeMessageTest(String test)
+ {
+ super(test);
+ }
+
public void testRollbackPartiallyConsumedBuffer() throws Exception
{
for (int i = 0 ; i < 1; i++)
@@ -1713,6 +1729,7 @@
100);
}
+
public void testPageOnLargeMessage() throws Exception
{
testPageOnLargeMessage(true, false);
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/largemessage/LargeMessageTestBase.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/largemessage/LargeMessageTestBase.java 2011-11-02
03:05:57 UTC (rev 11629)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/largemessage/LargeMessageTestBase.java 2011-11-02
04:15:29 UTC (rev 11630)
@@ -69,7 +69,18 @@
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
+
+ public LargeMessageTestBase(String test)
+ {
+ super(test);
+ }
+
+ public LargeMessageTestBase()
+ {
+ super();
+ }
+
@Override
protected void tearDown() throws Exception
{
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-11-02
03:05:57 UTC (rev 11629)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-11-02
04:15:29 UTC (rev 11630)
@@ -111,7 +111,7 @@
// Attributes ----------------------------------------------------
- private static final String testDir = System.getProperty("java.io.tmpdir",
"/tmp") + "/hornetq-unit-test";
+ private static final String testDir = System.getProperty("java.io.tmpdir",
"/tmp") + File.separator + "hornetq-unit-test";
// There is a verification about thread leakages. We only fail a single thread when
this happens
private static Set<Thread> alreadyFailedThread = new HashSet<Thread>();
@@ -1168,10 +1168,20 @@
for (int j = 0; j < files.length; j++)
{
- if (!deleteDirectory(new File(directory, files[j])))
+ try
{
- return false;
+
+ File fileTmp = new File(directory, files[j]);
+ if (!deleteDirectory(fileTmp))
+ {
+ log.warn("Couldn't delete " + fileTmp);
+ return false;
+ }
}
+ catch (Throwable e)
+ {
+ e.printStackTrace();
+ }
}
}
Show replies by date