From 016536791b95df23811dabd063010f0561526163 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Mon, 26 Jul 2021 12:42:00 +0530 Subject: Support for MariaDB Support for MariaDB Issue-ID: CCSDK-3384 Signed-off-by: Ravi Pendurty Change-Id: Ic93ad33257a091f2cd208cdf02d1d7400c256bf0 Signed-off-by: Ravi Pendurty --- .../ConfigurationFileRepresentation.java | 2 +- .../sdnr/wt/common/database/ExtRestClient.java | 8 +- .../sdnr/wt/common/database/HtDatabaseClient.java | 6 +- .../sdnr/wt/common/database/data/AliasesEntry.java | 4 + .../wt/common/database/data/DatabaseVersion.java | 149 +++++++++++++++++++++ .../sdnr/wt/common/database/data/EsVersion.java | 149 --------------------- .../sdnr/wt/common/database/data/IndicesEntry.java | 16 ++- .../wt/common/database/queries/QueryBuilder.java | 13 ++ .../common/database/responses/GetInfoResponse.java | 8 +- .../features/sdnr/wt/common/file/PomFile.java | 6 +- .../sdnr/wt/common/http/BaseHTTPClient.java | 17 ++- .../features/sdnr/wt/common/test/TestEsData.java | 10 +- 12 files changed, 215 insertions(+), 173 deletions(-) create mode 100644 sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/DatabaseVersion.java delete mode 100644 sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/EsVersion.java (limited to 'sdnr/wt/common/src') diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/ConfigurationFileRepresentation.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/ConfigurationFileRepresentation.java index 96bfa070b..54a5172a3 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/ConfigurationFileRepresentation.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/ConfigurationFileRepresentation.java @@ -46,7 +46,7 @@ public class ConfigurationFileRepresentation implements IConfigChangedListener { private static final Logger LOG = LoggerFactory.getLogger(ConfigurationFileRepresentation.class); private static final long FILE_POLL_INTERVAL_MS = 1000; - private static final String SECTIONNAME_ROOT = ""; + public static final String SECTIONNAME_ROOT = ""; private static final String LR = "\n"; private static final String EMPTY = ""; // end of constants diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/ExtRestClient.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/ExtRestClient.java index 1f67e5ef8..8b2dbb004 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/ExtRestClient.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/ExtRestClient.java @@ -44,7 +44,7 @@ import org.elasticsearch.client.RestClientBuilder.HttpClientConfigCallback; import org.json.JSONException; import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo; import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo.Protocol; -import org.onap.ccsdk.features.sdnr.wt.common.database.data.EsVersion; +import org.onap.ccsdk.features.sdnr.wt.common.database.data.DatabaseVersion; import org.onap.ccsdk.features.sdnr.wt.common.database.requests.ClusterHealthRequest; import org.onap.ccsdk.features.sdnr.wt.common.database.requests.ClusterSettingsRequest; import org.onap.ccsdk.features.sdnr.wt.common.database.requests.CreateAliasRequest; @@ -150,9 +150,9 @@ public class ExtRestClient { this.client = RestClient.builder(get(hosts)) .setHttpClientConfigCallback(new BasicAuthHttpClientConfigCallback(username, password, trustAll)) .build(); - EsVersion tmp = autoDetectVersion(); + DatabaseVersion tmp = autoDetectVersion(); LOG.info("working with sdnrdb version {}", tmp.toString()); - this.isES7 = tmp.isNewerOrEqualThan(new EsVersion(7, 0, 0)); + this.isES7 = tmp.isNewerOrEqualThan(new DatabaseVersion(7, 0, 0)); } /** @@ -160,7 +160,7 @@ public class ExtRestClient { * @throws IOException * @throws Exception */ - private EsVersion autoDetectVersion() throws IOException, Exception { + private DatabaseVersion autoDetectVersion() throws IOException, Exception { GetInfoResponse infoResponse = this.getInfo(); return infoResponse.getVersion(); diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/HtDatabaseClient.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/HtDatabaseClient.java index 232b68c73..e4b8893c5 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/HtDatabaseClient.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/HtDatabaseClient.java @@ -60,6 +60,7 @@ public class HtDatabaseClient extends ExtRestClient implements DatabaseClient, A private static final long TIMOUT_MS_DEFAULT = 30000; private static final long READ_MAX_SIZE = 9999; private final static long SLEEPTIMEMS = 5000; + private static final boolean FULLSIZEREQUEST_DEFAULT = false; private final Logger LOG = LoggerFactory.getLogger(HtDatabaseClient.class); @@ -90,7 +91,7 @@ public class HtDatabaseClient extends ExtRestClient implements DatabaseClient, A } static public HtDatabaseClient getClient(HostInfo[] hosts, String username, String password, boolean trustAll, - long timeoutms) throws HtDatabaseClientException { + boolean doFullsizeRequests, long timeoutms) throws HtDatabaseClientException { return getClient(hosts, REFRESH_AFTER_REWRITE_DEFAULT, username, password, trustAll, TIMOUT_MS_DEFAULT); } @@ -261,7 +262,8 @@ public class HtDatabaseClient extends ExtRestClient implements DatabaseClient, A total = response.getTotal(); } catch (IOException e) { - LOG.warn("Possible Database connection failure. If this error persists, please check Database connectivity"); + LOG.warn( + "Possible Database connection failure. If this error persists, please check Database connectivity"); LOG.warn("error do search {}: {}", queryBuilder, e); } return new SearchResult(response != null ? response.getHits() : new SearchHit[] {}, total); diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntry.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntry.java index d55e66d2e..118cf0282 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntry.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntry.java @@ -45,6 +45,10 @@ public class AliasesEntry { private final String alias; private final String index; + public AliasesEntry(String index, String alias) { + this.alias = alias; + this.index = index; + } public AliasesEntry(String line) throws ParseException { final Matcher matcher = pattern.matcher(line); if (!matcher.find() || matcher.groupCount() < 2) { diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/DatabaseVersion.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/DatabaseVersion.java new file mode 100644 index 000000000..e37b9d924 --- /dev/null +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/DatabaseVersion.java @@ -0,0 +1,149 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed 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. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.common.database.data; + +import java.text.ParseException; +import org.eclipse.jdt.annotation.NonNull; + + +/** + * @author Michael Dürre + * + */ +public class DatabaseVersion { + + private final String raw; + private final int major; + private final int minor; + private final int revision; + + public DatabaseVersion(@NonNull String version) throws ParseException { + String[] hlp = version.split("\\."); + if (hlp.length < 3) { + throw new ParseException("unable to parse version string: " + version, 0); + } + this.raw = version; + this.major = Integer.parseInt(hlp[0]); + this.minor = Integer.parseInt(hlp[1]); + this.revision = Integer.parseInt(hlp[2]); + } + + @Override + public String toString() { + return String.format("%d.%d.%d", this.major, this.minor, this.revision); + } + + /** + * @param major + * @param minor + * @param revision + */ + public DatabaseVersion(int major, int minor, int revision) { + this.raw = String.format("%d.%d.%d", major, minor, revision); + this.major = major; + this.minor = minor; + this.revision = revision; + } + + /** + * @return the revision + */ + public int getRevision() { + return revision; + } + + /** + * @return the minor + */ + public int getMinor() { + return minor; + } + + /** + * @return the major + */ + public int getMajor() { + return major; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof DatabaseVersion)) { + return false; + } + DatabaseVersion esobj = (DatabaseVersion) obj; + return this.major == esobj.major && this.minor == esobj.minor && this.revision == esobj.revision; + } + + @Override + public int hashCode() { + return this.raw.hashCode(); + } + + public boolean isNewerOrEqualThan(DatabaseVersion v) { + if (this.equals(v)) { + return true; + } + return this.isNewerThan(v); + } + public boolean isNewerThan(DatabaseVersion v) { + if (this.major > v.major) { + return true; + } else if (this.major < v.major) { + return false; + } + if (this.minor > v.minor) { + return true; + } else if (this.minor < v.minor) { + return false; + } + if (this.revision > v.revision) { + return true; + } + return false; + } + + public boolean isOlderOrEqualThan(DatabaseVersion v) { + if (this.equals(v)) { + return true; + } + return this.isOlderThan(v); + } + + public boolean isOlderThan(DatabaseVersion v) { + if (this.major < v.major) { + return true; + } else if (this.major > v.major) { + return false; + } + if (this.minor < v.minor) { + return true; + } else if (this.minor > v.minor) { + return false; + } + if (this.revision < v.revision) { + return true; + } + return false; + } + +} diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/EsVersion.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/EsVersion.java deleted file mode 100644 index e1fd02de0..000000000 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/EsVersion.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * ONAP : ccsdk features - * ================================================================================ - * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. - * All rights reserved. - * ================================================================================ - * Licensed 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. - * ============LICENSE_END========================================================= - * - */ -package org.onap.ccsdk.features.sdnr.wt.common.database.data; - -import java.text.ParseException; -import org.eclipse.jdt.annotation.NonNull; - - -/** - * @author Michael Dürre - * - */ -public class EsVersion { - - private final String raw; - private final int major; - private final int minor; - private final int revision; - - public EsVersion(@NonNull String version) throws ParseException { - String[] hlp = version.split("\\."); - if (hlp.length < 3) { - throw new ParseException("unable to parse version string: " + version, 0); - } - this.raw = version; - this.major = Integer.parseInt(hlp[0]); - this.minor = Integer.parseInt(hlp[1]); - this.revision = Integer.parseInt(hlp[2]); - } - - @Override - public String toString() { - return String.format("%d.%d.%d", this.major, this.minor, this.revision); - } - - /** - * @param major - * @param minor - * @param revision - */ - public EsVersion(int major, int minor, int revision) { - this.raw = String.format("%d.%d.%d", major, minor, revision); - this.major = major; - this.minor = minor; - this.revision = revision; - } - - /** - * @return the revision - */ - public int getRevision() { - return revision; - } - - /** - * @return the minor - */ - public int getMinor() { - return minor; - } - - /** - * @return the major - */ - public int getMajor() { - return major; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof EsVersion)) { - return false; - } - EsVersion esobj = (EsVersion) obj; - return this.major == esobj.major && this.minor == esobj.minor && this.revision == esobj.revision; - } - - @Override - public int hashCode() { - return this.raw.hashCode(); - } - - public boolean isNewerOrEqualThan(EsVersion v) { - if (this.equals(v)) { - return true; - } - return this.isNewerThan(v); - } - public boolean isNewerThan(EsVersion v) { - if (this.major > v.major) { - return true; - } else if (this.major < v.major) { - return false; - } - if (this.minor > v.minor) { - return true; - } else if (this.minor < v.minor) { - return false; - } - if (this.revision > v.revision) { - return true; - } - return false; - } - - public boolean isOlderOrEqualThan(EsVersion v) { - if (this.equals(v)) { - return true; - } - return this.isOlderThan(v); - } - - public boolean isOlderThan(EsVersion v) { - if (this.major < v.major) { - return true; - } else if (this.major > v.major) { - return false; - } - if (this.minor < v.minor) { - return true; - } else if (this.minor > v.minor) { - return false; - } - if (this.revision < v.revision) { - return true; - } - return false; - } - -} diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntry.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntry.java index b31ff4389..cc7fafb76 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntry.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntry.java @@ -29,7 +29,7 @@ import java.util.regex.Pattern; * @author Michael Dürre * * Entry of list indices http request (/_cat/indices) - * + * * yellow open inventoryequipment-v1 5nNPRbJ3T9arMxqxBbJKyQ 5 1 0 0 1.2kb 1.2kb */ public class IndicesEntry { @@ -93,6 +93,20 @@ public class IndicesEntry { return size2; } + protected IndicesEntry(String name, String status, String status2, String hash, int shards, int replicas, int c1, + int c2, String size1, String size2) { + this.name = name; + this.status = status; + this.status2 = status2; + this.hash = hash; + this.shards = shards; + this.replicas = replicas; + this.c1 = c1; + this.c2 = c2; + this.size1 = size1; + this.size2 = size2; + } + public IndicesEntry(String line) throws ParseException { Matcher matcher = pattern.matcher(line.trim()); if (!matcher.find() || matcher.groupCount() < 10) { diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/queries/QueryBuilder.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/queries/QueryBuilder.java index 519502efd..265c6f529 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/queries/QueryBuilder.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/queries/QueryBuilder.java @@ -100,4 +100,17 @@ public class QueryBuilder { public QueryBuilder aggregations(String key) { return this.aggregations(key, null); } + + public void doFullsizeRequest() { + this.setFullsizeRequest(true); + } + + public QueryBuilder setFullsizeRequest(boolean doFullsizeRequest) { + if (doFullsizeRequest) { + this.outerQuery.put("track_total_hits", doFullsizeRequest); + } else { + this.outerQuery.remove("track_total_hits"); + } + return this; + } } diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/GetInfoResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/GetInfoResponse.java index 946a8fb4a..79172e01c 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/GetInfoResponse.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/GetInfoResponse.java @@ -23,7 +23,7 @@ package org.onap.ccsdk.features.sdnr.wt.common.database.responses; import org.elasticsearch.client.Response; import org.json.JSONObject; -import org.onap.ccsdk.features.sdnr.wt.common.database.data.EsVersion; +import org.onap.ccsdk.features.sdnr.wt.common.database.data.DatabaseVersion; public class GetInfoResponse extends BaseResponse { @@ -37,7 +37,7 @@ public class GetInfoResponse extends BaseResponse { private final String clusterName; private final String name; - private final EsVersion version; + private final DatabaseVersion version; public GetInfoResponse(Response response) throws Exception { super(response); @@ -47,7 +47,7 @@ public class GetInfoResponse extends BaseResponse { } this.name = o.getString("name"); this.clusterName = o.getString("cluster_name"); - this.version = new EsVersion(o.getJSONObject("version").getString("number")); + this.version = new DatabaseVersion(o.getJSONObject("version").getString("number")); } public String getClusterName() { @@ -58,7 +58,7 @@ public class GetInfoResponse extends BaseResponse { return name; } - public EsVersion getVersion() { + public DatabaseVersion getVersion() { return version; } diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/file/PomFile.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/file/PomFile.java index c19cea08d..2e0701257 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/file/PomFile.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/file/PomFile.java @@ -41,8 +41,10 @@ public class PomFile { public PomFile(InputStream is) throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - // Remediate XML external entity vulnerabilty - prohibit the use of all protocols by external entities: - documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + // documentBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + // documentBuilderFactory.setFeature(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); + // documentBuilderFactory.setFeature(XMLInputFactory.SUPPORT_DTD, false); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); this.xmlDoc = documentBuilder.parse(is); } diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/http/BaseHTTPClient.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/http/BaseHTTPClient.java index ffb31c676..de878a5d5 100644 --- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/http/BaseHTTPClient.java +++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/http/BaseHTTPClient.java @@ -113,7 +113,12 @@ public class BaseHTTPClient { @Nonnull public BaseHTTPResponse sendRequest(String uri, String method, String body, Map headers) throws IOException { - return this.sendRequest(uri, method, body != null ? body.getBytes(CHARSET) : null, headers); + return this.sendRequest(uri, method, body != null ? body.getBytes(CHARSET) : null, headers, 0); + } + @Nonnull + public BaseHTTPResponse sendRequest(String uri, String method, String body, Map headers, int timeoutMs) + throws IOException { + return this.sendRequest(uri, method, body != null ? body.getBytes(CHARSET) : null, headers, timeoutMs); } public BaseHTTPResponse sendRequest(HttpServletRequest req) throws IOException { final String method = req.getMethod(); @@ -125,7 +130,7 @@ public class BaseHTTPClient { is.close(); } - return this.sendRequest(req.getRequestURI(), method, buffer,mapHeaders(req)); + return this.sendRequest(req.getRequestURI(), method, buffer,mapHeaders(req), 0); } private Map mapHeaders(HttpServletRequest req) { @@ -138,8 +143,10 @@ public class BaseHTTPClient { } return headers; } - - protected @Nonnull BaseHTTPResponse sendRequest(String uri, String method, byte[] body, Map headers) + protected @Nonnull BaseHTTPResponse sendRequest(String uri, String method, byte[] body, Map headers) throws IOException { + return this.sendRequest(uri, method, body, headers, 0); + } + protected @Nonnull BaseHTTPResponse sendRequest(String uri, String method, byte[] body, Map headers, int timeoutMs) throws IOException { if (uri == null) { uri = ""; @@ -156,7 +163,7 @@ public class BaseHTTPClient { LOG.trace("body:" + (body == null ? "null" : new String(body, CHARSET))); URL url = new URL(surl); URLConnection http = url.openConnection(); - http.setConnectTimeout(this.timeout); + http.setConnectTimeout(timeoutMs>0?timeoutMs:this.timeout); if (surl.toString().startsWith("https")) { if (sc != null) { ((HttpsURLConnection) http).setSSLSocketFactory(sc.getSocketFactory()); diff --git a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestEsData.java b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestEsData.java index 883d48ac1..c2471f58e 100644 --- a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestEsData.java +++ b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestEsData.java @@ -32,7 +32,7 @@ import java.text.ParseException; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.common.database.data.AliasesEntry; import org.onap.ccsdk.features.sdnr.wt.common.database.data.AliasesEntryList; -import org.onap.ccsdk.features.sdnr.wt.common.database.data.EsVersion; +import org.onap.ccsdk.features.sdnr.wt.common.database.data.DatabaseVersion; import org.onap.ccsdk.features.sdnr.wt.common.database.data.IndicesEntry; import org.onap.ccsdk.features.sdnr.wt.common.database.data.IndicesEntryList; @@ -45,9 +45,9 @@ public class TestEsData { @Test public void testVersion() { - EsVersion version = null; + DatabaseVersion version = null; try { - version = new EsVersion("2.3.4"); + version = new DatabaseVersion("2.3.4"); } catch (ParseException e) { fail(e.getMessage()); } @@ -56,8 +56,8 @@ public class TestEsData { assertEquals(3, version.getMinor()); assertEquals(4, version.getRevision()); - EsVersion versionNewer = new EsVersion(5, 0, 0); - EsVersion versionOlder = new EsVersion(2, 2, 0); + DatabaseVersion versionNewer = new DatabaseVersion(5, 0, 0); + DatabaseVersion versionOlder = new DatabaseVersion(2, 2, 0); assertTrue(version.isOlderOrEqualThan(versionNewer)); assertTrue(version.isNewerOrEqualThan(versionOlder)); -- cgit 1.2.3-korg