From c9ebf3522fda63c361fb5e2a4ffc1e88e0c567f0 Mon Sep 17 00:00:00 2001 From: Tglman Date: Wed, 15 Jan 2025 20:39:42 +0000 Subject: [PATCH] refactor: moved some legacy benchmark logic to specific module --- benchmarks/pom.xml | 100 ++++++++++++++++++ .../common/test/BaseMemoryDatabase.java | 42 ++++++++ .../common/test/SpeedTest.java | 0 .../common/test/SpeedTestAbstract.java | 0 .../common/test/SpeedTestData.java | 0 .../common/test/SpeedTestGroup.java | 0 .../common/test/SpeedTestMonoThread.java | 0 .../common/test/SpeedTestMultiThreads.java | 0 .../common/test/SpeedTestThread.java | 0 .../database/base/OrientMonoThreadTest.java | 2 - .../database/base/OrientMultiThreadTest.java | 2 - .../test/database/base/OrientThreadTest.java | 0 .../test/database/base/OrientTxSpeedTest.java | 0 .../speed/DictionaryPutDocumentSpeedTest.java | 2 - .../database/speed/FullTextIndexerTest.java | 2 - .../test/database/speed/GiantFileTest.java | 0 .../speed/IntgerSerializationSpeedTest.java | 6 -- .../database/speed/IteratorSpeedTest.java | 6 +- .../LocalCreateAsynchDocumentSpeedTest.java | 2 - .../speed/LocalCreateBinarySpeedTest.java | 2 - ...teDocumentMultiThreadIndexedSpeedTest.java | 2 - ...calCreateDocumentMultiThreadSpeedTest.java | 4 +- .../speed/LocalCreateDocumentSpeedTest.java | 6 -- .../LocalCreateFlatDocumentSpeedTest.java | 5 - .../LocalCreateIndexedDocumentSpeedTest.java | 2 - .../speed/LocalMTCreateDocumentSpeedTest.java | 6 +- .../speed/LocalPaginateStorageSpeedTest.java | 5 - .../speed/NotUniqueIndexSpeedTest.java | 3 - .../ODocumentSerializationSpeedTest.java | 2 - .../speed/OrientDbWriteLotsOfDataTest.java | 0 ...calCreateVerticesMultiThreadSpeedTest.java | 5 +- .../speed/ReadAllClusterObjectsSpeedTest.java | 4 - .../speed/RemoteCreateDocumentSpeedTest.java | 2 - .../speed/SQLSynchQuerySpeedTest.java | 9 +- .../speed/SuperNodeInsertSpeedTest.java | 5 +- .../UnsafeByteArrayComparatorSpeedTest.java | 4 - .../test/database/speed/VarIntSpeedTest.java | 6 -- .../orient/test/internal/EmptySpeedTest.java | 2 - .../internal/index/HashIndexSpeedTest.java | 4 - .../index/MVRBTreeInsertionSpeedTest.java | 3 - .../index/SBTreeInsertionSpeedTest.java | 4 - .../test/internal/network/TcpClient.java | 0 .../test/internal/network/TcpServer.java | 0 .../java/collection/ArrayListSpeedTest.java | 0 .../test/java/collection/ArraySpeedTest.java | 0 .../CollectionBaseAbstractSpeedTest.java | 0 .../java/collection/CollectionSpeedTest.java | 0 .../java/collection/HashMapGetSpeedTest.java | 0 .../java/collection/HashMapSpeedTest.java | 2 - .../LinkedHashMapPlusObjectTest.java | 0 .../java/collection/LinkedHashMapTest.java | 2 +- .../java/collection}/TryCatchSpeedTest.java | 4 +- .../java/lang/DateConversionSpeedTest.java | 0 .../test/java/lang/ExceptionSpeedTest.java | 2 - .../test/java/lang/NewGenSpeedTest.java | 2 - .../java/lang/StringBrowsingSpeedTest.java | 0 .../test/java/lang/ThreadLocalSpeedTest.java | 2 - .../test/java/md5/JavaMD5SpeedTest.java | 4 +- .../BinarySerializationSpeedTest.java | 2 - .../StringSerializationSpeedTest.java | 2 - pom.xml | 7 ++ tests/pom.xml | 9 +- .../test/database/load/MemoryLeaksTest.java | 27 ----- .../database/speed/FullTextSearchTest.java | 34 ------ .../speed/LocalCreateObjectSpeedTest.java | 68 ------------ .../orient/test/java/lang/MathTest.java | 45 -------- .../test/java/lang/ReflectionSpeedTest.java | 39 ------- .../test/java/lang/RuntimeCastSpeedTest.java | 48 --------- .../BinarySerializationStream.java | 39 ------- .../OrientStringContainsSpeedTest.java | 34 ------ .../OrientStringSplitSpeedTest.java | 38 ------- .../StringContainsSpeedTest.java | 32 ------ .../serialization/StringSplitSpeedTest.java | 35 ------ 73 files changed, 164 insertions(+), 562 deletions(-) create mode 100755 benchmarks/pom.xml create mode 100644 benchmarks/src/test/java/com/orientechnologies/common/test/BaseMemoryDatabase.java rename {core => benchmarks}/src/test/java/com/orientechnologies/common/test/SpeedTest.java (100%) rename {core => benchmarks}/src/test/java/com/orientechnologies/common/test/SpeedTestAbstract.java (100%) rename {core => benchmarks}/src/test/java/com/orientechnologies/common/test/SpeedTestData.java (100%) rename {core => benchmarks}/src/test/java/com/orientechnologies/common/test/SpeedTestGroup.java (100%) rename {core => benchmarks}/src/test/java/com/orientechnologies/common/test/SpeedTestMonoThread.java (100%) rename {core => benchmarks}/src/test/java/com/orientechnologies/common/test/SpeedTestMultiThreads.java (100%) rename {core => benchmarks}/src/test/java/com/orientechnologies/common/test/SpeedTestThread.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/base/OrientMonoThreadTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/base/OrientMultiThreadTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/base/OrientThreadTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/base/OrientTxSpeedTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/DictionaryPutDocumentSpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextIndexerTest.java (99%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/GiantFileTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/IntgerSerializationSpeedTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/IteratorSpeedTest.java (89%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateAsynchDocumentSpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateBinarySpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadIndexedSpeedTest.java (98%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadSpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentSpeedTest.java (95%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateFlatDocumentSpeedTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateIndexedDocumentSpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalMTCreateDocumentSpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/LocalPaginateStorageSpeedTest.java (95%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/NotUniqueIndexSpeedTest.java (95%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/ODocumentSerializationSpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/OrientDbWriteLotsOfDataTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/PLocalCreateVerticesMultiThreadSpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/ReadAllClusterObjectsSpeedTest.java (95%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/RemoteCreateDocumentSpeedTest.java (98%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/SQLSynchQuerySpeedTest.java (90%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/SuperNodeInsertSpeedTest.java (97%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/UnsafeByteArrayComparatorSpeedTest.java (95%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/database/speed/VarIntSpeedTest.java (93%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/internal/EmptySpeedTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/internal/index/HashIndexSpeedTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/internal/index/MVRBTreeInsertionSpeedTest.java (96%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/internal/index/SBTreeInsertionSpeedTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/internal/network/TcpClient.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/internal/network/TcpServer.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/collection/ArrayListSpeedTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/collection/ArraySpeedTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionBaseAbstractSpeedTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionSpeedTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapGetSpeedTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapSpeedTest.java (95%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapPlusObjectTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapTest.java (95%) rename {tests/src/test/java/com/orientechnologies/orient/test/java/lang => benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection}/TryCatchSpeedTest.java (91%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/lang/DateConversionSpeedTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/lang/ExceptionSpeedTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/lang/NewGenSpeedTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/lang/StringBrowsingSpeedTest.java (100%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/lang/ThreadLocalSpeedTest.java (95%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/md5/JavaMD5SpeedTest.java (94%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationSpeedTest.java (95%) rename {tests => benchmarks}/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSerializationSpeedTest.java (95%) delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/database/load/MemoryLeaksTest.java delete mode 100755 tests/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextSearchTest.java delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateObjectSpeedTest.java delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/java/lang/MathTest.java delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/java/lang/ReflectionSpeedTest.java delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/java/lang/RuntimeCastSpeedTest.java delete mode 100755 tests/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationStream.java delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/java/serialization/OrientStringContainsSpeedTest.java delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/java/serialization/OrientStringSplitSpeedTest.java delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringContainsSpeedTest.java delete mode 100644 tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSplitSpeedTest.java diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml new file mode 100755 index 00000000000..318ae13b598 --- /dev/null +++ b/benchmarks/pom.xml @@ -0,0 +1,100 @@ + + + + + + 4.0.0 + + com.orientechnologies + orientdb-parent + 4.0.0-SNAPSHOT + ../pom.xml + + + orientdb-benchmarks + + OrientDB Benchmarks + + + UTF-8 + 2023-01-01T00:00:00Z + + + + + com.orientechnologies + orientdb-test-commons + ${project.version} + test + + + com.orientechnologies + orientdb-client + ${project.version} + + + com.orientechnologies + orientdb-core + ${project.version} + test-jar + test + + + + + + java17 + + [17,) + + + + -Xmx${heapSize} + -Dstorage.diskCache.bufferSize=4096 + -Dmemory.directMemory.trackMode=true + -Djava.util.logging.manager=com.orientechnologies.common.log.ShutdownLogManager + -Dstorage.diskCache.checksumMode=storeAndThrow + -Dsecurity.warningDefaultUsers=false + --add-opens jdk.unsupported/sun.misc=ALL-UNNAMED + --add-opens java.base/sun.security.x509=ALL-UNNAMED + + + + + secondary-tests + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + + **/*ST.java + + + + + + + + + diff --git a/benchmarks/src/test/java/com/orientechnologies/common/test/BaseMemoryDatabase.java b/benchmarks/src/test/java/com/orientechnologies/common/test/BaseMemoryDatabase.java new file mode 100644 index 00000000000..2d5176ddc60 --- /dev/null +++ b/benchmarks/src/test/java/com/orientechnologies/common/test/BaseMemoryDatabase.java @@ -0,0 +1,42 @@ +package com.orientechnologies.common.test; + +import com.orientechnologies.orient.core.db.ODatabaseSession; +import com.orientechnologies.orient.core.db.OrientDB; +import com.orientechnologies.orient.core.db.OrientDBConfig; +import org.junit.After; +import org.junit.Before; + +public class BaseMemoryDatabase { + + protected ODatabaseSession db; + protected OrientDB context; + private String databaseName; + + @Before + public void beforeTest() { + context = new OrientDB("embedded:", OrientDBConfig.defaultConfig()); + String dbName = this.getClass().getSimpleName(); + dbName = dbName.replace('[', '_'); + dbName = dbName.replace(']', '_'); + this.databaseName = dbName; + context + .execute( + "create database " + + this.databaseName + + " memory users(admin identified by 'adminpwd' role admin) ") + .close(); + db = context.open(this.databaseName, "admin", "adminpwd"); + } + + protected void reOpen(String user, String password) { + this.db.close(); + this.db = context.open(this.databaseName, user, password); + } + + @After + public void afterTest() throws Exception { + db.close(); + context.drop(databaseName); + context.close(); + } +} diff --git a/core/src/test/java/com/orientechnologies/common/test/SpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTest.java similarity index 100% rename from core/src/test/java/com/orientechnologies/common/test/SpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTest.java diff --git a/core/src/test/java/com/orientechnologies/common/test/SpeedTestAbstract.java b/benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestAbstract.java similarity index 100% rename from core/src/test/java/com/orientechnologies/common/test/SpeedTestAbstract.java rename to benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestAbstract.java diff --git a/core/src/test/java/com/orientechnologies/common/test/SpeedTestData.java b/benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestData.java similarity index 100% rename from core/src/test/java/com/orientechnologies/common/test/SpeedTestData.java rename to benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestData.java diff --git a/core/src/test/java/com/orientechnologies/common/test/SpeedTestGroup.java b/benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestGroup.java similarity index 100% rename from core/src/test/java/com/orientechnologies/common/test/SpeedTestGroup.java rename to benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestGroup.java diff --git a/core/src/test/java/com/orientechnologies/common/test/SpeedTestMonoThread.java b/benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestMonoThread.java similarity index 100% rename from core/src/test/java/com/orientechnologies/common/test/SpeedTestMonoThread.java rename to benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestMonoThread.java diff --git a/core/src/test/java/com/orientechnologies/common/test/SpeedTestMultiThreads.java b/benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestMultiThreads.java similarity index 100% rename from core/src/test/java/com/orientechnologies/common/test/SpeedTestMultiThreads.java rename to benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestMultiThreads.java diff --git a/core/src/test/java/com/orientechnologies/common/test/SpeedTestThread.java b/benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestThread.java similarity index 100% rename from core/src/test/java/com/orientechnologies/common/test/SpeedTestThread.java rename to benchmarks/src/test/java/com/orientechnologies/common/test/SpeedTestThread.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientMonoThreadTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientMonoThreadTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientMonoThreadTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientMonoThreadTest.java index adc4c573f5d..a8782c32424 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientMonoThreadTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientMonoThreadTest.java @@ -17,9 +17,7 @@ import com.orientechnologies.common.test.SpeedTestMonoThread; import com.orientechnologies.orient.core.Orient; -import org.testng.annotations.Test; -@Test(enabled = false) public abstract class OrientMonoThreadTest extends SpeedTestMonoThread { public OrientMonoThreadTest(int iCycles) { super(iCycles); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientMultiThreadTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientMultiThreadTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientMultiThreadTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientMultiThreadTest.java index 537075dd59b..10d23245746 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientMultiThreadTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientMultiThreadTest.java @@ -17,9 +17,7 @@ import com.orientechnologies.common.test.SpeedTestMultiThreads; import com.orientechnologies.common.test.SpeedTestThread; -import org.testng.annotations.Test; -@Test(enabled = false) public abstract class OrientMultiThreadTest extends SpeedTestMultiThreads { public OrientMultiThreadTest( int iCycles, int iThreads, Class iThreadClass) { diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientThreadTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientThreadTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientThreadTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientThreadTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientTxSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientTxSpeedTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/database/base/OrientTxSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/base/OrientTxSpeedTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/DictionaryPutDocumentSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/DictionaryPutDocumentSpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/DictionaryPutDocumentSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/DictionaryPutDocumentSpeedTest.java index 89d44387157..b1d60c39925 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/DictionaryPutDocumentSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/DictionaryPutDocumentSpeedTest.java @@ -21,9 +21,7 @@ import com.orientechnologies.orient.core.index.OIndex; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; -import org.testng.annotations.Test; -@Test(enabled = false) public class DictionaryPutDocumentSpeedTest extends OrientMonoThreadTest { private ODatabaseDocument database; private ODocument record; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextIndexerTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextIndexerTest.java similarity index 99% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextIndexerTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextIndexerTest.java index 28237ae3170..9a38abc39b7 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextIndexerTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextIndexerTest.java @@ -5,9 +5,7 @@ import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; -import org.testng.annotations.Test; -@Test public class FullTextIndexerTest { private static final int DOCUMENTS = 1000; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/GiantFileTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/GiantFileTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/GiantFileTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/GiantFileTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/IntgerSerializationSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/IntgerSerializationSpeedTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/IntgerSerializationSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/IntgerSerializationSpeedTest.java index 1550aa74989..44b6a14c712 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/IntgerSerializationSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/IntgerSerializationSpeedTest.java @@ -19,12 +19,9 @@ import com.orientechnologies.common.serialization.types.OLongSerializer; import com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; -import org.testng.annotations.Test; -@Test public class IntgerSerializationSpeedTest extends OrientMonoThreadTest { - @Test(enabled = false) public static void main(String[] iArgs) throws InstantiationException, IllegalAccessException { IntgerSerializationSpeedTest test = new IntgerSerializationSpeedTest(); test.data.go(test); @@ -35,11 +32,9 @@ public IntgerSerializationSpeedTest() throws InstantiationException, IllegalAcce } @Override - @Test(enabled = false) public void init() {} @Override - @Test(enabled = false) public void cycle() { BytesContainer container = new BytesContainer(); @@ -63,6 +58,5 @@ public void cycle() { } @Override - @Test(enabled = false) public void deinit() {} } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/IteratorSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/IteratorSpeedTest.java similarity index 89% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/IteratorSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/IteratorSpeedTest.java index cc71ca3a6a2..850af00b457 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/IteratorSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/IteratorSpeedTest.java @@ -1,25 +1,23 @@ package com.orientechnologies.orient.test.database.speed; +import com.orientechnologies.common.test.BaseMemoryDatabase; import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal; import com.orientechnologies.orient.core.id.ORecordId; import com.orientechnologies.orient.core.iterator.ORecordIteratorClass; import com.orientechnologies.orient.core.metadata.schema.OClass; import com.orientechnologies.orient.core.record.impl.ODocument; -import com.orientechnologies.orient.test.database.BaseMemoryDatabase; -import org.testng.annotations.Test; /** * @author Andrey Lomakin (a.lomakin-at-orientdb.com) * @since 9/17/14 */ -@Test public class IteratorSpeedTest extends BaseMemoryDatabase { public void testIterationSpeed() { OClass oClass = db.getMetadata().getSchema().createClass("SpeedTest"); for (int i = 0; i < 1000000; i++) { ODocument document = new ODocument("SpeedTest"); - document.save(); + db.save(document); } ORecordIteratorClass iterator = diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateAsynchDocumentSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateAsynchDocumentSpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateAsynchDocumentSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateAsynchDocumentSpeedTest.java index b7db71c2eeb..90fbc7200eb 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateAsynchDocumentSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateAsynchDocumentSpeedTest.java @@ -24,9 +24,7 @@ import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; import java.util.Date; -import org.testng.annotations.Test; -@Test(enabled = false) public class LocalCreateAsynchDocumentSpeedTest extends OrientMonoThreadTest { private ODatabaseDocument database; private ODocument record; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateBinarySpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateBinarySpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateBinarySpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateBinarySpeedTest.java index c687fd7ba9e..10b66aff59d 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateBinarySpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateBinarySpeedTest.java @@ -22,9 +22,7 @@ import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; import java.util.Random; -import org.testng.annotations.Test; -@Test(enabled = false) public class LocalCreateBinarySpeedTest extends OrientMonoThreadTest { private ODatabaseDocument database; private ORecordBytes record; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadIndexedSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadIndexedSpeedTest.java similarity index 98% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadIndexedSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadIndexedSpeedTest.java index ced28c95f6f..74addbd996f 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadIndexedSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadIndexedSpeedTest.java @@ -27,13 +27,11 @@ import com.orientechnologies.orient.test.database.base.OrientMultiThreadTest; import com.orientechnologies.orient.test.database.base.OrientThreadTest; import java.util.Date; -import org.testng.annotations.Test; public class LocalCreateDocumentMultiThreadIndexedSpeedTest extends OrientMultiThreadTest { private ODatabaseDocument database; private long foundObjects; - @Test(enabled = false) public static class CreateObjectsThread extends OrientThreadTest { private ODatabaseDocument database; private ODocument record; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadSpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadSpeedTest.java index f989dce307a..c8e3319003d 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentMultiThreadSpeedTest.java @@ -25,14 +25,12 @@ import com.orientechnologies.orient.test.database.base.OrientMultiThreadTest; import com.orientechnologies.orient.test.database.base.OrientThreadTest; import java.util.Date; -import org.testng.Assert; -import org.testng.annotations.Test; +import org.junit.Assert; public class LocalCreateDocumentMultiThreadSpeedTest extends OrientMultiThreadTest { private ODatabaseDocumentInternal mainDatabase; private long foundObjects; - @Test(enabled = false) public static class CreateObjectsThread extends OrientThreadTest { private ODatabaseDocumentInternal database; private ODocument record; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentSpeedTest.java index b56c236a892..8466e4089b4 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateDocumentSpeedTest.java @@ -24,9 +24,7 @@ import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; import java.util.Date; -import org.testng.annotations.Test; -@Test public class LocalCreateDocumentSpeedTest extends OrientMonoThreadTest { private ODatabaseDocumentInternal database; private ODocument record; @@ -36,14 +34,12 @@ public LocalCreateDocumentSpeedTest() throws InstantiationException, IllegalAcce super(1000000); } - @Test(enabled = false) public static void main(String[] iArgs) throws InstantiationException, IllegalAccessException { LocalCreateDocumentSpeedTest test = new LocalCreateDocumentSpeedTest(); test.data.go(test); } @Override - @Test(enabled = false) public void init() { database = new ODatabaseDocumentTx(System.getProperty("url")); database.setSerializer(new ORecordSerializerBinary()); @@ -63,7 +59,6 @@ record = database.newInstance(); } @Override - @Test(enabled = false) public void cycle() { record.reset(); @@ -80,7 +75,6 @@ public void cycle() { } @Override - @Test(enabled = false) public void deinit() { System.out.println(Orient.instance().getProfiler().dump()); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateFlatDocumentSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateFlatDocumentSpeedTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateFlatDocumentSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateFlatDocumentSpeedTest.java index c2149f72f5b..81847a70348 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateFlatDocumentSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateFlatDocumentSpeedTest.java @@ -22,9 +22,7 @@ import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; import java.util.Date; -import org.testng.annotations.Test; -@Test(enabled = false) public class LocalCreateFlatDocumentSpeedTest extends OrientMonoThreadTest { private ODatabaseDocument database; private ODocument record; @@ -40,7 +38,6 @@ public LocalCreateFlatDocumentSpeedTest() throws InstantiationException, Illegal } @Override - @Test(enabled = false) public void init() { Orient.instance().getProfiler().startRecording(); @@ -54,7 +51,6 @@ record = database.newInstance(); } @Override - @Test(enabled = false) public void cycle() { record.reset(); record.setClassName("Account"); @@ -73,7 +69,6 @@ public void cycle() { } @Override - @Test(enabled = false) public void deinit() { if (database != null) database.drop(); super.deinit(); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateIndexedDocumentSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateIndexedDocumentSpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateIndexedDocumentSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateIndexedDocumentSpeedTest.java index 0d828f9c628..cf0f8cec200 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateIndexedDocumentSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateIndexedDocumentSpeedTest.java @@ -22,9 +22,7 @@ import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; -import org.testng.annotations.Test; -@Test(enabled = false) public class LocalCreateIndexedDocumentSpeedTest extends OrientMonoThreadTest { private ODatabaseDocument database; private ODocument record; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalMTCreateDocumentSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalMTCreateDocumentSpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalMTCreateDocumentSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalMTCreateDocumentSpeedTest.java index 13fc0a42068..4d7b0e2b4e0 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalMTCreateDocumentSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalMTCreateDocumentSpeedTest.java @@ -17,15 +17,12 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; +import org.junit.AfterClass; /** * @author Andrey Lomakin (a.lomakin-at-orientdb.com) * @since 8/19/14 */ -@Test public class LocalMTCreateDocumentSpeedTest { private static final Random random = new Random(); private OURLConnection data; @@ -40,7 +37,6 @@ public class LocalMTCreateDocumentSpeedTest { private OrientDB ctx; - @BeforeClass public void init() { data = OURLHelper.parse(System.getProperty("url")); ctx = new OrientDB(data.getType() + ":" + data.getPath(), OrientDBConfig.defaultConfig()); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalPaginateStorageSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalPaginateStorageSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalPaginateStorageSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalPaginateStorageSpeedTest.java index d5c549d26a5..605cc8c09d8 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalPaginateStorageSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/LocalPaginateStorageSpeedTest.java @@ -12,7 +12,6 @@ import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; import java.util.Date; -import org.testng.annotations.Test; public class LocalPaginateStorageSpeedTest extends OrientMonoThreadTest { private ODatabaseDocumentInternal database; @@ -25,14 +24,12 @@ public LocalPaginateStorageSpeedTest() throws InstantiationException, IllegalAcc super(1000000); } - @Test(enabled = false) public static void main(String[] iArgs) throws InstantiationException, IllegalAccessException { LocalPaginateStorageSpeedTest test = new LocalPaginateStorageSpeedTest(); test.data.go(test); } @Override - @Test(enabled = false) public void init() { ODatabaseDocumentAbstract.setDefaultSerializer(new ORecordSerializerBinary()); database = new ODatabaseDocumentTx("plocal:target/db/test"); @@ -53,7 +50,6 @@ record = database.newInstance(); } @Override - @Test(enabled = false) public void cycle() { record.reset(); @@ -70,7 +66,6 @@ public void cycle() { } @Override - @Test(enabled = false) public void deinit() { System.out.println(Orient.instance().getProfiler().dump()); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/NotUniqueIndexSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/NotUniqueIndexSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/NotUniqueIndexSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/NotUniqueIndexSpeedTest.java index ffe36b00316..98cc94c35f0 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/NotUniqueIndexSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/NotUniqueIndexSpeedTest.java @@ -7,7 +7,6 @@ import com.orientechnologies.orient.core.metadata.schema.OType; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; import java.util.Date; -import org.testng.annotations.Test; /** * @author Andrey Lomakin (a.lomakin-at-orientdb.com) @@ -24,7 +23,6 @@ public NotUniqueIndexSpeedTest() throws Exception { } @Override - @Test(enabled = false) public void init() throws Exception { super.init(); @@ -43,7 +41,6 @@ public void init() throws Exception { } @Override - @Test(enabled = false) public void cycle() throws Exception { String fVal = counter + "123456790qwertyASD"; counter++; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/ODocumentSerializationSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/ODocumentSerializationSpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/ODocumentSerializationSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/ODocumentSerializationSpeedTest.java index 5a2a909d6d1..2e5106a3c3e 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/ODocumentSerializationSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/ODocumentSerializationSpeedTest.java @@ -17,9 +17,7 @@ import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; -import org.testng.annotations.Test; -@Test(enabled = false) public class ODocumentSerializationSpeedTest extends OrientMonoThreadTest { private ODocument record; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/OrientDbWriteLotsOfDataTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/OrientDbWriteLotsOfDataTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/OrientDbWriteLotsOfDataTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/OrientDbWriteLotsOfDataTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/PLocalCreateVerticesMultiThreadSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/PLocalCreateVerticesMultiThreadSpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/PLocalCreateVerticesMultiThreadSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/PLocalCreateVerticesMultiThreadSpeedTest.java index 6228f08f7e2..5cfd4926b70 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/PLocalCreateVerticesMultiThreadSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/PLocalCreateVerticesMultiThreadSpeedTest.java @@ -26,16 +26,13 @@ import com.orientechnologies.orient.core.record.OVertex; import com.orientechnologies.orient.test.database.base.OrientMultiThreadTest; import com.orientechnologies.orient.test.database.base.OrientThreadTest; -import org.testng.Assert; -import org.testng.annotations.Test; +import org.junit.Assert; -@Test(enabled = false) public class PLocalCreateVerticesMultiThreadSpeedTest extends OrientMultiThreadTest { protected static final String URL = "embedded:target/databases"; protected static final OrientDB factory = new OrientDB(URL, OrientDBConfig.defaultConfig()); protected long foundObjects; - @Test(enabled = false) public static class CreateObjectsThread extends OrientThreadTest { private ODatabaseSession graph; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/ReadAllClusterObjectsSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/ReadAllClusterObjectsSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/ReadAllClusterObjectsSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/ReadAllClusterObjectsSpeedTest.java index c7fad8bfa8b..94c2a0283bb 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/ReadAllClusterObjectsSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/ReadAllClusterObjectsSpeedTest.java @@ -21,7 +21,6 @@ import com.orientechnologies.orient.core.record.impl.ODocument; import java.io.IOException; import java.io.UnsupportedEncodingException; -import org.testng.annotations.Test; public class ReadAllClusterObjectsSpeedTest extends SpeedTestMonoThread { private static final String CLASS_NAME = "Account"; @@ -36,14 +35,12 @@ public ReadAllClusterObjectsSpeedTest() { } @Override - @Test(enabled = false) public void init() throws IOException { db = new ODatabaseDocumentTx(url); db.open("admin", "admin"); } @Override - @Test(enabled = false) public void cycle() throws UnsupportedEncodingException { objectsRead = 0; @@ -65,7 +62,6 @@ public void afterCycle() throws Exception { } @Override - @Test(enabled = false) public void deinit() throws IOException { System.out.println("Read " + objectsRead + " objects in the cluster " + CLASS_NAME); db.close(); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/RemoteCreateDocumentSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/RemoteCreateDocumentSpeedTest.java similarity index 98% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/RemoteCreateDocumentSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/RemoteCreateDocumentSpeedTest.java index c72c32d084e..6daa04621c7 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/RemoteCreateDocumentSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/RemoteCreateDocumentSpeedTest.java @@ -23,9 +23,7 @@ import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; import java.util.Date; -import org.testng.annotations.Test; -@Test(enabled = false) public class RemoteCreateDocumentSpeedTest extends OrientMonoThreadTest { private ODatabaseDocument database; private ODocument record; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/SQLSynchQuerySpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/SQLSynchQuerySpeedTest.java similarity index 90% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/SQLSynchQuerySpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/SQLSynchQuerySpeedTest.java index 214fa59750c..2b3ed17ee87 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/SQLSynchQuerySpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/SQLSynchQuerySpeedTest.java @@ -19,11 +19,8 @@ import com.orientechnologies.orient.core.db.document.ODatabaseDocument; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.sql.executor.OResultSet; -import com.orientechnologies.orient.test.database.base.OrientTest; import java.io.UnsupportedEncodingException; -import org.testng.annotations.Test; -@Test(enabled = false) public class SQLSynchQuerySpeedTest extends SpeedTestMonoThread { protected int resultCount = 0; private ODatabaseDocument database; @@ -48,7 +45,11 @@ public void cycle() throws UnsupportedEncodingException { } public boolean result(final Object iRecord) { - OrientTest.printRecord(resultCount++, iRecord); + printRecord(resultCount++, iRecord); return true; } + + public static void printRecord(int i, final Object iRecord) { + if (iRecord != null) System.out.println(String.format("%-3d: %s", i, iRecord.toString())); + } } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/SuperNodeInsertSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/SuperNodeInsertSpeedTest.java similarity index 97% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/SuperNodeInsertSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/SuperNodeInsertSpeedTest.java index 5d49dced607..74a429d32ff 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/SuperNodeInsertSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/SuperNodeInsertSpeedTest.java @@ -13,8 +13,7 @@ import com.orientechnologies.orient.test.database.base.OrientMultiThreadTest; import com.orientechnologies.orient.test.database.base.OrientThreadTest; import java.util.concurrent.atomic.AtomicLong; -import org.testng.Assert; -import org.testng.annotations.Test; +import org.junit.Assert; /** @author Artem Orobets (enisher-at-gmail.com) */ /* @@ -30,7 +29,6 @@ * governing permissions and limitations under the License. */ -@Test(enabled = false) public class SuperNodeInsertSpeedTest extends OrientMultiThreadTest { protected static final String URL = "plocal:target/databases/graphspeedtest"; protected static final OrientDB factory = @@ -38,7 +36,6 @@ public class SuperNodeInsertSpeedTest extends OrientMultiThreadTest { protected static final AtomicLong counter = new AtomicLong(); protected static ORID superNodeRID; - @Test(enabled = false) public static class CreateObjectsThread extends OrientThreadTest { protected ODatabaseSession graph; protected OVertex superNode; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/UnsafeByteArrayComparatorSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/UnsafeByteArrayComparatorSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/UnsafeByteArrayComparatorSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/UnsafeByteArrayComparatorSpeedTest.java index 961dd492ec8..813a3c61956 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/UnsafeByteArrayComparatorSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/UnsafeByteArrayComparatorSpeedTest.java @@ -19,13 +19,11 @@ import com.orientechnologies.common.comparator.OUnsafeByteArrayComparator; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; import java.util.Random; -import org.testng.annotations.Test; /** * @author Andrey Lomakin (a.lomakin-at-orientdb.com) * @since 11.07.12 */ -@Test public class UnsafeByteArrayComparatorSpeedTest extends OrientMonoThreadTest { private final OUnsafeByteArrayComparator unsafeByteArrayComparator = new OUnsafeByteArrayComparator(); @@ -38,7 +36,6 @@ public UnsafeByteArrayComparatorSpeedTest() { } @Override - @Test(enabled = false) public void beforeCycle() throws Exception { int eqBorder = random.nextInt(bytesOne.length); @@ -52,7 +49,6 @@ public void beforeCycle() throws Exception { } @Override - @Test(enabled = false) public void cycle() throws Exception { unsafeByteArrayComparator.compare(bytesOne, bytesTwo); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/VarIntSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/VarIntSpeedTest.java similarity index 93% rename from tests/src/test/java/com/orientechnologies/orient/test/database/speed/VarIntSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/VarIntSpeedTest.java index a73f101eed7..837a19477e7 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/VarIntSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/database/speed/VarIntSpeedTest.java @@ -18,12 +18,9 @@ import com.orientechnologies.orient.core.serialization.serializer.record.binary.BytesContainer; import com.orientechnologies.orient.core.serialization.serializer.record.binary.OVarIntSerializer; import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; -import org.testng.annotations.Test; -@Test public class VarIntSpeedTest extends OrientMonoThreadTest { - @Test(enabled = false) public static void main(String[] iArgs) throws InstantiationException, IllegalAccessException { VarIntSpeedTest test = new VarIntSpeedTest(); test.data.go(test); @@ -34,11 +31,9 @@ public VarIntSpeedTest() throws InstantiationException, IllegalAccessException { } @Override - @Test(enabled = false) public void init() {} @Override - @Test(enabled = false) public void cycle() { BytesContainer container = new BytesContainer(); OVarIntSerializer.write(container, 20); @@ -53,6 +48,5 @@ public void cycle() { } @Override - @Test(enabled = false) public void deinit() {} } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/internal/EmptySpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/EmptySpeedTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/internal/EmptySpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/internal/EmptySpeedTest.java index 4dd906982ab..d401795b4c3 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/internal/EmptySpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/EmptySpeedTest.java @@ -16,7 +16,6 @@ package com.orientechnologies.orient.test.internal; import com.orientechnologies.common.test.SpeedTestMonoThread; -import org.testng.annotations.Test; /** * CAST: 74651ms NO CAST: @@ -30,7 +29,6 @@ public EmptySpeedTest() { super(100000000); } - @Test(enabled = false) @Override public void cycle() { counter++; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/internal/index/HashIndexSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/HashIndexSpeedTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/internal/index/HashIndexSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/HashIndexSpeedTest.java index 057f2dd6bf0..8a175e2912b 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/internal/index/HashIndexSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/HashIndexSpeedTest.java @@ -8,7 +8,6 @@ import com.orientechnologies.orient.core.index.OSimpleKeyIndexDefinition; import com.orientechnologies.orient.core.metadata.schema.OType; import java.util.Random; -import org.testng.annotations.Test; /** * @author Andrey Lomakin (a.lomakin-at-orientdb.com) @@ -24,7 +23,6 @@ public HashIndexSpeedTest() { } @Override - @Test(enabled = false) public void init() throws Exception { String buildDirectory = System.getProperty("buildDirectory", "."); if (buildDirectory == null) buildDirectory = "."; @@ -53,7 +51,6 @@ public void init() throws Exception { } @Override - @Test(enabled = false) public void cycle() throws Exception { databaseDocumentTx.begin(); String key = "bsadfasfas" + random.nextInt(); @@ -62,7 +59,6 @@ public void cycle() throws Exception { } @Override - @Test(enabled = false) public void deinit() throws Exception { databaseDocumentTx.drop(); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/internal/index/MVRBTreeInsertionSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/MVRBTreeInsertionSpeedTest.java similarity index 96% rename from tests/src/test/java/com/orientechnologies/orient/test/internal/index/MVRBTreeInsertionSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/MVRBTreeInsertionSpeedTest.java index dc66ae4097e..8d2e8ef1082 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/internal/index/MVRBTreeInsertionSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/MVRBTreeInsertionSpeedTest.java @@ -8,7 +8,6 @@ import com.orientechnologies.orient.core.index.OSimpleKeyIndexDefinition; import com.orientechnologies.orient.core.metadata.schema.OType; import java.util.Random; -import org.testng.annotations.Test; /** * @author Andrey Lomakin (a.lomakin-at-orientdb.com) @@ -25,7 +24,6 @@ public MVRBTreeInsertionSpeedTest() { } @Override - @Test(enabled = false) public void init() throws Exception { String buildDirectory = System.getProperty("buildDirectory", "."); @@ -56,7 +54,6 @@ public void init() throws Exception { } @Override - @Test(enabled = false) public void cycle() throws Exception { String key = "bsadfasfas" + random.nextInt(); index.put(key, new ORecordId(0, 0)); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/internal/index/SBTreeInsertionSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/SBTreeInsertionSpeedTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/internal/index/SBTreeInsertionSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/SBTreeInsertionSpeedTest.java index dfc1f97b436..a3410e6918a 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/internal/index/SBTreeInsertionSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/index/SBTreeInsertionSpeedTest.java @@ -6,7 +6,6 @@ import com.orientechnologies.orient.core.id.ORecordId; import com.orientechnologies.orient.core.index.OIndex; import java.util.Random; -import org.testng.annotations.Test; /** * @author Andrey Lomakin (a.lomakin-at-orientdb.com) @@ -22,7 +21,6 @@ public SBTreeInsertionSpeedTest() { } @Override - @Test(enabled = false) public void init() throws Exception { String buildDirectory = System.getProperty("buildDirectory", "."); @@ -46,7 +44,6 @@ public void init() throws Exception { } @Override - @Test(enabled = false) public void cycle() throws Exception { databaseDocumentTx.begin(); String key = "bsadfasfas" + random.nextInt(); @@ -55,7 +52,6 @@ public void cycle() throws Exception { } @Override - @Test(enabled = false) public void deinit() throws Exception { databaseDocumentTx.close(); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/internal/network/TcpClient.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/network/TcpClient.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/internal/network/TcpClient.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/internal/network/TcpClient.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/internal/network/TcpServer.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/internal/network/TcpServer.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/internal/network/TcpServer.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/internal/network/TcpServer.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/ArrayListSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/ArrayListSpeedTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/java/collection/ArrayListSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/ArrayListSpeedTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/ArraySpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/ArraySpeedTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/java/collection/ArraySpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/ArraySpeedTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionBaseAbstractSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionBaseAbstractSpeedTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionBaseAbstractSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionBaseAbstractSpeedTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionSpeedTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/CollectionSpeedTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapGetSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapGetSpeedTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapGetSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapGetSpeedTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapSpeedTest.java index 088bc87ce1c..3ed9b7ee849 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/HashMapSpeedTest.java @@ -16,9 +16,7 @@ package com.orientechnologies.orient.test.java.collection; import java.util.HashMap; -import org.testng.annotations.Test; -@Test(enabled = false) public class HashMapSpeedTest extends CollectionBaseAbstractSpeedTest { private HashMap map; diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapPlusObjectTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapPlusObjectTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapPlusObjectTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapPlusObjectTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapTest.java index bfb8d57814f..8e22db2fc47 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/LinkedHashMapTest.java @@ -2,7 +2,7 @@ import java.util.LinkedHashMap; import java.util.Map; -import org.testng.Assert; +import org.junit.Assert; public class LinkedHashMapTest { diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/TryCatchSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/TryCatchSpeedTest.java similarity index 91% rename from tests/src/test/java/com/orientechnologies/orient/test/java/lang/TryCatchSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/TryCatchSpeedTest.java index a294eff4d04..274c8e73d2a 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/TryCatchSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/collection/TryCatchSpeedTest.java @@ -13,13 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.orientechnologies.orient.test.java.lang; +package com.orientechnologies.orient.test.java.collection; import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.common.log.OLogger; import com.orientechnologies.common.test.SpeedTestMonoThread; import java.io.IOException; -import org.testng.annotations.Test; public class TryCatchSpeedTest extends SpeedTestMonoThread { private static final OLogger logger = OLogManager.instance().logger(TryCatchSpeedTest.class); @@ -29,7 +28,6 @@ public TryCatchSpeedTest() { } @Override - @Test(enabled = false) public void cycle() throws IOException { try { } catch (Throwable t) { diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/DateConversionSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/DateConversionSpeedTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/java/lang/DateConversionSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/DateConversionSpeedTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/ExceptionSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/ExceptionSpeedTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/java/lang/ExceptionSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/ExceptionSpeedTest.java index d00f78cde67..bcadd8e3a46 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/ExceptionSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/ExceptionSpeedTest.java @@ -18,7 +18,6 @@ import com.orientechnologies.common.test.SpeedTestMonoThread; import java.io.IOException; import java.util.NoSuchElementException; -import org.testng.annotations.Test; public class ExceptionSpeedTest extends SpeedTestMonoThread { @@ -27,7 +26,6 @@ public ExceptionSpeedTest() { } @Override - @Test(enabled = false) public void cycle() throws IOException { try { throw new NoSuchElementException(); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/NewGenSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/NewGenSpeedTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/java/lang/NewGenSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/NewGenSpeedTest.java index de355990788..430414ce5a2 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/NewGenSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/NewGenSpeedTest.java @@ -18,7 +18,6 @@ import com.orientechnologies.common.test.SpeedTestMonoThread; import com.orientechnologies.orient.core.record.impl.ODocument; import java.io.IOException; -import org.testng.annotations.Test; public class NewGenSpeedTest extends SpeedTestMonoThread { @@ -27,7 +26,6 @@ public NewGenSpeedTest() { } @Override - @Test(enabled = false) public void cycle() throws IOException { Object a = new ODocument(); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/StringBrowsingSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/StringBrowsingSpeedTest.java similarity index 100% rename from tests/src/test/java/com/orientechnologies/orient/test/java/lang/StringBrowsingSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/StringBrowsingSpeedTest.java diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/ThreadLocalSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/ThreadLocalSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/java/lang/ThreadLocalSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/ThreadLocalSpeedTest.java index 504e545eaa2..af26526bd02 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/ThreadLocalSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/lang/ThreadLocalSpeedTest.java @@ -17,7 +17,6 @@ import com.orientechnologies.common.test.SpeedTestMonoThread; import java.io.IOException; -import org.testng.annotations.Test; public class ThreadLocalSpeedTest extends SpeedTestMonoThread { private final ThreadLocal INSTANCE = new ThreadLocal() {}; @@ -27,7 +26,6 @@ public ThreadLocalSpeedTest() throws SecurityException, NoSuchFieldException { } @Override - @Test(enabled = false) public void cycle() throws IOException, IllegalArgumentException, IllegalAccessException { INSTANCE.set(this); INSTANCE.get(); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/md5/JavaMD5SpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/md5/JavaMD5SpeedTest.java similarity index 94% rename from tests/src/test/java/com/orientechnologies/orient/test/java/md5/JavaMD5SpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/md5/JavaMD5SpeedTest.java index 126c6b26c8c..8239fe7c6b2 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/md5/JavaMD5SpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/md5/JavaMD5SpeedTest.java @@ -18,8 +18,7 @@ import com.orientechnologies.common.test.SpeedTestMonoThread; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import org.testng.Assert; -import org.testng.annotations.Test; +import org.junit.Assert; public class JavaMD5SpeedTest extends SpeedTestMonoThread { private MessageDigest md; @@ -32,7 +31,6 @@ public JavaMD5SpeedTest() { } @Override - @Test(enabled = false) public void cycle() { md.reset(); md.update("admin".getBytes()); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationSpeedTest.java index 33fb1ad1149..ac566cc37d1 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationSpeedTest.java @@ -19,7 +19,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; -import org.testng.annotations.Test; public class BinarySerializationSpeedTest extends SpeedTestMonoThread { @@ -28,7 +27,6 @@ public BinarySerializationSpeedTest() { } @Override - @Test(enabled = false) public void cycle() throws IOException { ByteArrayOutputStream ba = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(ba); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSerializationSpeedTest.java b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSerializationSpeedTest.java similarity index 95% rename from tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSerializationSpeedTest.java rename to benchmarks/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSerializationSpeedTest.java index b391720a028..2ea3a97df6a 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSerializationSpeedTest.java +++ b/benchmarks/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSerializationSpeedTest.java @@ -17,7 +17,6 @@ import com.orientechnologies.common.test.SpeedTestMonoThread; import java.io.IOException; -import org.testng.annotations.Test; public class StringSerializationSpeedTest extends SpeedTestMonoThread { @@ -26,7 +25,6 @@ public StringSerializationSpeedTest() { } @Override - @Test(enabled = false) public void cycle() throws IOException { StringBuilder buffer = new StringBuilder(); buffer.append(Integer.valueOf(300).toString()); diff --git a/pom.xml b/pom.xml index 89d81ff0859..f337e51bcc0 100644 --- a/pom.xml +++ b/pom.xml @@ -714,6 +714,13 @@ all studio + benchmarks + + + + perf + + benchmarks diff --git a/tests/pom.xml b/tests/pom.xml index f708212cfa2..9ddb6f22589 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -81,14 +81,7 @@ jar compile - - com.orientechnologies - orientdb-core - ${project.version} - test-jar - test - - + com.orientechnologies orientdb-gremlin diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/load/MemoryLeaksTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/load/MemoryLeaksTest.java deleted file mode 100644 index 1007cdc5cac..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/load/MemoryLeaksTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.orientechnologies.orient.test.database.load; - -import com.orientechnologies.orient.core.db.document.ODatabaseDocument; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import com.orientechnologies.orient.core.record.impl.ODocument; -import org.testng.annotations.Test; - -/** - * Check the system as for memory leaks. - * - * @author Artem Orobets (enisher-at-gmail.com) - */ -public class MemoryLeaksTest { - - @Test - public void createLotsOfRecordsWithBigContent() { - ODatabaseDocument vDb = new ODatabaseDocumentTx("plocal:target/MemoryLeaksTest"); - vDb.create(); - for (int i = 0; i < 10000000; i++) { - ODocument vDoc = new ODocument(); - vDoc.field("test", new byte[100000]); - vDoc.save(); - if (i % 10 == 0) - System.out.println("Records created:" + i + " cacheSize: " + vDb.getLocalCache().getSize()); - } - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextSearchTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextSearchTest.java deleted file mode 100755 index 54ace2b0ffd..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/FullTextSearchTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.orientechnologies.orient.test.database.speed; - -import org.testng.annotations.Test; - -@Test -public class FullTextSearchTest { - // private static final int DOCUMENTS = 1000; - - public static void main(String[] iArgs) throws InstantiationException, IllegalAccessException { - // OProfilerStub.getInstance().startRecording(); - // - // final ODatabaseDocumentTx database = new - // ODatabaseDocumentTx(System.getProperty("url")).open("admin", "admin"); - // - // database.declareIntent(new OIntentMassiveRead()); - // database.begin(TXTYPE.NOTX); - // - // long time = System.currentTimeMillis(); - // - // List recs = null;// index.get("wife"); - // - // if (recs == null) - // System.out.println("\nERROR: Not found!"); - // else - // System.out.println("\nSearch for keyword 'wife' in " + ((System.currentTimeMillis() - time) / - // 1000f) + " sec."); - - // for (Entry> entry : index) { - // System.out.println("- " + entry.getKey() + ":" + entry.getValue().size()); - // } - - // database.close(); - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateObjectSpeedTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateObjectSpeedTest.java deleted file mode 100644 index 670697f9d9b..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/speed/LocalCreateObjectSpeedTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2010-2016 OrientDB LTD (http://orientdb.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 com.orientechnologies.orient.test.database.speed; - -import com.orientechnologies.orient.core.Orient; -import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE; -import com.orientechnologies.orient.object.db.OObjectDatabaseTx; -import com.orientechnologies.orient.test.database.base.OrientMonoThreadTest; -import com.orientechnologies.orient.test.domain.business.Account; -import java.util.Date; -import org.testng.annotations.Test; - -@Test(enabled = false) -public class LocalCreateObjectSpeedTest extends OrientMonoThreadTest { - private OObjectDatabaseTx database; - private Account account; - private Date date = new Date(); - - public static void main(String[] iArgs) throws InstantiationException, IllegalAccessException { - LocalCreateObjectSpeedTest test = new LocalCreateObjectSpeedTest(); - test.data.go(test); - } - - public LocalCreateObjectSpeedTest() throws InstantiationException, IllegalAccessException { - super(1000000); - } - - @Override - public void init() { - Orient.instance().getProfiler().startRecording(); - - database = new OObjectDatabaseTx(System.getProperty("url")).open("admin", "admin"); - database.getEntityManager().registerEntityClass(Account.class); - database.begin(TXTYPE.NOTX); - } - - @Override - public void cycle() { - account = new Account((int) data.getCyclesDone(), "Luca", "Garulli"); - account.setBirthDate(date); - account.setSalary(3000f + data.getCyclesDone()); - - database.save(account); - - if (data.getCyclesDone() == data.getCycles() - 1) database.commit(); - - account = null; - } - - @Override - public void deinit() { - database.close(); - super.deinit(); - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/MathTest.java b/tests/src/test/java/com/orientechnologies/orient/test/java/lang/MathTest.java deleted file mode 100644 index 32b4238ea86..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/MathTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010-2016 OrientDB LTD (http://orientdb.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 com.orientechnologies.orient.test.java.lang; - -import com.orientechnologies.orient.core.db.document.ODatabaseDocument; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import com.orientechnologies.orient.core.metadata.schema.OClass; -import com.orientechnologies.orient.core.metadata.schema.OSchema; -import com.orientechnologies.orient.core.metadata.schema.OType; -import com.orientechnologies.orient.core.sql.executor.OResult; -import java.util.List; -import java.util.stream.Collectors; -import org.testng.Assert; - -public class MathTest { - public static final void main(String[] args) { - final ODatabaseDocument db = new ODatabaseDocumentTx("memory:test").create(); - final OSchema schema = db.getMetadata().getSchema(); - final OClass clazz = schema.createClass("test"); - clazz.createProperty("numericAtt", OType.DOUBLE); - - db.command("INSERT INTO test(numericAtt) VALUES (28.23)").close(); - - final List docs = db.query("SELECT FROM test").stream().collect(Collectors.toList()); - Double value = (Double) docs.get(0).getProperty("numericAtt"); - - System.out.println(value); - - Assert.assertEquals(Double.valueOf(28.23), Float.valueOf(28.23f).doubleValue()); - Assert.assertEquals(Float.valueOf(28.23f), Double.valueOf(28.23).floatValue()); - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/ReflectionSpeedTest.java b/tests/src/test/java/com/orientechnologies/orient/test/java/lang/ReflectionSpeedTest.java deleted file mode 100644 index a7d86413a55..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/ReflectionSpeedTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010-2016 OrientDB LTD (http://orientdb.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 com.orientechnologies.orient.test.java.lang; - -import com.orientechnologies.common.test.SpeedTestMonoThread; -import com.orientechnologies.orient.test.domain.business.Account; -import java.io.IOException; -import java.lang.reflect.Field; -import org.testng.annotations.Test; - -public class ReflectionSpeedTest extends SpeedTestMonoThread { - private Field field; - private Account account = new Account(); - - public ReflectionSpeedTest() throws SecurityException, NoSuchFieldException { - super(10000000); - field = Account.class.getDeclaredField("name"); - if (!field.isAccessible()) field.setAccessible(true); - } - - @Override - @Test(enabled = false) - public void cycle() throws IOException, IllegalArgumentException, IllegalAccessException { - field.set(account, "Set test"); - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/RuntimeCastSpeedTest.java b/tests/src/test/java/com/orientechnologies/orient/test/java/lang/RuntimeCastSpeedTest.java deleted file mode 100644 index 03ffd48289d..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/lang/RuntimeCastSpeedTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010-2016 OrientDB LTD (http://orientdb.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 com.orientechnologies.orient.test.java.lang; - -import com.orientechnologies.common.test.SpeedTestAbstract; -import com.orientechnologies.common.test.SpeedTestMonoThread; -import java.io.IOException; -import org.testng.annotations.Test; - -/** - * CAST: 74651ms NO CAST: - * - * @author Luca Garulli (l.garulli--(at)--orientdb.com) - */ -public class RuntimeCastSpeedTest extends SpeedTestMonoThread { - private SpeedTestAbstract instance; - private int counter; - - public RuntimeCastSpeedTest() { - super(1000000000); - instance = this; - } - - @Override - @Test(enabled = false) - public void cycle() throws IOException { - ((RuntimeCastSpeedTest) instance).dummy(); - - // this.dummy(); - } - - public void dummy() { - counter++; - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationStream.java b/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationStream.java deleted file mode 100755 index abf37be4156..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/BinarySerializationStream.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.orientechnologies.orient.test.java.serialization; - -import com.orientechnologies.orient.core.serialization.OMemoryStream; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -public class BinarySerializationStream { - - public static void main(String[] args) { - - long time = System.currentTimeMillis(); - ByteArrayOutputStream s = new ByteArrayOutputStream(); - try { - DataOutputStream str = new DataOutputStream(s); - for (int i = 0; i < 1000000; i++) { - str.writeBytes("adfsdfsdfadfsdfsdfadfsdfsdfadfsdfsdf"); - str.writeInt(32); - str.writeLong(32); - str.writeByte(32); - } - } catch (IOException e) { - e.printStackTrace(); - } - System.out.println("Data Output Stream " + (System.currentTimeMillis() - time)); - time = System.currentTimeMillis(); - OMemoryStream mou = new OMemoryStream(); - for (int i = 0; i < 1000000; i++) { - mou.setCustom("adfsdfsdfadfsdfsdfadfsdfsdfadfsdfsdf"); - mou.set(32); - mou.set(32l); - mou.set((byte) 32); - } - - System.out.println("OMemoryStream " + (System.currentTimeMillis() - time)); - - System.out.println("" + s.toByteArray().length + " " + mou.toByteArray().length); - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/OrientStringContainsSpeedTest.java b/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/OrientStringContainsSpeedTest.java deleted file mode 100644 index ee4a7ad503e..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/OrientStringContainsSpeedTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010-2016 OrientDB LTD (http://orientdb.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 com.orientechnologies.orient.test.java.serialization; - -import com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper; - -public class OrientStringContainsSpeedTest { - private static final String TEXT = "Ciao, questa, e, una, prova. Che ne pensi?"; - private static final int MAX = 10000000; - - public static void main(String[] iArgs) { - System.out.println("Start testing cycle X " + MAX); - - long time = System.currentTimeMillis(); - for (int i = 0; i < MAX; ++i) { - OStringSerializerHelper.contains(TEXT, ','); - if (i % (MAX / 10) == 0) System.out.print("."); - } - System.out.println("\nElapsed: " + (System.currentTimeMillis() - time)); - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/OrientStringSplitSpeedTest.java b/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/OrientStringSplitSpeedTest.java deleted file mode 100644 index 85d747f02e1..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/OrientStringSplitSpeedTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010-2016 OrientDB LTD (http://orientdb.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 com.orientechnologies.orient.test.java.serialization; - -import com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper; -import java.util.List; - -public class OrientStringSplitSpeedTest { - private static final String TEXT = "Ciao, questa, e, una, prova. Che ne pensi?"; - private static final int MAX = 10000000; - - public static void main(String[] iArgs) { - List pieces = OStringSerializerHelper.split(TEXT, ','); - for (String s : pieces) System.out.println("String: " + s); - - System.out.println("Start testing cycle X " + MAX); - - long time = System.currentTimeMillis(); - for (int i = 0; i < MAX; ++i) { - pieces = OStringSerializerHelper.split(TEXT, ','); - if (i % (MAX / 10) == 0) System.out.print("."); - } - System.out.println("\nElapsed: " + (System.currentTimeMillis() - time)); - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringContainsSpeedTest.java b/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringContainsSpeedTest.java deleted file mode 100644 index b963d377402..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringContainsSpeedTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010-2016 OrientDB LTD (http://orientdb.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 com.orientechnologies.orient.test.java.serialization; - -public class StringContainsSpeedTest { - private static final String TEXT = "Ciao, questa, e, una, prova. Che ne pensi?"; - private static final int MAX = 10000000; - - public static void main(String[] iArgs) { - System.out.println("Start testing cycle X " + MAX); - - long time = System.currentTimeMillis(); - for (int i = 0; i < MAX; ++i) { - TEXT.contains(","); - if (i % (MAX / 10) == 0) System.out.print("."); - } - System.out.println("\nElapsed: " + (System.currentTimeMillis() - time)); - } -} diff --git a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSplitSpeedTest.java b/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSplitSpeedTest.java deleted file mode 100644 index f5fe36d6caf..00000000000 --- a/tests/src/test/java/com/orientechnologies/orient/test/java/serialization/StringSplitSpeedTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010-2016 OrientDB LTD (http://orientdb.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 com.orientechnologies.orient.test.java.serialization; - -public class StringSplitSpeedTest { - private static final String TEXT = "Ciao, questa, e, una, prova. Che ne pensi?"; - private static final int MAX = 10000000; - - public static void main(String[] iArgs) { - String[] pieces = TEXT.split(","); - for (String s : pieces) System.out.println("String: " + s); - - System.out.println("Start testing cycle X " + MAX); - - long time = System.currentTimeMillis(); - for (int i = 0; i < MAX; ++i) { - pieces = TEXT.split(","); - if (i % (MAX / 10) == 0) System.out.print("."); - } - System.out.println("\nElapsed: " + (System.currentTimeMillis() - time)); - } -}