Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-11-20 19:18:39 -0500
committerAngel Avila2014-11-20 19:18:39 -0500
commitfb951a7abaafdd80831632cd2d1e3784a30ef470 (patch)
tree66eb6e40f05ea3b295d1146a18163d36b6ac86b0 /plugins/org.eclipse.osee.orcs.db.test
parent73de4729644cf1d176259476940d4be3abf10e44 (diff)
downloadorg.eclipse.osee-fb951a7abaafdd80831632cd2d1e3784a30ef470.tar.gz
org.eclipse.osee-fb951a7abaafdd80831632cd2d1e3784a30ef470.tar.xz
org.eclipse.osee-fb951a7abaafdd80831632cd2d1e3784a30ef470.zip
refinement[ats_ATS140743]: Improve Join table cleaner
Change join table cleaner to use expiration time instead of sessions. Allow join expiration to vary based on where joins are used. Add default join expiration values to info table. Change-Id: I680a1cc4d2c1654c0ea508e60ef020c96161e4ef
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.db.test')
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQueryTest.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/CharJoinQueryTest.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ExportImportJoinQueryTest.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/IdJoinQueryTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TagQueueJoinQueryTest.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java18
11 files changed, 47 insertions, 67 deletions
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
index 99d454962a..ea16098df7 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
@@ -59,7 +59,6 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Matchers;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -125,16 +124,16 @@ public class DataLoaderFactoryImplTest {
@Override
public ArtifactJoinQuery answer(InvocationOnMock invocation) throws Throwable {
- return new ArtifactJoinQuery(joinAccessor, 23, Integer.MAX_VALUE);
+ return new ArtifactJoinQuery(joinAccessor, -1L, 23, Integer.MAX_VALUE);
}
});
- when(joinFactory.createIdJoinQuery(Mockito.anyString())).thenAnswer(new Answer<IdJoinQuery>() {
+ when(joinFactory.createIdJoinQuery()).thenAnswer(new Answer<IdJoinQuery>() {
@Override
public IdJoinQuery answer(InvocationOnMock invocation) throws Throwable {
- return new IdJoinQuery(joinAccessor, 23);
+ return new IdJoinQuery(joinAccessor, -1L, 23);
}
});
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
index d527dd52d2..181e6d3e62 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/ArtifactQuerySqlContextFactoryImplTest.java
@@ -14,7 +14,6 @@ import static java.util.Arrays.asList;
import static org.eclipse.osee.orcs.db.internal.search.handlers.SqlHandlerFactoryUtil.createArtifactSqlHandlerFactory;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.when;
@@ -162,19 +161,19 @@ public class ArtifactQuerySqlContextFactoryImplTest {
}
}).when(tagProcessor).collectFromString(eq(QUICK_SEARCH_VALUE), any(TagCollector.class));
- when(joinFactory.createIdJoinQuery(anyString())).thenAnswer(new Answer<IdJoinQuery>() {
+ when(joinFactory.createIdJoinQuery()).thenAnswer(new Answer<IdJoinQuery>() {
@Override
public IdJoinQuery answer(InvocationOnMock invocation) throws Throwable {
- return new IdJoinQuery(null, 23);
+ return new IdJoinQuery(null, -1L, 23);
}
});
- when(joinFactory.createCharJoinQuery(anyString())).thenAnswer(new Answer<CharJoinQuery>() {
+ when(joinFactory.createCharJoinQuery()).thenAnswer(new Answer<CharJoinQuery>() {
@Override
public CharJoinQuery answer(InvocationOnMock invocation) throws Throwable {
- return new CharJoinQuery(null, 23);
+ return new CharJoinQuery(null, -1L, 23);
}
});
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
index cf65a371c6..8fe775f682 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/BranchQuerySqlContextFactoryImplTest.java
@@ -18,7 +18,6 @@ import static org.eclipse.osee.framework.core.enums.BranchType.SYSTEM_ROOT;
import static org.eclipse.osee.framework.core.enums.BranchType.WORKING;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.Iterator;
@@ -102,11 +101,11 @@ public class BranchQuerySqlContextFactoryImplTest {
queryData = new QueryData(criteriaSet, options);
when(sqlProvider.getSql(OseeSql.QUERY_BUILDER)).thenReturn("/*+ ordered */");
- when(joinFactory.createIdJoinQuery(anyString())).thenAnswer(new Answer<IdJoinQuery>() {
+ when(joinFactory.createIdJoinQuery()).thenAnswer(new Answer<IdJoinQuery>() {
@Override
public IdJoinQuery answer(InvocationOnMock invocation) throws Throwable {
- return new IdJoinQuery(null, 23);
+ return new IdJoinQuery(null, -1L, 23);
}
});
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
index dd48226dd0..2afacbb048 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/engines/TxQuerySqlContextFactoryImplTest.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.orcs.db.internal.search.engines;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.when;
import java.sql.Timestamp;
import java.util.Arrays;
@@ -99,11 +98,11 @@ public class TxQuerySqlContextFactoryImplTest {
queryData = new QueryData(criteriaSet, options);
when(sqlProvider.getSql(OseeSql.QUERY_BUILDER)).thenReturn("/*+ ordered */");
- when(joinFactory.createIdJoinQuery(anyString())).thenAnswer(new Answer<IdJoinQuery>() {
+ when(joinFactory.createIdJoinQuery()).thenAnswer(new Answer<IdJoinQuery>() {
@Override
public IdJoinQuery answer(InvocationOnMock invocation) throws Throwable {
- return new IdJoinQuery(null, 23);
+ return new IdJoinQuery(null, -1L, 23);
}
});
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQueryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQueryTest.java
index 70063bd5f5..49d27790d2 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQueryTest.java
@@ -10,9 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.sql.join;
-import java.sql.Timestamp;
import java.util.List;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
import org.junit.Test;
@@ -27,7 +25,7 @@ public class ArtifactJoinQueryTest {
@Test
public void testAdd() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- ArtifactJoinQuery join = new ArtifactJoinQuery(joinAccessor, 999, 10);
+ ArtifactJoinQuery join = new ArtifactJoinQuery(joinAccessor, -1L, 999, 10);
Assert.assertEquals(0, join.size());
Assert.assertEquals(true, join.isEmpty());
@@ -49,18 +47,17 @@ public class ArtifactJoinQueryTest {
Assert.assertEquals(1, data.size());
Object[] entry = data.get(0);
- Assert.assertEquals(5, entry.length);
+ Assert.assertEquals(4, entry.length);
Assert.assertEquals(999, entry[0]);
- Assert.assertTrue(entry[1] instanceof Timestamp);
- Assert.assertEquals(1234, entry[2]);
- Assert.assertEquals(5678L, entry[3]);
+ Assert.assertEquals(1234, entry[1]);
+ Assert.assertEquals(5678L, entry[2]);
}
- @Test(expected = OseeDataStoreException.class)
+ @Test(expected = OseeCoreException.class)
public void testStoreTwice() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- ArtifactJoinQuery join = new ArtifactJoinQuery(joinAccessor, 1000, 10);
+ ArtifactJoinQuery join = new ArtifactJoinQuery(joinAccessor, -1L, 1000, 10);
Assert.assertEquals(false, join.wasStored());
join.store();
@@ -72,11 +69,11 @@ public class ArtifactJoinQueryTest {
join.store();
}
- @Test(expected = OseeDataStoreException.class)
+ @Test(expected = OseeCoreException.class)
public void testMoreThanAllowed() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
int maxSize = 5;
- ArtifactJoinQuery join = new ArtifactJoinQuery(joinAccessor, 1000, maxSize);
+ ArtifactJoinQuery join = new ArtifactJoinQuery(joinAccessor, -1L, 1000, maxSize);
for (int i = 0; i < maxSize + 1; i++) {
join.add(i + 1, 1123L, null);
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/CharJoinQueryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/CharJoinQueryTest.java
index 64677a18e2..2a295d229a 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/CharJoinQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/CharJoinQueryTest.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.orcs.db.internal.sql.join;
import java.util.List;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
import org.junit.Test;
@@ -26,7 +25,7 @@ public class CharJoinQueryTest {
@Test
public void testAdd() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- CharJoinQuery join = new CharJoinQuery(joinAccessor, 999);
+ CharJoinQuery join = new CharJoinQuery(joinAccessor, -1L, 999);
Assert.assertEquals(0, join.size());
Assert.assertEquals(true, join.isEmpty());
@@ -53,10 +52,10 @@ public class CharJoinQueryTest {
Assert.assertEquals("hello", entry[1]);
}
- @Test(expected = OseeDataStoreException.class)
+ @Test(expected = OseeCoreException.class)
public void testStoreTwice() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- CharJoinQuery join = new CharJoinQuery(joinAccessor, 1000);
+ CharJoinQuery join = new CharJoinQuery(joinAccessor, -1L, 1000);
Assert.assertEquals(false, join.wasStored());
join.store();
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ExportImportJoinQueryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ExportImportJoinQueryTest.java
index 540bdec52a..8308b21613 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ExportImportJoinQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/ExportImportJoinQueryTest.java
@@ -10,9 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.sql.join;
-import java.sql.Timestamp;
import java.util.List;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
import org.junit.Test;
@@ -27,7 +25,7 @@ public class ExportImportJoinQueryTest {
@Test
public void testAdd() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- ExportImportJoinQuery join = new ExportImportJoinQuery(joinAccessor, 999);
+ ExportImportJoinQuery join = new ExportImportJoinQuery(joinAccessor, -1L, 999);
Assert.assertEquals(0, join.size());
Assert.assertEquals(true, join.isEmpty());
@@ -49,18 +47,17 @@ public class ExportImportJoinQueryTest {
Assert.assertEquals(1, data.size());
Object[] entry = data.get(0);
- Assert.assertEquals(4, entry.length);
+ Assert.assertEquals(3, entry.length);
Assert.assertEquals(999, entry[0]);
- Assert.assertTrue(entry[1] instanceof Timestamp);
- Assert.assertEquals(1234L, entry[2]);
- Assert.assertEquals(5678L, entry[3]);
+ Assert.assertEquals(1234L, entry[1]);
+ Assert.assertEquals(5678L, entry[2]);
}
- @Test(expected = OseeDataStoreException.class)
+ @Test(expected = OseeCoreException.class)
public void testStoreTwice() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- ExportImportJoinQuery join = new ExportImportJoinQuery(joinAccessor, 1000);
+ ExportImportJoinQuery join = new ExportImportJoinQuery(joinAccessor, -1L, 1000);
Assert.assertEquals(false, join.wasStored());
join.store();
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/IdJoinQueryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/IdJoinQueryTest.java
index 52453c6b7b..3b9ff651f0 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/IdJoinQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/IdJoinQueryTest.java
@@ -10,9 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.sql.join;
-import java.sql.Timestamp;
import java.util.List;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
import org.junit.Test;
@@ -27,7 +25,7 @@ public class IdJoinQueryTest {
@Test
public void testAdd() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- IdJoinQuery join = new IdJoinQuery(joinAccessor, 999);
+ IdJoinQuery join = new IdJoinQuery(joinAccessor, -1L, 999);
Assert.assertEquals(0, join.size());
Assert.assertEquals(true, join.isEmpty());
@@ -49,17 +47,16 @@ public class IdJoinQueryTest {
Assert.assertEquals(1, data.size());
Object[] entry = data.get(0);
- Assert.assertEquals(3, entry.length);
+ Assert.assertEquals(2, entry.length);
Assert.assertEquals(999, entry[0]);
- Assert.assertTrue(entry[1] instanceof Timestamp);
- Assert.assertEquals(1234L, entry[2]);
+ Assert.assertEquals(1234L, entry[1]);
}
- @Test(expected = OseeDataStoreException.class)
+ @Test(expected = OseeCoreException.class)
public void testStoreTwice() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- IdJoinQuery join = new IdJoinQuery(joinAccessor, 1000);
+ IdJoinQuery join = new IdJoinQuery(joinAccessor, -1L, 1000);
Assert.assertEquals(false, join.wasStored());
join.store();
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java
index 94bc6c1f40..597748a98c 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.sql.join;
import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.database.core.OseeConnection;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.db.internal.sql.join.DatabaseJoinAccessor.JoinItem;
/**
@@ -26,7 +27,7 @@ public class MockJoinAccessor implements IJoinAccessor {
private List<Object[]> dataList;
@Override
- public void store(OseeConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList) {
+ public void store(OseeConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList, Long issuedAt, Long expiresIn) throws OseeCoreException {
this.connection = connection;
this.joinItem = joinItem;
this.queryId = queryId;
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TagQueueJoinQueryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TagQueueJoinQueryTest.java
index f0bdb8b636..7fdefd4021 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TagQueueJoinQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TagQueueJoinQueryTest.java
@@ -10,9 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.sql.join;
-import java.sql.Timestamp;
import java.util.List;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
import org.junit.Test;
@@ -27,7 +25,7 @@ public class TagQueueJoinQueryTest {
@Test
public void testAdd() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- TagQueueJoinQuery join = new TagQueueJoinQuery(joinAccessor, 999);
+ TagQueueJoinQuery join = new TagQueueJoinQuery(joinAccessor, -1L, 999);
Assert.assertEquals(0, join.size());
Assert.assertEquals(true, join.isEmpty());
@@ -49,17 +47,16 @@ public class TagQueueJoinQueryTest {
Assert.assertEquals(1, data.size());
Object[] entry = data.get(0);
- Assert.assertEquals(3, entry.length);
+ Assert.assertEquals(2, entry.length);
Assert.assertEquals(999, entry[0]);
- Assert.assertTrue(entry[1] instanceof Timestamp);
- Assert.assertEquals(1234L, entry[2]);
+ Assert.assertEquals(1234L, entry[1]);
}
- @Test(expected = OseeDataStoreException.class)
+ @Test(expected = OseeCoreException.class)
public void testStoreTwice() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- TagQueueJoinQuery join = new TagQueueJoinQuery(joinAccessor, 1000);
+ TagQueueJoinQuery join = new TagQueueJoinQuery(joinAccessor, -1L, 1000);
Assert.assertEquals(false, join.wasStored());
join.store();
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java
index 542e37564c..73fc0c4ccf 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java
@@ -10,9 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.sql.join;
-import java.sql.Timestamp;
import java.util.List;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.database.core.SQL3DataType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
@@ -28,7 +26,7 @@ public class TransactionJoinQueryTest {
@Test
public void testAdd() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- TransactionJoinQuery join = new TransactionJoinQuery(joinAccessor, 999);
+ TransactionJoinQuery join = new TransactionJoinQuery(joinAccessor, -1L, 999);
Assert.assertEquals(0, join.size());
Assert.assertEquals(true, join.isEmpty());
@@ -50,19 +48,17 @@ public class TransactionJoinQueryTest {
Assert.assertEquals(1, data.size());
Object[] entry = data.get(0);
- Assert.assertEquals(5, entry.length);
+ Assert.assertEquals(4, entry.length);
Assert.assertEquals(999, entry[0]);
- Assert.assertTrue(entry[1] instanceof Timestamp);
- Assert.assertEquals(1234L, entry[2]);
- Assert.assertEquals(5678, entry[3]);
- Assert.assertEquals(SQL3DataType.BIGINT, entry[4]);
-
+ Assert.assertEquals(1234L, entry[1]);
+ Assert.assertEquals(5678, entry[2]);
+ Assert.assertEquals(SQL3DataType.BIGINT, entry[3]);
}
- @Test(expected = OseeDataStoreException.class)
+ @Test(expected = OseeCoreException.class)
public void testStoreTwice() throws OseeCoreException {
MockJoinAccessor joinAccessor = new MockJoinAccessor();
- TransactionJoinQuery join = new TransactionJoinQuery(joinAccessor, 1000);
+ TransactionJoinQuery join = new TransactionJoinQuery(joinAccessor, -1L, 1000);
Assert.assertEquals(false, join.wasStored());
join.store();

Back to the top