You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2006/04/01 15:34:23 UTC
svn commit: r390669 - in
/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml:
./ DocumentViewTest.java TestAll.java
Author: jukka
Date: Sat Apr 1 05:34:20 2006
New Revision: 390669
URL: http://svn.apache.org/viewcvs?rev=390669&view=rev
Log:
JCR-369: Added a test case for the two document view import failure with more than one mixin type on a node.
Added:
jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/
jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/DocumentViewTest.java (with props)
jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/TestAll.java (with props)
Added: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/DocumentViewTest.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/DocumentViewTest.java?rev=390669&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/DocumentViewTest.java (added)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/DocumentViewTest.java Sat Apr 1 05:34:20 2006
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. 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.jackrabbit.core.xml;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.Session;
+import javax.jcr.ValueFormatException;
+
+import org.apache.jackrabbit.core.TestRepository;
+
+import junit.framework.TestCase;
+
+/**
+ * Jackrabbit-specific test cases for the document view XML format.
+ *
+ * @see org.apache.jackrabbit.test.api.ExportDocViewTest
+ * @see org.apache.jackrabbit.test.api.DocumentViewImportTest
+ */
+public class DocumentViewTest extends TestCase {
+
+ /**
+ * Test case for
+ * <a href="http://issues.apache.org/jira/browse/JCR-369">JCR-369</a>:
+ * IllegalNameException when importing document view with two mixins.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
+ public void testTwoMixins() throws Exception {
+ Session session = TestRepository.getInstance().login();
+ try {
+ String xml = "<two-mixins-test"
+ + " jcr:mixinTypes=\"mix:referenceable mix:lockable\""
+ + " xmlns:jcr=\"http://www.jcp.org/jcr/1.0\""
+ + " xmlns:mix=\"http://www.jcp.org/jcr/mix/1.0\"/>";
+ InputStream input = new ByteArrayInputStream(xml.getBytes("UTF-8"));
+ session.importXML(
+ "/", input, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
+ } catch (ValueFormatException e) {
+ fail("JCR-369: IllegalNameException when importing document view"
+ + " with two mixins");
+ } finally {
+ session.logout();
+ }
+ }
+
+}
Propchange: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/DocumentViewTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/TestAll.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/TestAll.java?rev=390669&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/TestAll.java (added)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/TestAll.java Sat Apr 1 05:34:20 2006
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. 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.jackrabbit.core.xml;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite for Jackrabbit-specific XML format test cases.
+ */
+public class TestAll extends TestCase {
+
+ /**
+ * Returns a {@link Test} suite that executes all tests inside this
+ * package.
+ *
+ * @return test suite
+ */
+ public static Test suite() {
+ TestSuite suite = new TestSuite("XML format test cases");
+ suite.addTestSuite(DocumentViewTest.class);
+ return suite;
+ }
+
+}
Propchange: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/TestAll.java
------------------------------------------------------------------------------
svn:eol-style = native