Examples of Functions


Examples of org.apache.shindig.expressions.Functions

  @Before
  public void setUp() throws Exception {
    JSONObject config = createConfig();

    JsonContainerConfig containerConfig =
        new JsonContainerConfig(config, Expressions.forTesting(new Functions()));
    mockFetcher = mock(HttpFetcher.class);
    fetcher = new DefaultServiceFetcher(containerConfig, mockFetcher);
  }
View Full Code Here

Examples of org.apache.shindig.expressions.Functions

    config.getJSONObject("default").
        getJSONObject(DefaultServiceFetcher.GADGETS_FEATURES_CONFIG)
        .remove(DefaultServiceFetcher.OSAPI_FEATURE_CONFIG);
    JsonContainerConfig containerConfig =
        new JsonContainerConfig(config,
            Expressions.forTesting(new Functions()));
    fetcher = new DefaultServiceFetcher(containerConfig, mockFetcher);

    EasyMock.expect(mockFetcher.fetch(EasyMock.isA(HttpRequest.class))).andReturn(
        new HttpResponse("")).anyTimes();
    replay();
View Full Code Here

Examples of org.apache.shindig.expressions.Functions

        .getJSONObject(DefaultServiceFetcher.OSAPI_FEATURE_CONFIG)
        .put(DefaultServiceFetcher.OSAPI_BASE_ENDPOINTS, new JSONArray(ImmutableList.of(endPoint1)));

    JsonContainerConfig containerConfig =
        new JsonContainerConfig(config,
            Expressions.forTesting(new Functions()));
    CapturingHttpFetcher httpFetcher = new CapturingHttpFetcher();
    fetcher = new DefaultServiceFetcher(containerConfig, httpFetcher);
    fetcher.setSecurityTokenCodec( new BasicSecurityTokenCodec() );
    Multimap<String, String> services = fetcher.getServicesForContainer("default", "dontcare");
    assertEquals(configuredServices, services);
View Full Code Here

Examples of org.drools.spi.Functions

        globalText.append( "  if cond:\n" );
        globalText.append( "    return on_true\n" );
        globalText.append( "  else:\n" );
        globalText.append( "    return on_false\n" );
       
        Functions functions = rule.getRuleSet( ).getFunctions( "python" );
        if ( functions != null )
        {
            globalText.append( stripOuterIndention( functions.getText( ) ) );
        }      
       
        if ( this.globals == null )
        {
            this.globals = getGlobals( globalText.toString( ) );
View Full Code Here

Examples of org.drools.spi.Functions

                                                                         localName );

        FunctionsFactory factory = module.getFunctionsFactory( localName );

        Configuration config = this.ruleSetReader.endConfiguration( );
        Functions functions;
        try
        {
            functions = factory.newFunctions( this.ruleSetReader.getRuleSet( ),
                                              this.ruleSetReader.getFactoryContext( ),
                                              config );
View Full Code Here

Examples of org.opengis.filter.capability.Functions

            boolean simple = true;
            FunctionName[] functionNames = { filterFac.functionName("MIN", 2),
                    filterFac.functionName("ABS", 1) };

            Functions functions = filterFac.functions(functionNames);
            final ArithmeticOperators aritmeticOps = filterFac.arithmeticOperators(simple,
                    functions);

            final boolean logicalOps = true;
            scalarCaps = filterFac.scalarCapabilities(comparisonOps, aritmeticOps, logicalOps);
View Full Code Here

Examples of org.opengis.filter.capability.Functions

    public void testParse() throws Exception {
        Element element = FilterMockData.element(document, document,
                new QName(OGC.NAMESPACE, "Functions"));
        FilterMockData.functionNames(document, element);

        Functions functions = (Functions) parse(OGC.FunctionsType);
        assertEquals(2, functions.getFunctionNames().size());
    }
View Full Code Here

Examples of org.opengis.filter.capability.Functions

        Functions functions = (Functions) parse(OGC.FunctionsType);
        assertEquals(2, functions.getFunctionNames().size());
    }

    public void testEncode() throws Exception {
        Functions functions = FilterMockData.functions();
        Document dom = encode(functions, new QName(OGC.NAMESPACE, "Functions"), OGC.FunctionsType);

        assertEquals(1, dom.getElementsByTagNameNS(OGC.NAMESPACE, "FunctionNames").getLength());
        assertEquals(2, dom.getElementsByTagNameNS(OGC.NAMESPACE, "FunctionName").getLength());
    }
View Full Code Here

Examples of org.opengis.filter.capability.Functions

    public Object getProperty(Object object, QName name)
        throws Exception {
        if ("Function_Names".equals(name.getLocalPart())
                || "FunctionNames".equals(name.getLocalPart()) /* 1.1 */) {
            Functions functions = (Functions) object;

            return functions.getFunctionNames();
        }

        return null;
    }
View Full Code Here

Examples of org.opengis.filter.capability.Functions

        //&lt;xsd:element ref="ogc:Simple_Arithmetic"/&gt;
        boolean simpleArithmetic = node.hasChild("Simple_Arithmetic")
            || node.hasChild("SimpleArithmetic"); //1.1

        //&lt;xsd:element name="Functions" type="ogc:FunctionsType"/&gt;
        Functions functions = (Functions) node.getChildValue(Functions.class);

        return factory.arithmeticOperators(simpleArithmetic, functions);
    }
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.