From 43ca0651e9f0e74dece9d955c03c51f6b45b1fb1 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 12 Feb 2014 00:10:00 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud) 58765: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 58763: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 58759: Merged V4.1.7 (4.1.7) to V4.1-BUG-FIX (4.1.8) 58711: MNT-10136 CLONE - CMIS TCK Test failed - Restored POST: http://servername:8080/alfresco/service/cmis/test was lost when test were moved to test-java git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62032 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web-scripts-application-context.xml | 2 - .../rest/test/CMISTestRunnerWebScript.java | 176 +++++++++--------- .../web-scripts-application-context-test.xml | 6 +- 3 files changed, 89 insertions(+), 95 deletions(-) rename source/{test-java => java}/org/alfresco/repo/cmis/rest/test/CMISTestRunnerWebScript.java (97%) diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml index a6c618ff78..0e53790a9b 100644 --- a/config/alfresco/web-scripts-application-context.xml +++ b/config/alfresco/web-scripts-application-context.xml @@ -346,9 +346,7 @@ - diff --git a/source/test-java/org/alfresco/repo/cmis/rest/test/CMISTestRunnerWebScript.java b/source/java/org/alfresco/repo/cmis/rest/test/CMISTestRunnerWebScript.java similarity index 97% rename from source/test-java/org/alfresco/repo/cmis/rest/test/CMISTestRunnerWebScript.java rename to source/java/org/alfresco/repo/cmis/rest/test/CMISTestRunnerWebScript.java index d7c7baf94d..8b168ca5fb 100644 --- a/source/test-java/org/alfresco/repo/cmis/rest/test/CMISTestRunnerWebScript.java +++ b/source/java/org/alfresco/repo/cmis/rest/test/CMISTestRunnerWebScript.java @@ -1,88 +1,88 @@ -/* - * Copyright (C) 2005-2010 Alfresco Software Limited. - * - * This file is part of Alfresco - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ -package org.alfresco.repo.cmis.rest.test; - -import java.io.IOException; -import java.io.PrintStream; -import java.util.Properties; - -import org.springframework.extensions.webscripts.AbstractWebScript; -import org.springframework.extensions.webscripts.WebScriptRequest; -import org.springframework.extensions.webscripts.WebScriptResponse; -import org.apache.chemistry.tck.atompub.TCKMessageWriter; -import org.apache.chemistry.tck.atompub.tools.TCKRunner; -import org.apache.chemistry.tck.atompub.tools.TCKRunnerOptions; - -/** - * Execute CMIS Tests - * - * @author davidc - */ -public class CMISTestRunnerWebScript extends AbstractWebScript -{ - /* (non-Javadoc) - * @see org.alfresco.web.scripts.WebScript#execute(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse) - */ - public void execute(WebScriptRequest req, WebScriptResponse res) - throws IOException - { - // setup default values - Properties properties = new Properties(); - properties.put(TCKRunnerOptions.PROP_VALIDATE, "false"); - properties.put(TCKRunnerOptions.PROP_FAIL_ON_VALIDATION_ERROR, "false"); - properties.put(TCKRunnerOptions.PROP_TRACE_REQUESTS, "false"); - - // apply form provided values - TCKRunnerOptions options = new TCKRunnerOptions(properties); - String[] names = req.getParameterNames(); - for (String name : names) - { - properties.setProperty(name, req.getParameter(name)); - } - - // execute tck - TCKRunner runner = new TCKRunner(options, new ResponseMessageWriter(res)); - runner.execute(properties); - } - - private static class ResponseMessageWriter implements TCKMessageWriter - { - private PrintStream printStream; - - public ResponseMessageWriter(WebScriptResponse res) throws IOException - { - printStream = new PrintStream(res.getOutputStream(), true, "UTF-8"); - } - - public void info(String message) - { - printStream.println("INFO " + message); - } - - public void trace(String message) - { - printStream.println("TRACE " + message); - } - - public void warn(String message) - { - printStream.println("WARN " + message); - } - } -} +/* + * Copyright (C) 2005-2010 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ +package org.alfresco.repo.cmis.rest.test; + +import java.io.IOException; +import java.io.PrintStream; +import java.util.Properties; + +import org.springframework.extensions.webscripts.AbstractWebScript; +import org.springframework.extensions.webscripts.WebScriptRequest; +import org.springframework.extensions.webscripts.WebScriptResponse; +import org.apache.chemistry.tck.atompub.TCKMessageWriter; +import org.apache.chemistry.tck.atompub.tools.TCKRunner; +import org.apache.chemistry.tck.atompub.tools.TCKRunnerOptions; + +/** + * Execute CMIS Tests + * + * @author davidc + */ +public class CMISTestRunnerWebScript extends AbstractWebScript +{ + /* (non-Javadoc) + * @see org.alfresco.web.scripts.WebScript#execute(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse) + */ + public void execute(WebScriptRequest req, WebScriptResponse res) + throws IOException + { + // setup default values + Properties properties = new Properties(); + properties.put(TCKRunnerOptions.PROP_VALIDATE, "false"); + properties.put(TCKRunnerOptions.PROP_FAIL_ON_VALIDATION_ERROR, "false"); + properties.put(TCKRunnerOptions.PROP_TRACE_REQUESTS, "false"); + + // apply form provided values + TCKRunnerOptions options = new TCKRunnerOptions(properties); + String[] names = req.getParameterNames(); + for (String name : names) + { + properties.setProperty(name, req.getParameter(name)); + } + + // execute tck + TCKRunner runner = new TCKRunner(options, new ResponseMessageWriter(res)); + runner.execute(properties); + } + + private static class ResponseMessageWriter implements TCKMessageWriter + { + private PrintStream printStream; + + public ResponseMessageWriter(WebScriptResponse res) throws IOException + { + printStream = new PrintStream(res.getOutputStream(), true, "UTF-8"); + } + + public void info(String message) + { + printStream.println("INFO " + message); + } + + public void trace(String message) + { + printStream.println("TRACE " + message); + } + + public void warn(String message) + { + printStream.println("WARN " + message); + } + } +} diff --git a/source/test-resources/alfresco/web-scripts-application-context-test.xml b/source/test-resources/alfresco/web-scripts-application-context-test.xml index f11a01dc97..cdc0549a4c 100644 --- a/source/test-resources/alfresco/web-scripts-application-context-test.xml +++ b/source/test-resources/alfresco/web-scripts-application-context-test.xml @@ -22,9 +22,5 @@ - - - - - + \ No newline at end of file