MCPcopy Create free account
hub / github.com/banq/jdonframework / testCQRS

Method testCQRS

src/test/java/com/jdon/SampleAppTest.java:132–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130 }
131
132 public void testCQRS() {
133 // AppUtil appUtil = new AppUtil();
134 AService service = (AService) appUtil.getComponentInstance("myaService");
135 AggregateRootA aggregateRootA = service.getAggregateRootA("11");
136 DomainMessage res = service.commandAandB("11", aggregateRootA, 100);
137
138 long start = System.currentTimeMillis();
139 DomainMessage res1 = (DomainMessage) res.getBlockEventResult();
140 ParameterVO result = (ParameterVO) res1.getBlockEventResult();
141
142 long stop = System.currentTimeMillis();
143
144 AggregateRootB aggregateRootB = service.getAggregateRootB("22");
145 Assert.assertEquals(result.getValue(),
146 aggregateRootB.getState(result.getId()));
147 System.out.print("\n test CQRS ok \n" + result + " " + (stop - start));
148 }
149
150 public void testBankAccount() {
151 Assert.assertTrue(AccountTransferMain.testTransferFinish());

Callers 2

mainMethod · 0.95
testJdonMethod · 0.80

Calls 8

getAggregateRootAMethod · 0.95
commandAandBMethod · 0.95
getBlockEventResultMethod · 0.95
getAggregateRootBMethod · 0.95
getValueMethod · 0.95
getStateMethod · 0.95
getIdMethod · 0.95
getComponentInstanceMethod · 0.45

Tested by

no test coverage detected