You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2015/09/08 16:33:41 UTC
[1/3] activemq-artemis git commit: speeding up test for slow machines
Repository: activemq-artemis
Updated Branches:
refs/heads/master 82f6a88d5 -> 8843a9ee1
speeding up test for slow machines
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3da19e5b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3da19e5b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3da19e5b
Branch: refs/heads/master
Commit: 3da19e5b0aed3f5e44cabb6b74e62a8457d4191d
Parents: cc88be5
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Sep 8 10:23:06 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Sep 8 10:29:29 2015 -0400
----------------------------------------------------------------------
.../src/test/java/org/apache/activemq/cli/test/ArtemisTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3da19e5b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
index ba069da..1ec7601 100644
--- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
+++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
@@ -74,7 +74,7 @@ public class ArtemisTest {
@Test
public void testSync() throws Exception {
- int writes = 2560;
+ int writes = 20;
int tries = 10;
long totalAvg = SyncCalculation.syncTest(temporaryFolder.getRoot(), 4096, writes, tries, true, true);
System.out.println();
[3/3] activemq-artemis git commit: This closes #159 fixing path
resolution
Posted by cl...@apache.org.
This closes #159 fixing path resolution
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/8843a9ee
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/8843a9ee
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/8843a9ee
Branch: refs/heads/master
Commit: 8843a9ee1ec1623720425c8281b7855da019bbda
Parents: 82f6a88 3da19e5
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Sep 8 10:33:31 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Sep 8 10:33:31 2015 -0400
----------------------------------------------------------------------
.../apache/activemq/cli/test/ArtemisTest.java | 2 +-
.../core/config/impl/ConfigurationImpl.java | 6 +-
.../core/config/impl/ConfigurationImplTest.java | 64 ++++++++++++++++++++
3 files changed, 66 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[2/3] activemq-artemis git commit: ARTEMIS-219 fixing path resolution
for windows
Posted by cl...@apache.org.
ARTEMIS-219 fixing path resolution for windows
https://issues.apache.org/jira/browse/ARTEMIS-219
The fix will basically use Path.resolve insead of URI.resolve
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/cc88be51
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/cc88be51
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/cc88be51
Branch: refs/heads/master
Commit: cc88be51e4504b58f57c3263bf775de6bf0cdf9e
Parents: 82f6a88
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Sep 8 09:25:09 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Sep 8 10:29:29 2015 -0400
----------------------------------------------------------------------
.../core/config/impl/ConfigurationImpl.java | 6 +-
.../core/config/impl/ConfigurationImplTest.java | 64 ++++++++++++++++++++
2 files changed, 65 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cc88be51/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
index 75fbe59..8b21f8a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
@@ -22,7 +22,6 @@ import java.io.File;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
-import java.net.URI;
import java.security.AccessController;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
@@ -1425,10 +1424,7 @@ public class ConfigurationImpl implements Configuration, Serializable {
*/
private File subFolder(String subFolder) {
try {
- // Resolve wont work without "/" as the last character
- URI artemisHome = new URI(getBrokerInstance().toURI() + "/");
- URI relative = artemisHome.resolve(subFolder);
- return new File(relative.getPath());
+ return getBrokerInstance().toPath().resolve(subFolder).toFile();
}
catch (Exception e) {
throw new RuntimeException(e);
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cc88be51/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
index 1fdcdbd..447d51b 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.activemq.artemis.core.config.impl;
+import java.io.File;
+
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.config.Configuration;
@@ -483,6 +485,68 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
Assert.assertTrue(conf.equals(conf2));
}
+ @Test
+ public void testResolvePath() throws Throwable {
+ // Validate that the resolve method will work even with artemis.instance doesn't exist
+
+ String oldProperty = System.getProperty("artemis.instance");
+
+ try {
+ System.setProperty("artemis.instance", "/tmp/" + RandomUtil.randomString());
+ ConfigurationImpl configuration = new ConfigurationImpl();
+ configuration.setJournalDirectory("./data-journal");
+ File journalLocation = configuration.getJournalLocation();
+ Assert.assertFalse("This path shouldn't resolve to a real folder", journalLocation.exists());
+ }
+ finally {
+ if (oldProperty == null) {
+ System.clearProperty("artemis.instance");
+ }
+ else {
+ System.setProperty("artemis.instance", oldProperty);
+ }
+ }
+
+ }
+
+ @Test
+ public void testAbsolutePath() throws Throwable {
+ // Validate that the resolve method will work even with artemis.instance doesn't exist
+
+ String oldProperty = System.getProperty("artemis.instance");
+
+ File tempFolder = null;
+ try {
+ System.setProperty("artemis.instance", "/tmp/" + RandomUtil.randomString());
+ tempFolder = File.createTempFile("journal-folder", "");
+ tempFolder.delete();
+
+ tempFolder = new File(tempFolder.getAbsolutePath());
+ tempFolder.mkdirs();
+
+ System.out.println("TempFolder = " + tempFolder.getAbsolutePath());
+
+ ConfigurationImpl configuration = new ConfigurationImpl();
+ configuration.setJournalDirectory(tempFolder.getAbsolutePath());
+ File journalLocation = configuration.getJournalLocation();
+
+ Assert.assertTrue(journalLocation.exists());
+ }
+ finally {
+ if (oldProperty == null) {
+ System.clearProperty("artemis.instance");
+ }
+ else {
+ System.setProperty("artemis.instance", oldProperty);
+ }
+
+ if (tempFolder != null) {
+ tempFolder.delete();
+ }
+ }
+
+ }
+
@Override
@Before
public void setUp() throws Exception {