Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 894669 Details for
Bug 1078839
Guided rule with DSL is not able to build (ERR102) on ibm16
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Unit test reproducing backward incompatibility
file_1078839.txt (text/plain), 3.24 KB, created by
Marek Winkler
on 2014-05-12 12:09:41 UTC
(
hide
)
Description:
Unit test reproducing backward incompatibility
Filename:
MIME Type:
Creator:
Marek Winkler
Created:
2014-05-12 12:09:41 UTC
Size:
3.24 KB
patch
obsolete
>package org.jboss.qa.brms.kie.dsl; > >import java.io.StringReader; > >import org.junit.Test; >import org.kie.api.KieServices; >import org.kie.api.io.KieResources; >import org.kie.api.io.Resource; >import org.kie.api.io.ResourceType; >import org.kie.internal.utils.KieHelper; > >/** > * Tests DSL parsing which should try to cover the maximum input fragment. > * > * Please see test methods comments. > */ >public class GreedyDslTest { > > private static final String DSL_BASIC = "#/ result \n" > + "[when]There is a number with=i:Integer()\n" > + "[when]There is a number with value of {value}=i:Integer(intValue() == {value})\n"; > > private static final String DSLR_BASIC = "package org.drools.test.dsl.basic \n" > + "rule 'basic rule' \n" > + "when \n" + " There is a number with value of 10\n" > + "then \n" + "end \n"; > > // illustrates the case when ordering according to the left part of DSL rule length is not enough > private static final String DSL_COMPLICATED = "#/ result \n" > + "[when]There is a number where {constraints}=i:Integer(where {constraints})\n" > + "[when]integer value=intValue()\n" > + "[when]long value=longValue()\n" > + "[when]where {attr:[a-zA-Z0-9()]+} is {value}={attr} == {value}\n"; > > private static final String DSLR_COMPLICATED = "package org.drools.test.dsl.complicated \n" > + "rule 'sample rule' \n" > + "when \n" + " There is a number where integer value is 10\n" > + "then \n" + "end \n"; > > /** > * Tests compiling DSL with overlapping definitions. > * > * Works with 6.0.2.ER2, works not in 6.0.1. > */ > @Test > public void testBasicGreedyDsl() { > final KieResources resources = KieServices.Factory.get().getResources(); > final Resource dslResource = resources.newReaderResource(new StringReader(DSL_BASIC)); > dslResource.setResourceType(ResourceType.DSL); > dslResource.setSourcePath("src/main/resources/test.dsl"); > > final Resource dslrResource = resources.newReaderResource(new StringReader(DSLR_BASIC)); > dslrResource.setResourceType(ResourceType.DSLR); > dslrResource.setSourcePath("src/main/resources/test.dslr"); > > new KieHelper().addResource(dslResource).addResource(dslrResource).build(); > } > > /** > * Tests compiling DSL with overlapping definitions when the ordering according to > * the left part of the DSL rule length is not enough. > * > * Works with 6.0.1, works not in 6.0.2.ER2. > */ > @Test > public void testComplicatedGreedyDsl() { > final KieResources resources = KieServices.Factory.get().getResources(); > final Resource dslResource = resources.newReaderResource(new StringReader(DSL_COMPLICATED)); > dslResource.setResourceType(ResourceType.DSL); > dslResource.setSourcePath("src/main/resources/test.dsl"); > > final Resource dslrResource = resources.newReaderResource(new StringReader(DSLR_COMPLICATED)); > dslrResource.setResourceType(ResourceType.DSLR); > dslrResource.setSourcePath("src/main/resources/test.dslr"); > > new KieHelper().addResource(dslResource).addResource(dslrResource).build(); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1078839
:
879525
| 894669