-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#697] Encodings: Add unit tests for unicode characters
- Loading branch information
1 parent
eba5c56
commit 59a8f09
Showing
9 changed files
with
436 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
...es/standard/tck/1.1/cl2/0102-feel-constants/translator/expected/java/dmn/DMNMetadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"dmnVersion" : "1.1", | ||
"modelVersion" : "2.0", | ||
"platformVersion" : "1.0", | ||
"dmnNamespaces" : [ "https://github.com/dmn-tck/tck" ], | ||
"nativeNamespace" : "", | ||
"types" : [ ], | ||
"elements" : [ { | ||
"@kind" : "decision", | ||
"id" : "d_Decision1", | ||
"informationReferences" : [ ], | ||
"javaOutputTypeName" : "String", | ||
"javaParameterName" : "decision1", | ||
"javaTypeName" : "Decision1", | ||
"knowledgeReferences" : [ ], | ||
"name" : "Decision1", | ||
"namespace" : "https://github.com/dmn-tck/tck", | ||
"protoRequestName" : "proto.Decision1Request", | ||
"protoResponseName" : "proto.Decision1Response", | ||
"transitiveRequiredInput" : [ ], | ||
"typeRef" : { | ||
"localName" : "string", | ||
"namespace" : "http://www.omg.org/spec/FEEL/20140401" | ||
} | ||
}, { | ||
"@kind" : "decision", | ||
"id" : "d_Decision2", | ||
"informationReferences" : [ ], | ||
"javaOutputTypeName" : "String", | ||
"javaParameterName" : "decision2", | ||
"javaTypeName" : "Decision2", | ||
"knowledgeReferences" : [ ], | ||
"name" : "Decision2", | ||
"namespace" : "https://github.com/dmn-tck/tck", | ||
"protoRequestName" : "proto.Decision2Request", | ||
"protoResponseName" : "proto.Decision2Response", | ||
"transitiveRequiredInput" : [ ], | ||
"typeRef" : { | ||
"localName" : "string", | ||
"namespace" : "http://www.omg.org/spec/FEEL/20140401" | ||
} | ||
}, { | ||
"@kind" : "decision", | ||
"id" : "d_Decision3", | ||
"informationReferences" : [ ], | ||
"javaOutputTypeName" : "String", | ||
"javaParameterName" : "decision3", | ||
"javaTypeName" : "Decision3", | ||
"knowledgeReferences" : [ ], | ||
"name" : "Decision3", | ||
"namespace" : "https://github.com/dmn-tck/tck", | ||
"protoRequestName" : "proto.Decision3Request", | ||
"protoResponseName" : "proto.Decision3Response", | ||
"transitiveRequiredInput" : [ ], | ||
"typeRef" : { | ||
"localName" : "string", | ||
"namespace" : "http://www.omg.org/spec/FEEL/20140401" | ||
} | ||
}, { | ||
"@kind" : "decision", | ||
"id" : "d_Decision4", | ||
"informationReferences" : [ ], | ||
"javaOutputTypeName" : "String", | ||
"javaParameterName" : "decision4", | ||
"javaTypeName" : "Decision4", | ||
"knowledgeReferences" : [ ], | ||
"name" : "Decision4", | ||
"namespace" : "https://github.com/dmn-tck/tck", | ||
"protoRequestName" : "proto.Decision4Request", | ||
"protoResponseName" : "proto.Decision4Response", | ||
"transitiveRequiredInput" : [ ], | ||
"typeRef" : { | ||
"localName" : "string", | ||
"namespace" : "http://www.omg.org/spec/FEEL/20140401" | ||
} | ||
} ] | ||
} |
75 changes: 75 additions & 0 deletions
75
...ases/standard/tck/1.1/cl2/0102-feel-constants/translator/expected/java/dmn/Decision1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
|
||
import java.util.*; | ||
import java.util.stream.Collectors; | ||
|
||
@javax.annotation.Generated(value = {"decision.ftl", "Decision1"}) | ||
@com.gs.dmn.runtime.annotation.DRGElement( | ||
namespace = "", | ||
name = "Decision1", | ||
label = "", | ||
elementKind = com.gs.dmn.runtime.annotation.DRGElementKind.DECISION, | ||
expressionKind = com.gs.dmn.runtime.annotation.ExpressionKind.LITERAL_EXPRESSION, | ||
hitPolicy = com.gs.dmn.runtime.annotation.HitPolicy.UNKNOWN, | ||
rulesCount = -1 | ||
) | ||
public class Decision1 extends com.gs.dmn.runtime.JavaTimeDMNBaseDecision { | ||
public static final com.gs.dmn.runtime.listener.DRGElement DRG_ELEMENT_METADATA = new com.gs.dmn.runtime.listener.DRGElement( | ||
"", | ||
"Decision1", | ||
"", | ||
com.gs.dmn.runtime.annotation.DRGElementKind.DECISION, | ||
com.gs.dmn.runtime.annotation.ExpressionKind.LITERAL_EXPRESSION, | ||
com.gs.dmn.runtime.annotation.HitPolicy.UNKNOWN, | ||
-1 | ||
); | ||
|
||
public Decision1() { | ||
} | ||
|
||
@java.lang.Override() | ||
public String applyMap(java.util.Map<String, String> input_, com.gs.dmn.runtime.ExecutionContext context_) { | ||
try { | ||
return apply(context_); | ||
} catch (Exception e) { | ||
logError("Cannot apply decision 'Decision1'", e); | ||
return null; | ||
} | ||
} | ||
|
||
public String apply(com.gs.dmn.runtime.ExecutionContext context_) { | ||
try { | ||
// Start decision 'Decision1' | ||
com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_ = context_ != null ? context_.getAnnotations() : null; | ||
com.gs.dmn.runtime.listener.EventListener eventListener_ = context_ != null ? context_.getEventListener() : null; | ||
com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_ = context_ != null ? context_.getExternalFunctionExecutor() : null; | ||
com.gs.dmn.runtime.cache.Cache cache_ = context_ != null ? context_.getCache() : null; | ||
long decision1StartTime_ = System.currentTimeMillis(); | ||
com.gs.dmn.runtime.listener.Arguments decision1Arguments_ = new com.gs.dmn.runtime.listener.Arguments(); | ||
eventListener_.startDRGElement(DRG_ELEMENT_METADATA, decision1Arguments_); | ||
|
||
// Evaluate decision 'Decision1' | ||
String output_ = lambda.apply(context_); | ||
|
||
// End decision 'Decision1' | ||
eventListener_.endDRGElement(DRG_ELEMENT_METADATA, decision1Arguments_, output_, (System.currentTimeMillis() - decision1StartTime_)); | ||
|
||
return output_; | ||
} catch (Exception e) { | ||
logError("Exception caught in 'Decision1' evaluation", e); | ||
return null; | ||
} | ||
} | ||
|
||
public com.gs.dmn.runtime.LambdaExpression<String> lambda = | ||
new com.gs.dmn.runtime.LambdaExpression<String>() { | ||
public String apply(Object... args_) { | ||
com.gs.dmn.runtime.ExecutionContext context_ = 0 < args_.length ? (com.gs.dmn.runtime.ExecutionContext) args_[0] : null; | ||
com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_ = context_ != null ? context_.getAnnotations() : null; | ||
com.gs.dmn.runtime.listener.EventListener eventListener_ = context_ != null ? context_.getEventListener() : null; | ||
com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_ = context_ != null ? context_.getExternalFunctionExecutor() : null; | ||
com.gs.dmn.runtime.cache.Cache cache_ = context_ != null ? context_.getCache() : null; | ||
|
||
return "foo bar"; | ||
} | ||
}; | ||
} |
75 changes: 75 additions & 0 deletions
75
...ases/standard/tck/1.1/cl2/0102-feel-constants/translator/expected/java/dmn/Decision2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
|
||
import java.util.*; | ||
import java.util.stream.Collectors; | ||
|
||
@javax.annotation.Generated(value = {"decision.ftl", "Decision2"}) | ||
@com.gs.dmn.runtime.annotation.DRGElement( | ||
namespace = "", | ||
name = "Decision2", | ||
label = "", | ||
elementKind = com.gs.dmn.runtime.annotation.DRGElementKind.DECISION, | ||
expressionKind = com.gs.dmn.runtime.annotation.ExpressionKind.LITERAL_EXPRESSION, | ||
hitPolicy = com.gs.dmn.runtime.annotation.HitPolicy.UNKNOWN, | ||
rulesCount = -1 | ||
) | ||
public class Decision2 extends com.gs.dmn.runtime.JavaTimeDMNBaseDecision { | ||
public static final com.gs.dmn.runtime.listener.DRGElement DRG_ELEMENT_METADATA = new com.gs.dmn.runtime.listener.DRGElement( | ||
"", | ||
"Decision2", | ||
"", | ||
com.gs.dmn.runtime.annotation.DRGElementKind.DECISION, | ||
com.gs.dmn.runtime.annotation.ExpressionKind.LITERAL_EXPRESSION, | ||
com.gs.dmn.runtime.annotation.HitPolicy.UNKNOWN, | ||
-1 | ||
); | ||
|
||
public Decision2() { | ||
} | ||
|
||
@java.lang.Override() | ||
public String applyMap(java.util.Map<String, String> input_, com.gs.dmn.runtime.ExecutionContext context_) { | ||
try { | ||
return apply(context_); | ||
} catch (Exception e) { | ||
logError("Cannot apply decision 'Decision2'", e); | ||
return null; | ||
} | ||
} | ||
|
||
public String apply(com.gs.dmn.runtime.ExecutionContext context_) { | ||
try { | ||
// Start decision 'Decision2' | ||
com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_ = context_ != null ? context_.getAnnotations() : null; | ||
com.gs.dmn.runtime.listener.EventListener eventListener_ = context_ != null ? context_.getEventListener() : null; | ||
com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_ = context_ != null ? context_.getExternalFunctionExecutor() : null; | ||
com.gs.dmn.runtime.cache.Cache cache_ = context_ != null ? context_.getCache() : null; | ||
long decision2StartTime_ = System.currentTimeMillis(); | ||
com.gs.dmn.runtime.listener.Arguments decision2Arguments_ = new com.gs.dmn.runtime.listener.Arguments(); | ||
eventListener_.startDRGElement(DRG_ELEMENT_METADATA, decision2Arguments_); | ||
|
||
// Evaluate decision 'Decision2' | ||
String output_ = lambda.apply(context_); | ||
|
||
// End decision 'Decision2' | ||
eventListener_.endDRGElement(DRG_ELEMENT_METADATA, decision2Arguments_, output_, (System.currentTimeMillis() - decision2StartTime_)); | ||
|
||
return output_; | ||
} catch (Exception e) { | ||
logError("Exception caught in 'Decision2' evaluation", e); | ||
return null; | ||
} | ||
} | ||
|
||
public com.gs.dmn.runtime.LambdaExpression<String> lambda = | ||
new com.gs.dmn.runtime.LambdaExpression<String>() { | ||
public String apply(Object... args_) { | ||
com.gs.dmn.runtime.ExecutionContext context_ = 0 < args_.length ? (com.gs.dmn.runtime.ExecutionContext) args_[0] : null; | ||
com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_ = context_ != null ? context_.getAnnotations() : null; | ||
com.gs.dmn.runtime.listener.EventListener eventListener_ = context_ != null ? context_.getEventListener() : null; | ||
com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_ = context_ != null ? context_.getExternalFunctionExecutor() : null; | ||
com.gs.dmn.runtime.cache.Cache cache_ = context_ != null ? context_.getCache() : null; | ||
|
||
return "šomeÚnicodeŠtriňg"; | ||
} | ||
}; | ||
} |
75 changes: 75 additions & 0 deletions
75
...ases/standard/tck/1.1/cl2/0102-feel-constants/translator/expected/java/dmn/Decision3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
|
||
import java.util.*; | ||
import java.util.stream.Collectors; | ||
|
||
@javax.annotation.Generated(value = {"decision.ftl", "Decision3"}) | ||
@com.gs.dmn.runtime.annotation.DRGElement( | ||
namespace = "", | ||
name = "Decision3", | ||
label = "", | ||
elementKind = com.gs.dmn.runtime.annotation.DRGElementKind.DECISION, | ||
expressionKind = com.gs.dmn.runtime.annotation.ExpressionKind.LITERAL_EXPRESSION, | ||
hitPolicy = com.gs.dmn.runtime.annotation.HitPolicy.UNKNOWN, | ||
rulesCount = -1 | ||
) | ||
public class Decision3 extends com.gs.dmn.runtime.JavaTimeDMNBaseDecision { | ||
public static final com.gs.dmn.runtime.listener.DRGElement DRG_ELEMENT_METADATA = new com.gs.dmn.runtime.listener.DRGElement( | ||
"", | ||
"Decision3", | ||
"", | ||
com.gs.dmn.runtime.annotation.DRGElementKind.DECISION, | ||
com.gs.dmn.runtime.annotation.ExpressionKind.LITERAL_EXPRESSION, | ||
com.gs.dmn.runtime.annotation.HitPolicy.UNKNOWN, | ||
-1 | ||
); | ||
|
||
public Decision3() { | ||
} | ||
|
||
@java.lang.Override() | ||
public String applyMap(java.util.Map<String, String> input_, com.gs.dmn.runtime.ExecutionContext context_) { | ||
try { | ||
return apply(context_); | ||
} catch (Exception e) { | ||
logError("Cannot apply decision 'Decision3'", e); | ||
return null; | ||
} | ||
} | ||
|
||
public String apply(com.gs.dmn.runtime.ExecutionContext context_) { | ||
try { | ||
// Start decision 'Decision3' | ||
com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_ = context_ != null ? context_.getAnnotations() : null; | ||
com.gs.dmn.runtime.listener.EventListener eventListener_ = context_ != null ? context_.getEventListener() : null; | ||
com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_ = context_ != null ? context_.getExternalFunctionExecutor() : null; | ||
com.gs.dmn.runtime.cache.Cache cache_ = context_ != null ? context_.getCache() : null; | ||
long decision3StartTime_ = System.currentTimeMillis(); | ||
com.gs.dmn.runtime.listener.Arguments decision3Arguments_ = new com.gs.dmn.runtime.listener.Arguments(); | ||
eventListener_.startDRGElement(DRG_ELEMENT_METADATA, decision3Arguments_); | ||
|
||
// Evaluate decision 'Decision3' | ||
String output_ = lambda.apply(context_); | ||
|
||
// End decision 'Decision3' | ||
eventListener_.endDRGElement(DRG_ELEMENT_METADATA, decision3Arguments_, output_, (System.currentTimeMillis() - decision3StartTime_)); | ||
|
||
return output_; | ||
} catch (Exception e) { | ||
logError("Exception caught in 'Decision3' evaluation", e); | ||
return null; | ||
} | ||
} | ||
|
||
public com.gs.dmn.runtime.LambdaExpression<String> lambda = | ||
new com.gs.dmn.runtime.LambdaExpression<String>() { | ||
public String apply(Object... args_) { | ||
com.gs.dmn.runtime.ExecutionContext context_ = 0 < args_.length ? (com.gs.dmn.runtime.ExecutionContext) args_[0] : null; | ||
com.gs.dmn.runtime.annotation.AnnotationSet annotationSet_ = context_ != null ? context_.getAnnotations() : null; | ||
com.gs.dmn.runtime.listener.EventListener eventListener_ = context_ != null ? context_.getEventListener() : null; | ||
com.gs.dmn.runtime.external.ExternalFunctionExecutor externalExecutor_ = context_ != null ? context_.getExternalFunctionExecutor() : null; | ||
com.gs.dmn.runtime.cache.Cache cache_ = context_ != null ? context_.getCache() : null; | ||
|
||
return "横綱"; | ||
} | ||
}; | ||
} |
Oops, something went wrong.