Package org.openengsb.core.api.xlink.model

Examples of org.openengsb.core.api.xlink.model.XLinkUrlBlueprint


    // @extract-end

    // @extract-start XLinkUtilsTestPrepareTemplate
    @Test
    public void testPrepareXLinkTemplate() {
        XLinkUrlBlueprint xLinkTemplate =
            XLinkUtils.prepareXLinkTemplate(servletUrl, connectorId, modelsToViews, expiresInDays, registeredTools);   

        //xLinkTemplate.getBaseUrl() =
        //http://openengsb.org/registryServlet.html?expirationDate=20120519212036

        assertTrue(xLinkTemplate.getViewToModels().containsKey(viewId1));
        assertTrue(xLinkTemplate.getViewToModels().get(viewId1)
                .getModelClassName().equals(exampleModelClass.getName()));
    }
View Full Code Here


    // @extract-start XLinkUtilsTestGenerateValidXLinkUrl
    @Test
    public void testGenerateValidXLinkUrl() throws ClassNotFoundException,
        IOException, NoSuchFieldException, IllegalArgumentException,
        IllegalAccessException {
        XLinkUrlBlueprint xLinkTemplate =
                XLinkUtils.prepareXLinkTemplate(servletUrl,
                connectorId, modelsToViews, expiresInDays, registeredTools)
        List<Object> values = new ArrayList<Object>(Arrays.asList("testMethod", "testClass", "testPackage"));

        ModelDescription modelInformation = xLinkTemplate.getViewToModels().get(viewId1);
        String modelAsJsonString = XLinkDemonstrationUtils
            .serializeModelObjectToJSON(values, modelInformation, serviceFinder);
        String xLinkUrl = XLinkDemonstrationUtils
            .generateValidXLinkUrl(xLinkTemplate, modelInformation, contextId, modelAsJsonString);
       
View Full Code Here

    // @extract-start XLinkUtilsTestGenerateValidXLinkUrlLocalSwitching
    @Test
    public void testGenerateValidXLinkUrlForLocalSwitching() throws ClassNotFoundException,
        IOException, NoSuchFieldException,
        IllegalArgumentException, IllegalAccessException {
        XLinkUrlBlueprint xLinkTemplate =
            XLinkUtils.prepareXLinkTemplate(servletUrl, connectorId, modelsToViews, expiresInDays, registeredTools)
        List<Object> values = new ArrayList<Object>(Arrays.asList("testMethod", "testClass", "testPackage"));
        ModelDescription modelInformation = xLinkTemplate.getViewToModels().get(viewId1);
        String modelAsJsonString
            = XLinkDemonstrationUtils.serializeModelObjectToJSON(values, modelInformation, serviceFinder);    
        String xLinkUrl = XLinkDemonstrationUtils.generateValidXLinkUrlForLocalSwitching(xLinkTemplate,
                modelInformation, contextId, viewId1, modelAsJsonString);
View Full Code Here

        baseUrl +=
            "?" + XLinkConstants.XLINK_EXPIRATIONDATE_KEY + "=" + urlEncodeParameter(getExpirationDate(expirationDays));
        String connectorIdParam = XLinkConstants.XLINK_CONNECTORID_KEY + "=" + urlEncodeParameter(connectorId);
        Map<String, ModelDescription> viewToModels = assigneModelsToViews(modelsToViews);
        return
            new XLinkUrlBlueprint(baseUrl,
                viewToModels,
                registeredTools,       
                connectorIdParam,
            new XLinkUrlKeyNames()
        );
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.xlink.model.XLinkUrlBlueprint

Copyright © 2018 www.massapicom. 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.