From e7c2c148b570bf79b520042c2bc980161999c704 Mon Sep 17 00:00:00 2001 From: lvca Date: Fri, 16 Jan 2015 17:40:10 +0100 Subject: [PATCH 1/3] Fixed issue #3348 --- .../core/sql/OCommandExecutorSQLSelect.java | 70 ++++++------- .../orient/core/sql/ORuntimeResult.java | 97 ++++++++++--------- 2 files changed, 81 insertions(+), 86 deletions(-) diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java index b8ed2992d2a..90c04ce71f5 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java @@ -19,13 +19,6 @@ */ package com.orientechnologies.orient.core.sql; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.Future; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - import com.orientechnologies.common.collection.OMultiCollectionIterator; import com.orientechnologies.common.collection.OMultiValue; import com.orientechnologies.common.concur.resource.OSharedResource; @@ -87,6 +80,12 @@ import com.orientechnologies.orient.core.storage.OStorage; import com.orientechnologies.orient.core.storage.OStorage.LOCKING_STRATEGY; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.Future; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + /** * Executes the SQL SELECT statement. the parse() method compiles the query and builds the meta information needed by the execute(). * If the query contains the ORDER BY clause, the results are temporary collected internally, then ordered and finally returned all @@ -764,24 +763,20 @@ protected void searchInClasses() { } protected int parseProjections() { - if (!parserOptionalKeyword(KEYWORD_SELECT)) { + if (!parserOptionalKeyword(KEYWORD_SELECT)) return -1; - } int upperBound = OStringSerializerHelper.getLowerIndexOf(parserTextUpperCase, parserGetCurrentPosition(), KEYWORD_FROM_2FIND, KEYWORD_LET_2FIND); if (upperBound == -1) - // UP TO THE END - { + // UP TO THE END upperBound = parserText.length(); - } int lastRealPositionProjection = -1; int currPos = parserGetCurrentPosition(); - if (currPos == -1) { + if (currPos == -1) return -1; - } final String projectionString = parserText.substring(currPos, upperBound); if (projectionString.trim().length() > 0) { @@ -795,33 +790,29 @@ protected int parseProjections() { for (String projectionItem : items) { String projection = OStringSerializerHelper.smartTrim(projectionItem.trim(), true, true); - if (projectionDefinition == null) { + if (projectionDefinition == null) throw new OCommandSQLParsingException("Projection not allowed with FLATTEN() and EXPAND() operators"); - } final List words = OStringSerializerHelper.smartSplit(projection, ' '); String fieldName; if (words.size() > 1 && words.get(1).trim().equalsIgnoreCase(KEYWORD_AS)) { // FOUND AS, EXTRACT ALIAS - if (words.size() < 3) { + if (words.size() < 3) throw new OCommandSQLParsingException("Found 'AS' without alias"); - } fieldName = words.get(2).trim(); - if (projectionDefinition.containsKey(fieldName)) { + if (projectionDefinition.containsKey(fieldName)) throw new OCommandSQLParsingException("Field '" + fieldName + "' is duplicated in current SELECT, choose a different name"); - } projection = words.get(0).trim(); - if (words.size() > 3) { + if (words.size() > 3) lastRealPositionProjection = projectionString.indexOf(words.get(3)); - } else { + else lastRealPositionProjection += projectionItem.length() + 1; - } } else { // EXTRACT THE FIELD NAME WITHOUT FUNCTIONS AND/OR LINKS @@ -830,32 +821,29 @@ protected int parseProjections() { lastRealPositionProjection = projectionString.indexOf(fieldName) + fieldName.length() + 1; - if (fieldName.charAt(0) == '@') { + if (fieldName.charAt(0) == '@') fieldName = fieldName.substring(1); - } endPos = extractProjectionNameSubstringEndPosition(fieldName); - if (endPos > -1) { + if (endPos > -1) fieldName = fieldName.substring(0, endPos); - } // FIND A UNIQUE NAME BY ADDING A COUNTER - for (int fieldIndex = 2; projectionDefinition.containsKey(fieldName); ++fieldIndex) { + for (int fieldIndex = 2; projectionDefinition.containsKey(fieldName); ++fieldIndex) fieldName += fieldIndex; - } } - String p = upperCase(projection); + final String p = upperCase(projection); if (p.startsWith("FLATTEN(") || p.startsWith("EXPAND(")) { - if (p.startsWith("FLATTEN(")) { + if (p.startsWith("FLATTEN(")) OLogManager.instance().debug(this, "FLATTEN() operator has been replaced by EXPAND()"); - } + List pars = OStringSerializerHelper.getParameters(projection); - if (pars.size() != 1) { + if (pars.size() != 1) throw new OCommandSQLParsingException( "EXPAND/FLATTEN operators expects the field name as parameter. Example EXPAND( out )"); - } + expandTarget = OSQLHelper.parseValue(this, pars.get(0).trim(), context); // BY PASS THIS AS PROJECTION BUT TREAT IT AS SPECIAL @@ -863,9 +851,8 @@ protected int parseProjections() { projections = null; if (groupedResult == null && expandTarget instanceof OSQLFunctionRuntime - && ((OSQLFunctionRuntime) expandTarget).aggregateResults()) { + && ((OSQLFunctionRuntime) expandTarget).aggregateResults()) getProjectionGroup(null); - } continue; } @@ -895,13 +882,12 @@ protected int parseProjections() { } } - if (upperBound < parserText.length() - 1) { + if (upperBound < parserText.length() - 1) parserSetCurrentPosition(upperBound); - } else if (lastRealPositionProjection > -1) { + else if (lastRealPositionProjection > -1) parserMoveCurrentPosition(lastRealPositionProjection); - } else { + else parserSetEndOfText(); - } return parserGetCurrentPosition(); } @@ -1324,7 +1310,9 @@ private void fetchFromTarget(final Iterator iTarget) { if (queryScanThresholdWarning > 0 && browsed > queryScanThresholdWarning && compiledFilter != null) { reportTip(String - .format("Query '%s' fetched more than %d records: to speed up the execution, create an index or change the query to use an existent index", parserText, queryScanThresholdWarning)); + .format( + "Query '%s' fetched more than %d records: to speed up the execution, create an index or change the query to use an existent index", + parserText, queryScanThresholdWarning)); queryScanThresholdWarning = 0; } } diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/ORuntimeResult.java b/core/src/main/java/com/orientechnologies/orient/core/sql/ORuntimeResult.java index d35901acc6f..ade3c9c8e83 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/ORuntimeResult.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/ORuntimeResult.java @@ -94,7 +94,9 @@ public static ODocument applyRecord(final ODocument iValue, final Map last = var.getLastChainOperator(); @@ -115,56 +117,61 @@ public static ODocument applyRecord(final ODocument iValue, final Map iteratorValues = new ArrayList(); - final Iterator projectionValueIterator = (Iterator) projectionValue; - while (projectionValueIterator.hasNext()) { - Object value = projectionValueIterator.next(); - if (value instanceof OIdentifiable) { - value = ((OIdentifiable) value).getRecord(); - if (!((OIdentifiable) value).getIdentity().isPersistent()) - link = false; - } - - if (value != null) - iteratorValues.add(value); + if (projectionValue == null) + // NULL + iValue.field(prjName, projectionValue); + else if (projectionValue instanceof ORidBag) + iValue.field(prjName, new ORidBag((ORidBag) projectionValue)); + else if (projectionValue instanceof OIdentifiable && !(projectionValue instanceof ORID) + && !(projectionValue instanceof ORecord)) + iValue.field(prjName, ((OIdentifiable) projectionValue).getRecord()); + else if (projectionValue instanceof Iterator) { + boolean link = true; + // make temporary value typical case graph database elemenet's iterator edges + if (projectionValue instanceof OResettable) + ((OResettable) projectionValue).reset(); + + final List iteratorValues = new ArrayList(); + final Iterator projectionValueIterator = (Iterator) projectionValue; + while (projectionValueIterator.hasNext()) { + Object value = projectionValueIterator.next(); + if (value instanceof OIdentifiable) { + value = ((OIdentifiable) value).getRecord(); + if (!((OIdentifiable) value).getIdentity().isPersistent()) + link = false; } - iValue.field(prjName, iteratorValues, link ? OType.LINKLIST : OType.EMBEDDEDLIST); - } else if (projectionValue instanceof ODocument && !((ODocument) projectionValue).getIdentity().isPersistent()) { - iValue.field(prjName, projectionValue, OType.EMBEDDED); - } else if (projectionValue instanceof Set) { - OType type = OType.getTypeByValue(projectionValue); - if (type == OType.LINKSET && !entriesPersistent((Collection) projectionValue)) - type = OType.EMBEDDEDSET; - iValue.field(prjName, projectionValue, type); - } else if (projectionValue instanceof Map) { - OType type = OType.getTypeByValue(projectionValue); - if (type == OType.LINKMAP && !entriesPersistent(((Map) projectionValue).values())) - type = OType.EMBEDDEDMAP; - iValue.field(prjName, projectionValue, type); - } else if (projectionValue instanceof List) { - OType type = OType.getTypeByValue(projectionValue); - if (type == OType.LINKLIST && !entriesPersistent((Collection) projectionValue)) - type = OType.EMBEDDEDLIST; - iValue.field(prjName, projectionValue, type); + if (value != null) + iteratorValues.add(value); + } - } else - iValue.field(prjName, projectionValue); + iValue.field(prjName, iteratorValues, link ? OType.LINKLIST : OType.EMBEDDEDLIST); + } else if (projectionValue instanceof ODocument && !((ODocument) projectionValue).getIdentity().isPersistent()) { + iValue.field(prjName, projectionValue, OType.EMBEDDED); + } else if (projectionValue instanceof Set) { + OType type = OType.getTypeByValue(projectionValue); + if (type == OType.LINKSET && !entriesPersistent((Collection) projectionValue)) + type = OType.EMBEDDEDSET; + iValue.field(prjName, projectionValue, type); + } else if (projectionValue instanceof Map) { + OType type = OType.getTypeByValue(projectionValue); + if (type == OType.LINKMAP && !entriesPersistent(((Map) projectionValue).values())) + type = OType.EMBEDDEDMAP; + iValue.field(prjName, projectionValue, type); + } else if (projectionValue instanceof List) { + OType type = OType.getTypeByValue(projectionValue); + if (type == OType.LINKLIST && !entriesPersistent((Collection) projectionValue)) + type = OType.EMBEDDEDLIST; + iValue.field(prjName, projectionValue, type); + + } else + iValue.field(prjName, projectionValue); } } From 2c20d7e9712cce83d42349677aee6930b3e275aa Mon Sep 17 00:00:00 2001 From: lvca Date: Fri, 16 Jan 2015 19:24:28 +0100 Subject: [PATCH 2/3] Fixed issue #3348 --- .../orient/core/sql/ORuntimeResult.java | 99 ++++++++++--------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/ORuntimeResult.java b/core/src/main/java/com/orientechnologies/orient/core/sql/ORuntimeResult.java index ade3c9c8e83..4531fb06f7b 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/ORuntimeResult.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/ORuntimeResult.java @@ -117,61 +117,62 @@ public static ODocument applyRecord(final ODocument iValue, final Map iteratorValues = new ArrayList(); + final Iterator projectionValueIterator = (Iterator) projectionValue; + while (projectionValueIterator.hasNext()) { + Object value = projectionValueIterator.next(); + if (value instanceof OIdentifiable) { + value = ((OIdentifiable) value).getRecord(); + if (!((OIdentifiable) value).getIdentity().isPersistent()) + link = false; + } - if (projectionValue == null) - // NULL - iValue.field(prjName, projectionValue); - else if (projectionValue instanceof ORidBag) - iValue.field(prjName, new ORidBag((ORidBag) projectionValue)); - else if (projectionValue instanceof OIdentifiable && !(projectionValue instanceof ORID) - && !(projectionValue instanceof ORecord)) - iValue.field(prjName, ((OIdentifiable) projectionValue).getRecord()); - else if (projectionValue instanceof Iterator) { - boolean link = true; - // make temporary value typical case graph database elemenet's iterator edges - if (projectionValue instanceof OResettable) - ((OResettable) projectionValue).reset(); - - final List iteratorValues = new ArrayList(); - final Iterator projectionValueIterator = (Iterator) projectionValue; - while (projectionValueIterator.hasNext()) { - Object value = projectionValueIterator.next(); - if (value instanceof OIdentifiable) { - value = ((OIdentifiable) value).getRecord(); - if (!((OIdentifiable) value).getIdentity().isPersistent()) - link = false; + if (value != null) + iteratorValues.add(value); } - if (value != null) - iteratorValues.add(value); - } + iValue.field(prjName, iteratorValues, link ? OType.LINKLIST : OType.EMBEDDEDLIST); + } else if (projectionValue instanceof ODocument && !((ODocument) projectionValue).getIdentity().isPersistent()) { + iValue.field(prjName, projectionValue, OType.EMBEDDED); + } else if (projectionValue instanceof Set) { + OType type = OType.getTypeByValue(projectionValue); + if (type == OType.LINKSET && !entriesPersistent((Collection) projectionValue)) + type = OType.EMBEDDEDSET; + iValue.field(prjName, projectionValue, type); + } else if (projectionValue instanceof Map) { + OType type = OType.getTypeByValue(projectionValue); + if (type == OType.LINKMAP && !entriesPersistent(((Map) projectionValue).values())) + type = OType.EMBEDDEDMAP; + iValue.field(prjName, projectionValue, type); + } else if (projectionValue instanceof List) { + OType type = OType.getTypeByValue(projectionValue); + if (type == OType.LINKLIST && !entriesPersistent((Collection) projectionValue)) + type = OType.EMBEDDEDLIST; + iValue.field(prjName, projectionValue, type); - iValue.field(prjName, iteratorValues, link ? OType.LINKLIST : OType.EMBEDDEDLIST); - } else if (projectionValue instanceof ODocument && !((ODocument) projectionValue).getIdentity().isPersistent()) { - iValue.field(prjName, projectionValue, OType.EMBEDDED); - } else if (projectionValue instanceof Set) { - OType type = OType.getTypeByValue(projectionValue); - if (type == OType.LINKSET && !entriesPersistent((Collection) projectionValue)) - type = OType.EMBEDDEDSET; - iValue.field(prjName, projectionValue, type); - } else if (projectionValue instanceof Map) { - OType type = OType.getTypeByValue(projectionValue); - if (type == OType.LINKMAP && !entriesPersistent(((Map) projectionValue).values())) - type = OType.EMBEDDEDMAP; - iValue.field(prjName, projectionValue, type); - } else if (projectionValue instanceof List) { - OType type = OType.getTypeByValue(projectionValue); - if (type == OType.LINKLIST && !entriesPersistent((Collection) projectionValue)) - type = OType.EMBEDDEDLIST; - iValue.field(prjName, projectionValue, type); - - } else - iValue.field(prjName, projectionValue); + } else + iValue.field(prjName, projectionValue); } } From b692ad250212abd76d3a54bef2c8e7cdfaf1b602 Mon Sep 17 00:00:00 2001 From: lvca Date: Fri, 16 Jan 2015 19:24:41 +0100 Subject: [PATCH 3/3] Removed many outputs in tests --- .../auto/CRUDDocumentPhysicalTest.java | 18 ++++---- .../auto/ConcurrentCommandAndOpenTest.java | 20 ++++----- .../database/auto/ConcurrentQueriesTest.java | 20 ++++----- ...ConcurrentSQLBatchUpdateSuperNodeTest.java | 38 ++++++++--------- .../database/auto/ConcurrentSchemaTest.java | 21 +++++----- .../database/auto/ConcurrentUpdatesTest.java | 24 ++++++----- .../auto/DatabaseConflictStategyTest.java | 16 ++++---- .../test/database/auto/DbCheckTest.java | 10 ++--- .../test/database/auto/DbListenerTest.java | 2 +- .../test/database/auto/FullTextIndexTest.java | 20 ++++----- .../test/database/auto/FunctionsTest.java | 8 ++-- .../test/database/auto/GraphDatabaseTest.java | 4 +- .../test/database/auto/ORidBagTest.java | 27 ++++++------ .../auto/ObjectTreeTestSchemaFull.java | 41 ++++++++++--------- .../test/database/auto/SQLSelectTest.java | 8 ++-- .../auto/TransactionConsistencyTest.java | 8 ++-- 16 files changed, 139 insertions(+), 146 deletions(-) diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDDocumentPhysicalTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDDocumentPhysicalTest.java index e36f8d88d76..e83fbcae7ac 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDDocumentPhysicalTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDDocumentPhysicalTest.java @@ -483,15 +483,15 @@ public void testJSONLinkd() { + jaimeDoc.toJSON() + "}}"); tyrionDoc.save(); - System.out.println("The saved documents are:"); +// System.out.println("The saved documents are:"); for (ODocument o : database.browseClass("PersonTest")) { - System.out.println("my id is " + o.getIdentity().toString()); - System.out.println("my name is: " + o.field("name")); - System.out.println("my ODocument representation is " + o); - System.out.println("my JSON representation is " + o.toJSON()); - System.out.println("my traversable links are: "); +// System.out.println("my id is " + o.getIdentity().toString()); +// System.out.println("my name is: " + o.field("name")); +// System.out.println("my ODocument representation is " + o); +// System.out.println("my JSON representation is " + o.toJSON()); +// System.out.println("my traversable links are: "); for (OIdentifiable id : new OSQLSynchQuery("traverse * from " + o.getIdentity().toString())) { - System.out.println(database.load(id.getIdentity()).toJSON()); + database.load(id.getIdentity()).toJSON(); } } } @@ -688,8 +688,8 @@ public void call(ORecordId iRID, Long iParameter) { final ODatabaseDocumentTx db = pool.acquire(); long tot; while ((tot = db.countClusterElements("Account")) < startRecordNumber + TOT_RECORDS) { - System.out.println("Asynchronous insertion: found " + tot + " records but waiting till " + (startRecordNumber + TOT_RECORDS) - + " is reached"); +// System.out.println("Asynchronous insertion: found " + tot + " records but waiting till " + (startRecordNumber + TOT_RECORDS) +// + " is reached"); try { Thread.sleep(100); } catch (InterruptedException e) { diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentCommandAndOpenTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentCommandAndOpenTest.java index 377bfdd5f22..5bb483a738f 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentCommandAndOpenTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentCommandAndOpenTest.java @@ -15,17 +15,15 @@ */ package com.orientechnologies.orient.test.database.auto; +import com.orientechnologies.orient.core.command.script.OCommandScript; import com.orientechnologies.orient.core.config.OGlobalConfiguration; +import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; +import com.orientechnologies.orient.core.sql.OCommandSQL; import org.testng.Assert; -import org.testng.annotations.BeforeClass; import org.testng.annotations.Optional; import org.testng.annotations.Parameters; import org.testng.annotations.Test; -import com.orientechnologies.orient.core.command.script.OCommandScript; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import com.orientechnologies.orient.core.sql.OCommandSQL; - @Test public class ConcurrentCommandAndOpenTest extends DocumentDBBaseTest { protected final static int MAX_CONNS = 10; @@ -45,9 +43,9 @@ public void concurrentCommands() throws Exception { public void run() { ODatabaseDocumentTx db = new ODatabaseDocumentTx(url).open("admin", "admin"); try { - System.out.println("Start sleeping..."); + //System.out.println("Start sleeping..."); db.command(new OCommandScript("SQL", "sleep 5000")).execute(); - System.out.println("Sleeping done!"); + //System.out.println("Sleeping done!"); } finally { db.close(); @@ -62,20 +60,20 @@ public void run() { int commandExecuted = 0; int iterations = MAX_CONNS * 5; for (int i = 0; i < iterations; ++i) { - System.out.println("Open database " + i); + //System.out.println("Open database " + i); ODatabaseDocumentTx db = new ODatabaseDocumentTx(url).open("admin", "admin"); try { db.command(new OCommandSQL("select from OUser")).execute(); - System.out.println("Command executed " + i); + //System.out.println("Command executed " + i); commandExecuted++; } finally { db.close(); } } - System.out.println("Waiting for the sleeping thread..."); + //System.out.println("Waiting for the sleeping thread..."); thread.join(); - System.out.println("Done!"); + //System.out.println("Done!"); Assert.assertEquals(commandExecuted, iterations); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentQueriesTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentQueriesTest.java index 8000642b1e3..0f6fbb59f1c 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentQueriesTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentQueriesTest.java @@ -15,20 +15,18 @@ */ package com.orientechnologies.orient.test.database.auto; -import java.util.concurrent.Callable; -import java.util.concurrent.atomic.AtomicLong; - +import com.orientechnologies.common.concur.ONeedRetryException; +import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; +import com.orientechnologies.orient.core.sql.OCommandSQL; +import com.orientechnologies.orient.test.ConcurrentTestHelper; import org.testng.Assert; -import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Optional; import org.testng.annotations.Parameters; import org.testng.annotations.Test; -import com.orientechnologies.common.concur.ONeedRetryException; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import com.orientechnologies.orient.core.sql.OCommandSQL; -import com.orientechnologies.orient.test.ConcurrentTestHelper; +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicLong; @Test public class ConcurrentQueriesTest extends DocumentDBBaseTest { @@ -94,7 +92,7 @@ public void init() { @Test public void concurrentCommands() throws Exception { - System.out.println("Spanning " + THREADS + " threads..."); +// System.out.println("Spanning " + THREADS + " threads..."); ConcurrentTestHelper.test(THREADS, new ConcurrentTestHelper.TestFactory() { @Override @@ -103,8 +101,8 @@ public Callable createWorker() { } }); - System.out.println("Done! Total queries executed in parallel: " + counter.get() + " average retries: " - + ((float) totalRetries.get() / (float) counter.get())); +// System.out.println("Done! Total queries executed in parallel: " + counter.get() + " average retries: " +// + ((float) totalRetries.get() / (float) counter.get())); Assert.assertEquals(counter.get(), CYCLES * THREADS); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentSQLBatchUpdateSuperNodeTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentSQLBatchUpdateSuperNodeTest.java index 9a7aa1895f8..6bf0a0b15ad 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentSQLBatchUpdateSuperNodeTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentSQLBatchUpdateSuperNodeTest.java @@ -18,7 +18,6 @@ import com.orientechnologies.orient.core.command.OCommandRequest; import com.orientechnologies.orient.core.command.script.OCommandScript; import com.orientechnologies.orient.core.config.OGlobalConfiguration; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.tinkerpop.blueprints.Direction; import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph; import com.tinkerpop.blueprints.impls.orient.OrientDynaElementIterable; @@ -87,14 +86,15 @@ public void run() { totalRetries.addAndGet(retries); } else if (res instanceof OrientDynaElementIterable) { - System.out.println("RETURNED ITER"); +// System.out.println("RETURNED ITER"); OrientDynaElementIterable it = (OrientDynaElementIterable) res; for (Object o : it) - System.out.println("RETURNED: " + o); + ; +// System.out.println("RETURNED: " + o); } } - System.out.println("Thread " + threadId + " completed"); +// System.out.println("Thread " + threadId + " completed"); graph.shutdown(); } catch (Throwable e) { @@ -159,7 +159,7 @@ public void deinit() { @Test(enabled = true) public void concurrentOptimisticUpdates() throws Exception { - System.out.println("Started Test OPTIMISTIC Batch Update against SuperNode"); +// System.out.println("Started Test OPTIMISTIC Batch Update against SuperNode"); counter.set(0); startedOn = System.currentTimeMillis(); @@ -177,19 +177,19 @@ public void concurrentOptimisticUpdates() throws Exception { for (int i = 0; i < THREADS; ++i) threads[i] = new Thread(ops[i], "ConcurrentSQLBatchUpdateSuperNodeTest-optimistic" + i); - System.out.println("Starting " + THREADS + " threads, " + OPTIMISTIC_CYCLES + " operations each"); +// System.out.println("Starting " + THREADS + " threads, " + OPTIMISTIC_CYCLES + " operations each"); for (int i = 0; i < THREADS; ++i) threads[i].start(); for (int i = 0; i < THREADS; ++i) { threads[i].join(); - System.out.println("Thread " + i + " completed"); +// System.out.println("Thread " + i + " completed"); } - System.out.println("ConcurrentSQLBatchUpdateSuperNodeTest Optimistic Done! Total updates executed in parallel: " - + counter.get() + " total retries: " + totalRetries.get() + " average retries: " - + ((float) totalRetries.get() / (float) counter.get())); +// System.out.println("ConcurrentSQLBatchUpdateSuperNodeTest Optimistic Done! Total updates executed in parallel: " +// + counter.get() + " total retries: " + totalRetries.get() + " average retries: " +// + ((float) totalRetries.get() / (float) counter.get())); Assert.assertEquals(counter.get(), OPTIMISTIC_CYCLES * THREADS); @@ -200,13 +200,13 @@ public void concurrentOptimisticUpdates() throws Exception { graphPool.shutdown(); - System.out.println("ConcurrentSQLBatchUpdateSuperNodeTest Optimistic Test completed in " - + (System.currentTimeMillis() - startedOn)); +// System.out.println("ConcurrentSQLBatchUpdateSuperNodeTest Optimistic Test completed in " +// + (System.currentTimeMillis() - startedOn)); } @Test(enabled = false) public void concurrentPessimisticUpdates() throws Exception { - System.out.println("Started Test PESSIMISTIC Batch Update against SuperNode"); +// System.out.println("Started Test PESSIMISTIC Batch Update against SuperNode"); counter.set(0); startedOn = System.currentTimeMillis(); @@ -225,18 +225,18 @@ public void concurrentPessimisticUpdates() throws Exception { for (int i = 0; i < THREADS; ++i) threads[i] = new Thread(ops[i], "ConcurrentSQLBatchUpdateSuperNodeTest-pessimistic" + i); - System.out.println("Starting " + THREADS + " threads, " + PESSIMISTIC_CYCLES + " operations each"); +// System.out.println("Starting " + THREADS + " threads, " + PESSIMISTIC_CYCLES + " operations each"); for (int i = 0; i < THREADS; ++i) threads[i].start(); for (int i = 0; i < THREADS; ++i) { threads[i].join(); - System.out.println("Thread " + i + " completed"); +// System.out.println("Thread " + i + " completed"); } - System.out.println("ConcurrentSQLBatchUpdateSuperNodeTest Pessimistic Done! Total updates executed in parallel: " - + counter.get() + " average retries: " + ((float) totalRetries.get() / (float) counter.get())); +// System.out.println("ConcurrentSQLBatchUpdateSuperNodeTest Pessimistic Done! Total updates executed in parallel: " +// + counter.get() + " average retries: " + ((float) totalRetries.get() / (float) counter.get())); Assert.assertEquals(counter.get(), PESSIMISTIC_CYCLES * THREADS); @@ -247,7 +247,7 @@ public void concurrentPessimisticUpdates() throws Exception { graphPool.shutdown(); - System.out.println("ConcurrentSQLBatchUpdateSuperNodeTest Pessimistic Test completed in " - + (System.currentTimeMillis() - startedOn)); + // System.out.println("ConcurrentSQLBatchUpdateSuperNodeTest Pessimistic Test completed in " + // + (System.currentTimeMillis() - startedOn)); } } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentSchemaTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentSchemaTest.java index d96ca67ab21..e155677ea4b 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentSchemaTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentSchemaTest.java @@ -19,18 +19,17 @@ */ package com.orientechnologies.orient.test.database.auto; -import java.util.concurrent.Callable; -import java.util.concurrent.atomic.AtomicLong; - +import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; +import com.orientechnologies.orient.core.metadata.schema.OClass; +import com.orientechnologies.orient.core.sql.OCommandSQL; +import com.orientechnologies.orient.test.ConcurrentTestHelper; import org.testng.Assert; import org.testng.annotations.Optional; import org.testng.annotations.Parameters; import org.testng.annotations.Test; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import com.orientechnologies.orient.core.metadata.schema.OClass; -import com.orientechnologies.orient.core.sql.OCommandSQL; -import com.orientechnologies.orient.test.ConcurrentTestHelper; +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicLong; @Test public class ConcurrentSchemaTest extends DocumentDBBaseTest { @@ -109,7 +108,7 @@ public ConcurrentSchemaTest(@Optional String url) { @Test public void concurrentCommands() throws Exception { - System.out.println("Create classes, spanning " + THREADS + " threads..."); +// System.out.println("Create classes, spanning " + THREADS + " threads..."); ConcurrentTestHelper.test(THREADS, new ConcurrentTestHelper.TestFactory() { @Override @@ -118,7 +117,7 @@ public Callable createWorker() { } }); - System.out.println("Create classes, checking..."); +// System.out.println("Create classes, checking..."); for (int id = 0; id < THREADS; ++id) { for (int i = 0; i < CYCLES; ++i) { @@ -127,7 +126,7 @@ public Callable createWorker() { } } - System.out.println("Dropping classes, spanning " + THREADS + " threads..."); +// System.out.println("Dropping classes, spanning " + THREADS + " threads..."); ConcurrentTestHelper.test(THREADS, new ConcurrentTestHelper.TestFactory() { @Override @@ -136,7 +135,7 @@ public Callable createWorker() { } }); - System.out.println("Done!"); +// System.out.println("Done!"); Assert.assertEquals(counter.get(), 0); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentUpdatesTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentUpdatesTest.java index 34ec6c7c9be..852fcf3bacf 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentUpdatesTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ConcurrentUpdatesTest.java @@ -181,7 +181,7 @@ public void deinit() { @Test public void concurrentOptimisticUpdates() throws Exception { - System.out.println("Started Test OPTIMISTIC"); +// System.out.println("Started Test OPTIMISTIC"); counter.set(0); startedOn = System.currentTimeMillis(); @@ -214,8 +214,8 @@ public void concurrentOptimisticUpdates() throws Exception { for (int i = 0; i < THREADS; ++i) threads[i].join(); - System.out.println("Done! Total updates executed in parallel: " + counter.get() + " average retries: " - + ((float) totalRetries.get() / (float) counter.get())); +// System.out.println("Done! Total updates executed in parallel: " + counter.get() + " average retries: " +// + ((float) totalRetries.get() / (float) counter.get())); Assert.assertEquals(counter.get(), OPTIMISTIC_CYCLES * THREADS); @@ -224,21 +224,23 @@ public void concurrentOptimisticUpdates() throws Exception { for (int i = 0; i < THREADS; ++i) Assert.assertEquals(doc1.field(ops[i].threadName), ops[i].fieldValue, ops[i].threadName); - System.out.println("RESULT doc 1:"); - System.out.println(doc1.toJSON()); + doc1.toJSON(); +// System.out.println("RESULT doc 1:"); +// System.out.println(doc1.toJSON()); doc2 = databases[0].load(rid2, null, true); for (int i = 0; i < THREADS; ++i) Assert.assertEquals(doc2.field(ops[i].threadName), ops[i].fieldValue, ops[i].threadName); - System.out.println("RESULT doc 2:"); +// System.out.println("RESULT doc 2:"); + doc2.toJSON(); System.out.println(doc2.toJSON()); for (int i = 0; i < THREADS; ++i) databases[i].close(); - System.out.println("Test completed in " + (System.currentTimeMillis() - startedOn)); +// System.out.println("Test completed in " + (System.currentTimeMillis() - startedOn)); } @Test @@ -252,7 +254,7 @@ public void concurrentOptimisticSQLUpdates() throws Exception { } protected void sqlUpdate(boolean lock) throws InterruptedException { - System.out.println("Started Test " + (lock ? "LOCK" : "")); +// System.out.println("Started Test " + (lock ? "LOCK" : "")); counter.set(0); startedOn = System.currentTimeMillis(); @@ -280,7 +282,7 @@ protected void sqlUpdate(boolean lock) throws InterruptedException { for (int i = 0; i < THREADS; ++i) threads[i].join(); - System.out.println("Done! Total sql updates executed in parallel: " + counter.get()); +// System.out.println("Done! Total sql updates executed in parallel: " + counter.get()); Assert.assertEquals(counter.get(), PESSIMISTIC_CYCLES * THREADS); @@ -290,7 +292,7 @@ protected void sqlUpdate(boolean lock) throws InterruptedException { for (int i = 0; i < THREADS; ++i) databases[i].close(); - System.out.println("concurrentOptimisticSQLUpdates Test " + (lock ? "LOCK" : "") + " completed in " - + (System.currentTimeMillis() - startedOn)); +// System.out.println("concurrentOptimisticSQLUpdates Test " + (lock ? "LOCK" : "") + " completed in " +// + (System.currentTimeMillis() - startedOn)); } } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DatabaseConflictStategyTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DatabaseConflictStategyTest.java index e9befbcc8fc..6bf1974adc5 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DatabaseConflictStategyTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DatabaseConflictStategyTest.java @@ -29,8 +29,6 @@ import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; import com.tinkerpop.blueprints.impls.orient.OrientVertex; -import java.util.Set; - public final class DatabaseConflictStategyTest { private String dbName; @@ -75,12 +73,12 @@ public void runTest() { } public void printVertex(String info, OrientVertex vtx) { - System.out.println("--------" + info + " ----------"); - System.out.println(vtx); - Set keys = vtx.getPropertyKeys(); - for (String key : keys) { - System.out.println("Key = " + key + " Value = " + vtx.getProperty(key)); - } +// System.out.println("--------" + info + " ----------"); +// System.out.println(vtx); +// Set keys = vtx.getPropertyKeys(); +// for (String key : keys) { +// System.out.println("Key = " + key + " Value = " + vtx.getProperty(key)); +// } } /** @@ -133,7 +131,7 @@ private void createVertexType(OrientBaseGraph orientGraph, String className) { } private void log(String message) { - System.out.println(message); +// System.out.println(message); } private void log(String message, Throwable th) { diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DbCheckTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DbCheckTest.java index f7c03e96a9b..1a78c376658 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DbCheckTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DbCheckTest.java @@ -15,16 +15,14 @@ */ package com.orientechnologies.orient.test.database.auto; -import java.io.IOException; - +import com.orientechnologies.orient.core.command.OCommandOutputListener; import com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage; import org.testng.Assert; import org.testng.annotations.Optional; import org.testng.annotations.Parameters; import org.testng.annotations.Test; -import com.orientechnologies.orient.core.command.OCommandOutputListener; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; +import java.io.IOException; @Test(groups = "db") public class DbCheckTest extends DocumentDBBaseTest implements OCommandOutputListener { @@ -43,7 +41,7 @@ public void checkDatabaseIntegrity() throws IOException { @Override @Test(enabled = false) public void onMessage(final String iText) { - System.out.print(iText); - System.out.flush(); +// System.out.print(iText); +// System.out.flush(); } } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DbListenerTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DbListenerTest.java index b3f4cbceef3..cc8ef8f9838 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DbListenerTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/DbListenerTest.java @@ -83,7 +83,7 @@ public void onRecordAfterUpdate(ODocument iDocument) { final Object oldValue = iDocument.getOriginalValue(f); final Object newValue = iDocument.field(f); - System.out.println("Field " + f + " Old: " + oldValue + " -> " + newValue); +// System.out.println("Field " + f + " Old: " + oldValue + " -> " + newValue); } changes.put(iDocument, changedFields); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/FullTextIndexTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/FullTextIndexTest.java index 9e363b221d7..58c937b468b 100644 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/FullTextIndexTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/FullTextIndexTest.java @@ -15,20 +15,18 @@ */ package com.orientechnologies.orient.test.database.auto; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Random; -import java.util.Set; - +import com.orientechnologies.orient.core.record.impl.ODocument; +import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; import org.testng.Assert; import org.testng.annotations.Optional; import org.testng.annotations.Parameters; import org.testng.annotations.Test; -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import com.orientechnologies.orient.core.record.impl.ODocument; -import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.Set; @Test(groups = { "index" }) public class FullTextIndexTest extends DocumentDBBaseTest { @@ -104,8 +102,8 @@ public void testFullTextInsertion() { doc.save(); } - System.out.println("Indexed words: " - + database.getMetadata().getSchema().getClass("Whiz").getProperty("text").getIndex().getSize()); +// System.out.println("Indexed words: " +// + database.getMetadata().getSchema().getClass("Whiz").getProperty("text").getIndex().getSize()); } @Test(dependsOnMethods = "testFullTextInsertion") diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/FunctionsTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/FunctionsTest.java index fd1b7fbc5f6..37d8432d6ae 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/FunctionsTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/FunctionsTest.java @@ -89,8 +89,8 @@ public void testMultiThreadsFunctionCallMoreThanPool() { final int TOT = 1000; final int threadNum = OGlobalConfiguration.SCRIPT_POOL.getValueAsInteger() * 3; - System.out.println("Starting " + threadNum + " concurrent threads with scriptPool=" - + OGlobalConfiguration.SCRIPT_POOL.getValueAsInteger() + " executing function for " + TOT + " times"); +// System.out.println("Starting " + threadNum + " concurrent threads with scriptPool=" +// + OGlobalConfiguration.SCRIPT_POOL.getValueAsInteger() + " executing function for " + TOT + " times"); final long startTime = System.currentTimeMillis(); @@ -123,8 +123,8 @@ public void run() { Assert.assertEquals(counter.get(), (long) threadNum * TOT); final long totalTime = System.currentTimeMillis() - startTime; - System.out.println("Executed in " + totalTime + "ms: select+fun()=" + (totalTime / ((float) threadNum * TOT)) - + " select+fun()/sec=" + (1000 / (totalTime / ((float) threadNum * TOT)))); +// System.out.println("Executed in " + totalTime + "ms: select+fun()=" + (totalTime / ((float) threadNum * TOT)) +// + " select+fun()/sec=" + (1000 / (totalTime / ((float) threadNum * TOT)))); } } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/GraphDatabaseTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/GraphDatabaseTest.java index 25c58978f81..35d86b089ef 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/GraphDatabaseTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/GraphDatabaseTest.java @@ -236,7 +236,7 @@ public void nestedQuery() { Assert.assertEquals(result.size(), 2); for (int i = 0; i < result.size(); i++) { - System.out.println("uno: " + result.get(i)); +// System.out.println("uno: " + result.get(i)); Assert.assertTrue(((ODocument) result.get(i).getRecord()).containsField("lat")); } @@ -245,7 +245,7 @@ public void nestedQuery() { Assert.assertEquals(result.size(), 2); for (int i = 0; i < result.size(); i++) { - System.out.println("dos: " + result.get(i)); +// System.out.println("dos: " + result.get(i)); Assert.assertTrue(((ODocument) result.get(i).getRecord()).containsField("lat")); Assert.assertTrue(((ODocument) result.get(i).getRecord()).containsField("distance")); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ORidBagTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ORidBagTest.java index 71f1bee545f..62ec3d651b5 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ORidBagTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ORidBagTest.java @@ -1,19 +1,9 @@ package com.orientechnologies.orient.test.database.auto; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; -import java.util.*; - -import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; -import org.testng.Assert; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - import com.orientechnologies.orient.client.db.ODatabaseHelper; import com.orientechnologies.orient.client.remote.OServerAdmin; import com.orientechnologies.orient.core.config.OGlobalConfiguration; +import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import com.orientechnologies.orient.core.db.record.OIdentifiable; import com.orientechnologies.orient.core.db.record.ridbag.ORidBag; import com.orientechnologies.orient.core.id.ORID; @@ -25,6 +15,15 @@ import com.orientechnologies.orient.core.storage.OStorageProxy; import com.tinkerpop.blueprints.impls.orient.OrientGraph; import com.tinkerpop.blueprints.impls.orient.OrientVertex; +import org.testng.Assert; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.util.*; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; @Test public abstract class ORidBagTest extends DocumentDBBaseTest { @@ -1401,9 +1400,9 @@ public void stackOverflowDuringToString() { c.addEdge("link", a); c.addEdge("link", b); - System.out.println("A: " + a.getRecord()); - System.out.println("B: " + b.getRecord()); - System.out.println("C: " + c.getRecord()); +// System.out.println("A: " + a.getRecord()); +// System.out.println("B: " + b.getRecord()); +// System.out.println("C: " + c.getRecord()); database.commit(); } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ObjectTreeTestSchemaFull.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ObjectTreeTestSchemaFull.java index c2b7821c349..d2e34014c70 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ObjectTreeTestSchemaFull.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/ObjectTreeTestSchemaFull.java @@ -15,21 +15,6 @@ */ package com.orientechnologies.orient.test.database.auto; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javassist.util.proxy.Proxy; - -import org.testng.Assert; -import org.testng.annotations.*; - import com.orientechnologies.orient.core.id.ORID; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.serialization.serializer.object.OObjectSerializer; @@ -56,6 +41,24 @@ import com.orientechnologies.orient.test.domain.customserialization.Sec; import com.orientechnologies.orient.test.domain.customserialization.SecurityRole; import com.orientechnologies.orient.test.domain.whiz.Profile; +import javassist.util.proxy.Proxy; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; @Test(groups = { "record-object", "treeSchemaFull" }, dependsOnGroups = "physicalSchemaFull") public class ObjectTreeTestSchemaFull extends ObjectDBBaseTest { @@ -255,7 +258,7 @@ public void testQueryCircular() { Profile parent; for (Profile r : result) { - System.out.println(r.getNick()); +// System.out.println(r.getNick()); parent = r.getInvitedBy(); @@ -274,7 +277,7 @@ public void testQueryMultiCircular() { for (ODocument profile : result) { - System.out.println(profile.field("name") + " " + profile.field("surname")); +// System.out.println(profile.field("name") + " " + profile.field("surname")); final Collection followers = profile.field("followers"); @@ -282,8 +285,8 @@ public void testQueryMultiCircular() { for (ODocument follower : followers) { Assert.assertTrue(((Collection) follower.field("followings")).contains(profile)); - System.out.println("- follower: " + follower.field("name") + " " + follower.field("surname") + " (parent: " - + follower.field("name") + " " + follower.field("surname") + ")"); +// System.out.println("- follower: " + follower.field("name") + " " + follower.field("surname") + " (parent: " +// + follower.field("name") + " " + follower.field("surname") + ")"); } } } diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/SQLSelectTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/SQLSelectTest.java index 113598c86c1..ffcc643618c 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/SQLSelectTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/SQLSelectTest.java @@ -965,7 +965,7 @@ public void queryWithAutomaticPaginationWithWhere() { last = resultset.get(resultset.size() - 1).getIdentity(); - System.out.printf("\nIterating page %d, last record is %s", iterationCount, last); +// System.out.printf("\nIterating page %d, last record is %s", iterationCount, last); iterationCount++; resultset = database.query(query); @@ -1225,7 +1225,7 @@ public void testTraverse() { List recordDocs = executeQuery(sb.toString(), graph.getRawGraph()); for (ODocument doc : recordDocs) { - System.out.println(doc); +// System.out.println(doc); } graph.shutdown(); @@ -1281,8 +1281,8 @@ public void testParams() { Map parameters = new HashMap(); parameters.put("p1", "a"); - System.out.println(database.query(new OSQLSynchQuery("select from test where (f1 = :p1)"), parameters)); - System.out.println(database.query(new OSQLSynchQuery("select from test where f1 = :p1 and f2 = :p1"), parameters)); + database.query(new OSQLSynchQuery("select from test where (f1 = :p1)"), parameters); + database.query(new OSQLSynchQuery("select from test where f1 = :p1 and f2 = :p1"), parameters); } @Test diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/TransactionConsistencyTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/TransactionConsistencyTest.java index 13a7bd6656b..6b3718f2702 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/TransactionConsistencyTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/TransactionConsistencyTest.java @@ -527,7 +527,7 @@ public void deletesWithinTransactionArentWorking() throws IOException { } public void TransactionRollbackConstistencyTest() { - System.out.println("**************************TransactionRollbackConsistencyTest***************************************"); +// System.out.println("**************************TransactionRollbackConsistencyTest***************************************"); OClass vertexClass = database.getMetadata().getSchema().createClass("TRVertex"); OClass edgeClass = database.getMetadata().getSchema().createClass("TREdge"); @@ -574,7 +574,7 @@ public void TransactionRollbackConstistencyTest() { final List result1 = database.command(new OCommandSQL("select from TRPerson")).execute(); Assert.assertNotNull(result1); Assert.assertEquals(result1.size(), cnt); - System.out.println("Before transaction commit"); +// System.out.println("Before transaction commit"); for (ODocument d : result1) System.out.println(d); @@ -624,12 +624,12 @@ public void TransactionRollbackConstistencyTest() { final List result2 = database.command(new OCommandSQL("select from TRPerson")).execute(); Assert.assertNotNull(result2); - System.out.println("After transaction commit failure/rollback"); +// System.out.println("After transaction commit failure/rollback"); for (ODocument d : result2) System.out.println(d); Assert.assertEquals(result2.size(), cnt); - System.out.println("**************************TransactionRollbackConstistencyTest***************************************"); +// System.out.println("**************************TransactionRollbackConstistencyTest***************************************"); } @Test