You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2010/07/16 17:25:31 UTC

svn commit: r964833 - in /click/trunk/click/framework/test/org/apache/click/element: ./ CssImportTest.java JsImportTest.java

Author: sabob
Date: Fri Jul 16 15:25:30 2010
New Revision: 964833

URL: http://svn.apache.org/viewvc?rev=964833&view=rev
Log:
added tests for JsImport and CssImport

Added:
    click/trunk/click/framework/test/org/apache/click/element/
    click/trunk/click/framework/test/org/apache/click/element/CssImportTest.java
    click/trunk/click/framework/test/org/apache/click/element/JsImportTest.java

Added: click/trunk/click/framework/test/org/apache/click/element/CssImportTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/element/CssImportTest.java?rev=964833&view=auto
==============================================================================
--- click/trunk/click/framework/test/org/apache/click/element/CssImportTest.java (added)
+++ click/trunk/click/framework/test/org/apache/click/element/CssImportTest.java Fri Jul 16 15:25:30 2010
@@ -0,0 +1,36 @@
+/*
+ * 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.click.element;
+
+import junit.framework.TestCase;
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Provide tests for CssImport.
+ */
+public class CssImportTest extends TestCase {
+
+    public void testMarkup() {
+        CssImport cssImport = new CssImport("test.css");
+        cssImport.setId("css-id");
+        String cssImportStr = cssImport.toString();
+        assertTrue(StringUtils.countMatches(cssImportStr, "href=") == 1);
+        assertTrue(StringUtils.countMatches(cssImportStr, "id=") == 1);
+    }
+}

Added: click/trunk/click/framework/test/org/apache/click/element/JsImportTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/element/JsImportTest.java?rev=964833&view=auto
==============================================================================
--- click/trunk/click/framework/test/org/apache/click/element/JsImportTest.java (added)
+++ click/trunk/click/framework/test/org/apache/click/element/JsImportTest.java Fri Jul 16 15:25:30 2010
@@ -0,0 +1,36 @@
+/*
+ * 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.click.element;
+
+import junit.framework.TestCase;
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Provide tests for JsImport.
+ */
+public class JsImportTest extends TestCase {
+
+    public void testMarkup() {
+        JsImport jsImport = new JsImport("test.js");
+        jsImport.setId("js-id");
+        String jsImportStr = jsImport.toString();
+        assertTrue(StringUtils.countMatches(jsImportStr, "src=") == 1);
+        assertTrue(StringUtils.countMatches(jsImportStr, "id=") == 1);
+    }
+}