Skip to content

Commit 3b42a21

Browse files
authored
Compare Models (#601)
* add support of model diff tool * Merge branch 'master' into model_diff * update parameter * Fix various delete problem * add message properties and command file for windows * update exception * add topology section * merge from master * grab from master * fix script name * Fix command line parameter * Fix merging problems * correct spellings * Experiment to use alias tree to figure out folder or attribute * add validation * add message for validation * Use alias methods to check for folder or attributes * use for loop to prevent infinite loop * correct logic * update method and add CompareException * copyrights update * change wordings * removed operator specific logic * Add documentations * Fix file writing issues * Fix file writing for results * remove unused var * add support of variable substitution * update doc * fix script error * update wordings and script * handle deleting top level tree * fix code error * Add unit test for model diff * Add parsing to catch error * Add translate error check * Add more tests for model_diff * Add CreateException * minor refactor * update exception handling * update exception in test * change to use true or false for dictionary check * rename model_diff to compare_model * renamed file and update test * change test to use new temporary directory each time * update unit test * doc updates * adding messages for identical model
1 parent b06ea7c commit 3b42a21

File tree

17 files changed

+1779
-0
lines changed

17 files changed

+1779
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Many organizations are using WebLogic Server, with or without other Oracle Fusio
1010
- [Discover Domain Tool](site/discover.md)
1111
- [Encrypt Model Tool](site/encrypt.md)
1212
- [Validate Model Tool](site/validate.md)
13+
- [Compare Model Tool](site/compare.md)
1314
- [Extract Domain Resource Tool](site/kubernetes.md)
1415
- [The Model](#the-metadata-model)
1516
- [Top-Level Sections](#top-level-model-sections)
@@ -82,6 +83,7 @@ Currently, the project provides five single-purpose tools, all exposed as shell
8283
- The [Discover Domain Tool](site/discover.md) (`discoverDomain`) introspects an existing domain and creates a model file describing the domain and an archive file of the binaries deployed to the domain.
8384
- The [Encrypt Model Tool](site/encrypt.md) (`encryptModel`) encrypts the passwords in a model (or its variable file) using a user-provided passphrase.
8485
- The [Validate Model Tool](site/validate.md) (`validateModel`) provides both standalone validation of a model as well as model usage information to help users write or edit their models.
86+
- The [Compare Model Tool](site/compare.md) (`compareModel`) compares two model files.
8587
- The [Extract Domain Resource Tool](site/kubernetes.md) (`extractDomainResource`) generates a domain resource YAML for use with the Oracle WebLogic Server Kubernetes Operator.
8688

8789
As new use cases are discovered, new tools will likely be added to cover those operations but all will use the metadata model to describe what needs to be done.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* Copyright (c) 2020 Oracle Corporation and/or its affiliates.
3+
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4+
*/
5+
package oracle.weblogic.deploy.compare;
6+
7+
import oracle.weblogic.deploy.exception.BundleAwareException;
8+
import oracle.weblogic.deploy.exception.ExceptionHelper;
9+
10+
/**
11+
* The exception used by the validation-related components.
12+
*/
13+
public class CompareException extends BundleAwareException {
14+
private static final long serialVersionUID = 1L;
15+
16+
/**
17+
* Constructs a default exception.
18+
*/
19+
public CompareException() {
20+
// default constructor
21+
}
22+
23+
/**
24+
* Constructs a new exception with the specified message id.
25+
*
26+
* @param messageID the message ID
27+
*/
28+
public CompareException(String messageID) {
29+
super(messageID);
30+
}
31+
32+
/**
33+
* Constructs a new exception with the specified message id and parameters.
34+
*
35+
* @param messageID the message ID
36+
* @param params the parameters to use to fill in the message tokens
37+
*/
38+
public CompareException(String messageID, Object... params) {
39+
super(messageID, params);
40+
}
41+
42+
/**
43+
* Constructs a new exception with the specified message id and cause.
44+
*
45+
* @param messageID the message ID
46+
* @param cause the exception that triggered the creation of this exception
47+
*/
48+
public CompareException(String messageID, Throwable cause) {
49+
super(messageID, cause);
50+
}
51+
52+
/**
53+
* Constructs a new exception with passed message id, cause, and parameters.
54+
*
55+
* @param messageID the message ID
56+
* @param cause the exception that triggered the creation of this exception
57+
* @param params the parameters to use to fill in the message tokens
58+
*/
59+
public CompareException(String messageID, Throwable cause, Object... params) {
60+
super(messageID, cause, params);
61+
}
62+
63+
/**
64+
* Constructs a new exception with the specified cause.
65+
*
66+
* @param cause the exception that triggered the creation of this exception
67+
*/
68+
public CompareException(Throwable cause) {
69+
super(cause);
70+
}
71+
72+
/**
73+
* {@inheritDoc}
74+
*/
75+
@Override
76+
public String getBundleName() {
77+
return ExceptionHelper.getResourceBundleName();
78+
}
79+
}

0 commit comments

Comments
 (0)