Examples of ContextEntry


Examples of org.drools.rule.ContextEntry

     */
    @Before
    public void setUp() {
        // create mock objects
        constraint = mock(BetaNodeFieldConstraint.class);
        final ContextEntry c = mock(ContextEntry.class);

        when(constraint.createContextEntry()).thenReturn(c);

        this.rule = new Rule("test-rule");
        this.context = new PropagationContextImpl(0,
View Full Code Here

Examples of org.drools.rule.ContextEntry

     * Setup the BetaNode used in each of the tests
     */
    public void setUp() {
        // create mock objects
        constraint = mockery.mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mockery.mock( ContextEntry.class );
       
        // set mock objects expectations
        mockery.checking( new Expectations() {{
            // allowed calls and return values
            allowing( constraint ).createContextEntry(); will(returnValue(c));
View Full Code Here

Examples of org.drools.rule.ContextEntry

     * @throws IntrospectionException
     */
    public void setUp() throws IntrospectionException {
        // create mock objects
        constraint = mockery.mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mockery.mock( ContextEntry.class );

        // set mock objects expectations
        mockery.checking( new Expectations() {
            {
                // allowed calls and return values
View Full Code Here

Examples of org.drools.rule.ContextEntry

     */
    @Before
    public void setUp() {
        // create mock objects
        constraint = mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mock( ContextEntry.class );

        when( constraint.createContextEntry() ).thenReturn( c );

        this.rule = new Rule( "test-rule" );
        this.context = new PropagationContextImpl( 0,
View Full Code Here

Examples of org.drools.rule.ContextEntry

     */
    @Before
    public void setUp() throws IntrospectionException {
        // create mock objects
        constraint = mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mock( ContextEntry.class );
       
        when( constraint.createContextEntry() ).thenReturn(c);

        this.rule = new Rule( "test-rule" );
        this.context = new PropagationContextImpl( 0,
View Full Code Here

Examples of org.drools.rule.ContextEntry

                       returnValueDescr,
                       analysis );
       
        ((MVELReturnValueExpression)returnValue.getExpression()).compile((MVELDialectRuntimeData) pkgBuilder.getPackageRegistry( pkg.getName() ).getDialectRuntimeRegistry().getDialectData( "mvel" ));

        ContextEntry retValContext = returnValue.createContextEntry();

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        final InternalWorkingMemory wm = (InternalWorkingMemory) ruleBase.newStatefulSession();

        final Cheese stilton = new Cheese( "stilton",
View Full Code Here

Examples of org.drools.rule.ContextEntry

     * @throws IntrospectionException
     */
    public void setUp() throws IntrospectionException {
        // create mock objects
        constraint = mockery.mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mockery.mock( ContextEntry.class );

        // set mock objects expectations
        mockery.checking( new Expectations() {
            {
                // allowed calls and return values
View Full Code Here

Examples of org.drools.rule.ContextEntry

     */
    @Before
    public void setUp() throws IntrospectionException {
        // create mock objects
        constraint = mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mock( ContextEntry.class );
       
        when( constraint.createContextEntry() ).thenReturn(c);

        this.rule = new Rule( "test-rule" );
        this.context = new PropagationContextImpl( 0,
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

      }
    }
    if (bcContextEntries_!=null) {
      LinkedList<ContextEntry> bcContextEntriesCopy = new LinkedList<ContextEntry>();
      for (Iterator<ContextEntry> it = bcContextEntries_.iterator(); it.hasNext();) {
        ContextEntry ce = it.next();
        if (!bcContextEntriesCopy.contains(ce)) {
          bcContextEntriesCopy.add(ce);
        }
      }
      for (Iterator<ContextEntry> it = bcContextEntriesCopy.iterator(); it.hasNext();) {
        ContextEntry ce = it.next();
        boolean foundIt = false;
        for (Iterator<ILoggingResourceable> it2 = inputCopy.iterator(); it2.hasNext();) {
          ILoggingResourceable resourceInfo = it2.next();
          if (resourceInfo.correspondsTo(ce)) {
            // perfecto
            result.add(resourceInfo);
            it2.remove();
            foundIt = true;
            break;
          }
        }
        if (!foundIt) {
          String oresourceableOres = "n/a (null)";
          if (ce !=null && ce.getOLATResourceable() !=null) {
              try {
                java.lang.reflect.Method getOlatResource = ce.getOLATResourceable().getClass().getDeclaredMethod("getOlatResource");
                if (getOlatResource!=null) {
                  oresourceableOres = String.valueOf(getOlatResource.invoke(ce.getOLATResourceable()));
                }
              } catch (SecurityException e) {
                log_.error("SecurityException while retrieving getOlatResource() Method from "+ce.getOLATResourceable().getClass());
              } catch (NoSuchMethodException e) {
                log_.info("(OK) ContextEntry's OLATResourceable had no further getOlatResource() method: "+ce.getOLATResourceable().getClass());
              } catch (IllegalArgumentException e) {
                log_.error("IllegalArgumentException while calling getOlatResource() Method from "+ce.getOLATResourceable().getClass(), e);
              } catch (IllegalAccessException e) {
                log_.error("IllegalAccessException while calling getOlatResource() Method from "+ce.getOLATResourceable().getClass(), e);
              } catch (InvocationTargetException e) {
                log_.error("IllegalAccessException while calling getOlatResource() Method from "+ce.getOLATResourceable().getClass(), e);
              }
          }
          log_.info("Could not find any LoggingResourceable corresponding to this ContextEntry: "+ce.toString()+", ce.getOLATResourceable()="+ce.getOLATResourceable()+", ce.getOLATResourceable().getOlatResource()="+oresourceableOres+", dump of resource infos:");
          for (Iterator<ILoggingResourceable> it2 = inputCopy.iterator(); it2.hasNext();) {
            ILoggingResourceable resourceInfo = it2.next();
            log_.info("id: "+resourceInfo.getId()+", name="+resourceInfo.getName()+", type="+resourceInfo.getType()+", toString: "+resourceInfo.toString());
          }
          log_.error("Could not find any LoggingResourceable corresponding to this ContextEntry: "+ce.toString(),
              new Exception("UserActivityLoggerImpl.getCombinedOrderedLoggingResourceables()"));
        }
      }
    }
   
View Full Code Here

Examples of org.olat.core.id.context.ContextEntry

    // strip beginning slash
    String startURI = ( (fileName.charAt(0) == '/')? fileName.substring(1) : fileName);

    // jump (e.g. from search) to the path if the business-launch-path says so.
    BusinessControl bc = getWindowControl().getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
    if ( ce != null ) { // a context path is left for me
      Tracing.logDebug("businesscontrol (for further jumps) would be:"+bc, SinglePageController.class);
      OLATResourceable ores = ce.getOLATResourceable();
      Tracing.logDebug("OLATResourceable=" + ores, SinglePageController.class);
      String typeName = ores.getResourceableTypeName();
      // typeName format: 'path=/test1/test2/readme.txt'
      // First remove prefix 'path='
      String path = typeName.substring("path=".length());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.