Author: fmui
Date: Fri Aug 28 16:30:13 2015
New Revision: 1698365
URL: http://svn.apache.org/r1698365
Log:
added code coverage and more unit tests
Added:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/OperationContextTest.java
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/MimeTypesTest.java
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementTest.java
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractConverterTest.java
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java
chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml
chemistry/opencmis/trunk/pom.xml
Added:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/OperationContextTest.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/OperationContextTest.java?rev=1698365&view=auto
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/OperationContextTest.java
(added)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/OperationContextTest.java
Fri Aug 28 16:30:13 2015
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.client.runtime;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Set;
+
+import org.junit.Test;
+
+public class OperationContextTest {
+
+ @Test
+ public void testFilter() {
+ OperationContextImpl oc = new OperationContextImpl();
+
+ oc.setFilterString("p1 ,p2, p3");
+ Set<String> filter = oc.getFilter();
+
+ assertEquals(6, filter.size());
+ assertTrue(filter.contains("p1"));
+ assertTrue(filter.contains("p2"));
+ assertTrue(filter.contains("p3"));
+ assertTrue(filter.contains("cmis:objectId"));
+ assertTrue(filter.contains("cmis:objectTypeId"));
+ assertTrue(filter.contains("cmis:baseTypeId"));
+
+ oc.setFilterString("*");
+ filter = oc.getFilter();
+
+ assertEquals(1, filter.size());
+ assertTrue(filter.contains("*"));
+ }
+
+ @Test
+ public void testRenditionFilter() {
+ OperationContextImpl oc = new OperationContextImpl();
+
+ oc.setRenditionFilterString("a/b , c/d");
+ Set<String> filter = oc.getRenditionFilter();
+
+ assertEquals(2, filter.size());
+ assertTrue(filter.contains("a/b"));
+ assertTrue(filter.contains("c/d"));
+
+ oc.setRenditionFilterString("");
+ filter = oc.getRenditionFilter();
+
+ assertEquals(1, filter.size());
+ assertTrue(filter.contains("cmis:none"));
+
+ oc.setRenditionFilterString(null);
+ filter = oc.getRenditionFilter();
+
+ assertEquals(1, filter.size());
+ assertTrue(filter.contains("cmis:none"));
+ }
+}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementTest.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementTest.java?rev=1698365&r1=1698364&r2=1698365&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementTest.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/QueryStatementTest.java
Fri Aug 28 16:30:13 2015
@@ -19,7 +19,12 @@
package org.apache.chemistry.opencmis.client.runtime;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.TimeZone;
@@ -117,6 +122,26 @@ public class QueryStatementTest {
st.setId(1, new ObjectIdImpl("123"));
assertEquals("SELECT * FROM cmis:document WHERE abc:id = '123'",
st.toQueryString());
+ // URIs
+ try {
+ query = "SELECT * FROM cmis:document WHERE abc:uri = ?";
+ st = new QueryStatementImpl(session, query);
+ st.setUri(1, new URI("http://apache.org/test"));
+ assertEquals("SELECT * FROM cmis:document WHERE abc:uri =
'http://apache.org/test'", st.toQueryString());
+ } catch (URISyntaxException e) {
+ fail(e.toString());
+ }
+
+ // URLs
+ try {
+ query = "SELECT * FROM cmis:document WHERE abc:url = ?";
+ st = new QueryStatementImpl(session, query);
+ st.setUrl(1, new URL("http://apache.org/test"));
+ assertEquals("SELECT * FROM cmis:document WHERE abc:url =
'http://apache.org/test'", st.toQueryString());
+ } catch (MalformedURLException e) {
+ fail(e.toString());
+ }
+
// booleans
query = "SELECT * FROM cmis:document WHERE abc:bool = ?";
st = new QueryStatementImpl(session, query);
Added:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/MimeTypesTest.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/MimeTypesTest.java?rev=1698365&view=auto
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/MimeTypesTest.java
(added)
+++
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/MimeTypesTest.java
Fri Aug 28 16:30:13 2015
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.commons.impl.misc;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+
+import org.apache.chemistry.opencmis.commons.impl.MimeTypes;
+import org.junit.Test;
+
+public class MimeTypesTest {
+
+ @Test
+ public void testMimeTypes() {
+ assertEquals(".txt", MimeTypes.getExtension("text/plain"));
+ assertEquals(".txt", MimeTypes.getExtension("TEXT/PLAIN"));
+ assertEquals(".txt", MimeTypes.getExtension("text/plain ;
charset=UTF-8"));
+ assertEquals("", MimeTypes.getExtension("unknown/type"));
+ assertEquals("", MimeTypes.getExtension(null));
+
+ assertEquals("text/plain", MimeTypes.getMIMEType("txt"));
+ assertEquals("text/plain", MimeTypes.getMIMEType(".txt"));
+ assertEquals("application/octet-stream",
MimeTypes.getMIMEType("someUnknownExtension"));
+ assertEquals("application/octet-stream",
MimeTypes.getMIMEType((String) null));
+
+ assertEquals("text/plain", MimeTypes.getMIMEType(new
File("test.txt")));
+ assertEquals("application/octet-stream", MimeTypes.getMIMEType((File)
null));
+ }
+}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractConverterTest.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractConverterTest.java?rev=1698365&r1=1698364&r2=1698365&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractConverterTest.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractConverterTest.java
Fri Aug 28 16:30:13 2015
@@ -280,11 +280,11 @@ public abstract class AbstractConverterT
LOG.debug(name + ": " + expected + " / " + actual);
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
- if ((expected == null) || (actual == null)) {
+ if (expected == null || actual == null) {
fail("Data object is null! name: " + name + " / expected: " +
expected + " / actual: " + actual);
}
@@ -365,4 +365,33 @@ public abstract class AbstractConverterT
}
}
}
+
+ /**
+ * Compares two extensions.
+ */
+ protected void assertExtensionsEquals(List<CmisExtensionElement> expected,
List<CmisExtensionElement> actual) {
+ if (expected == null && actual == null) {
+ return;
+ }
+
+ if (expected == null || actual == null) {
+ fail("Extension list is null! expected: " + expected + " / actual:
" + actual);
+ }
+
+ assertEquals(expected.size(), actual.size());
+
+ int n = expected.size();
+ for (int i = 0; i < n; i++) {
+ CmisExtensionElement expectedElement = expected.get(0);
+ CmisExtensionElement actualElement = actual.get(0);
+
+ if (expectedElement == null || actualElement == null) {
+ fail("Extension element is null! expected: " + expectedElement
+ " / actual: " + actualElement);
+ }
+
+ assertEquals(expectedElement.getName(), actualElement.getName());
+ assertEquals(expectedElement.getValue(), actualElement.getValue());
+ assertExtensionsEquals(expectedElement.getChildren(),
actualElement.getChildren());
+ }
+ }
}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java?rev=1698365&r1=1698364&r2=1698365&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/AbstractXMLConverterTest.java
Fri Aug 28 16:30:13 2015
@@ -103,6 +103,7 @@ public abstract class AbstractXMLConvert
/**
* Sets up the schema.
*/
+ @Override
@Before
public void init() throws Exception {
super.init();
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java?rev=1698365&r1=1698364&r2=1698365&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/xml/ObjectConvertTest.java
Fri Aug 28 16:30:13 2015
@@ -24,8 +24,11 @@ import static org.junit.Assert.assertTru
import java.io.ByteArrayOutputStream;
import java.io.StringWriter;
+import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -41,7 +44,19 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.data.ObjectInFolderData;
import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList;
import org.apache.chemistry.opencmis.commons.data.ObjectList;
+import org.apache.chemistry.opencmis.commons.data.PropertyBoolean;
+import org.apache.chemistry.opencmis.commons.data.PropertyData;
+import org.apache.chemistry.opencmis.commons.data.PropertyDateTime;
+import org.apache.chemistry.opencmis.commons.data.PropertyDecimal;
+import org.apache.chemistry.opencmis.commons.data.PropertyHtml;
+import org.apache.chemistry.opencmis.commons.data.PropertyId;
+import org.apache.chemistry.opencmis.commons.data.PropertyInteger;
+import org.apache.chemistry.opencmis.commons.data.PropertyString;
+import org.apache.chemistry.opencmis.commons.data.PropertyUri;
import org.apache.chemistry.opencmis.commons.data.RenditionData;
+import
org.apache.chemistry.opencmis.commons.definitions.MutablePropertyDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
import org.apache.chemistry.opencmis.commons.enums.Action;
import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
import org.apache.chemistry.opencmis.commons.enums.ChangeType;
@@ -57,6 +72,8 @@ import org.apache.chemistry.opencmis.com
import
org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlPrincipalDataImpl;
import
org.apache.chemistry.opencmis.commons.impl.dataobjects.AllowableActionsImpl;
import
org.apache.chemistry.opencmis.commons.impl.dataobjects.ChangeEventInfoDataImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.DocumentTypeDefinitionImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.FolderTypeDefinitionImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectDataImpl;
import
org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectInFolderContainerImpl;
import
org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectInFolderDataImpl;
@@ -64,6 +81,14 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectListImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.PolicyIdListImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyBooleanDefinitionImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyDateTimeDefinitionImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyDecimalDefinitionImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyHtmlDefinitionImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdDefinitionImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIntegerDefinitionImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringDefinitionImpl;
+import
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyUriDefinitionImpl;
import
org.apache.chemistry.opencmis.commons.impl.dataobjects.RenditionDataImpl;
import
org.apache.chemistry.opencmis.commons.impl.jaxb.CmisObjectInFolderContainerType;
import
org.apache.chemistry.opencmis.commons.impl.jaxb.CmisObjectInFolderListType;
@@ -85,8 +110,9 @@ public class ObjectConvertTest extends A
ObjectDataImpl data11 = createObjectData(true,
CmisVersion.CMIS_1_1, true, true);
assertObjectData11(data11, true);
- ObjectDataImpl data11j = createObjectData(true,
CmisVersion.CMIS_1_1, true, false);
+ ObjectDataImpl data11j = createObjectData(true,
CmisVersion.CMIS_1_1, true, true);
assertJsonObjectData11(data11j);
+ assertJsonObjectData11Succinct(data11j);
}
}
@@ -372,7 +398,46 @@ public class ObjectConvertTest extends A
ObjectData result = JSONConverter.convertObject((Map<String, Object>)
json, typeCache);
assertNotNull(result);
- assertDataObjectsEquals("ObjectData", data, result, null);
+ assertDataObjectsEquals("ObjectData", data, result,
Collections.singleton("getExtensions"));
+ assertExtensionsEquals(data.getExtensions(), result.getExtensions());
+ }
+
+ protected void assertJsonObjectData11Succinct(ObjectData data) throws
Exception {
+ TypeCache typeCache = new TestTypeCache(data);
+
+ StringWriter sw = new StringWriter();
+
+ JSONObject jsonObject = JSONConverter.convert(data, typeCache,
JSONConverter.PropertyMode.CHANGE, true,
+ DateTimeFormat.SIMPLE);
+ jsonObject.writeJSONString(sw);
+
+ // test toJSONString()
+ assertEquals(sw.toString(), jsonObject.toJSONString());
+
+ Object json = (new JSONParser()).parse(sw.toString());
+ assertTrue(json instanceof Map<?, ?>);
+ @SuppressWarnings("unchecked")
+ ObjectData result = JSONConverter.convertObject((Map<String, Object>)
json, typeCache);
+
+ assertNotNull(result);
+
+ Set<String> ignoreMethods = new HashSet<String>();
+ ignoreMethods.add("getProperties");
+ ignoreMethods.add("getExtensions");
+
+ assertDataObjectsEquals("ObjectData", data, result, ignoreMethods);
+ assertExtensionsEquals(data.getExtensions(), result.getExtensions());
+
+ assertEquals(data.getProperties().getPropertyList().size(),
result.getProperties().getPropertyList().size());
+
+ for (PropertyData<?> prop : data.getProperties().getPropertyList()) {
+
assertTrue(result.getProperties().getProperties().containsKey(prop.getId()));
+
+ Object value =
data.getProperties().getProperties().get(prop.getId()).getFirstValue();
+ if (value instanceof String) {
+ assertEquals(value,
result.getProperties().getProperties().get(prop.getId()).getFirstValue());
+ }
+ }
}
protected void assertObjectList(ObjectList children1, ObjectInFolderList
children2) throws Exception {
@@ -462,4 +527,70 @@ public class ObjectConvertTest extends A
assertNotNull(result);
assertDataObjectsEquals("ObjectContainer", container, result, null);
}
+
+ private static class TestTypeCache implements TypeCache {
+
+ private DocumentTypeDefinitionImpl objectType;
+
+ public TestTypeCache(ObjectData data) {
+ objectType = new DocumentTypeDefinitionImpl();
+
+ for (PropertyData<?> prop :
data.getProperties().getPropertyList()) {
+ MutablePropertyDefinition<?> propDef;
+
+ if (prop instanceof PropertyString) {
+ propDef = new PropertyStringDefinitionImpl();
+ } else if (prop instanceof PropertyId) {
+ propDef = new PropertyIdDefinitionImpl();
+ } else if (prop instanceof PropertyBoolean) {
+ propDef = new PropertyBooleanDefinitionImpl();
+ } else if (prop instanceof PropertyInteger) {
+ propDef = new PropertyIntegerDefinitionImpl();
+ } else if (prop instanceof PropertyDateTime) {
+ propDef = new PropertyDateTimeDefinitionImpl();
+ } else if (prop instanceof PropertyDecimal) {
+ propDef = new PropertyDecimalDefinitionImpl();
+ } else if (prop instanceof PropertyHtml) {
+ propDef = new PropertyHtmlDefinitionImpl();
+ } else if (prop instanceof PropertyUri) {
+ propDef = new PropertyUriDefinitionImpl();
+ } else {
+ throw new IllegalArgumentException("Invalid data type!");
+ }
+
+ propDef.setId(prop.getId());
+ propDef.setDisplayName(prop.getDisplayName());
+ propDef.setLocalName(prop.getLocalName());
+ propDef.setQueryName(prop.getQueryName());
+
+ objectType.addPropertyDefinition(propDef);
+ }
+ }
+
+ @Override
+ public TypeDefinition getTypeDefinition(String typeId) {
+ if ("cmis:folder".equals(typeId)) {
+ return new FolderTypeDefinitionImpl();
+ } else if ("cmis:document".equals(typeId)) {
+ return new DocumentTypeDefinitionImpl();
+ } else {
+ return objectType;
+ }
+ }
+
+ @Override
+ public TypeDefinition reloadTypeDefinition(String typeId) {
+ return null;
+ }
+
+ @Override
+ public TypeDefinition getTypeDefinitionForObject(String objectId) {
+ return null;
+ }
+
+ @Override
+ public PropertyDefinition<?> getPropertyDefinition(String propId) {
+ return null;
+ }
+ }
}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java?rev=1698365&r1=1698364&r2=1698365&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java
Fri Aug 28 16:30:13 2015
@@ -27,6 +27,7 @@ import static org.junit.Assert.assertTru
import static org.junit.Assert.fail;
import java.io.File;
+import java.io.FileInputStream;
import org.apache.chemistry.opencmis.commons.server.TempStoreOutputStream;
import
org.apache.chemistry.opencmis.server.shared.TempStoreOutputStreamFactory;
@@ -208,6 +209,80 @@ public class ThresholdOutputStreamTest {
}
@Test
+ public void testDestroy() throws Exception {
+ TempStoreOutputStreamFactory streamFactory =
TempStoreOutputStreamFactory.newInstance(null, 0, 1024, false);
+
+ TempStoreOutputStream tempStream = streamFactory.newOutputStream();
+ tempStream.setMimeType(MIME_TYPE_2);
+ tempStream.setFileName(FILE_NAME_2);
+ assertTrue(tempStream instanceof ThresholdOutputStream);
+
+ // set content
+ ThresholdOutputStream tos = (ThresholdOutputStream) tempStream;
+ tos.write(CONTENT);
+ tos.close();
+
+ // get and check input stream
+ ThresholdInputStream tis = (ThresholdInputStream) tos.getInputStream();
+
+ assertFalse(tis.isInMemory());
+
+ File tempFile = tis.getTemporaryFile();
+ assertTrue(tempFile.exists());
+
+ // destroy
+ tempStream.destroy(new Exception("ohoh"));
+
+ // check temp file
+ assertFalse(tempFile.exists());
+ }
+
+ @Test
+ public void testEncrypt() throws Exception {
+ TempStoreOutputStreamFactory streamFactory =
TempStoreOutputStreamFactory.newInstance(null, 0, 1024, true);
+
+ TempStoreOutputStream tempStream = streamFactory.newOutputStream();
+ tempStream.setMimeType(MIME_TYPE_2);
+ tempStream.setFileName(FILE_NAME_2);
+ assertTrue(tempStream instanceof ThresholdOutputStream);
+
+ // set content
+ ThresholdOutputStream tos = (ThresholdOutputStream) tempStream;
+ tos.write(CONTENT);
+ tos.close();
+
+ // get and check input stream
+ ThresholdInputStream tis = (ThresholdInputStream) tos.getInputStream();
+
+ assertFalse(tis.isInMemory());
+
+ File tempFile = tis.getTemporaryFile();
+ assertTrue(tempFile.exists());
+
+ // temp file must not contain clear data
+ boolean isDifferent = false;
+
+ FileInputStream tempFileStream = new
FileInputStream(tis.getTemporaryFile());
+ for (byte b1 : CONTENT) {
+ byte b2 = (byte) tempFileStream.read();
+ if (b1 != b2) {
+ isDifferent = true;
+ break;
+ }
+ }
+
+ tempFileStream.close();
+
+ assertTrue(isDifferent);
+
+ // close
+ tis.close();
+
+ // check temp file
+ assertFalse(tempFile.exists());
+ }
+
+ @Test
public void testNoThreshold() throws Exception {
int size = 128 * 1024;
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml?rev=1698365&r1=1698364&r2=1698365&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml
Fri Aug 28 16:30:13 2015
@@ -1,34 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you
- may not use this file except in compliance with the License. You may
obtain
- a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless
- required by applicable law or agreed to in writing, software
distributed
- under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES
- OR CONDITIONS OF ANY KIND, either express or implied. See the License
for
- the specific language governing permissions and limitations under the
License. -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you
+ may not use this file except in compliance with the License. You may obtain
+ a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
+ required by applicable law or agreed to in writing, software distributed
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the
License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.chemistry.opencmis</groupId>
- <artifactId>chemistry-opencmis</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
-
- <artifactId>chemistry-opencmis-test-fit</artifactId>
- <name>OpenCMIS Full Integration Tests</name>
- <packaging>war</packaging>
-
- <properties>
- <parentBasedir>../../</parentBasedir>
- <modeshape.version>3.2.0.Final</modeshape.version>
+ <parent>
+ <groupId>org.apache.chemistry.opencmis</groupId>
+ <artifactId>chemistry-opencmis</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+
+ <artifactId>chemistry-opencmis-test-fit</artifactId>
+ <name>OpenCMIS Full Integration Tests</name>
+ <packaging>war</packaging>
+
+ <properties>
+ <parentBasedir>../../</parentBasedir>
+ <modeshape.version>3.2.0.Final</modeshape.version>
<jackrabbit-core.version>2.6.1</jackrabbit-core.version>
- <maven-failsafe-plugin.version>2.17</maven-failsafe-plugin.version>
<maven-jetty-plugin.version>6.1.22</maven-jetty-plugin.version>
<jcr.version>2.0</jcr.version>
<overlay.groupId />
@@ -43,204 +42,205 @@
<default.versionableDocumentType>VersionableType</default.versionableDocumentType>
<test.versionable>true</test.versionable>
<test.notVersionable>true</test.notVersionable>
+ <argLine>-Xmx512m -ea:org.apache.chemistry</argLine>
</properties>
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <overlays>
- <overlay>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <overlays>
+ <overlay>
<groupId>${overlay.groupId}</groupId>
<artifactId>${overlay.artifactId}</artifactId>
- </overlay>
- </overlays>
- <webResources>
- <resource>
-
<directory>${project.basedir}/src/main/webapp/WEB-INF</directory>
- <filtering>true</filtering>
- <targetPath>WEB-INF</targetPath>
- <includes>
- <include>**/*.*</include>
- </includes>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
-
<version>${maven-failsafe-plugin.version}</version>
- <configuration>
- <encoding>UTF-8</encoding>
- <reuseForks>true</reuseForks>
-
<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
- <argLine>-Xmx512m
-ea:org.apache.chemistry</argLine>
- </configuration>
- <executions>
- <execution>
- <id>integration-test</id>
- <goals>
-
<goal>integration-test</goal>
- </goals>
- </execution>
- <execution>
- <id>verify</id>
- <goals>
- <goal>verify</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>${maven-jetty-plugin.version}</version>
- <configuration>
-
<scanIntervalSeconds>10</scanIntervalSeconds>
- <stopPort>19966</stopPort>
- <stopKey>foo</stopKey>
- <connectors>
- <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>19080</port>
- <host>0.0.0.0</host>
- </connector>
- </connectors>
- <systemProperties>
+ </overlay>
+ </overlays>
+ <webResources>
+ <resource>
+
<directory>${project.basedir}/src/main/webapp/WEB-INF</directory>
+ <filtering>true</filtering>
+ <targetPath>WEB-INF</targetPath>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${failsafe.version}</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <reuseForks>true</reuseForks>
+ <forkCount>1</forkCount>
+
<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${maven-jetty-plugin.version}</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopPort>19966</stopPort>
+ <stopKey>foo</stopKey>
+ <connectors>
+ <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>19080</port>
+ <host>0.0.0.0</host>
+ </connector>
+ </connectors>
+ <systemProperties>
+ <systemProperty>
+
<name>org.apache.chemistry.opencmis.session.repository.id</name>
+ <value>${repository}</value>
+ </systemProperty>
+ <systemProperty>
+ <name>org.apache.chemistry.opencmis.user</name>
+ <value>${user}</value>
+ </systemProperty>
+ <systemProperty>
+ <name>org.apache.chemistry.opencmis.password</name>
+ <value>${password}</value>
+ </systemProperty>
+ <systemProperty>
+
<name>org.apache.chemistry.opencmis.tck.default.documentType</name>
+ <value>${default.documentType}</value>
+ </systemProperty>
+ <systemProperty>
+
<name>org.apache.chemistry.opencmis.tck.default.versionableDocumentType</name>
+ <value>${default.versionableDocumentType}</value>
+ </systemProperty>
+ <systemProperty>
+
<name>org.apache.chemistry.opencmis.tck.testNotVersionable</name>
+ <value>${test.notVersionable}</value>
+ </systemProperty>
<systemProperty>
-
<name>org.apache.chemistry.opencmis.session.repository.id</name>
- <value>${repository}</value>
- </systemProperty>
- <systemProperty>
-
<name>org.apache.chemistry.opencmis.user</name>
- <value>${user}</value>
- </systemProperty>
- <systemProperty>
-
<name>org.apache.chemistry.opencmis.password</name>
- <value>${password}</value>
- </systemProperty>
- <systemProperty>
-
<name>org.apache.chemistry.opencmis.tck.default.documentType</name>
- <value>${default.documentType}</value>
- </systemProperty>
- <systemProperty>
-
<name>org.apache.chemistry.opencmis.tck.default.versionableDocumentType</name>
-
<value>${default.versionableDocumentType}</value>
- </systemProperty>
- <systemProperty>
-
<name>org.apache.chemistry.opencmis.tck.testNotVersionable</name>
- <value>${test.notVersionable}</value>
- </systemProperty>
- <systemProperty>
-
<name>org.apache.chemistry.opencmis.tck.testVersionable</name>
- <value>${test.versionable}</value>
- </systemProperty>
- <systemProperty>
- <name>project.basedir</name>
- <value>${project.basedir}</value>
- </systemProperty>
+
<name>org.apache.chemistry.opencmis.tck.testVersionable</name>
+ <value>${test.versionable}</value>
+ </systemProperty>
<systemProperty>
- <name>project.build.directory</name>
-
<value>${project.build.directory}</value>
- </systemProperty>
- </systemProperties>
- <webAppConfig>
-
<contextPath>/opencmis</contextPath>
- </webAppConfig>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
-
<phase>pre-integration-test</phase>
- <goals>
- <goal>run-war</goal>
- </goals>
- <configuration>
-
<scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
-
<phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>chemistry-opencmis-test-tck</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>chemistry-opencmis-test-util</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <profiles>
+ <name>project.basedir</name>
+ <value>${project.basedir}</value>
+ </systemProperty>
+ <systemProperty>
+ <name>project.build.directory</name>
+ <value>${project.build.directory}</value>
+ </systemProperty>
+ </systemProperties>
+ <webAppConfig>
+ <contextPath>/opencmis</contextPath>
+ </webAppConfig>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run-war</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>chemistry-opencmis-test-tck</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>chemistry-opencmis-test-util</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
<profile>
<id>jcr-modeshape-inmemory</id>
<properties>
- <overlay.groupId>org.apache.chemistry.opencmis</overlay.groupId>
-
<overlay.artifactId>chemistry-opencmis-server-jcr</overlay.artifactId>
-
<factory.class>org.apache.chemistry.opencmis.jcr.JcrServiceFactory</factory.class>
- <!-- Used in ServiceLoader to look up impl. -->
-
<service.factory.class>org.modeshape.jcr.JcrRepositoryFactory</service.factory.class>
- <repository>test</repository>
- <default.documentType>cmis:document</default.documentType>
-
<default.versionableDocumentType>cmis:document</default.versionableDocumentType>
- <test.versionable>true</test.versionable>
+
<overlay.groupId>org.apache.chemistry.opencmis</overlay.groupId>
+
<overlay.artifactId>chemistry-opencmis-server-jcr</overlay.artifactId>
+
<factory.class>org.apache.chemistry.opencmis.jcr.JcrServiceFactory</factory.class>
+ <!-- Used in ServiceLoader to look up impl. -->
+
<service.factory.class>org.modeshape.jcr.JcrRepositoryFactory</service.factory.class>
+ <repository>test</repository>
+ <default.documentType>cmis:document</default.documentType>
+
<default.versionableDocumentType>cmis:document</default.versionableDocumentType>
+ <test.versionable>true</test.versionable>
<test.notVersionable>false</test.notVersionable>
- <forkMode>never</forkMode>
+ <forkMode>never</forkMode>
</properties>
- <dependencies>
- <dependency>
- <groupId>org.modeshape</groupId>
- <artifactId>modeshape-jcr</artifactId>
- <version>${modeshape.version}</version>
- <exclusions>
+ <dependencies>
+ <dependency>
+ <groupId>org.modeshape</groupId>
+ <artifactId>modeshape-jcr</artifactId>
+ <version>${modeshape.version}</version>
+ <exclusions>
<exclusion>
<artifactId>tika-parsers</artifactId>
<groupId>org.apache.tika</groupId>
</exclusion>
</exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.chemistry.opencmis</groupId>
-
<artifactId>chemistry-opencmis-server-jcr</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.apache.chemistry.opencmis</groupId>
-
<artifactId>chemistry-opencmis-server-bindings</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.chemistry.opencmis</groupId>
-
<artifactId>chemistry-opencmis-server-jcr</artifactId>
- <version>${project.version}</version>
- <classifier>classes</classifier>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.chemistry.opencmis</groupId>
+ <artifactId>chemistry-opencmis-server-jcr</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.chemistry.opencmis</groupId>
+ <artifactId>chemistry-opencmis-server-bindings</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.chemistry.opencmis</groupId>
+ <artifactId>chemistry-opencmis-server-jcr</artifactId>
+ <version>${project.version}</version>
+ <classifier>classes</classifier>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
@@ -250,33 +250,33 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
- </dependency>
- </dependencies>
+ </dependency>
+ </dependencies>
</profile>
<profile>
<id>chemistry-inmemory</id>
<activation>
- <activeByDefault>true</activeByDefault>
- </activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
<properties>
- <overlay.groupId>${project.groupId}</overlay.groupId>
-
<overlay.artifactId>chemistry-opencmis-server-inmemory</overlay.artifactId>
-
<factory.class>org.apache.chemistry.opencmis.inmemory.server.InMemoryServiceFactoryImpl</factory.class>
- <!-- Used in ServiceLoader to look up impl. -->
- <service.factory.class>${factory.class}</service.factory.class>
- <repository>test</repository>
+ <overlay.groupId>${project.groupId}</overlay.groupId>
+
<overlay.artifactId>chemistry-opencmis-server-inmemory</overlay.artifactId>
+
<factory.class>org.apache.chemistry.opencmis.inmemory.server.InMemoryServiceFactoryImpl</factory.class>
+ <!-- Used in ServiceLoader to look up impl. -->
+ <service.factory.class>${factory.class}</service.factory.class>
+ <repository>test</repository>
<default.documentType>cmis:document</default.documentType>
<default.versionableDocumentType>VersionableType</default.versionableDocumentType>
<test.versionable>true</test.versionable>
<test.notVersionable>true</test.notVersionable>
</properties>
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
-
<artifactId>chemistry-opencmis-server-inmemory</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>chemistry-opencmis-server-inmemory</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
@@ -286,27 +286,27 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
- </dependency>
+ </dependency>
</dependencies>
- </profile>
+ </profile>
<profile>
<id>jcr-jackrabbit-inmemory</id>
<properties>
- <overlay.groupId>${project.groupId}</overlay.groupId>
-
<overlay.artifactId>chemistry-opencmis-server-bindings-war</overlay.artifactId>
-
<factory.class>org.apache.chemistry.opencmis.jcr.JcrServiceFactory</factory.class>
- <!-- Used in ServiceLoader to look up impl. -->
-
<service.factory.class>org.apache.jackrabbit.core.RepositoryFactoryImpl</service.factory.class>
- <repository>default</repository>
- <user>admin</user>
- <password>admin</password>
- <default.documentType>cmis:document</default.documentType>
-
<default.versionableDocumentType>cmis:document</default.versionableDocumentType>
- <test.versionable>true</test.versionable>
+ <overlay.groupId>${project.groupId}</overlay.groupId>
+
<overlay.artifactId>chemistry-opencmis-server-bindings-war</overlay.artifactId>
+
<factory.class>org.apache.chemistry.opencmis.jcr.JcrServiceFactory</factory.class>
+ <!-- Used in ServiceLoader to look up impl. -->
+
<service.factory.class>org.apache.jackrabbit.core.RepositoryFactoryImpl</service.factory.class>
+ <repository>default</repository>
+ <user>admin</user>
+ <password>admin</password>
+ <default.documentType>cmis:document</default.documentType>
+
<default.versionableDocumentType>cmis:document</default.versionableDocumentType>
+ <test.versionable>true</test.versionable>
<test.notVersionable>false</test.notVersionable>
- <forkMode>never</forkMode>
+ <forkMode>never</forkMode>
</properties>
- <dependencies>
+ <dependencies>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
@@ -327,24 +327,24 @@
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.chemistry.opencmis</groupId>
-
<artifactId>chemistry-opencmis-server-jcr</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.apache.chemistry.opencmis</groupId>
-
<artifactId>chemistry-opencmis-server-bindings</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.chemistry.opencmis</groupId>
-
<artifactId>chemistry-opencmis-server-jcr</artifactId>
- <version>${project.version}</version>
- <classifier>classes</classifier>
- </dependency>
- </dependencies>
- </profile>
+ <dependency>
+ <groupId>org.apache.chemistry.opencmis</groupId>
+ <artifactId>chemistry-opencmis-server-jcr</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.chemistry.opencmis</groupId>
+ <artifactId>chemistry-opencmis-server-bindings</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.chemistry.opencmis</groupId>
+ <artifactId>chemistry-opencmis-server-jcr</artifactId>
+ <version>${project.version}</version>
+ <classifier>classes</classifier>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
</project>
Modified: chemistry/opencmis/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/pom.xml?rev=1698365&r1=1698364&r2=1698365&view=diff
==============================================================================
--- chemistry/opencmis/trunk/pom.xml (original)
+++ chemistry/opencmis/trunk/pom.xml Fri Aug 28 16:30:13 2015
@@ -40,10 +40,10 @@
</organization>
<url>http://chemistry.apache.org/java/</url>
-
+
<ciManagement>
- <system>Hudson Zones Apache</system>
- <url>http://hudson.zones.apache.org/hudson/view/Chemistry/</url>
+ <system>Apache Build Server</system>
+ <url>https://builds.apache.org/view/A-D/view/Chemistry/</url>
</ciManagement>
<inceptionYear>2009</inceptionYear>
<description>
@@ -206,13 +206,13 @@
<maven.compile.target>1.6</maven.compile.target>
<docs.start.url>http://chemistry.apache.org/java/opencmis.html</docs.start.url>
<docs.download.directory>${project.build.directory}/downloaded-site</docs.download.directory>
- <!--
- | Here we configure Maven documentation site (incl. Javadocs)
deployment
+ <!--
+ | Here we configure Maven documentation site (incl. Javadocs)
deployment
|
| By default site is deployed to:
- |
https://svn.apache.org/repos/asf/chemistry/site/trunk/content/java/${site.label}/maven/
- | where site.label = project.version
-
+ |
https://svn.apache.org/repos/asf/chemistry/site/trunk/content/java/${site.label}/maven/
+ | where site.label = project.version
+
| For details/changes see
http://chemistry.apache.org/java/documentation-lifecycle.html
|
| Note: Site label (or any other property like site.staging.url)
can be overriden on the command line to deploy to distinct location during site
development
@@ -230,6 +230,9 @@
<osgi.version>5.0.0</osgi.version>
<felix.plugin.version>2.3.7</felix.plugin.version>
<junit.version>4.11</junit.version>
+ <surefire.version>2.18.1</surefire.version>
+ <failsafe.version>2.18.1</failsafe.version>
+ <jacoco.version>0.7.5.201505241946</jacoco.version>
<slf4j.version>1.7.5</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<apacheclient.version>4.2.6</apacheclient.version>
@@ -313,7 +316,7 @@
<timestampFormat>{0,date,yyyy-MM-dd'T'HH:mm:ssZ}</timestampFormat>
</configuration>
</plugin>
- <!-- Working, but not attached to the deployment.
+ <!-- Working, but not attached to the deployment.
Blocked on http://jira.codehaus.org/browse/MINSTALL-82
<plugin>
<groupId>net.ju-n.maven.plugins</groupId>
@@ -436,7 +439,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.14.1</version>
+ <version>${surefire.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>${failsafe.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -638,6 +646,36 @@
</reporting>
<profiles>
+ <profile>
+ <id>coverage</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>${jacoco.version}</version>
+ <executions>
+ <execution>
+ <id>default-prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>default-report</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
<!--
Extending the default -Papache-release profile used *only*
during releases