diff options
author | Rama-Huawei <rama.subba.reddy.s@huawei.com> | 2022-05-18 10:54:09 +0530 |
---|---|---|
committer | Rama-Huawei <rama.subba.reddy.s@huawei.com> | 2022-06-02 10:25:45 +0530 |
commit | 1e5a6e041efef87d43a182b54d4b01f4ae87355c (patch) | |
tree | f5dea5ee17a6768a5a9b9b1d1ba771294748395b /mod/genprocessor/src/main/java | |
parent | 95855b69835177954e185f171af2f0aea3b3d3f3 (diff) |
CodeCoverage improvement for dcaegen2-platform-mod-genprocessor
Issue-ID: DCAEGEN2-3169
Signed-off-by: Rama-Huawei <rama.subba.reddy.s@huawei.com>
Change-Id: Ia7d7cd62b0f07953edfeceebe0ab38398ed9bb85
Diffstat (limited to 'mod/genprocessor/src/main/java')
8 files changed, 22 insertions, 14 deletions
diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java index 9c50991..445291e 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/App.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2022 Huawei. 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. @@ -205,9 +206,7 @@ public class App { return true; } } - } catch (InterruptedException e) { - throw new RuntimeException("Error while creating jar", e); - } catch (IOException e) { + } catch (InterruptedException | IOException e) { throw new RuntimeException("Error while creating jar", e); } @@ -315,11 +314,11 @@ public class App { String sleepstr = System.getenv("GENPROC_SLEEP_SEC"); long sleepdur = (sleepstr != null)? 1000 * Long.parseLong(sleepstr): 0; do { - try { - main2(args); - } catch (Exception e) { - LOG.error(e.toString(), e); - } + try { + main2(args); + } catch (Exception e) { + LOG.error(e.toString(), e); + } Thread.sleep(sleepdur); } while (sleepdur > 0); return; @@ -401,3 +400,4 @@ public class App { } } } + diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/Comp.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/Comp.java index 69d8776..458f4df 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/Comp.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/Comp.java @@ -32,4 +32,5 @@ public class Comp { @JsonProperty("selfUrl") public String selfUrl; -}
\ No newline at end of file +} + diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/CompList.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/CompList.java index fcf25b4..ae15ded 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/CompList.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/CompList.java @@ -68,3 +68,4 @@ public class CompList { public List<CompShort> components; } + diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/CompSpec.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/CompSpec.java index 34b7398..41e7aa5 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/CompSpec.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/CompSpec.java @@ -142,3 +142,4 @@ public class CompSpec { } } + diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/DCAEProcessor.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/DCAEProcessor.java index b920b90..72c0714 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/DCAEProcessor.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/DCAEProcessor.java @@ -89,4 +89,5 @@ public abstract class DCAEProcessor extends AbstractProcessor { return this.relationships; } -}
\ No newline at end of file +} + diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/OnboardingAPIClient.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/OnboardingAPIClient.java index 12c3726..85032f7 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/OnboardingAPIClient.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/OnboardingAPIClient.java @@ -62,4 +62,5 @@ public class OnboardingAPIClient { } } -}
\ No newline at end of file +} + diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/ProcessorBuilder.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/ProcessorBuilder.java index ca87bda..8d7be7d 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/ProcessorBuilder.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/ProcessorBuilder.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2022 Huawei. 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. @@ -112,7 +113,7 @@ public class ProcessorBuilder { ccFile.addAttribute(attr); } - private static void addMethod(CtClass target, String methodCode) { + public static void addMethod(CtClass target, String methodCode) { try { CtMethod method = CtMethod.make(methodCode, target); target.addMethod(method); @@ -192,4 +193,5 @@ public class ProcessorBuilder { addMethod(target, createCodeRelationships(compSpec)); } -}
\ No newline at end of file +} + diff --git a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/Utils.java b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/Utils.java index 9a7c50a..8dbc062 100644 --- a/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/Utils.java +++ b/mod/genprocessor/src/main/java/org/onap/dcae/genprocessor/Utils.java @@ -41,4 +41,5 @@ public class Utils { return String.format("%s-%s", compSpec.name, compSpec.version); } -}
\ No newline at end of file +} + |