-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93489ef
commit 06c702b
Showing
4 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...e/basket/src/test/scala/org/finos/vuu/core/module/basket/TestHelper/TestDataFactory.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
example/main-java/src/test/java/org/finos/vuu/JavaTestExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |