Skip to content

Commit

Permalink
#1151 resolved bug with viewport keys registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjstevo committed Jan 23, 2024
1 parent c192e20 commit c23e721
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ class VirtualizedViewPortTest extends VuuServerTestCase {
assertVpEq(combineQsForVp(viewport)) {
Table(
("orderId" ,"quantity","price" ,"side" ,"trader" ),
(null ,null ,null ,null ,null )
("10" ,-1157793070,8220501950349663546L,"Sell" ,"trader1" ),
("11" ,-1158177819,-5263473657679273937L,"Sell" ,"trader1" ),
("12" ,-1160101563,1103624592719277817L,"Sell" ,"trader1" ),
("13" ,-1160486312,6066393058399891950L,"Sell" ,"trader1" ),
("14" ,-1159332065,-8821912338641950449L,"Buy" ,"trader1" )
)
}

Expand All @@ -66,11 +70,11 @@ class VirtualizedViewPortTest extends VuuServerTestCase {
assertVpEq(combineQsForVp(viewport)) {
Table(
("orderId" ,"quantity","price" ,"side" ,"trader" ),
("14" ,-1159332065,-8821912338641950449L,"Buy" ,"trader1" ),
("10" ,-1157793070,8220501950349663546L,"Sell" ,"trader1" ),
("11" ,-1158177819,-5263473657679273937L,"Sell" ,"trader1" ),
("12" ,-1160101563,1103624592719277817L,"Sell" ,"trader1" ),
("13" ,-1160486312,6066393058399891950L,"Sell" ,"trader1" ),
("14" ,-1159332065,-8821912338641950449L,"Buy" ,"trader1" ),
("5" ,-1157408321,3257733484669049412L,"Buy" ,"trader1" ),
("6" ,-1156254074,6816172161336758629L,"Sell" ,"trader1" ),
("7" ,-1156638823,-6667803446692178854L,"Sell" ,"trader1" ),
Expand Down
89 changes: 89 additions & 0 deletions vuu/src/main/resources/runconfigurations/Run All Tests.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,100 @@
<configuration default="false" name="Run All Tests" type="ScalaTestRunConfiguration" factoryName="ScalaTest" show_console_on_std_err="false" show_console_on_std_out="false">
<module name="vuu" />
<option name="allowRunningInParallel" value="false" />
<option name="projectPathOnTarget" />
<option name="selectedOptions">
<list />
</option>
<option name="testKind" value="All in package" />
<option name="classBuf">
<list>
<option value="org.finos.vuu.data.order.ignite.IgniteOrderStoreTest" />
<option value="org.finos.vuu.order.oms.OmsApiTest" />
<option value="org.finos.vuu.json.ObjectMappingTest" />
<option value="org.finos.vuu.json.JsonVsSerializerTest" />
<option value="org.finos.vuu.json.ViewPortMenuTest" />
<option value="org.finos.vuu.plugin.PluginFeatureTest" />
<option value="org.finos.vuu.plugin.virtualized.table.VirtualizedDataTableTest" />
<option value="org.finos.vuu.plugin.virtualized.table.VirtualizedTableKeysTest" />
<option value="org.finos.vuu.csv.BasketLoaderTests" />
<option value="org.finos.vuu.example.virtualized.table.VirtualizedViewPortTest" />
<option value="org.finos.vuu.core.module.ModuleSyntaxTest" />
<option value="org.finos.vuu.core.module.editable.EditableTest" />
<option value="org.finos.vuu.core.module.modulefrommodule.ModuleConstructorTest" />
<option value="org.finos.vuu.core.module.authn.AuthNServerTest" />
<option value="org.finos.vuu.core.module.typeahead.TypeAheadModuleTest" />
<option value="org.finos.vuu.core.module.basket.BasketSendToMarketTest" />
<option value="org.finos.vuu.core.module.basket.BasketMutateOffMarketTest" />
<option value="org.finos.vuu.core.module.basket.BasketConstituentMutateTest" />
<option value="org.finos.vuu.core.module.basket.BasketCreateTest" />
<option value="org.finos.vuu.core.module.auths.PermissionsTest" />
<option value="org.finos.vuu.core.index.IndexedFieldTest" />
<option value="org.finos.vuu.core.table.RpcTableTest" />
<option value="org.finos.vuu.core.table.DataTableTest" />
<option value="org.finos.vuu.core.table.DataTypesTest" />
<option value="org.finos.vuu.core.table.RowDeleteTest" />
<option value="org.finos.vuu.core.table.JavaToScalaRowUpdates" />
<option value="org.finos.vuu.core.table.AutoSubscribeTableTest" />
<option value="org.finos.vuu.core.table.join.JoinTableTest" />
<option value="org.finos.vuu.core.table.join.JoinManagerTest" />
<option value="org.finos.vuu.core.table.join.MultiJoinTableTest" />
<option value="org.finos.vuu.core.table.join.JoinsOfJoinsTableTest" />
<option value="org.finos.vuu.core.table.column.CalculatedColumnMathTest" />
<option value="org.finos.vuu.core.table.column.CalculatedColumnLogicTest" />
<option value="org.finos.vuu.core.table.column.CalculatedColumnParseTest" />
<option value="org.finos.vuu.core.table.column.CalculatedColumnStringTest" />
<option value="org.finos.vuu.core.filter.FilterGrammarTest" />
<option value="org.finos.vuu.core.groupBy.BuildBigGroupByTest" />
<option value="org.finos.vuu.core.groupBy.TreeNodeHashingTest" />
<option value="org.finos.vuu.core.sort.GenericSortTest" />
<option value="org.finos.vuu.feature.ignite.filter.IgniteSqlFilteringTest" />
<option value="org.finos.vuu.feature.ignite.filter.IgniteFilterGrammarTest" />
<option value="org.finos.vuu.feature.ignite.filter.IgniteIndexFilteringTest" />
<option value="org.finos.vuu.net.WebSocketApiTest" />
<option value="org.finos.vuu.net.http.HttpServerTest" />
<option value="org.finos.vuu.net.flowcontrol.FlowControllerTest" />
<option value="org.finos.vuu.net.ws.WebSocketServerClientTest" />
<option value="org.finos.vuu.net.rest.RestServiceTest" />
<option value="org.finos.vuu.net.rpc.RpcTest" />
<option value="org.finos.vuu.net.rpc.RpcModuleTest" />
<option value="org.finos.vuu.state.VuiStateStoreTest" />
<option value="org.finos.vuu.viewport.TreeSortTest" />
<option value="org.finos.vuu.viewport.TreeOnOffTest" />
<option value="org.finos.vuu.viewport.FilterAndSortTest" />
<option value="org.finos.vuu.viewport.RangeSubtractTest" />
<option value="org.finos.vuu.viewport.ChangeViewPortTest" />
<option value="org.finos.vuu.viewport.DeleteViewPortTest" />
<option value="org.finos.vuu.viewport.TreeAndAggregateTest" />
<option value="org.finos.vuu.viewport.ViewPortColumnsTests" />
<option value="org.finos.vuu.viewport.ViewPortListenerTest" />
<option value="org.finos.vuu.viewport.TreeAndAggregate2Test" />
<option value="org.finos.vuu.viewport.AmendViewPortToTreeTest" />
<option value="org.finos.vuu.viewport.AbstractViewPortTestCase" />
<option value="org.finos.vuu.viewport.VisualLinkedViewPortTest" />
<option value="org.finos.vuu.viewport.TreeUpdateChildCountsTest" />
<option value="org.finos.vuu.viewport.UpdateSelectionViewPortTest" />
<option value="org.finos.vuu.viewport.OnlySendDiffRowsViewPortTest" />
<option value="org.finos.vuu.viewport.TreeBuilderAndAggregatesTest" />
<option value="org.finos.vuu.viewport.VisualLinkedTreeViewPortTest" />
<option value="org.finos.vuu.viewport.CalculatedColumnsViewPortTest" />
<option value="org.finos.vuu.viewport.thread.ResubmitExecutorTest" />
<option value="org.finos.vuu.viewport.performance.CalculateTreeOptimizationTest" />
<option value="org.finos.vuu.viewport.performance.DontRecalculateUnchangedViewPortTest" />
<option value="org.finos.vuu.viewport.disable.DisableViewPortTest" />
<option value="org.finos.vuu.viewport.editable.EditableViewportWithRpcTest" />
<option value="org.finos.vuu.viewport.sessiontable.EditSessionTableTest" />
<option value="org.finos.vuu.viewport.sessiontable.SessionTableViewportTest" />
<option value="org.finos.vuu.viewport.validation.CreateValidViewportTest" />
<option value="org.finos.vuu.viewport.empty.EmptyViewPortTest" />
<option value="org.finos.vuu.viewport.menurpc.CallMenuRpcFromViewPortTest" />
<option value="org.finos.vuu.api.CoreServerApiTest" />
<option value="org.finos.vuu.provider.simulation.SimulatedPricesProviderTest" />
<option value="org.finos.vuu.module.vuucel.VuuCelGrammarTest" />
</list>
</option>
<option name="javaOptions" value="--add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.access=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.math=ALL-UNNAMED --add-opens=java.sql/java.sql=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED" />
<option name="searchTest" value="In whole project" />
<option name="shortenClasspath" value="NONE" />
<option name="testPackagePath" value="org.finos.vuu" />
<option name="workingDirectory" value="$PROJECT_DIR$" />
<method v="2">
Expand Down
6 changes: 4 additions & 2 deletions vuu/src/main/scala/org/finos/vuu/viewport/ViewPort.scala
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ class ViewPortImpl(val id: String,
//TODO: CJS this is not correct, we should only subscribe to keys within the VP range
//this will check every key and remove it

newKeys.toArray().foreach( key => {
newKeySet.add(newKeys.get(i))
newKeys.foreach( key => {
newKeySet.add(key)
})

// while (i < newKeys.length) {
Expand All @@ -478,12 +478,14 @@ class ViewPortImpl(val id: String,

def unsubscribeForKey(key: String): Unit = {
subscribedKeys.remove(key)
logger.info(s"Unsubscribed to key [${key}]")
rowKeyToIndex.remove(key)
removeObserver(key)
}

def subscribeForKey(key: String, index: Int): Unit = {
subscribedKeys.put(key, "-")
logger.info(s"Subscribed to key [${key}]")
rowKeyToIndex.put(key, index)
addObserver(key)
}
Expand Down

0 comments on commit c23e721

Please sign in to comment.