Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2011-05-13 19:20:42 -0400
committerRyan D. Brooks2011-05-13 19:20:42 -0400
commita128581bcf59c07e65fe13d37d26e1d9da4bcbb6 (patch)
treef23ded5264f686bce62bb505352ea734b473a251 /plugins/org.eclipse.osee.framework.skynet.core.test
parent79c6eb098448608c1cb77132ebf906b3544680b1 (diff)
downloadorg.eclipse.osee-a128581bcf59c07e65fe13d37d26e1d9da4bcbb6.tar.gz
org.eclipse.osee-a128581bcf59c07e65fe13d37d26e1d9da4bcbb6.tar.xz
org.eclipse.osee-a128581bcf59c07e65fe13d37d26e1d9da4bcbb6.zip
refactor: Cleanup logging
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Production_Suite.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java62
3 files changed, 34 insertions, 32 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java
index dccbf50a65..3d74297393 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.skynet.core;
import static org.junit.Assert.assertTrue;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPurgeTest;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTestSuite;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeInheritanceTest;
@@ -99,6 +100,7 @@ import org.junit.runners.Suite;
public class FrameworkCore_Demo_Suite {
@BeforeClass
public static void setUp() throws Exception {
+ OseeProperties.setIsInTest(true);
assertTrue("Demo Application Server must be running.",
ClientSessionManager.getAuthenticationProtocols().contains("demo"));
assertTrue("Client must authenticate using demo protocol",
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Production_Suite.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Production_Suite.java
index eb6771b7f6..aa306542a9 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Production_Suite.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Production_Suite.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.skynet.core;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQueryPerformanceTests;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQueryTestProduction;
import org.junit.Assert;
@@ -27,6 +28,7 @@ public class FrameworkCore_Production_Suite {
@BeforeClass
public static void setUp() throws Exception {
+ OseeProperties.setIsInTest(true);
Assert.assertTrue("Application Server must be running.",
ClientSessionManager.getAuthenticationProtocols().contains("lba"));
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java
index 78112e690e..54d147c602 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/revision/DeletionTest.java
@@ -13,12 +13,9 @@ package org.eclipse.osee.framework.skynet.core.revision;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-
import java.util.Collection;
import java.util.LinkedList;
-
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -71,9 +68,7 @@ public class DeletionTest {
private static final String GET_RELATION_DEBUG =
"select txs.branch_id, txs.transaction_id, txs.tx_current, txs.mod_type, txs.gamma_id, rel.rel_link_id, rel.a_art_id, rel.b_art_id FROM osee_txs txs, osee_relation_link rel WHERE txs.branch_id = ? AND txs.gamma_id = rel.gamma_id AND rel.rel_link_id = ?";
- private static final boolean DEBUG =
- "TRUE".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.osee.framework.skynet.core.test/debug/Junit"));
-
+ private static final boolean DEBUG = false;
private static final boolean DELETE_TRANSACTION_TEST = true;
private static final boolean INDIVIDUAL_DELETE_TEST = true;
@@ -362,15 +357,16 @@ public class DeletionTest {
public static void dumpArtifact(Artifact artifact) throws OseeCoreException {
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
- System.out.println(" Artifact Dump : " + artifact.getName());
- chStmt.runPreparedQuery(GET_ARTIFACT_DEBUG, artifact.getBranch().getId(), artifact.getArtId());
- while (chStmt.next()) {
- System.out.println(String.format(
- " Art Id = %d Branch Id = %d TX_Current = %d mod_type = %d Transaction_id = %d Gamma_id = %d",
- chStmt.getInt("art_id"), chStmt.getInt("branch_id"), chStmt.getInt("tx_current"),
- chStmt.getInt("mod_type"), chStmt.getInt("transaction_id"), chStmt.getInt("gamma_id")));
+ if (DEBUG) {
+ System.out.println(" Artifact Dump : " + artifact.getName());
+ chStmt.runPreparedQuery(GET_ARTIFACT_DEBUG, artifact.getBranch().getId(), artifact.getArtId());
+ while (chStmt.next()) {
+ System.out.println(String.format(
+ " Art Id = %d Branch Id = %d TX_Current = %d mod_type = %d Transaction_id = %d Gamma_id = %d",
+ chStmt.getInt("art_id"), chStmt.getInt("branch_id"), chStmt.getInt("tx_current"),
+ chStmt.getInt("mod_type"), chStmt.getInt("transaction_id"), chStmt.getInt("gamma_id")));
+ }
}
-
} finally {
chStmt.close();
}
@@ -379,16 +375,17 @@ public class DeletionTest {
public static void dumpAttribute(Attribute<?> attribute) throws OseeDataStoreException, OseeCoreException {
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
- System.out.println(" Attribute Dump");
- chStmt.runPreparedQuery(GET_ATTRIBUTE_DEBUG, attribute.getArtifact().getBranch().getId(), attribute.getId());
- while (chStmt.next()) {
- System.out.println(String.format(
- " Attribute Id = %d Art_id = %d Branch Id = %d TX_Current = %d mod_type = %d Transaction_id = %d Gamma_id = %d",
- chStmt.getInt("attr_id"), chStmt.getInt("art_id"), chStmt.getInt("branch_id"),
- chStmt.getInt("tx_current"), chStmt.getInt("mod_type"), chStmt.getInt("transaction_id"),
- chStmt.getInt("gamma_id")));
+ if (DEBUG) {
+ System.out.println(" Attribute Dump");
+ chStmt.runPreparedQuery(GET_ATTRIBUTE_DEBUG, attribute.getArtifact().getBranch().getId(), attribute.getId());
+ while (chStmt.next()) {
+ System.out.println(String.format(
+ " Attribute Id = %d Art_id = %d Branch Id = %d TX_Current = %d mod_type = %d Transaction_id = %d Gamma_id = %d",
+ chStmt.getInt("attr_id"), chStmt.getInt("art_id"), chStmt.getInt("branch_id"),
+ chStmt.getInt("tx_current"), chStmt.getInt("mod_type"), chStmt.getInt("transaction_id"),
+ chStmt.getInt("gamma_id")));
+ }
}
-
} finally {
chStmt.close();
}
@@ -397,16 +394,17 @@ public class DeletionTest {
public static void dumpRelation(RelationLink relation, Artifact artifact) throws OseeCoreException {
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
- System.out.println(" Relation Dump");
- chStmt.runPreparedQuery(GET_RELATION_DEBUG, artifact.getBranch().getId(), relation.getId());
- while (chStmt.next()) {
- System.out.println(String.format(
- " Relation Id = %d a_art_id = %d b_art_id = %d Branch Id = %d TX_Current = %d mod_type = %d Transaction_id = %d Gamma_id = %d",
- chStmt.getInt("rel_link_id"), chStmt.getInt("a_art_id"), chStmt.getInt("b_art_id"),
- chStmt.getInt("branch_id"), chStmt.getInt("tx_current"), chStmt.getInt("mod_type"),
- chStmt.getInt("transaction_id"), chStmt.getInt("gamma_id")));
+ if (DEBUG) {
+ System.out.println(" Relation Dump");
+ chStmt.runPreparedQuery(GET_RELATION_DEBUG, artifact.getBranch().getId(), relation.getId());
+ while (chStmt.next()) {
+ System.out.println(String.format(
+ " Relation Id = %d a_art_id = %d b_art_id = %d Branch Id = %d TX_Current = %d mod_type = %d Transaction_id = %d Gamma_id = %d",
+ chStmt.getInt("rel_link_id"), chStmt.getInt("a_art_id"), chStmt.getInt("b_art_id"),
+ chStmt.getInt("branch_id"), chStmt.getInt("tx_current"), chStmt.getInt("mod_type"),
+ chStmt.getInt("transaction_id"), chStmt.getInt("gamma_id")));
+ }
}
-
} finally {
chStmt.close();
}

Back to the top