commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r332995 - /jakarta/commons/proper/jelly/trunk/jelly-tags/junit/src/java/org/apache/commons/jelly/tags/junit/AssertFileExistsTag.java
Date Sun, 13 Nov 2005 13:33:03 GMT
Author: dion
Date: Sun Nov 13 05:33:00 2005
New Revision: 332995

URL: http://svn.apache.org/viewcvs?rev=332995&view=rev
Log:
Added

Added:
    jakarta/commons/proper/jelly/trunk/jelly-tags/junit/src/java/org/apache/commons/jelly/tags/junit/AssertFileExistsTag.java
  (with props)

Added: jakarta/commons/proper/jelly/trunk/jelly-tags/junit/src/java/org/apache/commons/jelly/tags/junit/AssertFileExistsTag.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jelly/trunk/jelly-tags/junit/src/java/org/apache/commons/jelly/tags/junit/AssertFileExistsTag.java?rev=332995&view=auto
==============================================================================
--- jakarta/commons/proper/jelly/trunk/jelly-tags/junit/src/java/org/apache/commons/jelly/tags/junit/AssertFileExistsTag.java
(added)
+++ jakarta/commons/proper/jelly/trunk/jelly-tags/junit/src/java/org/apache/commons/jelly/tags/junit/AssertFileExistsTag.java
Sun Nov 13 05:33:00 2005
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.commons.jelly.tags.junit;
+
+import java.io.File;
+
+import org.apache.commons.jelly.JellyTagException;
+import org.apache.commons.jelly.XMLOutput;
+import org.apache.commons.jelly.expression.Expression;
+
+/**
+ * Checks that a file exists, and if not, then the test will fail.
+ *
+ * @author <a href="mailto:dion@apache.org">Dion Gillard</a>
+ * @version $Revision$
+ */
+public class AssertFileExistsTag extends AssertTagSupport
+{
+	/** the file to check */
+	private File file;
+
+	/**
+	 * Do the tag functionality: check the file exists.
+	 * @param output a place to write text output
+	 * @throws JellyTagException if the file doesn't exist.
+	 */
+	public void doTag(XMLOutput output) throws JellyTagException
+    {
+        String message = getBodyText();
+        
+        if (file == null)
+        {
+            fail(message, "file given is null");
+        }
+	}
+    
+    public void setFile(File aFile)
+    {
+        file = aFile;
+    }
+}

Propchange: jakarta/commons/proper/jelly/trunk/jelly-tags/junit/src/java/org/apache/commons/jelly/tags/junit/AssertFileExistsTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/proper/jelly/trunk/jelly-tags/junit/src/java/org/apache/commons/jelly/tags/junit/AssertFileExistsTag.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message