diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2017-08-07 12:30:35 +0800 |
---|---|---|
committer | Guangrong Fu <fu.guangrong@zte.com.cn> | 2017-08-07 12:41:11 +0800 |
commit | 20a1514bf93035472d4f940f00a357106d4bec1f (patch) | |
tree | 53c8e874f204f4b5ac7e64cbfdf783dbd2e9e019 /rulemgt | |
parent | 40f54b8acefce59ecbd9e9fde60e062373243982 (diff) |
Change the groupid from openo to onap
Change the groupid and package paths to onap.
Change-Id: I8432e9ac2c979bbc36e10e6a702c6f04fc41446a
Issue-ID: HOLMES-7
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'rulemgt')
-rw-r--r-- | rulemgt/pom.xml | 18 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/RuleActiveApp.java) | 14 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAppConfig.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/RuleAppConfig.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4Engine.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4Engine.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4Engine.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4Engine.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequest.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequest.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequest.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleQueryCondition.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleQueryCondition.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequest.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponse.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponse.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponse.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponse.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleResult4API.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleResult4API.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java) | 10 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java) | 33 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/constant/RuleMgtConstant.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/constant/RuleMgtConstant.java) | 4 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleDao.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleDao.java) | 19 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDao.java) | 19 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapper.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapper.java) | 4 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/RuleMgtResources.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/resources/RuleMgtResources.java) | 51 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java (renamed from rulemgt/src/main/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapper.java) | 53 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleActiveAppTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleActiveAppTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleAppConfigTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleAppConfigTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequestTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleQueryConditionTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleQueryConditionTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleResult4APITest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleResult4APITest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java) | 4 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java) | 21 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java) | 15 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java) | 2 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/resources/RuleMgtResourcesTest.java) | 18 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java (renamed from rulemgt/src/test/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java) | 59 |
39 files changed, 184 insertions, 206 deletions
diff --git a/rulemgt/pom.xml b/rulemgt/pom.xml index e4af4c6..a4e1388 100644 --- a/rulemgt/pom.xml +++ b/rulemgt/pom.xml @@ -19,9 +19,9 @@ <modelVersion>4.0.0</modelVersion> <parent> - <groupId>org.openo.holmes.rule-management</groupId> + <groupId>org.onap.holmes.rule-management</groupId> <artifactId>holmes-rulemgt-parent</artifactId> - <version>1.1.0-SNAPSHOT</version> + <version>1.0.0-SNAPSHOT</version> </parent> <artifactId>holmes-rulemgt</artifactId> @@ -31,8 +31,9 @@ <dependencies> <dependency> - <groupId>org.openo.holmes.actions</groupId> + <groupId>org.onap.holmes.common</groupId> <artifactId>holmes-actions</artifactId> + <version>1.0.0-SNAPSHOT</version> <exclusions> <exclusion> <groupId>org.glassfish.jersey.containers</groupId> @@ -45,11 +46,6 @@ </exclusions> </dependency> <dependency> - <groupId>org.glassfish.jersey.containers</groupId> - <artifactId>jersey-container-servlet-core</artifactId> - <version>2.22.2</version> - </dependency> - <dependency> <groupId>org.easymock</groupId> <artifactId>easymock</artifactId> </dependency> @@ -104,10 +100,6 @@ <artifactId>slf4j-api</artifactId> </dependency> <dependency> - <groupId>org.openo.client.cli</groupId> - <artifactId>swagger-sdk</artifactId> - </dependency> - <dependency> <groupId>io.swagger</groupId> <artifactId>swagger-jersey2-jaxrs</artifactId> <scope>provided</scope> @@ -241,7 +233,7 @@ implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> - <mainClass>org.openo.holmes.rulemgt.RuleActiveApp</mainClass> + <mainClass>org.onap.holmes.rulemgt.RuleActiveApp</mainClass> </transformer> </transformers> </configuration> diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/RuleActiveApp.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java index 96a1f00..8dc697c 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/RuleActiveApp.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java @@ -14,18 +14,18 @@ * limitations under the License. */ -package org.openo.holmes.rulemgt; +package org.onap.holmes.rulemgt; import io.dropwizard.setup.Environment; import java.io.IOException; import lombok.extern.slf4j.Slf4j; -import org.openo.dropwizard.ioc.bundle.IOCApplication; -import org.openo.holmes.common.api.entity.ServiceRegisterEntity; -import org.openo.holmes.common.config.MicroServiceConfig; -import org.openo.holmes.common.utils.MSBRegisterUtil; +import org.onap.holmes.common.dropwizard.ioc.bundle.IOCApplication; +import org.onap.holmes.common.api.entity.ServiceRegisterEntity; +import org.onap.holmes.common.config.MicroServiceConfig; +import org.onap.holmes.common.utils.MSBRegisterUtil; @Slf4j -public class RuleActiveApp extends IOCApplication < RuleAppConfig > { +public class RuleActiveApp extends IOCApplication< RuleAppConfig > { public static void main( String[] args ) throws Exception { new RuleActiveApp().run( args ); @@ -53,7 +53,7 @@ public class RuleActiveApp extends IOCApplication < RuleAppConfig > { serviceRegisterEntity.setServiceName("holmes-rule-mgmt"); serviceRegisterEntity.setProtocol("REST"); serviceRegisterEntity.setVersion("v1"); - serviceRegisterEntity.setUrl("/openoapi/holmes-rule-mgmt/v1"); + serviceRegisterEntity.setUrl("/onapapi/holmes-rule-mgmt/v1"); serviceRegisterEntity.setSingleNode(MicroServiceConfig.getServiceIp(), "9101", 0); serviceRegisterEntity.setVisualRange("1|0"); return serviceRegisterEntity; diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/RuleAppConfig.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAppConfig.java index 4fcb486..20f96c2 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/RuleAppConfig.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAppConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.openo.holmes.rulemgt; +package org.onap.holmes.rulemgt; import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.Configuration; diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4Engine.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4Engine.java index 1475ce9..c36fce7 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4Engine.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4Engine.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import lombok.Getter;
import lombok.Setter;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4Engine.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4Engine.java index 3ed4c4d..7c94395 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4Engine.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4Engine.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequest.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequest.java index 463eb2a..e79cc62 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequest.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import lombok.Getter;
import lombok.Setter;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequest.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequest.java index 9407b99..f090c3b 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequest.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequest.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequest.java index ac9d795..7cc4fff 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequest.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleQueryCondition.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleQueryCondition.java index c68b40d..f3b9b91 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleQueryCondition.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleQueryCondition.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequest.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequest.java index 6ce265a..e2811e3 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequest.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponse.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponse.java index e5597b8..7fe432e 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponse.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponse.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponse.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponse.java index a720eca..17903ab 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponse.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponse.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleResult4API.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleResult4API.java index ee948d0..c444b22 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bean/response/RuleResult4API.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bean/response/RuleResult4API.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java index e792fbf..f3e8d5c 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bolt.enginebolt;
+package org.onap.holmes.rulemgt.bolt.enginebolt;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
@@ -26,10 +26,10 @@ import javax.ws.rs.core.Response; import lombok.extern.slf4j.Slf4j;
import org.glassfish.jersey.client.ClientConfig;
import org.jvnet.hk2.annotations.Service;
-import org.openo.holmes.common.config.MicroServiceConfig;
-import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
-import org.openo.holmes.rulemgt.constant.RuleMgtConstant;
+import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.constant.RuleMgtConstant;
+import org.onap.holmes.common.config.MicroServiceConfig;
@Slf4j
@Service
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java index 8e9055b..733cae0 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java @@ -13,18 +13,17 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.bolt.enginebolt;
+package org.onap.holmes.rulemgt.bolt.enginebolt;
import javax.inject.Inject;
import javax.ws.rs.core.Response;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.jvnet.hk2.annotations.Service;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
-import org.openo.holmes.rulemgt.constant.RuleMgtConstant;
+import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.constant.RuleMgtConstant;
+import org.onap.holmes.common.exception.CorrelationException;
@Service
@Slf4j
@@ -38,18 +37,18 @@ public class EngineWrapper { try {
response = engineService.deploy(correlationRule);
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CALL_DEPLOY_RULE_REST_FAILED, e);
+ throw new CorrelationException("Failed to call the rule deployment RESTful API.", e);
}
if (response.getStatus() == RuleMgtConstant.RESPONSE_STATUS_OK) {
- log.info("Call deploy rule rest interface in engine successfully.");
+ log.info("Succeeded in calling the rule deployment RESTful API from the engine management service.");
try {
JSONObject json = JSONObject.fromObject(response.readEntity(String.class));
return json.get(RuleMgtConstant.PACKAGE).toString();
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_PARSE_DEPLOY_RESULT_ERROR, e);
+ throw new CorrelationException("Failed to parse the value returned by the engine management service.", e);
}
} else {
- throw new CorrelationException(I18nProxy.ENGINE_DEPLOY_RULE_FAILED);
+ throw new CorrelationException("Failed to deploy the rule!");
}
}
@@ -58,31 +57,31 @@ public class EngineWrapper { try {
response = engineService.delete(packageName);
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CALL_DELETE_RULE_REST_FAILED, e);
+ throw new CorrelationException("Failed to call the rule deleting RESTful API.", e);
}
if (response.getStatus() == RuleMgtConstant.RESPONSE_STATUS_OK) {
- log.info("Call delete rule rest interface in engine successfully.");
+ log.info("Succeeded in calling the rule deleting RESTful API from the engine management service.");
return true;
} else {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_DELETE_RULE_FAILED);
+ throw new CorrelationException("Failed to delete the rule!");
}
}
public boolean checkRuleFromEngine(CorrelationCheckRule4Engine correlationCheckRule4Engine)
throws CorrelationException {
- log.info("content:" + correlationCheckRule4Engine.getContent());
+ log.info("Rule Contents: " + correlationCheckRule4Engine.getContent());
Response response;
try {
response = engineService.check(correlationCheckRule4Engine);
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CALL_CHECK_RULE_REST_FAILED, e);
+ throw new CorrelationException("Failed to call the rule verification RESTful API.", e);
}
if (response.getStatus() == RuleMgtConstant.RESPONSE_STATUS_OK) {
- log.info("Call check rule rest interface in engine successfully.");
+ log.info("Succeeded in calling the rule verification RESTful API from the engine management service.");
return true;
} else {
log.info(response.getStatus() + " " + response.getStatusInfo() + " " + response.getEntity());
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CHECK_NO_PASS);
+ throw new CorrelationException("Failed to verify the rule. The contents of the rule are invalid.");
}
}
}
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/constant/RuleMgtConstant.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/constant/RuleMgtConstant.java index a9b891a..debfb05 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/constant/RuleMgtConstant.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/constant/RuleMgtConstant.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.constant;
+package org.onap.holmes.rulemgt.constant;
public class RuleMgtConstant {
@@ -24,6 +24,6 @@ public class RuleMgtConstant { public static final int STATUS_RULE_CLOSE = 0;
public static final int STATUS_RULE_ALL = 2;
public static final String PACKAGE = "package";
- public static final String ENGINE_PATH = "/openoapi/holmes-engine-mgmt/v1/rule";
+ public static final String ENGINE_PATH = "/onapapi/holmes-engine-mgmt/v1/rule";
public static final int RESPONSE_STATUS_OK = 200;
}
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleDao.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleDao.java index 3a7f300..2a422c4 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleDao.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleDao.java @@ -13,13 +13,12 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.db;
+package org.onap.holmes.rulemgt.db;
import java.util.List;
-import org.openo.holmes.common.api.entity.CorrelationRule;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.db.mapper.CorrelationRuleMapper;
+import org.onap.holmes.common.api.entity.CorrelationRule;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.rulemgt.db.mapper.CorrelationRuleMapper;
import org.skife.jdbi.v2.sqlobject.Bind;
import org.skife.jdbi.v2.sqlobject.BindBean;
import org.skife.jdbi.v2.sqlobject.GetGeneratedKeys;
@@ -67,7 +66,7 @@ public abstract class CorrelationRuleDao { addRule(correlationRule);
return correlationRule;
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_DB_ERROR,e);
+ throw new CorrelationException("Can not access the database. Please contact the administrator for help.", e);
}
}
@@ -75,7 +74,7 @@ public abstract class CorrelationRuleDao { try {
updateRuleByRid(correlationRule);
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_DB_ERROR,e);
+ throw new CorrelationException("Can not access the database. Please contact the administrator for help.", e);
}
}
@@ -83,7 +82,7 @@ public abstract class CorrelationRuleDao { try {
deleteRule2DbInner(correlationRule);
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_DB_ERROR,e);
+ throw new CorrelationException("Can not access the database. Please contact the administrator for help.", e);
}
}
@@ -92,7 +91,7 @@ public abstract class CorrelationRuleDao { try {
return queryRuleById(rid);
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_DB_ERROR,e);
+ throw new CorrelationException("Can not access the database. Please contact the administrator for help.", e);
}
}
@@ -100,7 +99,7 @@ public abstract class CorrelationRuleDao { try {
return queryRuleByName(name);
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_DB_ERROR,e);
+ throw new CorrelationException("Can not access the database. Please contact the administrator for help.", e);
}
}
}
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDao.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java index 487684e..322006d 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDao.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.db;
+package org.onap.holmes.rulemgt.db;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
@@ -26,12 +26,11 @@ import java.util.Properties; import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import org.jvnet.hk2.annotations.Service;
-import org.openo.holmes.common.api.entity.CorrelationRule;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.DbDaoUtil;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
-import org.openo.holmes.rulemgt.constant.RuleMgtConstant;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.rulemgt.constant.RuleMgtConstant;
+import org.onap.holmes.common.api.entity.CorrelationRule;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.common.utils.DbDaoUtil;
import org.skife.jdbi.v2.Handle;
import org.skife.jdbi.v2.Query;
@@ -57,8 +56,8 @@ public class CorrelationRuleQueryDao { }
return correlationRules;
} catch (Exception e) {
- log.warn("Query rule: rule id =" + ruleQueryCondition.getRid() + " failed");
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_QUERY_RULE_FAILED, e);
+ log.warn("Failed to query the rule: id =" + ruleQueryCondition.getRid() + ".");
+ throw new CorrelationException("Failed to query the rule.", e);
} finally {
dbDaoUtil.close(handle);
}
@@ -123,7 +122,7 @@ public class CorrelationRuleQueryDao { }
return "";
} catch (Exception e) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CREATE_QUERY_SQL_FAILED, e);
+ throw new CorrelationException("An error occurred while building the query SQL.", e);
}
}
}
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapper.java index 437e0dd..d40253f 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapper.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapper.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.db.mapper;
+package org.onap.holmes.rulemgt.db.mapper;
-import org.openo.holmes.common.api.entity.CorrelationRule;
+import org.onap.holmes.common.api.entity.CorrelationRule;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultSetMapper;
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/resources/RuleMgtResources.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/RuleMgtResources.java index f3256b2..04578f7 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/resources/RuleMgtResources.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/resources/RuleMgtResources.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.resources;
+package org.onap.holmes.rulemgt.resources;
import com.codahale.metrics.annotation.Timed;
import io.swagger.annotations.Api;
@@ -22,7 +22,6 @@ import io.swagger.annotations.ApiParam; import io.swagger.annotations.SwaggerDefinition;
import java.io.IOException;
import java.util.Locale;
-import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.DELETE;
@@ -37,23 +36,22 @@ import javax.ws.rs.core.MediaType; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.jvnet.hk2.annotations.Service;
-import org.openo.holmes.common.api.entity.ServiceRegisterEntity;
-import org.openo.holmes.common.config.MicroServiceConfig;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.ExceptionUtil;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.common.utils.JacksonUtil;
-import org.openo.holmes.common.utils.LanguageUtil;
-import org.openo.holmes.common.utils.MSBRegisterUtil;
-import org.openo.holmes.common.utils.UserUtil;
-import org.openo.holmes.rulemgt.bean.request.RuleCreateRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleDeleteRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
-import org.openo.holmes.rulemgt.bean.request.RuleUpdateRequest;
-import org.openo.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
-import org.openo.holmes.rulemgt.bean.response.RuleQueryListResponse;
-import org.openo.holmes.rulemgt.constant.RuleMgtConstant;
-import org.openo.holmes.rulemgt.wrapper.RuleMgtWrapper;
+import org.onap.holmes.common.api.entity.ServiceRegisterEntity;
+import org.onap.holmes.common.config.MicroServiceConfig;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.common.utils.ExceptionUtil;
+import org.onap.holmes.common.utils.JacksonUtil;
+import org.onap.holmes.common.utils.LanguageUtil;
+import org.onap.holmes.common.utils.MSBRegisterUtil;
+import org.onap.holmes.common.utils.UserUtil;
+import org.onap.holmes.rulemgt.bean.request.RuleCreateRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleDeleteRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.rulemgt.bean.request.RuleUpdateRequest;
+import org.onap.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
+import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;
+import org.onap.holmes.rulemgt.constant.RuleMgtConstant;
+import org.onap.holmes.rulemgt.wrapper.RuleMgtWrapper;
@Service
@SwaggerDefinition
@@ -81,8 +79,7 @@ public class RuleMgtResources { return ruleChangeResponse;
} catch (CorrelationException e) {
log.error("create rule:" + ruleCreateRequest.getRuleName() + " failed", e);
- throw ExceptionUtil.buildExceptionResponse(I18nProxy.getInstance().getValue(locale,
- e.getMessage()));
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
}
}
@@ -100,8 +97,7 @@ public class RuleMgtResources { return ruleChangeResponse;
} catch (CorrelationException e) {
log.error("update rule:" + ruleUpdateRequest.getContent() + " failed", e);
- throw ExceptionUtil.buildExceptionResponse(I18nProxy.getInstance().getValue(locale,
- e.getMessage()));
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
}
}
@@ -118,8 +114,7 @@ public class RuleMgtResources { return true;
} catch (CorrelationException e) {
log.error("delete rule:" + ruleDeleteRequest.getRuleId() + " failed", e);
- throw ExceptionUtil.buildExceptionResponse(I18nProxy.getInstance().getValue(locale,
- e.getMessage()));
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
}
}
@@ -142,8 +137,7 @@ public class RuleMgtResources { return ruleQueryListResponse;
} catch (CorrelationException e) {
log.error("query rule failed,cause query condition conversion failure", e);
- throw ExceptionUtil.buildExceptionResponse(I18nProxy.getInstance().getValue(locale,
- e.getMessage()));
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
}
}
@@ -161,8 +155,7 @@ public class RuleMgtResources { return ruleQueryCondition;
} catch (IOException e) {
log.warn("queryRequest convert to json failed", e);
- throw ExceptionUtil.buildExceptionResponse(I18nProxy.getInstance().getValue(locale,
- I18nProxy.RULE_MANAGEMENT_DATA_FORMAT_ERROR));
+ throw ExceptionUtil.buildExceptionResponse("The request format is invalid!");
}
}
}
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java index 58d461f..beffa56 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapper.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.openo.holmes.rulemgt.wrapper;
+package org.onap.holmes.rulemgt.wrapper;
import java.util.ArrayList;
import java.util.Date;
@@ -23,23 +23,22 @@ import javax.inject.Inject; import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import org.jvnet.hk2.annotations.Service;
-import org.openo.holmes.common.api.entity.CorrelationRule;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.DbDaoUtil;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.RuleCreateRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleDeleteRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
-import org.openo.holmes.rulemgt.bean.request.RuleUpdateRequest;
-import org.openo.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
-import org.openo.holmes.rulemgt.bean.response.RuleQueryListResponse;
-import org.openo.holmes.rulemgt.bean.response.RuleResult4API;
-import org.openo.holmes.rulemgt.bolt.enginebolt.EngineWrapper;
-import org.openo.holmes.rulemgt.constant.RuleMgtConstant;
-import org.openo.holmes.rulemgt.db.CorrelationRuleDao;
-import org.openo.holmes.rulemgt.db.CorrelationRuleQueryDao;
+import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
+import org.onap.holmes.rulemgt.bean.response.RuleResult4API;
+import org.onap.holmes.rulemgt.constant.RuleMgtConstant;
+import org.onap.holmes.rulemgt.db.CorrelationRuleDao;
+import org.onap.holmes.common.api.entity.CorrelationRule;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.common.utils.DbDaoUtil;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.RuleCreateRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleDeleteRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.rulemgt.bean.request.RuleUpdateRequest;
+import org.onap.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
+import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;
+import org.onap.holmes.rulemgt.bolt.enginebolt.EngineWrapper;
+import org.onap.holmes.rulemgt.db.CorrelationRuleQueryDao;
@Service
@@ -64,14 +63,14 @@ public class RuleMgtWrapper { public RuleAddAndUpdateResponse addCorrelationRule(String creator, RuleCreateRequest ruleCreateRequest)
throws CorrelationException {
if (ruleCreateRequest == null) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY);
+ throw new CorrelationException("The request object can not be empty!");
}
CorrelationRule correlationRule = convertCreateRequest2Rule(creator,
ruleCreateRequest);
checkCorrelation(correlationRule);
CorrelationRule ruleTemp = correlationRuleDao.queryRuleByRuleName(correlationRule.getName());
if (ruleTemp != null) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_REPEAT_RULE_NAME);
+ throw new CorrelationException("A rule with the same name already exists.");
}
correlationRule.setPackageName(deployRule2Engine(correlationRule));
CorrelationRule result = correlationRuleDao.saveRule(correlationRule);
@@ -83,11 +82,11 @@ public class RuleMgtWrapper { public RuleAddAndUpdateResponse updateCorrelationRule(String modifier, RuleUpdateRequest ruleUpdateRequest)
throws CorrelationException {
if (ruleUpdateRequest == null) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY);
+ throw new CorrelationException("The request object can not be empty!");
}
CorrelationRule oldCorrelationRule = correlationRuleDao.queryRuleByRid(ruleUpdateRequest.getRuleId());
if (oldCorrelationRule == null) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_RULE_NOT_EXIST_DATABASE);
+ throw new CorrelationException("You're trying to update a rule which does not exist in the system.");
}
CorrelationRule newCorrelationRule = convertRuleUpdateRequest2CorrelationRule(modifier,
ruleUpdateRequest, oldCorrelationRule.getName());
@@ -110,14 +109,14 @@ public class RuleMgtWrapper { String ruleName = correlationRule.getName() == null ? "" : correlationRule.getName().trim();
String content = correlationRule.getContent() == null ? "" : correlationRule.getContent().trim();
if ("".equals(content)) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CONTENT_CANNOT_BE_EMPTY);
+ throw new CorrelationException("The contents of the rule can not be empty!");
}
if (enabled != RuleMgtConstant.STATUS_RULE_CLOSE
&& enabled != RuleMgtConstant.STATUS_RULE_OPEN) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR);
+ throw new CorrelationException("Invalid rule status. Only 0 (disabled) and 1 (enabled) are allowed.");
}
if ("".equals(ruleName)) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_RULE_NAME_CANNOT_BE_EMPTY);
+ throw new CorrelationException("The name of the rule can not be empty.");
}
}
@@ -137,12 +136,12 @@ public class RuleMgtWrapper { public void deleteCorrelationRule(RuleDeleteRequest ruleDeleteRequest)
throws CorrelationException {
if (ruleDeleteRequest == null) {
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY);
+ throw new CorrelationException("The request object can not be empty!");
}
CorrelationRule correlationRule = correlationRuleDao.queryRuleByRid(ruleDeleteRequest.getRuleId());
if (correlationRule == null) {
log.warn("the rule:rule id=" + ruleDeleteRequest.getRuleId() + " does not exist the database.");
- throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_RULE_NOT_EXIST_DATABASE);
+ throw new CorrelationException("You're trying to delete a rule which does not exist in the system.");
}
if (correlationRule.getEnabled() == RuleMgtConstant.STATUS_RULE_OPEN) {
engineWarpper.deleteRuleFromEngine(correlationRule.getPackageName());
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleActiveAppTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleActiveAppTest.java index 4f35b94..cd79ae8 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleActiveAppTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleActiveAppTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openo.holmes.rulemgt; +package org.onap.holmes.rulemgt; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleAppConfigTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleAppConfigTest.java index d14e55e..d411603 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/RuleAppConfigTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/RuleAppConfigTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt;
+package org.onap.holmes.rulemgt;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNull.notNullValue;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java index 59e020c..e292e16 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationCheckRule4EngineTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.*;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java index 8a9b8ec..418ff41 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationDeployRule4EngineTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.junit.Assert.*;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java index 5f3c5c1..e616a71 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/CorrelationRestRequestTest.java @@ -15,7 +15,7 @@ */
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequestTest.java index 3f5469d..54fa132 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleCreateRequestTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleCreateRequestTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java index f9a09ff..3d49b2f 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleDeleteRequestTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.*;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleQueryConditionTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleQueryConditionTest.java index 8bb5b8b..36d5024 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleQueryConditionTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleQueryConditionTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java index 4cd4744..9f24c0c 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/request/RuleUpdateRequestTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.request;
+package org.onap.holmes.rulemgt.bean.request;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java index 82731d6..a7db0fe 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleAddAndUpdateResponseTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import static org.junit.Assert.*;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java index c6e0a7e..fa423db 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleQueryListResponseTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleResult4APITest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleResult4APITest.java index 3af245e..2c006ab 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bean/response/RuleResult4APITest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bean/response/RuleResult4APITest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bean.response;
+package org.onap.holmes.rulemgt.bean.response;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java index f4275eb..b3cb93d 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java @@ -15,7 +15,7 @@ */
-package org.openo.holmes.rulemgt.bolt.enginebolt;
+package org.onap.holmes.rulemgt.bolt.enginebolt;
import org.apache.http.HttpResponse;
@@ -25,7 +25,7 @@ import org.apache.http.impl.client.HttpClients; import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.rule.PowerMockRule;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java index 38afa47..b63b106 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineWrapperTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.bolt.enginebolt;
+package org.onap.holmes.rulemgt.bolt.enginebolt;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -27,10 +27,9 @@ import org.junit.Before; import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.common.exception.CorrelationException;
import org.powermock.api.easymock.PowerMock;
import org.powermock.reflect.Whitebox;
@@ -54,7 +53,7 @@ public class EngineWrapperTest { @Test
public void deployEngine_invoke_rule_deploy_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CALL_DEPLOY_RULE_REST_FAILED);
+ thrown.expectMessage("Failed to call the rule deployment RESTful API.");
EasyMock.expect(engineServiceMock.deploy(EasyMock.anyObject(CorrelationDeployRule4Engine.class))).andThrow(
new RuntimeException(""));
@@ -68,7 +67,7 @@ public class EngineWrapperTest { @Test
public void deployEngine_http_status_not_ok() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.ENGINE_DEPLOY_RULE_FAILED);
+ thrown.expectMessage("Failed to deploy the rule!");
EasyMock.expect(engineServiceMock.deploy(EasyMock.anyObject(CorrelationDeployRule4Engine.class)))
.andReturn(response);
@@ -85,7 +84,7 @@ public class EngineWrapperTest { String content = "";
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_PARSE_DEPLOY_RESULT_ERROR);
+ thrown.expectMessage("Failed to parse the value returned by the engine management service.");
EasyMock.expect(engineServiceMock.deploy(EasyMock.anyObject(CorrelationDeployRule4Engine.class)))
.andReturn(response);
EasyMock.expect(response.getStatus()).andReturn(200);
@@ -115,7 +114,7 @@ public class EngineWrapperTest { @Test
public void deleteRuleFromEngine_invoke_rule_delete_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CALL_DELETE_RULE_REST_FAILED);
+ thrown.expectMessage("Failed to call the rule deleting RESTful API.");
EasyMock.expect(engineServiceMock.delete(EasyMock.anyObject(String.class))).andThrow(
new RuntimeException(""));
@@ -129,7 +128,7 @@ public class EngineWrapperTest { @Test
public void deleteRuleFromEngine_http_status_not_ok() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_DELETE_RULE_FAILED);
+ thrown.expectMessage("Failed to delete the rule!");
EasyMock.expect(engineServiceMock.delete(EasyMock.anyObject(String.class)))
.andReturn(response);
@@ -158,7 +157,7 @@ public class EngineWrapperTest { @Test
public void checkRuleFromEngine_rule_delete_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CALL_CHECK_RULE_REST_FAILED);
+ thrown.expectMessage("Failed to call the rule verification RESTful API.");
EasyMock.expect(engineServiceMock.check(EasyMock.anyObject(CorrelationCheckRule4Engine.class))).andThrow(
new RuntimeException(""));
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java index f241484..3854cdc 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDaoTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.db;
+package org.onap.holmes.rulemgt.db;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@@ -30,11 +30,10 @@ import org.junit.Before; import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.openo.holmes.common.api.entity.CorrelationRule;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.DbDaoUtil;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.common.api.entity.CorrelationRule;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.common.utils.DbDaoUtil;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
import org.powermock.api.easymock.PowerMock;
import org.powermock.modules.junit4.rule.PowerMockRule;
import org.powermock.reflect.Whitebox;
@@ -76,7 +75,7 @@ public class CorrelationRuleQueryDaoTest { public void getCorrelationRulesByCondition_db_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_QUERY_RULE_FAILED);
+ thrown.expectMessage("Failed to query the rule.");
EasyMock.expect(dbDaoUtil.getHandle()).andReturn(handle);
EasyMock.expect(handle.createQuery(EasyMock.anyObject(String.class))).andReturn(query);
@@ -110,7 +109,7 @@ public class CorrelationRuleQueryDaoTest { @Test
public void getCorrelationRulesByCondition_get_where_sql_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CREATE_QUERY_SQL_FAILED);
+ thrown.expectMessage("An error occurred while building the query SQL.");
EasyMock.expect(dbDaoUtil.getHandle()).andReturn(handle);
EasyMock.expect(handle.createQuery(EasyMock.anyObject(String.class))).andReturn(query);
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java index 65a53dd..bcf56ca 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/db/mapper/CorrelationRuleMapperTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.db.mapper;
+package org.onap.holmes.rulemgt.db.mapper;
import static org.easymock.EasyMock.expect;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/resources/RuleMgtResourcesTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java index 16a547b..dd68ad8 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/resources/RuleMgtResourcesTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/resources/RuleMgtResourcesTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.resources;
+package org.onap.holmes.rulemgt.resources;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.WebApplicationException;
@@ -24,14 +24,14 @@ import org.junit.Before; import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.rulemgt.bean.request.RuleCreateRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleDeleteRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
-import org.openo.holmes.rulemgt.bean.request.RuleUpdateRequest;
-import org.openo.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
-import org.openo.holmes.rulemgt.bean.response.RuleQueryListResponse;
-import org.openo.holmes.rulemgt.wrapper.RuleMgtWrapper;
+import org.onap.holmes.rulemgt.bean.request.RuleCreateRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleDeleteRequest;
+import org.onap.holmes.rulemgt.wrapper.RuleMgtWrapper;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.rulemgt.bean.request.RuleUpdateRequest;
+import org.onap.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
+import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;
import org.powermock.api.easymock.PowerMock;
import org.powermock.reflect.Whitebox;
diff --git a/rulemgt/src/test/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java index f6d0544..0c81b98 100644 --- a/rulemgt/src/test/java/org/openo/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java +++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapperTest.java @@ -14,7 +14,7 @@ * limitations under the License.
*/
-package org.openo.holmes.rulemgt.wrapper;
+package org.onap.holmes.rulemgt.wrapper;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
@@ -29,21 +29,20 @@ import org.junit.Rule; import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
-import org.openo.holmes.common.api.entity.CorrelationRule;
-import org.openo.holmes.common.exception.CorrelationException;
-import org.openo.holmes.common.utils.DbDaoUtil;
-import org.openo.holmes.common.utils.I18nProxy;
-import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
-import org.openo.holmes.rulemgt.bean.request.RuleCreateRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleDeleteRequest;
-import org.openo.holmes.rulemgt.bean.request.RuleQueryCondition;
-import org.openo.holmes.rulemgt.bean.request.RuleUpdateRequest;
-import org.openo.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
-import org.openo.holmes.rulemgt.bean.response.RuleQueryListResponse;
-import org.openo.holmes.rulemgt.bolt.enginebolt.EngineWrapper;
-import org.openo.holmes.rulemgt.db.CorrelationRuleDao;
-import org.openo.holmes.rulemgt.db.CorrelationRuleQueryDao;
+import org.onap.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
+import org.onap.holmes.rulemgt.db.CorrelationRuleDao;
+import org.onap.holmes.common.api.entity.CorrelationRule;
+import org.onap.holmes.common.exception.CorrelationException;
+import org.onap.holmes.common.utils.DbDaoUtil;
+import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
+import org.onap.holmes.rulemgt.bean.request.RuleCreateRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleDeleteRequest;
+import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;
+import org.onap.holmes.rulemgt.bean.request.RuleUpdateRequest;
+import org.onap.holmes.rulemgt.bean.response.RuleAddAndUpdateResponse;
+import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;
+import org.onap.holmes.rulemgt.bolt.enginebolt.EngineWrapper;
+import org.onap.holmes.rulemgt.db.CorrelationRuleQueryDao;
import org.powermock.api.easymock.PowerMock;
import org.powermock.modules.junit4.rule.PowerMockRule;
import org.powermock.reflect.Whitebox;
@@ -93,7 +92,7 @@ public class RuleMgtWrapperTest { @Test
public void addCorrelationRule_name_is_null() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_RULE_NAME_CANNOT_BE_EMPTY);
+ thrown.expectMessage("The name of the rule can not be empty.");
ruleMgtWrapper.addCorrelationRule(USER_NAME, createRuleCreateRequest(null, "This is a rule for testing.",
"Mocked contents.", 0));
@@ -102,7 +101,7 @@ public class RuleMgtWrapperTest { @Test
public void addCorrelationRule_request_null() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY));
+ thrown.expectMessage("The request object can not be empty!");
ruleMgtWrapper.addCorrelationRule(USER_NAME, null);
}
@@ -110,7 +109,7 @@ public class RuleMgtWrapperTest { @Test
public void addCorrelationRule_name_is_empty() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_RULE_NAME_CANNOT_BE_EMPTY);
+ thrown.expectMessage("The name of the rule can not be empty.");
ruleMgtWrapper.addCorrelationRule("admin", createRuleCreateRequest("", "This is a rule for testing.",
"Mocked contents.", 0));
@@ -119,7 +118,7 @@ public class RuleMgtWrapperTest { @Test
public void addCorrelationRule_content_is_empty() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_CONTENT_CANNOT_BE_EMPTY);
+ thrown.expectMessage("The contents of the rule can not be empty!");
ruleMgtWrapper.addCorrelationRule("admin", createRuleCreateRequest("test", "This is a rule for testing.",
"", 0));
@@ -128,7 +127,7 @@ public class RuleMgtWrapperTest { @Test
public void addCorrelationRule_enabled_is_off_limit() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR);
+ thrown.expectMessage("Invalid rule status. Only 0 (disabled) and 1 (enabled) are allowed.");
ruleMgtWrapper.addCorrelationRule("admin", createRuleCreateRequest("test", "This is a rule for testing.",
"Mocked contents.", 3));
@@ -144,7 +143,7 @@ public class RuleMgtWrapperTest { CorrelationRule correlationRule = convertCreateRequest2CorrelationRule(ruleCreateRequest);
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_REPEAT_RULE_NAME);
+ thrown.expectMessage("A rule with the same name already exists.");
EasyMock.expect(correlationRuleDaoMock.queryRuleByRuleName(ruleName)).andReturn(correlationRule);
PowerMock.replayAll();
@@ -183,7 +182,7 @@ public class RuleMgtWrapperTest { @Test
public void updateCorrelationRule_param_null() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY);
+ thrown.expectMessage("The request object can not be empty!");
ruleMgtWrapper.updateCorrelationRule(USER_NAME, null);
}
@@ -241,7 +240,7 @@ public class RuleMgtWrapperTest { @Test
public void updateCorrelationRule_rule_not_exist() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage(I18nProxy.RULE_MANAGEMENT_RULE_NOT_EXIST_DATABASE);
+ thrown.expectMessage("You're trying to update a rule which does not exist in the system.");
EasyMock.expect(correlationRuleDaoMock.queryRuleByRid(EasyMock.anyObject(String.class))).andReturn(null);
@@ -255,7 +254,7 @@ public class RuleMgtWrapperTest { @Test
public void deleteCorrelationRule_request_null() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_REQUEST_OBJECT_IS_EMPTY));
+ thrown.expectMessage("The request object can not be empty!");
ruleMgtWrapper.deleteCorrelationRule(null);
}
@@ -263,7 +262,7 @@ public class RuleMgtWrapperTest { @Test
public void deleteCorrelationRule_rule_not_exit() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_RULE_NOT_EXIST_DATABASE));
+ thrown.expectMessage("You're trying to delete a rule which does not exist in the system.");
RuleDeleteRequest ruleDeleteRequest = createRuleDeleteRequest("rule_" + System.currentTimeMillis());
@@ -299,11 +298,11 @@ public class RuleMgtWrapperTest { @Test
public void getCorrelationRuleByCondition_data_format_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_CREATE_QUERY_SQL_FAILED));
+ thrown.expectMessage("An error occurred while building the query SQL.");
EasyMock.expect(correlationRuleQueryDaoMock.getCorrelationRulesByCondition(EasyMock.anyObject(
RuleQueryCondition.class)))
- .andThrow(new CorrelationException(I18nProxy.RULE_MANAGEMENT_CREATE_QUERY_SQL_FAILED));
+ .andThrow(new CorrelationException("An error occurred while building the query SQL."));
PowerMock.replay(correlationRuleQueryDaoMock, CorrelationRuleQueryDao.class);
@@ -315,11 +314,11 @@ public class RuleMgtWrapperTest { @Test
public void getCorrelationRuleByCondition_db_exception() throws Exception {
thrown.expect(CorrelationException.class);
- thrown.expectMessage((I18nProxy.RULE_MANAGEMENT_QUERY_RULE_FAILED));
+ thrown.expectMessage("Failed to query the rule.");
EasyMock.expect(correlationRuleQueryDaoMock.getCorrelationRulesByCondition(EasyMock.anyObject(
RuleQueryCondition.class)))
- .andThrow(new CorrelationException(I18nProxy.RULE_MANAGEMENT_QUERY_RULE_FAILED));
+ .andThrow(new CorrelationException("Failed to query the rule."));
PowerMock.replay(correlationRuleQueryDaoMock, CorrelationRuleQueryDao.class);
|