[JBoss JIRA] (WFCORE-2880) remove-alias should fail when remove non-existent alias from credential store.
by Hynek Švábek (JIRA)
Hynek Švábek created WFCORE-2880:
------------------------------------
Summary: remove-alias should fail when remove non-existent alias from credential store.
Key: WFCORE-2880
URL: https://issues.jboss.org/browse/WFCORE-2880
Project: WildFly Core
Issue Type: Bug
Components: Security
Reporter: Hynek Švábek
Assignee: Darran Lofthouse
Priority: Critical
remove-alias should fail when remove non-existent alias from credential store.
There is expected fail when we try to remove non-existent alias from credential store.
*How to reproduce*
*create credential store*
{code}
/subsystem=elytron/credential-store=cs001:add(create=true, credential-reference={clear-text=pass123},location=cs001.jceks)
{code}
*Try to remove alias from empty credential store*
{code}
/subsystem=elytron/credential-store=cs001:remove-alias(alias=alias001)
{
"outcome" => "success",
"result" => undefined
}
{code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years
[JBoss JIRA] (DROOLS-1266) OOPath use with primitives does not return any match
by Tibor Zimányi (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1266?page=com.atlassian.jira.plugi... ]
Tibor Zimányi updated DROOLS-1266:
----------------------------------
Labels: oopath (was: )
> OOPath use with primitives does not return any match
> ----------------------------------------------------
>
> Key: DROOLS-1266
> URL: https://issues.jboss.org/browse/DROOLS-1266
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Reporter: Matteo Mortari
> Assignee: Mario Fusco
> Labels: oopath
>
> Consider the following reproducer:
> {code:java}
> @Test
> public void testPrimitives() {
> String drl =
> "import org.drools.compiler.xpath.*;\n" +
> "global java.util.List list\n" +
> "\n" +
> "rule R when\n" +
> " Adult( $x: /children.age )\n" +
> "then\n" +
> " list.add( $x );\n" +
> "end\n";
>
> System.out.println(drl);
> KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL )
> .build()
> .newKieSession();
> List<String> list = new ArrayList<String>();
> ksession.setGlobal( "list", list );
> Man bob = new Man( "Bob", 40 );
> bob.addChild( new Child( "Charles", 12 ) );
> bob.addChild( new Child( "Debbie", 8 ) );
> ksession.insert( bob );
> ksession.fireAllRules();
>
> assertEquals(2, list.size());
> }
> {code}
> these reproducer/test fails. Does not provide any match of the primitive type returned by {{age}}.
> Please note if the rule was instead:
> {code:java}
> rule R when
> Adult( $x: /children.name )
> then
> ...
> {code}
> the test would pass.
> Hence appears OOPath is not matching on the primitive types?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years
[JBoss JIRA] (DROOLS-1265) OOPath use in accumulate throws ClassCastException at runtime
by Tibor Zimányi (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1265?page=com.atlassian.jira.plugi... ]
Tibor Zimányi updated DROOLS-1265:
----------------------------------
Labels: oopath (was: )
> OOPath use in accumulate throws ClassCastException at runtime
> -------------------------------------------------------------
>
> Key: DROOLS-1265
> URL: https://issues.jboss.org/browse/DROOLS-1265
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Reporter: Matteo Mortari
> Assignee: Matteo Mortari
> Labels: oopath
> Fix For: 6.5.0.Final, 7.0.0.Beta2
>
>
> A rule with the following ClassCastException at runtime
> {code:java}
> rule R when
> accumulate ( Adult( $child: /children ) ; $avg: average ($child.getAge()) )
> then
> ...
> {code}
> would fail with the
> {code:java}
> java.lang.RuntimeException: java.lang.ClassCastException: org.drools.core.reteoo.SubnetworkTuple cannot be cast to org.drools.compiler.xpath.Child
> at org.drools.core.rule.SingleAccumulate.accumulate(SingleAccumulate.java:106)
> at org.drools.core.phreak.PhreakAccumulateNode.addMatch(PhreakAccumulateNode.java:769)
> at org.drools.core.phreak.PhreakAccumulateNode.doLeftInserts(PhreakAccumulateNode.java:176)
> at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:97)
> at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:534)
> at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:505)
> at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:341)
> at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:301)
> at org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:198)
> at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:141)
> at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:94)
> at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:194)
> at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:73)
> at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:969)
> at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1311)
> at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1250)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1353)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1344)
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1325)
> at org.drools.compiler.xpath.XpathTest.testAccumulate(XpathTest.java:991)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
> Caused by: java.lang.ClassCastException: org.drools.core.reteoo.SubnetworkTuple cannot be cast to org.drools.compiler.xpath.Child
> at defaultpkg.Rule_R138182734AccumulateExpression0Invoker.evaluate(Rule_R138182734AccumulateExpression0Invoker.java:19)
> at org.drools.core.base.accumulators.JavaAccumulatorFunctionExecutor.accumulate(JavaAccumulatorFunctionExecutor.java:109)
> at org.drools.core.rule.SingleAccumulate.accumulate(SingleAccumulate.java:98)
> ... 42 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years
[JBoss JIRA] (DROOLS-1376) OOPath 2+ notifyModification() result only the 1st being effective
by Tibor Zimányi (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1376?page=com.atlassian.jira.plugi... ]
Tibor Zimányi updated DROOLS-1376:
----------------------------------
Labels: oopath (was: )
> OOPath 2+ notifyModification() result only the 1st being effective
> ------------------------------------------------------------------
>
> Key: DROOLS-1376
> URL: https://issues.jboss.org/browse/DROOLS-1376
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Beta3
> Reporter: Matteo Mortari
> Assignee: Matteo Mortari
> Labels: oopath
>
> Reproducible by adding in XPathTest:
> {code:java}
> @Test
> public void testDoubleAdd() {
> String drl =
> "import org.drools.compiler.xpath.*;\n" +
> "\n" +
> "rule R2 when\n" +
> " Group( $id: name, $p: /members{age >= 20} )\n" +
> "then\n" +
> " System.out.println( $id + \".\" + $p.getName() );\n" +
> " insertLogical( $id + \".\" + $p.getName() );\n" +
> "end\n";
> KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL )
> .build()
> .newKieSession();
>
> Group x = new Group("X");
> Group y = new Group("Y");
> ksession.insert( x );
> ksession.insert( y );
> ksession.fireAllRules();
> assertFalse (factsCollection(ksession).contains("X.Ada"));
> assertFalse (factsCollection(ksession).contains("X.Bea"));
> assertFalse (factsCollection(ksession).contains("Y.Ada"));
> assertFalse (factsCollection(ksession).contains("Y.Bea"));
>
> Adult ada = new Adult("Ada", 20);
> Adult bea = new Adult("Bea", 20);
> x.addPerson(ada);
> x.addPerson(bea);
> y.addPerson(ada);
> y.addPerson(bea);
> ksession.fireAllRules();
> assertTrue (factsCollection(ksession).contains("X.Ada"));
> assertTrue (factsCollection(ksession).contains("X.Bea"));
> assertTrue (factsCollection(ksession).contains("Y.Ada"));
> assertTrue (factsCollection(ksession).contains("Y.Bea"));
>
> x.removePerson(ada);
> x.removePerson(bea);
> y.removePerson(ada);
> y.removePerson(bea);
> ksession.fireAllRules();
> assertFalse (factsCollection(ksession).contains("X.Ada"));
> assertFalse (factsCollection(ksession).contains("X.Bea"));
> assertFalse (factsCollection(ksession).contains("Y.Ada"));
> assertFalse (factsCollection(ksession).contains("Y.Bea"));
> }
>
> @Test
> public void testDoubleRemove() {
> String drl =
> "import org.drools.compiler.xpath.*;\n" +
> "\n" +
> "rule R2 when\n" +
> " Group( $id: name, $p: /members{age >= 20} )\n" +
> "then\n" +
> " System.out.println( $id + \".\" + $p.getName() );\n" +
> " insertLogical( $id + \".\" + $p.getName() );\n" +
> "end\n";
> KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL )
> .build()
> .newKieSession();
>
> Adult ada = new Adult("Ada", 20);
> Adult bea = new Adult("Bea", 20);
> Group x = new Group("X");
> Group y = new Group("Y");
> x.addPerson(ada);
> x.addPerson(bea);
> y.addPerson(ada);
> y.addPerson(bea);
> ksession.insert( x );
> ksession.insert( y );
> ksession.fireAllRules();
> assertTrue (factsCollection(ksession).contains("X.Ada"));
> assertTrue (factsCollection(ksession).contains("X.Bea"));
> assertTrue (factsCollection(ksession).contains("Y.Ada"));
> assertTrue (factsCollection(ksession).contains("Y.Bea"));
>
> x.removePerson(ada);
> x.removePerson(bea);
> y.removePerson(ada);
> y.removePerson(bea);
> ksession.fireAllRules();
> assertFalse (factsCollection(ksession).contains("X.Ada"));
> assertFalse (factsCollection(ksession).contains("X.Bea"));
> assertFalse (factsCollection(ksession).contains("Y.Ada"));
> assertFalse (factsCollection(ksession).contains("Y.Bea"));
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years
[JBoss JIRA] (DROOLS-1413) OOPath constraint bug2
by Tibor Zimányi (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1413?page=com.atlassian.jira.plugi... ]
Tibor Zimányi updated DROOLS-1413:
----------------------------------
Labels: oopath (was: )
> OOPath constraint bug2
> ----------------------
>
> Key: DROOLS-1413
> URL: https://issues.jboss.org/browse/DROOLS-1413
> Project: Drools
> Issue Type: Sub-task
> Reporter: Matteo Mortari
> Assignee: Mario Fusco
> Labels: oopath
> Fix For: 7.0.0.Beta7
>
>
> {code:java}
> @Test
> public void testWronglyMatchAlsoEqualsBis() {
> String drl =
> "import org.drools.compiler.xpath.*;\n" +
> "global java.util.Set duplicateNames; \n" +
> "\n" +
> "rule DIFF_FILES_BUT_WITH_SAME_FILENAME when\n" +
> " $dir1 : TMFileSet( $ic1 : /files, $ic2 : /files{name == $ic1.name}, $ic1 != $ic2 )\n" +
> "then\n" +
> " System.out.println( $dir1 + \".: \" + $ic1 + \" \" + $ic2 );\n" +
> " duplicateNames.add( $ic1.getName() );\n" +
> "end\n";
> KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL )
> .build()
> .newKieSession();
>
> Set duplicateNames = new HashSet();
> ksession.setGlobal("duplicateNames", duplicateNames);
>
> TMFileSet x = new TMFileSet("X");
> TMFile file0 = new TMFile("File0", 47);
> TMFile file1 = new TMFile("File1", 47);
> TMFile file2 = new TMFile("File0", 47);
> x.getFiles().addAll(Arrays.asList(new TMFile[]{file0, file1, file2}));
>
> ksession.insert(x);
> ksession.fireAllRules();
>
> assertTrue( duplicateNames.contains("File0") );
> assertFalse( duplicateNames.contains("File1") );
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years