Skip to content

Commit

Permalink
#989 fixed some of the merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjstevo committed Dec 29, 2023
1 parent 93489ef commit 06c702b
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.finos.vuu.core.module.basket.TestHelper

import org.finos.vuu.core.module.basket.BasketModule.{BasketTradingColumnNames => BT, BasketTradingConstituentColumnNames => BTC}
import org.finos.vuu.core.table.RowWithData
import org.finos.vuu.core.module.basket.BasketModule.{Sides, BasketColumnNames => B, BasketConstituentColumnNames => BC, BasketTradingColumnNames => BT, BasketTradingConstituentColumnNames => BTC}

object TestDataFactory {
def uuid = java.util.UUID.randomUUID.toString
Expand Down
9 changes: 9 additions & 0 deletions example/main-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
<version>0.9.36-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.finos.vuu</groupId>
<artifactId>vuu</artifactId>
<version>0.9.36-SNAPSHOT</version>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.finos.vuu</groupId>
<artifactId>basket</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class MyExampleModule extends DefaultModule {

private final String NAME = "MY_MOD";
public static final String NAME = "MY_MOD";

public ViewServerModule create(final TableDefContainer tableDefContainer){
return ModuleFactory.withNamespace(NAME, tableDefContainer)
Expand Down
60 changes: 60 additions & 0 deletions example/main-java/src/test/java/org/finos/vuu/JavaTestExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.finos.vuu;

import org.finos.toolbox.jmx.MetricsProvider;
import org.finos.toolbox.jmx.MetricsProviderImpl;
import org.finos.toolbox.lifecycle.LifecycleContainer;
import org.finos.toolbox.time.Clock;
import org.finos.toolbox.time.TestFriendlyClock;
import org.finos.vuu.core.module.TableDefContainer;
import org.finos.vuu.core.module.ViewServerModule;
import org.finos.vuu.module.MyExampleModule;
import org.finos.vuu.provider.MockProvider;
import org.finos.vuu.test.VuuServerTestCase;
import org.finos.vuu.viewport.ViewPort;
import org.scalatest.Ignore;
import scala.collection.immutable.Seq;

import java.util.Arrays;
import java.util.stream.Collectors;

import static scala.jdk.javaapi.CollectionConverters.asScala;

public class JavaTestExample extends VuuServerTestCase {

public static Seq<ViewServerModule> toScalaSeq(ViewServerModule... modules){
return new scala.collection.mutable.ListBuffer<ViewServerModule>().addAll(asScala(Arrays.stream(modules).collect(Collectors.toList()))).toSeq();
}


@Ignore
public void testVuuServerFunctionality() throws Exception{

final MetricsProvider metrics = new MetricsProviderImpl();
final Clock clock = new TestFriendlyClock(1000000000000L);
final LifecycleContainer lifecycle = new LifecycleContainer(clock);
final TableDefContainer tableDefContainer = new TableDefContainer();

final ViewServerModule module = new MyExampleModule().create(tableDefContainer);

withVuuServer(toScalaSeq(module), (vuuServer) -> {

vuuServer.login("test", "test");

ViewPort viewport = vuuServer.createViewPort(MyExampleModule.NAME, "myTable");

MockProvider provider = vuuServer.getProvider(MyExampleModule.NAME, "myTable");

// provider.tick("123", Map.of("id", "123", "foo", "bar", "myInt", 123));
//
// Seq<ViewPortUpdate> updates = combineQs(viewport);
//
// assertVpEq(updates, () -> asList(
// asList("id", "foo", "myInt"),
// asList("123", "bar", 123)
// ));

return null;
}, clock, lifecycle, metrics);
}

}

0 comments on commit 06c702b

Please sign in to comment.