From c2b276a0b8e085f67d3766507ef79baca25b21f1 Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Wed, 17 Dec 2014 18:33:34 +0000 Subject: [PATCH] HCOLL-184 added BuildVersionTest and check Assets to use org.junit --- pom.xml | 12 ++++++ .../chronicle/map/VanillaChronicleMap.java | 8 ++-- .../chronicle/map/BuildVersionTest.java | 38 +++++++++++++++++++ .../chronicle/map/CHMUseCasesTest.java | 2 +- .../map/ChronicleMapImportExportTest.java | 4 +- .../openhft/chronicle/map/Issue42Test.java | 2 +- .../map/TcpReplicationLargeEntryTest.java | 2 +- 7 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 src/test/java/net/openhft/chronicle/map/BuildVersionTest.java diff --git a/pom.xml b/pom.xml index 2b938975b..ca7b5f7c4 100644 --- a/pom.xml +++ b/pom.xml @@ -75,6 +75,12 @@ 1.3.6 + + org.ops4j.pax.url + pax-url-aether + 2.2.0 + + @@ -92,6 +98,12 @@ jettison + + true + org.ops4j.pax.url + pax-url-aether + + net.openhft compiler diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index deae98e0c..b64a2b89a 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -247,7 +247,7 @@ class VanillaChronicleMap, if (offHeapMapSize > GIGABYTES.toBytes(4L)) { System.out.printf( "WARNING: On Windows, you probably cannot create a ChronicleMap\n" + - "of more than 4 GB. The configured map requires %.2f GB of off-heap memory.\n", + "of more than 4 GB. The configured map requires %.2f GB of off-heap memory.\n", offHeapMapSizeInGb); } try { @@ -256,9 +256,9 @@ class VanillaChronicleMap, double freePhysicalMemoryInGb = freePhysicalMemory * 1.0 / oneGb; System.out.printf( "WARNING: On Windows, you probably cannot create a ChronicleMap\n" + - "of more than 90%% of available free memory in the system.\n" + - "The configured map requires %.2f GB of off-heap memory.\n" + - "There is only %.2f GB of free physical memory in the system.\n", + "of more than 90%% of available free memory in the system.\n" + + "The configured map requires %.2f GB of off-heap memory.\n" + + "There is only %.2f GB of free physical memory in the system.\n", offHeapMapSizeInGb, freePhysicalMemoryInGb); } diff --git a/src/test/java/net/openhft/chronicle/map/BuildVersionTest.java b/src/test/java/net/openhft/chronicle/map/BuildVersionTest.java new file mode 100644 index 000000000..2f6ef24c5 --- /dev/null +++ b/src/test/java/net/openhft/chronicle/map/BuildVersionTest.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 Higher Frequency Trading + * + * http://www.higherfrequencytrading.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.openhft.chronicle.map; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; + +/** + * @author Rob Austin. + */ +public class BuildVersionTest { + + + @Test + public void test() throws IOException, InterruptedException { + // checks that we always get a version + Assert.assertNotNull(BuildVersion.version()); + } + +} diff --git a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java index 9eda52d37..d5b83f8b1 100644 --- a/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java +++ b/src/test/java/net/openhft/chronicle/map/CHMUseCasesTest.java @@ -1,7 +1,7 @@ package net.openhft.chronicle.map; import com.google.common.primitives.Chars; -import junit.framework.Assert; + import org.junit.Assert; import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig; import net.openhft.lang.io.ByteBufferBytes; import net.openhft.lang.io.serialization.impl.*; diff --git a/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java b/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java index 2984996d7..bd1cb7ef3 100644 --- a/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java +++ b/src/test/java/net/openhft/chronicle/map/ChronicleMapImportExportTest.java @@ -1,9 +1,9 @@ package net.openhft.chronicle.map; -import junit.framework.Assert; -import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig; + import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig; import net.openhft.lang.values.LongValue; import net.openhft.lang.values.LongValue$$Native; +import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/src/test/java/net/openhft/chronicle/map/Issue42Test.java b/src/test/java/net/openhft/chronicle/map/Issue42Test.java index 7d078c7f2..16cd331b8 100755 --- a/src/test/java/net/openhft/chronicle/map/Issue42Test.java +++ b/src/test/java/net/openhft/chronicle/map/Issue42Test.java @@ -18,7 +18,7 @@ package net.openhft.chronicle.map; -import junit.framework.Assert; + import org.junit.Assert; import net.openhft.lang.Jvm; import org.junit.Test; diff --git a/src/test/java/net/openhft/chronicle/map/TcpReplicationLargeEntryTest.java b/src/test/java/net/openhft/chronicle/map/TcpReplicationLargeEntryTest.java index 003a4273d..daffb7415 100644 --- a/src/test/java/net/openhft/chronicle/map/TcpReplicationLargeEntryTest.java +++ b/src/test/java/net/openhft/chronicle/map/TcpReplicationLargeEntryTest.java @@ -1,8 +1,8 @@ package net.openhft.chronicle.map; -import junit.framework.Assert; import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test;