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 573789 Details for
Bug 724294
Issues with knowledge agent when using temporal constraints
[?]
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.
Class demonstrating the problem
CEP2.java (text/x-java), 3.04 KB, created by
manstis
on 2012-03-29 20:24:21 UTC
(
hide
)
Description:
Class demonstrating the problem
Filename:
MIME Type:
Creator:
manstis
Created:
2012-03-29 20:24:21 UTC
Size:
3.04 KB
patch
obsolete
>/* > * Copyright 2012 JBoss Inc > * > * Licensed under the Apache License, Version 2.0 (the "License"); you may not > * use this file except in compliance with the License. You may obtain a copy of > * the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT > * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the > * License for the specific language governing permissions and limitations under > * the License. > */ >package org.jboss.qa.guvnor.agent; > >import java.io.IOException; >import java.io.InputStream; >import java.util.HashSet; >import java.util.Set; > >import org.drools.KnowledgeBase; >import org.drools.KnowledgeBaseConfiguration; >import org.drools.KnowledgeBaseFactory; >import org.drools.conf.EventProcessingOption; >import org.drools.core.util.DroolsStreamUtils; >import org.drools.definition.KnowledgePackage; >import org.drools.definitions.impl.KnowledgePackageImp; >import org.drools.rule.Package; > >/** > * https://bugzilla.redhat.com/show_bug.cgi?id=724294 > */ >public class CEP2 { > > public static void main(String[] args) throws IOException, > ClassNotFoundException { > new CEP2().testSetupOfOperatorCache(); > } > > public void testSetupOfOperatorCache() throws IOException, > ClassNotFoundException { > > //Uncomment the following line and the test will pass. > > //This is because calling this code implicitly causes EvaluatorRegistry to be invoked > //and the static initializer block in all (registered) org.drools.base.evaluators classes > //to be called. These populate the CACHE in org.drools.base.evaluators.Operator. This CACHE > //is used by Operator.readResolve lookup an Operator object from it's String identifier. > //readResolve is invoked during deserialization and, if a deserialized Operator is not in > //the cache Null is returned leading to the reported bug. > > // final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); > > //Deserialise a binary package. > //This code is based loosely on that in KnowledgeAgentImpl.addResourcesToKnowledgeBase > InputStream is = this.getClass().getClassLoader().getResourceAsStream( "withcep.pkg" ); > Package pkg = (Package) DroolsStreamUtils.streamIn( is); > > Set<KnowledgePackage> kpackages = new HashSet<KnowledgePackage>(); > KnowledgePackage kpackage = new KnowledgePackageImp( pkg ); > kpackages.add(kpackage); > > //If KnowledgeBaseConfiguration is empty or does not contain EventProcessingOption.STREAM option the test passes. > KnowledgeBaseConfiguration kbconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); > kbconfig.setOption(EventProcessingOption.STREAM); > KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbconfig); > kbase.addKnowledgePackages(kpackages); > > } > >}
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 724294
:
514330
|
514331
| 573789 |
573790