Examples of ActionDef


Examples of org.auraframework.def.ActionDef

            PropertyReference ref = (PropertyReference) expression;
            ref = ref.getStem();

            ControllerDef controllerDef = getControllerDef();
            ActionDef actionDef = controllerDef.getSubDefinition(ref.toString());
            Action action = Aura.getInstanceService().getInstance(actionDef);

            AuraContext context = Aura.getContextService().getCurrentContext();
            Action previous = context.setCurrentAction(action);
            try {
View Full Code Here

Examples of org.auraframework.def.ActionDef

   
    public void testCreatingJavaActionDef(){
        DefDescriptor<ControllerDef> controllerDesc = DefDescriptorImpl.getInstance("java://org.auraframework.impl.java.controller.TestController", ControllerDef.class);
        DefDescriptor<ActionDef> actionDefDesc = SubDefDescriptorImpl.getInstance("getString", controllerDesc, ActionDef.class);
        try{
            ActionDef actionDef = actionDefDesc.getDef();
            assertNotNull(actionDef);
            assertTrue(actionDef instanceof JavaActionDef);
            assertTrue(actionDef.getParameters().isEmpty());
            assertEquals(DefDescriptorImpl.getInstance("java://java.lang.String", TypeDef.class), actionDef.getReturnType());
            assertEquals(ActionType.SERVER,actionDef.getActionType());
        }catch(Exception e){
            fail("Failed to create a valid java actiondef without parameters");
        }
        controllerDesc = DefDescriptorImpl.getInstance("java://org.auraframework.impl.java.controller.TestControllerWithParameters", ControllerDef.class);
        actionDefDesc = SubDefDescriptorImpl.getInstance("sumValues", controllerDesc, ActionDef.class);
        try{
            ActionDef actionDef = actionDefDesc.getDef();
            assertNotNull(actionDef);
            assertEquals(2, actionDef.getParameters().size());
            assertEquals("a", actionDef.getParameters().get(0).getName());
            assertEquals("java://java.lang.Integer", actionDef.getParameters().get(0).getType().toString());
            assertEquals("b", actionDef.getParameters().get(1).getName());
            assertEquals("java://java.lang.Integer", actionDef.getParameters().get(0).getType().toString());
            assertEquals(DefDescriptorImpl.getInstance("java://java.lang.Integer", TypeDef.class), actionDef.getReturnType());
        }catch(Exception e){
            fail("Failed to create a valid java actiondef with parameters");
        }
    }
View Full Code Here

Examples of org.auraframework.def.ActionDef

   
    private JavaActionDef getJavaActionDef(String controller, String actionName) throws QuickFixException {
        DefDescriptor<ControllerDef> controllerDesc = DefDescriptorImpl.getInstance(controller,
                ControllerDef.class);
        DefDescriptor<ActionDef> actionDefDesc = SubDefDescriptorImpl.getInstance(actionName, controllerDesc, ActionDef.class);
        ActionDef actionDef = actionDefDesc.getDef();
        assertTrue(actionDef instanceof JavaActionDef);
        return (JavaActionDef)actionDef;
    }
View Full Code Here

Examples of org.auraframework.def.ActionDef

                "org.auraframework.impl.java.controller.TestControllerWithDuplicateAction");
    }

    public void testGetSubDefinition() throws Exception {
        ControllerDef controller = getJavaController("java://org.auraframework.impl.java.controller.TestController");
        ActionDef subDef = controller.getSubDefinition("getString");
        assertEquals("SubDefinition is the wrong type", ActionDef.ActionType.SERVER, subDef.getActionType());
        assertEquals("java://org.auraframework.impl.java.controller.TestController/ACTION$getString", subDef
                .getDescriptor().getQualifiedName());
    }
View Full Code Here

Examples of org.auraframework.def.ActionDef

                .getDescriptor().getQualifiedName());
    }

    public void testGetNullSubDefinition() throws Exception {
        ControllerDef controller = getJavaController("java://org.auraframework.impl.java.controller.TestController");
        ActionDef subDefNonExistent = controller.getSubDefinition("iDontExist");
        assertNull("Trying to retrieve non-existent subdefiniton should return null", subDefNonExistent);
    }
View Full Code Here

Examples of org.auraframework.def.ActionDef

    /**
     * Action without annotation is not backgroundable
     */
    public void testJavaActionDefIsBackgroundWithoutAnnotation() throws Exception {
        ControllerDef controller = getJavaController("java://org.auraframework.impl.java.controller.ParallelActionTestController");
        ActionDef actionDef = controller.getActionDefs().get("executeInForeground");
        assertFalse("ActionDefs should not be backgroundable without BackgroundAction annotation",
                ((JavaActionDef) actionDef).isBackground());
    }
View Full Code Here

Examples of org.auraframework.def.ActionDef

    /**
     * Action without annotation is not backgroundable
     */
    public void testJavaActionDefIsBackgroundWithAnnotation() throws Exception {
        ControllerDef controller = getJavaController("java://org.auraframework.impl.java.controller.ParallelActionTestController");
        ActionDef actionDef = controller.getActionDefs().get("executeInBackground");
        assertTrue("ActionDefs should be backgroundable with BackgroundAction annotation",
                ((JavaActionDef) actionDef).isBackground());
    }
View Full Code Here

Examples of org.eclipse.sapphire.ui.def.ActionDef

                new Comparator<Element>()
                {
                    public int compare( final Element a,
                                        final Element b )
                    {
                        final ActionDef x = (ActionDef) a;
                        final ActionDef y = (ActionDef) b;
                       
                        return comp( x.getId().content(), y.getId().content() );
                    }
                }
            );
        }
View Full Code Here

Examples of pddl4j.exp.action.ActionDef

      List<Proposition> goalState    = new ArrayList<Proposition>();
     
      logger.finest("--> Actions\n");
     
      while(actionsIterator.hasNext()){
        ActionDef actionDef = actionsIterator.next();
        logger.finest(actionDef.toString());
       
        Exp precontidion = (Exp) ((Action)actionDef).getPrecondition();
        Exp effect = (Exp) ((Action)actionDef).getEffect();
       
        List<String> parameterTypes = new ArrayList<String>();
       
        OperatorImpl operatorImpl = new OperatorImpl(actionDef.getName());
        List<Term> termsOp = new ArrayList<Term>();
        for(pddl4j.exp.term.Term term: actionDef.getParameters()){
          termsOp.add(new VarTerm(term.getImage().replace("?", "").toUpperCase()));
          parameterTypes.add(term.getTypeSet().toString());
         
          Set<String> setVar = this.types.get(term.getTypeSet().toString());
         
          for(Constant c: this.pddlObject.getTypedDomain(term.getTypeSet())){
            if(setVar == null){
              setVar = new HashSet<String>();
              setVar.add(c.toString());
              this.types.put(term.getTypeSet().toString(), setVar);
            } else setVar.add(c.toString());
          }
        }

        this.parameterTypes.put(actionDef.getName(), parameterTypes);
       
        operatorImpl.addTerms(termsOp);
       
        operatorImpl.getPreconds().addAll(this.getPropositionFromDomainExp(precontidion));
        operatorImpl.getEffects().addAll(this.getPropositionFromDomainExp(effect));
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.