How to use destroy method of Support Package

Best Unobtainium_ruby code snippet using Support.destroy

ExecRowRecogIntervalOrTerminated.java

Source:ExecRowRecogIntervalOrTerminated.java Github

copy

Full Screen

...72 sendTimer(isolated, 10000);73 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A3", null, null, null, null});74 sendTimer(isolated, Integer.MAX_VALUE);75 assertFalse(listener.isInvoked());76 // destroy77 stmt.destroy();78 isolated.destroy();79 }80 private void runAssertion_A_B(EPServiceProvider epService) {81 EPServiceProviderIsolated isolated = epService.getEPServiceIsolated("I1");82 sendTimer(isolated, 0);83 // the interval is not effective84 String[] fields = "a,b".split(",");85 String text = "select * from MyEvent#keepall " +86 "match_recognize (" +87 " measures A.theString as a, B.theString as b" +88 " pattern (A B)" +89 " interval 10 seconds or terminated" +90 " define" +91 " A as A.theString like 'A%'," +92 " B as B.theString like 'B%'" +93 ")";94 EPStatement stmt = isolated.getEPAdministrator().createEPL(text, "stmt1", null);95 SupportUpdateListener listener = new SupportUpdateListener();96 stmt.addListener(listener);97 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A1"));98 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B1"));99 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A1", "B1"});100 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A2"));101 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A3"));102 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B2"));103 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A3", "B2"});104 // destroy105 stmt.destroy();106 isolated.destroy();107 }108 private void runAssertionDocSample(EPServiceProvider epService) {109 EPServiceProviderIsolated isolated = epService.getEPServiceIsolated("I1");110 sendTimer(isolated, 0);111 String[] fields = "a_id,count_b,first_b,last_b".split(",");112 String text = "select * from TemperatureSensorEvent\n" +113 "match_recognize (\n" +114 " partition by device\n" +115 " measures A.id as a_id, count(B.id) as count_b, first(B.id) as first_b, last(B.id) as last_b\n" +116 " pattern (A B*)\n" +117 " interval 5 seconds or terminated\n" +118 " define\n" +119 " A as A.temp > 100,\n" +120 " B as B.temp > 100)";121 EPStatement stmt = isolated.getEPAdministrator().createEPL(text, "stmt1", null);122 SupportUpdateListener listener = new SupportUpdateListener();123 stmt.addListener(listener);124 sendTemperatureEvent(isolated, "E1", 1, 98);125 sendTemperatureEvent(isolated, "E2", 1, 101);126 sendTemperatureEvent(isolated, "E3", 1, 102);127 sendTemperatureEvent(isolated, "E4", 1, 101); // falls below128 assertFalse(listener.isInvoked());129 sendTemperatureEvent(isolated, "E5", 1, 100); // falls below130 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"E2", 2L, "E3", "E4"});131 sendTimer(isolated, Integer.MAX_VALUE);132 assertFalse(listener.isInvoked());133 // destroy134 stmt.destroy();135 isolated.destroy();136 }137 private void runAssertion_A_B_Cstar(EPServiceProvider epService) {138 EPServiceProviderIsolated isolated = epService.getEPServiceIsolated("I1");139 sendTimer(isolated, 0);140 String[] fields = "a,b,c0,c1,c2".split(",");141 String text = "select * from MyEvent#keepall " +142 "match_recognize (" +143 " measures A.theString as a, B.theString as b, " +144 "C[0].theString as c0, C[1].theString as c1, C[2].theString as c2 " +145 " pattern (A B C*)" +146 " interval 10 seconds or terminated" +147 " define" +148 " A as A.theString like 'A%'," +149 " B as B.theString like 'B%'," +150 " C as C.theString like 'C%'" +151 ")";152 EPStatement stmt = isolated.getEPAdministrator().createEPL(text, "stmt1", null);153 SupportUpdateListener listener = new SupportUpdateListener();154 stmt.addListener(listener);155 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A1"));156 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B1"));157 isolated.getEPRuntime().sendEvent(new SupportRecogBean("C1"));158 isolated.getEPRuntime().sendEvent(new SupportRecogBean("C2"));159 assertFalse(listener.isInvoked());160 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B2"));161 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A1", "B1", "C1", "C2", null});162 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A2"));163 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X1"));164 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B3"));165 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X2"));166 assertFalse(listener.isInvoked());167 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A3"));168 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B4"));169 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X3"));170 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A3", "B4", null, null, null});171 sendTimer(isolated, 20000);172 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A4"));173 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B5"));174 isolated.getEPRuntime().sendEvent(new SupportRecogBean("C3"));175 assertFalse(listener.isInvoked());176 sendTimer(isolated, 30000);177 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A4", "B5", "C3", null, null});178 sendTimer(isolated, Integer.MAX_VALUE);179 assertFalse(listener.isInvoked());180 // destroy181 stmt.destroy();182 isolated.destroy();183 }184 private void runAssertion_A_Bstar_or_Cstar(EPServiceProvider epService) {185 EPServiceProviderIsolated isolated = epService.getEPServiceIsolated("I1");186 sendTimer(isolated, 0);187 String[] fields = "a,b0,b1,c0,c1".split(",");188 String text = "select * from MyEvent#keepall " +189 "match_recognize (" +190 " measures A.theString as a, " +191 "B[0].theString as b0, B[1].theString as b1, " +192 "C[0].theString as c0, C[1].theString as c1 " +193 " pattern (A (B* | C*))" +194 " interval 10 seconds or terminated" +195 " define" +196 " A as A.theString like 'A%'," +197 " B as B.theString like 'B%'," +198 " C as C.theString like 'C%'" +199 ")";200 EPStatement stmt = isolated.getEPAdministrator().createEPL(text, "stmt1", null);201 SupportUpdateListener listener = new SupportUpdateListener();202 stmt.addListener(listener);203 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A1"));204 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X1"));205 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A1", null, null, null, null});206 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A2"));207 isolated.getEPRuntime().sendEvent(new SupportRecogBean("C1"));208 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A2", null, null, null, null});209 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B1"));210 EPAssertionUtil.assertPropsPerRow(listener.getAndResetLastNewData(), fields,211 new Object[][]{{"A2", null, null, "C1", null}});212 isolated.getEPRuntime().sendEvent(new SupportRecogBean("C2"));213 assertFalse(listener.isInvoked());214 // destroy215 stmt.destroy();216 isolated.destroy();217 }218 private void runAssertion_A_Bplus(EPServiceProvider epService) {219 EPServiceProviderIsolated isolated = epService.getEPServiceIsolated("I1");220 sendTimer(isolated, 0);221 String[] fields = "a,b0,b1,b2".split(",");222 String text = "select * from MyEvent#keepall " +223 "match_recognize (" +224 " measures A.theString as a, B[0].theString as b0, B[1].theString as b1, B[2].theString as b2" +225 " pattern (A B+)" +226 " interval 10 seconds or terminated" +227 " define" +228 " A as A.theString like 'A%'," +229 " B as B.theString like 'B%'" +230 ")";231 EPStatement stmt = isolated.getEPAdministrator().createEPL(text, "stmt1", null);232 SupportUpdateListener listener = new SupportUpdateListener();233 stmt.addListener(listener);234 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A1"));235 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X1"));236 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A2"));237 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B2"));238 assertFalse(listener.isInvoked());239 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X2"));240 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A2", "B2", null, null});241 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A3"));242 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A4"));243 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B3"));244 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B4"));245 assertFalse(listener.isInvoked());246 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X3", -1));247 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A4", "B3", "B4", null});248 // destroy249 stmt.destroy();250 isolated.destroy();251 }252 private void runAssertion_Astar(EPServiceProvider epService) {253 EPServiceProviderIsolated isolated = epService.getEPServiceIsolated("I1");254 sendTimer(isolated, 0);255 String[] fields = "a0,a1,a2,a3,a4".split(",");256 String text = "select * from MyEvent#keepall " +257 "match_recognize (" +258 " measures A[0].theString as a0, A[1].theString as a1, A[2].theString as a2, A[3].theString as a3, A[4].theString as a4" +259 " pattern (A*)" +260 " interval 10 seconds or terminated" +261 " define" +262 " A as theString like 'A%'" +263 ")";264 EPStatement stmt = isolated.getEPAdministrator().createEPL(text, "stmt1", null);265 SupportUpdateListener listener = new SupportUpdateListener();266 stmt.addListener(listener);267 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A1"));268 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A2"));269 assertFalse(listener.isInvoked());270 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B1"));271 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A1", "A2", null, null, null});272 sendTimer(isolated, 2000);273 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A3"));274 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A4"));275 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A5"));276 assertFalse(listener.isInvoked());277 sendTimer(isolated, 12000);278 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A3", "A4", "A5", null, null});279 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A6"));280 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B2"));281 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A3", "A4", "A5", "A6", null});282 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B3"));283 assertFalse(listener.isInvoked());284 // destroy285 stmt.destroy();286 isolated.destroy();287 }288 private void runAssertion_A_Bstar(EPServiceProvider epService, boolean allMatches) {289 EPServiceProviderIsolated isolated = epService.getEPServiceIsolated("I1");290 sendTimer(isolated, 0);291 String[] fields = "a,b0,b1,b2".split(",");292 String text = "select * from MyEvent#keepall " +293 "match_recognize (" +294 " measures A.theString as a, B[0].theString as b0, B[1].theString as b1, B[2].theString as b2" +295 (allMatches ? " all matches" : "") +296 " pattern (A B*)" +297 " interval 10 seconds or terminated" +298 " define" +299 " A as A.theString like \"A%\"," +300 " B as B.theString like \"B%\"" +301 ")";302 EPStatement stmt = isolated.getEPAdministrator().createEPL(text, "stmt1", null);303 SupportUpdateListener listener = new SupportUpdateListener();304 stmt.addListener(listener);305 // test output by terminated because of misfit event306 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A1"));307 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B1"));308 assertFalse(listener.isInvoked());309 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X1"));310 if (!allMatches) {311 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A1", "B1", null, null});312 } else {313 EPAssertionUtil.assertPropsPerRowAnyOrder(listener.getAndResetLastNewData(), fields,314 new Object[][]{{"A1", "B1", null, null}, {"A1", null, null, null}});315 }316 sendTimer(isolated, 20000);317 assertFalse(listener.isInvoked());318 // test output by timer expiry319 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A2"));320 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B2"));321 assertFalse(listener.isInvoked());322 sendTimer(isolated, 29999);323 sendTimer(isolated, 30000);324 if (!allMatches) {325 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A2", "B2", null, null});326 } else {327 EPAssertionUtil.assertPropsPerRowAnyOrder(listener.getAndResetLastNewData(), fields,328 new Object[][]{{"A2", "B2", null, null}, {"A2", null, null, null}});329 }330 // destroy331 stmt.destroy();332 isolated.destroy();333 EPStatement stmtFromModel = SupportModelHelper.compileCreate(epService, text);334 stmtFromModel.destroy();335 }336 private void runAssertion_A_parenthesisBstar(EPServiceProvider epService) {337 EPServiceProviderIsolated isolated = epService.getEPServiceIsolated("I1");338 sendTimer(isolated, 0);339 String[] fields = "a,b0,b1,b2".split(",");340 String text = "select * from MyEvent#keepall " +341 "match_recognize (" +342 " measures A.theString as a, B[0].theString as b0, B[1].theString as b1, B[2].theString as b2" +343 " pattern (A (B)*)" +344 " interval 10 seconds or terminated" +345 " define" +346 " A as A.theString like \"A%\"," +347 " B as B.theString like \"B%\"" +348 ")";349 EPStatement stmt = isolated.getEPAdministrator().createEPL(text, "stmt1", null);350 SupportUpdateListener listener = new SupportUpdateListener();351 stmt.addListener(listener);352 // test output by terminated because of misfit event353 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A1"));354 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B1"));355 assertFalse(listener.isInvoked());356 isolated.getEPRuntime().sendEvent(new SupportRecogBean("X1"));357 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A1", "B1", null, null});358 sendTimer(isolated, 20000);359 assertFalse(listener.isInvoked());360 // test output by timer expiry361 isolated.getEPRuntime().sendEvent(new SupportRecogBean("A2"));362 isolated.getEPRuntime().sendEvent(new SupportRecogBean("B2"));363 assertFalse(listener.isInvoked());364 sendTimer(isolated, 29999);365 sendTimer(isolated, 30000);366 EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), fields, new Object[]{"A2", "B2", null, null});367 // destroy368 stmt.destroy();369 isolated.destroy();370 EPStatement stmtFromModel = SupportModelHelper.compileCreate(epService, text);371 stmtFromModel.destroy();372 }373 private void sendTemperatureEvent(EPServiceProviderIsolated isolated, String id, int device, double temp) {374 isolated.getEPRuntime().sendEvent(new Object[]{id, device, temp}, "TemperatureSensorEvent");375 }376 private void sendTimer(EPServiceProviderIsolated isolated, long time) {377 CurrentTimeEvent theEvent = new CurrentTimeEvent(time);378 isolated.getEPRuntime().sendEvent(theEvent);379 }380}...

Full Screen

Full Screen

ExecClientAudit.java

Source:ExecClientAudit.java Github

copy

Full Screen

...53 epService.getEPRuntime().sendEvent(new Object[]{100d}, "OrderEvent");54 } else {55 epService.getEPRuntime().sendEvent(Collections.singletonMap("price", 100d), "OrderEvent");56 }57 stmt.destroy();58 }59 private void runAssertionAudit(EPServiceProvider epService) throws Exception {60 SupportUpdateListener listener = new SupportUpdateListener();61 // stream, and test audit callback62 SupportAuditCallback callback = new SupportAuditCallback();63 AuditPath.setAuditCallback(callback);64 AUDITLOG.info("*** Stream: ");65 EPStatement stmtInput = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('stream') select * from SupportBean(theString = 'E1')");66 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));67 assertEquals(1, callback.getAudits().size());68 AuditContext cb = callback.getAudits().get(0);69 assertEquals("SupportBean(theString=...) inserted SupportBean[SupportBean(E1, 1)]", cb.getMessage());70 assertEquals("ABC", cb.getStatementName());71 assertEquals(EPServiceProviderName.DEFAULT_ENGINE_URI, cb.getEngineURI());72 assertEquals(AuditEnum.STREAM, cb.getCategory());73 AuditPath.setAuditCallback(null);74 stmtInput.destroy();75 AUDITLOG.info("*** Named Window And Insert-Into: ");76 EPStatement stmtNW = epService.getEPAdministrator().createEPL("@Name('create') @Audit create window WinOne#keepall as SupportBean");77 EPStatement stmtInsertNW = epService.getEPAdministrator().createEPL("@Name('insert') @Audit insert into WinOne select * from SupportBean");78 EPStatement stmtConsumeNW = epService.getEPAdministrator().createEPL("@Name('select') @Audit select * from WinOne");79 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));80 stmtNW.destroy();81 stmtInsertNW.destroy();82 stmtConsumeNW.destroy();83 AUDITLOG.info("*** Insert-Into: ");84 EPStatement stmtInsertInto = epService.getEPAdministrator().createEPL("@Name('insert') @Audit insert into ABC select * from SupportBean");85 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));86 stmtInsertInto.destroy();87 AUDITLOG.info("*** Schedule: ");88 epService.getEPRuntime().sendEvent(new CurrentTimeEvent(0));89 EPStatement stmtSchedule = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('schedule') select irstream * from SupportBean#time(1 sec)");90 stmtSchedule.addListener(listener);91 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));92 listener.reset();93 log.info("Sending time");94 epService.getEPRuntime().sendEvent(new CurrentTimeEvent(2000));95 assertTrue(listener.isInvoked());96 listener.reset();97 stmtSchedule.destroy();98 // exprdef-instances99 AUDITLOG.info("*** Expression-Def: ");100 EPStatement stmtExprDef = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('exprdef') " +101 "expression DEF { 1 } " +102 "expression INN { x => x.theString }" +103 "expression OUT { x => INN(x) } " +104 "select DEF(), OUT(sb) from SupportBean sb");105 stmtExprDef.addListener(listener);106 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));107 assertEquals(1, listener.assertOneGetNewAndReset().get("DEF()"));108 stmtExprDef.destroy();109 // pattern-instances110 AUDITLOG.info("*** Pattern-Lifecycle: ");111 EPStatement stmtPatternLife = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('pattern-instances') select a.intPrimitive as val0 from pattern [every a=SupportBean -> (b=SupportBean_ST0 and not SupportBean_ST1)]");112 stmtPatternLife.addListener(listener);113 log.info("Sending E1");114 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));115 log.info("Sending E2");116 epService.getEPRuntime().sendEvent(new SupportBean("E2", 2));117 log.info("Sending E3");118 epService.getEPRuntime().sendEvent(new SupportBean_ST1("E3", 3));119 stmtPatternLife.destroy();120 // pattern121 AUDITLOG.info("*** Pattern: ");122 EPStatement stmtPattern = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('pattern') select a.intPrimitive as val0 from pattern [a=SupportBean -> b=SupportBean_ST0]");123 stmtPattern.addListener(listener);124 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));125 epService.getEPRuntime().sendEvent(new SupportBean_ST0("E2", 2));126 assertEquals(1, listener.assertOneGetNewAndReset().get("val0"));127 stmtPattern.destroy();128 // view129 AUDITLOG.info("*** View: ");130 EPStatement stmtView = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('view') select intPrimitive from SupportBean#lastevent");131 stmtView.addListener(listener);132 epService.getEPRuntime().sendEvent(new SupportBean("E1", 50));133 assertEquals(50, listener.assertOneGetNewAndReset().get("intPrimitive"));134 stmtView.destroy();135 EPStatement stmtGroupedView = epService.getEPAdministrator().createEPL("@Audit Select * From SupportBean#groupwin(theString)#length(2)");136 stmtGroupedView.addListener(listener);137 epService.getEPRuntime().sendEvent(new SupportBean("E1", 50));138 listener.reset();139 stmtGroupedView.destroy();140 EPStatement stmtGroupedWIntersectionView = epService.getEPAdministrator().createEPL("@Audit Select * From SupportBean#groupwin(theString)#length(2)#unique(intPrimitive)");141 stmtGroupedWIntersectionView.addListener(listener);142 epService.getEPRuntime().sendEvent(new SupportBean("E1", 50));143 listener.reset();144 stmtGroupedWIntersectionView.destroy();145 // expression146 AUDITLOG.info("*** Expression: ");147 EPStatement stmtExpr = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('expression') select intPrimitive*100 as val0, sum(intPrimitive) as val1 from SupportBean");148 stmtExpr.addListener(listener);149 epService.getEPRuntime().sendEvent(new SupportBean("E1", 50));150 assertEquals(5000, listener.assertOneGetNew().get("val0"));151 assertEquals(50, listener.assertOneGetNewAndReset().get("val1"));152 stmtExpr.destroy();153 // expression-detail154 AUDITLOG.info("*** Expression-Nested: ");155 EPStatement stmtExprNested = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('expression-nested') select ('A'||theString)||'X' as val0 from SupportBean");156 stmtExprNested.addListener(listener);157 epService.getEPRuntime().sendEvent(new SupportBean("E1", 50));158 assertEquals("AE1X", listener.assertOneGetNewAndReset().get("val0"));159 stmtExprNested.destroy();160 // property161 AUDITLOG.info("*** Property: ");162 EPStatement stmtProp = epService.getEPAdministrator().createEPL("@Name('ABC') @Audit('property') select intPrimitive from SupportBean");163 stmtProp.addListener(listener);164 epService.getEPRuntime().sendEvent(new SupportBean("E1", 50));165 assertEquals(50, listener.assertOneGetNewAndReset().get("intPrimitive"));166 stmtProp.destroy();167 // with aggregation168 epService.getEPAdministrator().createEPL("@Audit @Name ('create') create window MyWindow#keepall as SupportBean");169 String eplWithAgg = "@Audit @Name('S0') on SupportBean as sel select count(*) from MyWindow as win having count(*)=3 order by win.intPrimitive";170 EPStatement stmtWithAgg = epService.getEPAdministrator().createEPL(eplWithAgg);171 stmtWithAgg.destroy();172 // data flow173 EPStatement stmtDataflow = epService.getEPAdministrator().createEPL("@Audit @Name('df') create dataflow MyFlow " +174 "EventBusSource -> a<SupportBean> {filter:theString like 'I%'} " +175 "Filter(a) -> b {filter: true}" +176 "LogSink(b) {log:false}");177 EPDataFlowInstance df = epService.getEPRuntime().getDataFlowRuntime().instantiate("MyFlow");178 df.start();179 epService.getEPRuntime().sendEvent(new SupportBean("I1", 1));180 df.cancel();181 // context partitions182 epService.getEPAdministrator().createEPL("create context WhenEventArrives " +183 "initiated by SupportBean_ST0 as st0 " +184 "terminated by SupportBean_ST1(id=st0.id)");185 epService.getEPAdministrator().createEPL("@Audit('ContextPartition') context WhenEventArrives select * from SupportBean");186 epService.getEPRuntime().sendEvent(new SupportBean_ST0("E1", 0));187 epService.getEPRuntime().sendEvent(new SupportBean_ST1("E1", 0));188 stmtDataflow.destroy();189 // table190 AUDITLOG.info("*** Table And Insert-Into and Into-table: ");191 EPStatement stmtTable = epService.getEPAdministrator().createEPL("@Name('create-table') @Audit create table TableOne(c0 string primary key, cnt count(*))");192 EPStatement stmtIntoTable = epService.getEPAdministrator().createEPL("@Name('into-table') @Audit into table TableOne select count(*) as cnt from SupportBean group by theString");193 EPStatement stmtAccessTable = epService.getEPAdministrator().createEPL("@Name('access-table') @Audit select TableOne[id].cnt from SupportBean_ST0");194 stmtAccessTable.addListener(listener);195 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));196 epService.getEPRuntime().sendEvent(new SupportBean_ST0("E1", 0));197 stmtTable.destroy();198 stmtIntoTable.destroy();199 stmtAccessTable.destroy();200 // int-expression with endpoint-included201 epService.getEPAdministrator().createEPL("@audit select * from SupportBean#keepall where intPrimitive in (1:3)");202 epService.getEPRuntime().sendEvent(new SupportBean("E1", 1));203 }204}...

Full Screen

Full Screen

CellAdapter.java

Source:CellAdapter.java Github

copy

Full Screen

1package md51558244f76c53b6aeda52c8a337f2c37;2public abstract class CellAdapter3 extends android.widget.BaseAdapter4 implements5 mono.android.IGCUserPeer,6 android.widget.AdapterView.OnItemLongClickListener,7 android.view.ActionMode.Callback,8 android.widget.AdapterView.OnItemClickListener,9 android.support.v7.view.ActionMode.Callback10{11/** @hide */12 public static final String __md_methods;13 static {14 __md_methods = 15 "n_onItemLongClick:(Landroid/widget/AdapterView;Landroid/view/View;IJ)Z:GetOnItemLongClick_Landroid_widget_AdapterView_Landroid_view_View_IJHandler:Android.Widget.AdapterView/IOnItemLongClickListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\n" +16 "n_onActionItemClicked:(Landroid/view/ActionMode;Landroid/view/MenuItem;)Z:GetOnActionItemClicked_Landroid_view_ActionMode_Landroid_view_MenuItem_Handler:Android.Views.ActionMode/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\n" +17 "n_onCreateActionMode:(Landroid/view/ActionMode;Landroid/view/Menu;)Z:GetOnCreateActionMode_Landroid_view_ActionMode_Landroid_view_Menu_Handler:Android.Views.ActionMode/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\n" +18 "n_onDestroyActionMode:(Landroid/view/ActionMode;)V:GetOnDestroyActionMode_Landroid_view_ActionMode_Handler:Android.Views.ActionMode/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\n" +19 "n_onPrepareActionMode:(Landroid/view/ActionMode;Landroid/view/Menu;)Z:GetOnPrepareActionMode_Landroid_view_ActionMode_Landroid_view_Menu_Handler:Android.Views.ActionMode/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\n" +20 "n_onItemClick:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V:GetOnItemClick_Landroid_widget_AdapterView_Landroid_view_View_IJHandler:Android.Widget.AdapterView/IOnItemClickListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\n" +21 "n_onActionItemClicked:(Landroid/support/v7/view/ActionMode;Landroid/view/MenuItem;)Z:GetOnActionItemClicked_Landroid_support_v7_view_ActionMode_Landroid_view_MenuItem_Handler:Android.Support.V7.View.ActionMode/ICallbackInvoker, Xamarin.Android.Support.v7.AppCompat\n" +22 "n_onCreateActionMode:(Landroid/support/v7/view/ActionMode;Landroid/view/Menu;)Z:GetOnCreateActionMode_Landroid_support_v7_view_ActionMode_Landroid_view_Menu_Handler:Android.Support.V7.View.ActionMode/ICallbackInvoker, Xamarin.Android.Support.v7.AppCompat\n" +23 "n_onDestroyActionMode:(Landroid/support/v7/view/ActionMode;)V:GetOnDestroyActionMode_Landroid_support_v7_view_ActionMode_Handler:Android.Support.V7.View.ActionMode/ICallbackInvoker, Xamarin.Android.Support.v7.AppCompat\n" +24 "n_onPrepareActionMode:(Landroid/support/v7/view/ActionMode;Landroid/view/Menu;)Z:GetOnPrepareActionMode_Landroid_support_v7_view_ActionMode_Landroid_view_Menu_Handler:Android.Support.V7.View.ActionMode/ICallbackInvoker, Xamarin.Android.Support.v7.AppCompat\n" +25 "";26 mono.android.Runtime.register ("Xamarin.Forms.Platform.Android.CellAdapter, Xamarin.Forms.Platform.Android", CellAdapter.class, __md_methods);27 }28 public CellAdapter ()29 {30 super ();31 if (getClass () == CellAdapter.class)32 mono.android.TypeManager.Activate ("Xamarin.Forms.Platform.Android.CellAdapter, Xamarin.Forms.Platform.Android", "", this, new java.lang.Object[] { });33 }34 public CellAdapter (android.content.Context p0)35 {36 super ();37 if (getClass () == CellAdapter.class)38 mono.android.TypeManager.Activate ("Xamarin.Forms.Platform.Android.CellAdapter, Xamarin.Forms.Platform.Android", "Android.Content.Context, Mono.Android", this, new java.lang.Object[] { p0 });39 }40 public boolean onItemLongClick (android.widget.AdapterView p0, android.view.View p1, int p2, long p3)41 {42 return n_onItemLongClick (p0, p1, p2, p3);43 }44 private native boolean n_onItemLongClick (android.widget.AdapterView p0, android.view.View p1, int p2, long p3);45 public boolean onActionItemClicked (android.view.ActionMode p0, android.view.MenuItem p1)46 {47 return n_onActionItemClicked (p0, p1);48 }49 private native boolean n_onActionItemClicked (android.view.ActionMode p0, android.view.MenuItem p1);50 public boolean onCreateActionMode (android.view.ActionMode p0, android.view.Menu p1)51 {52 return n_onCreateActionMode (p0, p1);53 }54 private native boolean n_onCreateActionMode (android.view.ActionMode p0, android.view.Menu p1);55 public void onDestroyActionMode (android.view.ActionMode p0)56 {57 n_onDestroyActionMode (p0);58 }59 private native void n_onDestroyActionMode (android.view.ActionMode p0);60 public boolean onPrepareActionMode (android.view.ActionMode p0, android.view.Menu p1)61 {62 return n_onPrepareActionMode (p0, p1);63 }64 private native boolean n_onPrepareActionMode (android.view.ActionMode p0, android.view.Menu p1);65 public void onItemClick (android.widget.AdapterView p0, android.view.View p1, int p2, long p3)66 {67 n_onItemClick (p0, p1, p2, p3);68 }69 private native void n_onItemClick (android.widget.AdapterView p0, android.view.View p1, int p2, long p3);70 public boolean onActionItemClicked (android.support.v7.view.ActionMode p0, android.view.MenuItem p1)71 {72 return n_onActionItemClicked (p0, p1);73 }74 private native boolean n_onActionItemClicked (android.support.v7.view.ActionMode p0, android.view.MenuItem p1);75 public boolean onCreateActionMode (android.support.v7.view.ActionMode p0, android.view.Menu p1)76 {77 return n_onCreateActionMode (p0, p1);78 }79 private native boolean n_onCreateActionMode (android.support.v7.view.ActionMode p0, android.view.Menu p1);80 public void onDestroyActionMode (android.support.v7.view.ActionMode p0)81 {82 n_onDestroyActionMode (p0);83 }84 private native void n_onDestroyActionMode (android.support.v7.view.ActionMode p0);85 public boolean onPrepareActionMode (android.support.v7.view.ActionMode p0, android.view.Menu p1)86 {87 return n_onPrepareActionMode (p0, p1);88 }89 private native boolean n_onPrepareActionMode (android.support.v7.view.ActionMode p0, android.view.Menu p1);90 private java.util.ArrayList refList;91 public void monodroidAddReference (java.lang.Object obj)92 {93 if (refList == null)94 refList = new java.util.ArrayList ();95 refList.add (obj);96 }97 public void monodroidClearReferences ()98 {99 if (refList != null)100 refList.clear ();101 }102}...

Full Screen

Full Screen

destroy

Using AI Code Generation

copy

Full Screen

1support = Support.new('test')2 def initialize(name)3support = Support.new('test')4 def initialize(name)5support = Support.new('test')6 def initialize(name)7support = Support.new('test')8 def initialize(name)9support = Support.new('test')10 def initialize(name)11support = Support.new('test')12 def initialize(name)13support = Support.new('test')14 def initialize(name)

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Unobtainium_ruby automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful