You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by si...@apache.org on 2011/11/01 13:40:02 UTC

svn commit: r1195964 - in /cocoon/cocoon3/trunk/cocoon-cli/src/test: java/org/ java/org/apache/ java/org/apache/cocoon/ java/org/apache/cocoon/cli/ java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java resources/missing-elements.xml

Author: simonetripodi
Date: Tue Nov  1 12:40:02 2011
New Revision: 1195964

URL: http://svn.apache.org/viewvc?rev=1195964&view=rev
Log:
first checkin of PipelineDescriptorParser tests

Added:
    cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/
    cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/
    cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/
    cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/
    cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java   (with props)
    cocoon/cocoon3/trunk/cocoon-cli/src/test/resources/missing-elements.xml   (with props)

Added: cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java?rev=1195964&view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java (added)
+++ cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java Tue Nov  1 12:40:02 2011
@@ -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.cocoon.cli;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+public final class PipelineDescriptorParserTestCase
+{
+
+    private PipelineDescriptorParser parser = new PipelineDescriptorParser();
+
+    private File testDir = new File( System.getProperty( "user.dir" ), "src/test/resources" );
+
+    // The content of element 'pipeline' is not complete. One of '{"":generator}' is expected.
+    @Test( expected = SAXException.class )
+    public void missingElements() throws IOException, SAXException
+    {
+        parser.parse( getTestFile( "missing-elements.xml" ) );
+    }
+
+    private File getTestFile( String name )
+    {
+        return new File( testDir, name );
+    }
+
+}

Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/test/java/org/apache/cocoon/cli/PipelineDescriptorParserTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/cocoon3/trunk/cocoon-cli/src/test/resources/missing-elements.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-cli/src/test/resources/missing-elements.xml?rev=1195964&view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-cli/src/test/resources/missing-elements.xml (added)
+++ cocoon/cocoon3/trunk/cocoon-cli/src/test/resources/missing-elements.xml Tue Nov  1 12:40:02 2011
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+ -->
+<!-- $Id$ -->
+<pipelines xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Valid Pipeline" default="id0">
+    <pipeline id="id0"/>
+</pipelines>

Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/test/resources/missing-elements.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/test/resources/missing-elements.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/test/resources/missing-elements.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml