From 8f490bc0962ddf28e9313133d6c8abda707d7c88 Mon Sep 17 00:00:00 2001 From: vinoja98 Date: Thu, 8 Sep 2022 15:48:34 +0530 Subject: [PATCH] some errors fixed --- .../extension/io/live/source/LiveSource.java | 11 +++++---- .../io/live/utils/LiveSourceConstants.java | 22 +++++++++++++++++- .../io/live/source/TestCaseOfLiveSource.java | 9 +++---- .../extension/io/live/source/LiveSource.class | Bin 3530 -> 0 bytes .../io/live/source/TestCaseOfLiveSource.class | Bin 3929 -> 0 bytes .../target/test-classes/log4j.properties | 13 ----------- component/target/test-classes/testng.xml | 12 ---------- 7 files changed, 32 insertions(+), 35 deletions(-) delete mode 100644 component/target/classes/io/siddhi/extension/io/live/source/LiveSource.class delete mode 100644 component/target/test-classes/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.class delete mode 100644 component/target/test-classes/log4j.properties delete mode 100644 component/target/test-classes/testng.xml diff --git a/component/src/main/java/io/siddhi/extension/io/live/source/LiveSource.java b/component/src/main/java/io/siddhi/extension/io/live/source/LiveSource.java index 33e4f6c..6cdad4d 100644 --- a/component/src/main/java/io/siddhi/extension/io/live/source/LiveSource.java +++ b/component/src/main/java/io/siddhi/extension/io/live/source/LiveSource.java @@ -19,13 +19,14 @@ import io.siddhi.core.util.snapshot.state.StateFactory; import io.siddhi.core.util.transport.OptionHolder; import io.siddhi.extension.io.live.utils.LiveSourceConstants; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.apache.log4j.LogManager; -import org.apache.log4j.Logger; + import javax.security.auth.login.CredentialException; @@ -111,7 +112,8 @@ }, examples = { @Example( - syntax = "@source(type = 'live', sql.query='Select * from table', host.name='api-varden-example'," + + syntax = "@source(type = 'live', sql.query='Select * from table'," + + "\nhost.name='api-varden-example'," + "\napi.key = 'apikey-xxxxxxxxx', " + "\n@map(type='keyvalue'), @attributes(id = 'id', name = 'name'))" + "\ndefine stream inputStream (id int, name string)", @@ -187,7 +189,7 @@ protected ServiceDeploymentInfo exposeServiceDeploymentInfo() { * @throws ConnectionUnavailableException if it cannot connect to the source backend immediately. */ @Override - public void connect(ConnectionCallback connectionCallback,State state) throws ConnectionUnavailableException { + public void connect(ConnectionCallback connectionCallback , State state) throws ConnectionUnavailableException { C8DB db; try { db = new C8DB.Builder() @@ -218,7 +220,6 @@ public void connect(ConnectionCallback connectionCallback,State state) throws Co } catch (IOException e) { throw new RuntimeException(e); } -// System.out.println(r.toString()); logger.info("Event " + r.toString()); sourceEventListener.onEvent(r.toString(), requestedTransportPropertyNames); diff --git a/component/src/main/java/io/siddhi/extension/io/live/utils/LiveSourceConstants.java b/component/src/main/java/io/siddhi/extension/io/live/utils/LiveSourceConstants.java index 1663ebd..0cca21a 100644 --- a/component/src/main/java/io/siddhi/extension/io/live/utils/LiveSourceConstants.java +++ b/component/src/main/java/io/siddhi/extension/io/live/utils/LiveSourceConstants.java @@ -1,5 +1,25 @@ +/* + * Copyright (c) 2017 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ package io.siddhi.extension.io.live.utils; - +/** + * Live source constants. + */ public class LiveSourceConstants { public static final String SQLQUERY = "sql.query"; public static final String HOSTNAME = "host.name"; diff --git a/component/src/test/java/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.java b/component/src/test/java/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.java index 790ef1d..96f7128 100644 --- a/component/src/test/java/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.java +++ b/component/src/test/java/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.java @@ -16,9 +16,7 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import java.net.URI; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; @@ -51,8 +49,11 @@ public void liveSelect() throws Exception { siddhiManager.setPersistenceStore(persistenceStore); siddhiManager.setExtension("xml-input-mapper", XmlSourceMapper.class); String inStreamDefinition = "@App:name('TestSiddhiApp')" + - "@source(type='live', sql.query='select count from network_traffic', host.name='api-varden-4f0f3c4f.paas.macrometa.io'," + - "api.key = 'madu140_gmail.com.AccessPortal.2PL8EeyIAMn2sx7YHKWMM58tmJLES4NyIWq6Cnsj0BTMjygJyF3b14zb2sidcauXccccb8'," + + "@source(type='live'," + + "sql.query='select count from network_traffic'," + + "host.name='api-varden-4f0f3c4f.paas.macrometa.io'," + + "api.key = 'madu140_gmail.com." + + "AccessPortal.2PL8EeyIAMn2sx7YHKWMM58tmJLES4NyIWq6Cnsj0BTMjygJyF3b14zb2sidcauXccccb8'," + " @map(type='keyvalue'), @attributes(id = 'id', name = 'name'))," + "define stream inputStream (count int)"; String query = ("@info(name = 'query') " diff --git a/component/target/classes/io/siddhi/extension/io/live/source/LiveSource.class b/component/target/classes/io/siddhi/extension/io/live/source/LiveSource.class deleted file mode 100644 index a445e04de6d13274f5b7787c910acd726b42ca43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3530 zcmcgu&vO(-6n>p-vdIuc0;qsWtI^$sB;$`LND>Gnfkc)NvP%^3(wXTb1G6(jPw!T? zO7H#){s$iYalq12E}r~5ym<6zS!Mb4%Wl{caBE8{MkmXm+OkC?oNZ}iaq59xPDIm;4yOTJiJ}!zlZ-~o4@5)Qz6iGL zidJ5*1*Jo=^rfS3*QIJQ8rlwHooWw?$h#r2b}S8du^|Ip_F`x^>qp(`yqPA}!@1f$cv zQgKrR0+|}2m+2Ko!&_3P`C&9(>~J#gi#VPx?U~JCVsvVR256Ack+K)am3nPMs;b!V zlgx&W@YjX%%sg8hoJoSUsGrV^&}(!Q0qboK+r!B}4?B>uoH51dpJE4cACf$s^=@2U zd%mq(>9=o18U$SmeOIdK9?9#oHn1u7#E$DgLhsM~A98ou{{v`dtPuDix|BDlq!(PM~BQ`VHxFC#*%DFU)Ru zq(YoVExyRD;oZB22w*+XF?U1|gqm+i-iGUt3*N}i@qa~GG)5&ule3IYbTTu$sfO<- zz}{PRje3wAZo*k}U5*z^ooAMEIZu;ML1tvRDhWvN>W$Wl`+S zEJkZIaivWR{SKix%1fBTh;f7z2?a$h)!t54TPkoe96$0W(ZEcl~A=WL;p zJQDa>zNx|**X9O6p&j3B0TE1~Zn`p<$U-QLTUn6CBt8-D#7^r6v^7@~QQ~v909ix$ zby+Bl^EsjMIN7Lc85cd*fIS!LX5(gJ#zLuNxpEV2n5X55C$A)wO1zl3LE(C35GdfK zQ)0BU9B|Wrc^2R}W)h@oz)126gFrgQZ6fGA(MgUhOY;Ci*FgUO!(G17O!ZQ%P%r}p zjuv9Ek0!=vm+I`#vd{0@^oI*tFqMD!)S znyi4V=6RFBY>WmtaP~31-VOO8fsCXI#1XRrze#W5-}s!u4ou|M&op*-^qt34e1ci0 z)2}-$SZxdEXgssfcHjRCO?=x0{-y&wkb!e#)4Lhi7-0s(x{=>^Ap6>G-=p^t+y_A9 zfSYP>!5l-ng^zk{;Yo+B-7Q>bXYd@*CJNS_y+1pEsE1khKHeYrS5M%@{ege?1WxY@ zWUL3UpJuSDKANRV7{9_EFN3IaF?zOK%zJ>R!^@M!MD|r3y^VQ58|#iD})ad`h1o8Vk|f1^FQU4-!SijQ{`u diff --git a/component/target/test-classes/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.class b/component/target/test-classes/io/siddhi/extension/io/live/source/TestCaseOfLiveSource.class deleted file mode 100644 index e1b88f6e96e1802ff29267bbdc2f096d3e38cd43..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3929 zcmbVP`Bxj)8NH8fggj1cCALev$&DRJ7$m@W1KV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pwg0y&HI;cN0ez+Bb0Q5l-~(8+wEnd-vA{9^q6| z*Fhc&HlH0h#t(zzIEW;Ua;|jiktU>&=8U~KPiaFhpA~}B92L;>TvI1@_x=MX+Sk$7 zR37Im;3VxjwM}976NNb{Y{vliDA0pXRG;ArRf`oKq?mf|Z#a+`UdOpjTw3Vdz?J+a zUS8P1cwrM09ABC3?_0-Ie_}fE>N*OE*G4)Lb0eMoo4CEu)A1O0Ht^Y=&UL)8j^a9& zM!I^s680vXh2GN}sIJ5B=~_o!Des{25v@l{y!B6fu?=@<(~A!~lx6%s_3$y?IlYc= z^=SNgjCYmT50ts>;l0fAqY3QcV>D?$&FR4qum22Q;f{*(>Uxhvy2S7s%4+y6Q68jZr0sobi{8BtZC?z(!|%DGZuS&Mb+ety e{=e{HyZapr;i>y=!ym%mKjKdu;}mf?^6!7OX;Ogz diff --git a/component/target/test-classes/log4j.properties b/component/target/test-classes/log4j.properties deleted file mode 100644 index b52a2f1..0000000 --- a/component/target/test-classes/log4j.properties +++ /dev/null @@ -1,13 +0,0 @@ -# For the general syntax of property based configuration files see the -# documenation of org.apache.log4j.PropertyConfigurator. -# The root category uses the appender called A1. Since no priority is -# specified, the root category assumes the default priority for root -# which is DEBUG in log4j. The root category is the only category that -# has a default priority. All other categories need not be assigned a -# priority in which case they inherit their priority from the -# hierarchy. -#log4j.rootLogger=DEBUG, stdout -log4j.rootLogger=INFO, stdout -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%m%n diff --git a/component/target/test-classes/testng.xml b/component/target/test-classes/testng.xml deleted file mode 100644 index a04f603..0000000 --- a/component/target/test-classes/testng.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - -