From 2d5df2f8501de28518fdd09dab9c59300b522519 Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Thu, 3 Nov 2016 16:29:29 -0400 Subject: [PATCH 1/2] remote tests fix and cleanup --- .../common/mithra/test/RemoteTestSuite.java | 6 +-- .../test/TestApplicationNotification.java | 6 +-- .../common/mithra/test/TestClientPortal.java | 42 +------------------ .../test/TestClientPortalUsingDerby.java | 2 + ...MithraReplicationNotificationMessages.java | 2 + .../TestMultiClientNotificationTestCase.java | 1 + .../test/TestTransactionalClientPortal.java | 1 + .../evo/TestEmbeddedValueObjectsRemote.java | 1 + 8 files changed, 15 insertions(+), 46 deletions(-) diff --git a/reladomo/src/test/java/com/gs/fw/common/mithra/test/RemoteTestSuite.java b/reladomo/src/test/java/com/gs/fw/common/mithra/test/RemoteTestSuite.java index 9db91f51..26bda0a4 100644 --- a/reladomo/src/test/java/com/gs/fw/common/mithra/test/RemoteTestSuite.java +++ b/reladomo/src/test/java/com/gs/fw/common/mithra/test/RemoteTestSuite.java @@ -36,11 +36,11 @@ public static Test suite() // suite.addTest(new MultiVmNotificationsTestSuite(TestNotificationMessages.class)); // suite.addTest(new MultiClientVmTestSuite(TestMultiClientNotificationTestCase.class)); // suite.addTest(new MultiVmNotificationsTestSuite(TestPeerToPeerMithraTestCase.class)); -// suite.addTest(new MultiVmNotificationsTestSuite(TestApplicationNotification.class)); + suite.addTest(new MultiVmNotificationsTestSuite(TestApplicationNotification.class)); // suite.addTest(new MultiVmNotificationsTestSuite(TestMithraReplicationNotificationMessages.class)); - suite.addTest(new MultiVmTestSuite(TestClientPortal.class)); +// suite.addTest(new MultiVmTestSuite(TestClientPortal.class)); // suite.addTest(new MultiVmTestSuite(TestClientPortalUsingDerby.class)); - suite.addTest(new MultiVmTestSuite(TestTransactionalClientPortal.class)); +// suite.addTest(new MultiVmTestSuite(TestTransactionalClientPortal.class)); // suite.addTest(new MultiVmTestSuite(TestEmbeddedValueObjectsRemote.class)); //suite.addTest(new MultiVmTestSuite(TestPureObjectsRemote.class)); diff --git a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestApplicationNotification.java b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestApplicationNotification.java index 380ec9a2..2a8fbd32 100644 --- a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestApplicationNotification.java +++ b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestApplicationNotification.java @@ -1083,17 +1083,17 @@ public void testSimpleListNotificationWithMultipleSourceAttributesAddingObjectAf //add a new team to the registered list Team team = new Team(); - team.setTeamId(999); + team.setTeamId(10999); team.setSourceId("B"); team.setDivisionId(1); - team.setName("Team 999"); + team.setName("Team 10999"); team.insert(); teamList.add(team); updateClassCount = TeamFinder.getMithraObjectPortal().getPerClassUpdateCountHolder().getUpdateCount(); //server-side update the newly added team this.getRemoteSlaveVm().executeMethod("serverUpdateTeamName", new Class[]{String.class, int.class,String.class}, - new Object[]{"B", new Integer(999), "New Team 999"}); + new Object[]{"B", new Integer(10999), "New Team 999"}); waitForMessages(updateClassCount, TeamFinder.getMithraObjectPortal()); waitForNotification(listener); diff --git a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestClientPortal.java b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestClientPortal.java index c2ba663c..8b30c9ed 100644 --- a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestClientPortal.java +++ b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestClientPortal.java @@ -36,46 +36,7 @@ import com.gs.fw.common.mithra.test.aggregate.TestMin; import com.gs.fw.common.mithra.test.aggregate.TestNumericAttribute; import com.gs.fw.common.mithra.test.aggregate.TestSum; -import com.gs.fw.common.mithra.test.domain.Account; -import com.gs.fw.common.mithra.test.domain.AccountTransactionException; -import com.gs.fw.common.mithra.test.domain.AccountTransactionExceptionFinder; -import com.gs.fw.common.mithra.test.domain.AuditedOrder; -import com.gs.fw.common.mithra.test.domain.AuditedOrderItem; -import com.gs.fw.common.mithra.test.domain.AuditedOrderStatus; -import com.gs.fw.common.mithra.test.domain.Book; -import com.gs.fw.common.mithra.test.domain.BookFinder; -import com.gs.fw.common.mithra.test.domain.BookList; -import com.gs.fw.common.mithra.test.domain.DatedEntity; -import com.gs.fw.common.mithra.test.domain.Group; -import com.gs.fw.common.mithra.test.domain.GroupFinder; -import com.gs.fw.common.mithra.test.domain.GroupList; -import com.gs.fw.common.mithra.test.domain.InfinityTimestamp; -import com.gs.fw.common.mithra.test.domain.Manufacturer; -import com.gs.fw.common.mithra.test.domain.NoExportTestObject; -import com.gs.fw.common.mithra.test.domain.NoExportTestObjectFinder; -import com.gs.fw.common.mithra.test.domain.Order; -import com.gs.fw.common.mithra.test.domain.OrderFinder; -import com.gs.fw.common.mithra.test.domain.OrderItem; -import com.gs.fw.common.mithra.test.domain.OrderItemList; -import com.gs.fw.common.mithra.test.domain.OrderList; -import com.gs.fw.common.mithra.test.domain.ParaBalance; -import com.gs.fw.common.mithra.test.domain.ParaDesk; -import com.gs.fw.common.mithra.test.domain.ParaDeskFinder; -import com.gs.fw.common.mithra.test.domain.ParaDeskList; -import com.gs.fw.common.mithra.test.domain.Profile; -import com.gs.fw.common.mithra.test.domain.ProfileFinder; -import com.gs.fw.common.mithra.test.domain.ProfileList; -import com.gs.fw.common.mithra.test.domain.SpecialAccount; -import com.gs.fw.common.mithra.test.domain.SpecialAccountFinder; -import com.gs.fw.common.mithra.test.domain.TamsAccount; -import com.gs.fw.common.mithra.test.domain.TamsAccountFinder; -import com.gs.fw.common.mithra.test.domain.TamsAccountList; -import com.gs.fw.common.mithra.test.domain.Trial; -import com.gs.fw.common.mithra.test.domain.TrialFinder; -import com.gs.fw.common.mithra.test.domain.User; -import com.gs.fw.common.mithra.test.domain.UserFinder; -import com.gs.fw.common.mithra.test.domain.UserGroup; -import com.gs.fw.common.mithra.test.domain.UserList; +import com.gs.fw.common.mithra.test.domain.*; import com.gs.fw.common.mithra.test.domain.dated.AuditedOrderStatusTwo; import com.gs.fw.common.mithra.test.inherited.TestReadOnlyInherited; import java.sql.Connection; @@ -146,6 +107,7 @@ protected Class[] getRestrictedClassList() result.add(NoExportTestObject.class); result.add(AccountTransactionException.class); result.add(SpecialAccount.class); + result.add(FullyCachedTinyBalance.class); Class[] array = new Class[result.size()]; result.toArray(array); return array; diff --git a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestClientPortalUsingDerby.java b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestClientPortalUsingDerby.java index 33adc0c4..c3166b26 100644 --- a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestClientPortalUsingDerby.java +++ b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestClientPortalUsingDerby.java @@ -17,6 +17,7 @@ package com.gs.fw.common.mithra.test; import com.gs.fw.common.mithra.databasetype.DerbyDatabaseType; +import com.gs.fw.common.mithra.test.domain.FullyCachedTinyBalance; import com.gs.fw.common.mithra.test.domain.SpecialAccount; import java.sql.SQLException; @@ -35,6 +36,7 @@ protected Class[] getRestrictedClassList() Set result = new HashSet(); addTestClassesFromOther(new TestOrderby(), result); result.add(SpecialAccount.class); + result.add(FullyCachedTinyBalance.class); Class[] array = new Class[result.size()]; result.toArray(array); return array; diff --git a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestMithraReplicationNotificationMessages.java b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestMithraReplicationNotificationMessages.java index 86fc802b..779ca8c9 100644 --- a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestMithraReplicationNotificationMessages.java +++ b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestMithraReplicationNotificationMessages.java @@ -18,6 +18,7 @@ import com.gs.fw.common.mithra.MithraManagerProvider; import com.gs.fw.common.mithra.finder.Operation; +import com.gs.fw.common.mithra.test.domain.FullyCachedTinyBalance; import com.gs.fw.common.mithra.test.domain.SpecialAccount; import com.gs.fw.common.mithra.test.domain.TestReplicatedObject; import com.gs.fw.common.mithra.test.domain.dated.TestTamsAccountIncomeFunction; @@ -49,6 +50,7 @@ protected Class[] getRestrictedClassList() TestTamsMithraTrial.class, TestTamsAccountIncomeFunction.class, TestReplicatedObject.class, + FullyCachedTinyBalance.class, SpecialAccount.class }; } diff --git a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestMultiClientNotificationTestCase.java b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestMultiClientNotificationTestCase.java index 5633cba6..d6e8574f 100644 --- a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestMultiClientNotificationTestCase.java +++ b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestMultiClientNotificationTestCase.java @@ -40,6 +40,7 @@ protected Class[] getRestrictedClassList() Employee.class, Product.class, TinyBalance.class, + FullyCachedTinyBalance.class, Contract.class, SpecialAccount.class }; diff --git a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestTransactionalClientPortal.java b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestTransactionalClientPortal.java index 22210d64..c071cfe3 100644 --- a/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestTransactionalClientPortal.java +++ b/reladomo/src/test/java/com/gs/fw/common/mithra/test/TestTransactionalClientPortal.java @@ -111,6 +111,7 @@ protected Class[] getRestrictedClassList() result.add(ProductSpecification.class); result.add(SalesLineItem.class); result.add(SpecialAccount.class); + result.add(FullyCachedTinyBalance.class); result.add(WallCrossImpl.class); result.add(PureOrder.class); result.add(PureOrderItem.class); diff --git a/reladomo/src/test/java/com/gs/fw/common/mithra/test/evo/TestEmbeddedValueObjectsRemote.java b/reladomo/src/test/java/com/gs/fw/common/mithra/test/evo/TestEmbeddedValueObjectsRemote.java index 8c5c1feb..7c388333 100644 --- a/reladomo/src/test/java/com/gs/fw/common/mithra/test/evo/TestEmbeddedValueObjectsRemote.java +++ b/reladomo/src/test/java/com/gs/fw/common/mithra/test/evo/TestEmbeddedValueObjectsRemote.java @@ -68,6 +68,7 @@ private void addTestClassesToBeDecoupled(Set result) result.add(ProductSpecification.class); result.add(SalesLineItem.class); result.add(SpecialAccount.class); + result.add(FullyCachedTinyBalance.class); result.add(WallCrossImpl.class); } From fcdb2270e7fc4d9fee77e6d6a67291020df0c866 Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Thu, 3 Nov 2016 16:43:02 -0400 Subject: [PATCH 2/2] implement equalitySubstituteWithMultiEquality in ChainedMapper --- build/reladomo-config.xml | 2 +- .../common/mithra/finder/ChainedMapper.java | 25 +++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/build/reladomo-config.xml b/build/reladomo-config.xml index 477a71e1..ed20f569 100644 --- a/build/reladomo-config.xml +++ b/build/reladomo-config.xml @@ -14,6 +14,6 @@ under the License. --> - + \ No newline at end of file diff --git a/reladomo/src/main/java/com/gs/fw/common/mithra/finder/ChainedMapper.java b/reladomo/src/main/java/com/gs/fw/common/mithra/finder/ChainedMapper.java index 2ce7172f..24c5d3e8 100644 --- a/reladomo/src/main/java/com/gs/fw/common/mithra/finder/ChainedMapper.java +++ b/reladomo/src/main/java/com/gs/fw/common/mithra/finder/ChainedMapper.java @@ -21,6 +21,7 @@ import com.gs.fw.common.mithra.extractor.Extractor; import com.gs.fw.common.mithra.util.InternalList; import com.gs.fw.common.mithra.util.MithraFastList; +import com.gs.fw.common.mithra.util.SmallSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.gs.fw.common.mithra.MithraObjectPortal; @@ -380,17 +381,27 @@ public boolean isJoinedWith(MithraObjectPortal portal) public MappedOperation equalitySubstituteWithMultiEquality(MappedOperation mappedOperation, MultiEqualityOperation op) { - HashSet set = new HashSet(); - this.addDepenedentAttributesToSet(set); - for(Iterator it = set.iterator();it.hasNext();) + SmallSet set = new SmallSet(4); + op.zAddAllLeftAttributes(set); + Operation possibleSub = NoOperation.instance(); + for(int i=0;i