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
This commit is contained in:
Alan Davis
2014-02-12 00:10:00 +00:00
parent 8270475ea1
commit 43ca0651e9
3 changed files with 89 additions and 95 deletions

View File

@@ -346,9 +346,7 @@
<bean id="webscript.org.alfresco.cmiskind" class="org.alfresco.repo.cmis.rest.CMISWebScript" parent="webscript" scope="prototype" /> <bean id="webscript.org.alfresco.cmiskind" class="org.alfresco.repo.cmis.rest.CMISWebScript" parent="webscript" scope="prototype" />
<!-- CMIS Test Runner Web Script --> <!-- CMIS Test Runner Web Script -->
<!-- This is a test and should not be in the bundled with the webapp. Redefined in the test context
<bean id="webscript.org.alfresco.cmis.test.post" class="org.alfresco.repo.cmis.rest.test.CMISTestRunnerWebScript" parent="webscript" /> <bean id="webscript.org.alfresco.cmis.test.post" class="org.alfresco.repo.cmis.rest.test.CMISTestRunnerWebScript" parent="webscript" />
-->
<!-- Content Retrieval --> <!-- Content Retrieval -->
<bean id="webscript.org.alfresco.cmis.content.get" class="org.alfresco.repo.web.scripts.content.ContentGet" parent="webscript"> <bean id="webscript.org.alfresco.cmis.content.get" class="org.alfresco.repo.web.scripts.content.ContentGet" parent="webscript">

View File

@@ -1,88 +1,88 @@
/* /*
* Copyright (C) 2005-2010 Alfresco Software Limited. * Copyright (C) 2005-2010 Alfresco Software Limited.
* *
* This file is part of Alfresco * This file is part of Alfresco
* *
* Alfresco is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* Alfresco is distributed in the hope that it will be useful, * Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.alfresco.repo.cmis.rest.test; package org.alfresco.repo.cmis.rest.test;
import java.io.IOException; import java.io.IOException;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.Properties; import java.util.Properties;
import org.springframework.extensions.webscripts.AbstractWebScript; import org.springframework.extensions.webscripts.AbstractWebScript;
import org.springframework.extensions.webscripts.WebScriptRequest; import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse; import org.springframework.extensions.webscripts.WebScriptResponse;
import org.apache.chemistry.tck.atompub.TCKMessageWriter; import org.apache.chemistry.tck.atompub.TCKMessageWriter;
import org.apache.chemistry.tck.atompub.tools.TCKRunner; import org.apache.chemistry.tck.atompub.tools.TCKRunner;
import org.apache.chemistry.tck.atompub.tools.TCKRunnerOptions; import org.apache.chemistry.tck.atompub.tools.TCKRunnerOptions;
/** /**
* Execute CMIS Tests * Execute CMIS Tests
* *
* @author davidc * @author davidc
*/ */
public class CMISTestRunnerWebScript extends AbstractWebScript public class CMISTestRunnerWebScript extends AbstractWebScript
{ {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScript#execute(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse) * @see org.alfresco.web.scripts.WebScript#execute(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse)
*/ */
public void execute(WebScriptRequest req, WebScriptResponse res) public void execute(WebScriptRequest req, WebScriptResponse res)
throws IOException throws IOException
{ {
// setup default values // setup default values
Properties properties = new Properties(); Properties properties = new Properties();
properties.put(TCKRunnerOptions.PROP_VALIDATE, "false"); properties.put(TCKRunnerOptions.PROP_VALIDATE, "false");
properties.put(TCKRunnerOptions.PROP_FAIL_ON_VALIDATION_ERROR, "false"); properties.put(TCKRunnerOptions.PROP_FAIL_ON_VALIDATION_ERROR, "false");
properties.put(TCKRunnerOptions.PROP_TRACE_REQUESTS, "false"); properties.put(TCKRunnerOptions.PROP_TRACE_REQUESTS, "false");
// apply form provided values // apply form provided values
TCKRunnerOptions options = new TCKRunnerOptions(properties); TCKRunnerOptions options = new TCKRunnerOptions(properties);
String[] names = req.getParameterNames(); String[] names = req.getParameterNames();
for (String name : names) for (String name : names)
{ {
properties.setProperty(name, req.getParameter(name)); properties.setProperty(name, req.getParameter(name));
} }
// execute tck // execute tck
TCKRunner runner = new TCKRunner(options, new ResponseMessageWriter(res)); TCKRunner runner = new TCKRunner(options, new ResponseMessageWriter(res));
runner.execute(properties); runner.execute(properties);
} }
private static class ResponseMessageWriter implements TCKMessageWriter private static class ResponseMessageWriter implements TCKMessageWriter
{ {
private PrintStream printStream; private PrintStream printStream;
public ResponseMessageWriter(WebScriptResponse res) throws IOException public ResponseMessageWriter(WebScriptResponse res) throws IOException
{ {
printStream = new PrintStream(res.getOutputStream(), true, "UTF-8"); printStream = new PrintStream(res.getOutputStream(), true, "UTF-8");
} }
public void info(String message) public void info(String message)
{ {
printStream.println("INFO " + message); printStream.println("INFO " + message);
} }
public void trace(String message) public void trace(String message)
{ {
printStream.println("TRACE " + message); printStream.println("TRACE " + message);
} }
public void warn(String message) public void warn(String message)
{ {
printStream.println("WARN " + message); printStream.println("WARN " + message);
} }
} }
} }

View File

@@ -22,9 +22,5 @@
</bean> </bean>
</property> </property>
</bean> </bean>
<!-- Moved from main context, as it's a test bean -->
<bean id="webscript.org.alfresco.cmis.test.post" class="org.alfresco.repo.cmis.rest.test.CMISTestRunnerWebScript" parent="webscript" />
</beans> </beans>