You are viewing a plain text version of this content. The canonical link for it is here.
Posted to portalapps-dev@portals.apache.org by sh...@apache.org on 2009/02/26 15:09:22 UTC

svn commit: r748157 [3/3] - in /portals/applications/sandbox: ./ widgets/ widgets/trunk/ widgets/trunk/src/ widgets/trunk/src/main/ widgets/trunk/src/main/java/ widgets/trunk/src/main/java/org/ widgets/trunk/src/main/java/org/apache/ widgets/trunk/src/...

Added: portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/edit/index.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/edit/index.jsp?rev=748157&view=auto
==============================================================================
--- portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/edit/index.jsp (added)
+++ portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/edit/index.jsp Thu Feb 26 14:09:20 2009
@@ -0,0 +1,238 @@
+<%--
+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.
+--%>
+<%@page pageEncoding="UTF-8" %>
+<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div>
+<c:if test="${currentName != ''}">
+<div>Current: ${currentName}</div>
+</c:if>
+<div style="padding: 3px;">
+  <table>
+    <thead class="portlet-section-subheader">
+      <tr>
+        <th style="width: 250px;">Name</th>
+        <th style="width: 50px;">Action</th>
+      </tr>
+    </thead>
+    <tbody><c:forEach var="widget" varStatus="s" items="${widgetItems}">
+      <tr style="background-color:${s.index %2 == 0 ? 'eeeeee' : 'e0e0e0'}">
+        <td>${f:h(widget.shortName)}</td>
+        <td align="center"><s:link href="update/${f:u(widget.id)}">Select</s:link></td>
+      </tr>
+    </c:forEach></tbody>
+  </table>
+</div>
+<div style="padding: 3px;">
+<s:form>
+	<div>
+		Category:
+		<html:select property="category">
+<html:option value="">All</html:option>
+<html:option value="1">News</html:option>
+<html:option value="2">Business &amp; Finance</html:option>
+<html:option value="3">Sport</html:option>
+<html:option value="4">TV, Movies &amp; Music</html:option>
+<html:option value="6">Tools &amp; Technology</html:option>
+<html:option value="7">Fun &amp; Games</html:option>
+<html:option value="8">Lifestyle</html:option>
+<html:option value="10">Shopping</html:option>
+<html:option value="13">Travel</html:option>
+		</html:select>
+	</div>
+	<div>
+		Search:
+		<html:text property="query" size="10"/>
+	</div>
+	<div>
+		Language:
+		<html:select property="language">
+    <html:option value="any">Any region</html:option>
+    <html:option value="al">Albania</html:option>
+    <html:option value="dz">Algeria</html:option>
+
+    <html:option value="ar">Argentina</html:option>
+    <html:option value="au">Australia</html:option>
+    <html:option value="at">Austria</html:option>
+    <html:option value="bh">Bahreテッn</html:option>
+    <html:option value="bd">Bangladesh</html:option>
+    <html:option value="pv">Basque Country</html:option>
+
+    <html:option value="by">Belarus</html:option>
+    <html:option value="be">Belgium (dutch)</html:option>
+    <html:option value="bef">Belgium (french)</html:option>
+    <html:option value="bz">Belize</html:option>
+    <html:option value="bo">Bolivia</html:option>
+    <html:option value="ba">Bosnia and Herzegovina</html:option>
+
+    <html:option value="br">Brazil</html:option>
+    <html:option value="bg">Bulgaria</html:option>
+    <html:option value="kh">Cambodia</html:option>
+    <html:option value="cm">Cameroon</html:option>
+    <html:option value="ca">Canada</html:option>
+    <html:option value="qc">Canada (Quebec)</html:option>
+
+    <html:option value="cl">Chile</html:option>
+    <html:option value="cn">China</html:option>
+    <html:option value="hk">China (Hong Kong)</html:option>
+    <html:option value="tw">China (Taiwan)</html:option>
+    <html:option value="co">Colombia</html:option>
+    <html:option value="cd">Congo</html:option>
+
+    <html:option value="cr">Costa Rica</html:option>
+    <html:option value="hr">Croatia</html:option>
+    <html:option value="cy">Cyprus</html:option>
+    <html:option value="cz">Czech Republic</html:option>
+    <html:option value="dk">Denmark</html:option>
+    <html:option value="do">Dominican Republic</html:option>
+
+    <html:option value="ec">Ecuador</html:option>
+    <html:option value="eg">Egypt</html:option>
+    <html:option value="sv">El Salvador</html:option>
+    <html:option value="ee">Estonia</html:option>
+    <html:option value="et">Ethiopia</html:option>
+    <html:option value="fk">Falkland Islands</html:option>
+
+    <html:option value="fo">Faroe Islands</html:option>
+    <html:option value="fi">Finland</html:option>
+    <html:option value="fr">France</html:option>
+    <html:option value="pf">French Polynesia</html:option>
+    <html:option value="de">Germany</html:option>
+    <html:option value="gr">Greece</html:option>
+
+    <html:option value="gra">Greece (Attica)</html:option>
+    <html:option value="gt">Guatemala</html:option>
+    <html:option value="gy">Guyana</html:option>
+    <html:option value="hn">Honduras</html:option>
+    <html:option value="hu">Hungary</html:option>
+    <html:option value="is">Iceland</html:option>
+
+    <html:option value="in">India</html:option>
+    <html:option value="id">Indonesia</html:option>
+    <html:option value="ir">Iran</html:option>
+    <html:option value="iq">Iraq</html:option>
+    <html:option value="ie">Ireland</html:option>
+    <html:option value="il">Israel</html:option>
+
+    <html:option value="it">Italy</html:option>
+    <html:option value="ci">Ivory Coast</html:option>
+    <html:option value="jp">Japan</html:option>
+    <html:option value="jo">Jordan</html:option>
+    <html:option value="ke">Kenya</html:option>
+    <html:option value="ko">Kosovo</html:option>
+
+    <html:option value="kd">Kurdistan</html:option>
+    <html:option value="kw">Kuwait</html:option>
+    <html:option value="lv">Latvia</html:option>
+    <html:option value="lb">Lebanon</html:option>
+    <html:option value="lt">Lithuania</html:option>
+    <html:option value="lu">Luxembourg</html:option>
+
+    <html:option value="ly">Lybia</html:option>
+    <html:option value="my">Malaysia</html:option>
+    <html:option value="mr">Mauritania</html:option>
+    <html:option value="mx">Mexico</html:option>
+    <html:option value="mn">Mongolia</html:option>
+    <html:option value="ma">Morocco</html:option>
+
+    <html:option value="mm">Myanmar</html:option>
+    <html:option value="nl">Netherlands</html:option>
+    <html:option value="nlf">Netherlands (Friesland)</html:option>
+    <html:option value="nz">New Zealand</html:option>
+    <html:option value="ni">Nicaragua</html:option>
+    <html:option value="ng">Nigeria</html:option>
+
+    <html:option value="no">Norway</html:option>
+    <html:option value="pk">Pakistan</html:option>
+    <html:option value="ps">Palestine</html:option>
+    <html:option value="pa">Panama</html:option>
+    <html:option value="py">Paraguay</html:option>
+    <html:option value="pe">Peru</html:option>
+
+    <html:option value="ph">Philippines</html:option>
+    <html:option value="pl">Poland</html:option>
+    <html:option value="pt">Portugal</html:option>
+    <html:option value="re">Reunion</html:option>
+    <html:option value="ro">Romania</html:option>
+    <html:option value="ru">Russia</html:option>
+
+    <html:option value="sa">Saudi Arabia</html:option>
+    <html:option value="sn">Senegal</html:option>
+    <html:option value="rs">Serbia</html:option>
+    <html:option value="sg">Singapore</html:option>
+    <html:option value="sk">Slovakia</html:option>
+    <html:option value="si">Slovenia</html:option>
+
+    <html:option value="so">Somalia</html:option>
+    <html:option value="za">South Africa</html:option>
+    <html:option value="kr">South Korea</html:option>
+    <html:option value="es">Spain</html:option>
+    <html:option value="ct">Spain (Catalonia)</html:option>
+    <html:option value="ga">Spain (Galicia)</html:option>
+
+    <html:option value="lk">Sri Lanka</html:option>
+    <html:option value="sr">Suriname</html:option>
+    <html:option value="se">Sweden</html:option>
+    <html:option value="ch">Switzerland</html:option>
+    <html:option value="chf">Switzerland (french)</html:option>
+    <html:option value="sy">Syria</html:option>
+
+    <html:option value="th">Thailand</html:option>
+    <html:option value="tn">Tunisia</html:option>
+    <html:option value="tr">Turkey</html:option>
+    <html:option value="ua">Ukraina</html:option>
+    <html:option value="ae">United Arab Emirates</html:option>
+    <html:option value="gb">United Kingdom</html:option>
+
+    <html:option value="us">United States</html:option>
+    <html:option value="uy">Uruguay</html:option>
+    <html:option value="ve">Venezuela</html:option>
+    <html:option value="vn">Vietnam</html:option>
+
+		</html:select>
+	</div>
+	<div>
+		<input type="submit" name="find" value="Find"/>
+		<input type="submit" name="reset" value="Reset"/>
+	</div>
+</s:form>
+</div>
+<div style="padding: 3px;">
+	<span>
+	<c:if test="${existPrevPage}">
+		<s:link href="prev">&lt;&lt;Previous</s:link>
+	</c:if>
+	</span>
+	<span>
+		<c:forEach var="p" varStatus="s" items="${pageItems}">
+		<span>
+			<c:if test="${p == currentPageNumber}">
+			${p}
+			</c:if>
+			<c:if test="${p != currentPageNumber}">
+			<s:link href="list/${p}">${p}</s:link>
+			</c:if>
+		</span>
+		</c:forEach>
+	</span>
+	<span>
+	<c:if test="${existNextPage}">
+		<s:link href="next">Next&gt;&gt;</s:link>
+	</c:if>
+	</span>
+</div>
+<div style="padding: 3px;">
+<span>${currentPageNumber}/${allPageCount} (${allRecordCount})</span>
+</div>
\ No newline at end of file

Propchange: portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/edit/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/error.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/error.jsp?rev=748157&view=auto
==============================================================================
--- portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/error.jsp (added)
+++ portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/error.jsp Thu Feb 26 14:09:20 2009
@@ -0,0 +1,18 @@
+<%--
+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.
+--%>
+<%@page pageEncoding="UTF-8" %>
+<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div>

Propchange: portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/error.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/index.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/index.jsp?rev=748157&view=auto
==============================================================================
--- portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/index.jsp (added)
+++ portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/index.jsp Thu Feb 26 14:09:20 2009
@@ -0,0 +1,18 @@
+<%--
+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.
+--%>
+<%@page pageEncoding="UTF-8" %>
+<iframe id="frame_${f:h(id)}" name="frame_${f:h(id)}" frameborder="0" width="100%" height="${f:h(height)}" src="http://www.netvibes.com/api/uwa/frame/uwa_generic.php?id=${f:h(id)}&amp;moduleUrl=${url}"></iframe>
\ No newline at end of file

Propchange: portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/view/netvibes/view/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/web.xml?rev=748157&view=auto
==============================================================================
--- portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/web.xml (added)
+++ portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/web.xml Thu Feb 26 14:09:20 2009
@@ -0,0 +1,170 @@
+<?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.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+  <display-name>Widget Portlet</display-name>
+  <description>Display Widgets on your portal.</description>
+  <context-param>
+    <param-name>sastruts.VIEW_PREFIX</param-name>
+    <param-value>/WEB-INF/view</param-value>
+  </context-param>
+  <filter>
+    <filter-name>encodingfilter</filter-name>
+    <filter-class>org.seasar.extension.filter.EncodingFilter</filter-class>
+    <init-param>
+      <param-name>encoding</param-name>
+      <param-value>UTF-8</param-value>
+    </init-param>
+  </filter>
+  <filter>
+    <filter-name>portletRequestFilter</filter-name>
+    <filter-class>org.seasar.struts.portlet.filter.PortletRequestFilter</filter-class>
+  </filter>
+  <filter>
+    <filter-name>requestDumpFilter</filter-name>
+    <filter-class>org.seasar.extension.filter.RequestDumpFilter</filter-class>
+  </filter>
+  <filter>
+    <filter-name>s2filter</filter-name>
+    <filter-class>org.seasar.struts.portlet.filter.S2ContainerFilter</filter-class>
+  </filter>
+  <filter>
+    <filter-name>hotdeployfilter</filter-name>
+    <filter-class>org.seasar.struts.portlet.filter.HotdeployFilter</filter-class>
+  </filter>
+  <filter>
+    <filter-name>routingfilter</filter-name>
+    <filter-class>org.seasar.struts.filter.RoutingFilter</filter-class>
+    <init-param>
+      <param-name>jspDirectAccess</param-name>
+      <param-value>false</param-value>
+    </init-param>
+  </filter>
+  <filter>
+    <filter-name>portletRoutingfilter</filter-name>
+    <filter-class>org.seasar.struts.portlet.filter.PortletRoutingFilter</filter-class>
+    <init-param>
+      <param-name>jspDirectAccess</param-name>
+      <param-value>false</param-value>
+    </init-param>
+  </filter>
+  <filter-mapping>
+    <filter-name>encodingfilter</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>portletRequestFilter</filter-name>
+    <url-pattern>/*</url-pattern>
+    <dispatcher>INCLUDE</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>s2filter</filter-name>
+    <url-pattern>/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+    <dispatcher>FORWARD</dispatcher>
+    <dispatcher>INCLUDE</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>hotdeployfilter</filter-name>
+    <url-pattern>/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+    <dispatcher>FORWARD</dispatcher>
+    <dispatcher>INCLUDE</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>routingfilter</filter-name>
+    <url-pattern>/*</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>portletRoutingfilter</filter-name>
+    <url-pattern>/*</url-pattern>
+    <dispatcher>INCLUDE</dispatcher>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>requestDumpFilter</filter-name>
+    <url-pattern>*.do</url-pattern>
+    <dispatcher>REQUEST</dispatcher>
+    <dispatcher>FORWARD</dispatcher>
+    <dispatcher>INCLUDE</dispatcher>
+  </filter-mapping>
+  <servlet>
+    <servlet-name>action</servlet-name>
+    <servlet-class>org.seasar.struts.portlet.servlet.ActionServlet</servlet-class>
+    <init-param>
+      <param-name>config</param-name>
+      <param-value>/WEB-INF/struts-config.xml</param-value>
+    </init-param>
+    <init-param>
+      <param-name>configFactory</param-name>
+      <param-value>org.seasar.struts.config.S2ModuleConfigFactory</param-value>
+    </init-param>
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+  <servlet>
+    <servlet-name>s2container</servlet-name>
+    <servlet-class>org.seasar.framework.container.servlet.S2ContainerServlet</servlet-class>
+    <load-on-startup>2</load-on-startup>
+  </servlet>
+<!-- BEGIN: J2 
+  <servlet>
+    <description>MVC Servlet for Jetspeed Portlet Applications</description>
+    <display-name>Jetspeed Container</display-name>
+    <servlet-name>JetspeedContainer</servlet-name>
+    <servlet-class>org.apache.jetspeed.container.JetspeedContainerServlet</servlet-class>
+    <init-param>
+      <param-name>contextName</param-name>
+      <param-value>widgets</param-value>
+    </init-param>
+    <load-on-startup>0</load-on-startup>
+  </servlet>
+ END: J2 -->
+  <servlet-mapping>
+    <servlet-name>action</servlet-name>
+    <url-pattern>*.do</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>s2container</servlet-name>
+    <url-pattern>/s2container</url-pattern>
+  </servlet-mapping>
+<!-- BEGIN: J2 
+  <servlet-mapping>
+    <servlet-name>JetspeedContainer</servlet-name>
+    <url-pattern>/container/*</url-pattern>
+  </servlet-mapping>
+ END: J2 -->
+  <welcome-file-list>
+    <welcome-file>index.html</welcome-file>
+    <welcome-file>index.htm</welcome-file>
+    <welcome-file>index.jsp</welcome-file>
+  </welcome-file-list>
+  <jsp-config>
+<!-- BEGIN: J2 
+    <taglib>
+      <taglib-uri>http://java.sun.com/portlet</taglib-uri>
+      <taglib-location>/WEB-INF/tld/portlet.tld</taglib-location>
+    </taglib>
+ END: J2 -->
+    <jsp-property-group>
+      <url-pattern>*.jsp</url-pattern>
+      <el-ignored>false</el-ignored>
+      <page-encoding>UTF-8</page-encoding>
+      <scripting-invalid>false</scripting-invalid>
+      <include-prelude>/WEB-INF/view/common/common.jsp</include-prelude>
+    </jsp-property-group>
+  </jsp-config>
+</web-app>

Propchange: portals/applications/sandbox/widgets/trunk/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/google/builder/QueryBuilderImplTest.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/google/builder/QueryBuilderImplTest.java?rev=748157&view=auto
==============================================================================
--- portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/google/builder/QueryBuilderImplTest.java (added)
+++ portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/google/builder/QueryBuilderImplTest.java Thu Feb 26 14:09:20 2009
@@ -0,0 +1,93 @@
+/*
+ * 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.portals.applications.widget.google.builder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.portals.applications.widget.WidgetRuntimeException;
+import org.apache.portals.applications.widget.builder.QueryBuilder;
+import org.seasar.extension.unit.S2TestCase;
+
+public class QueryBuilderImplTest
+    extends S2TestCase
+{
+
+    public QueryBuilder googleGadgetqueryBuilder;
+
+    @Override
+    protected String getRootDicon()
+        throws Throwable
+    {
+        return "widget-google.dicon";
+    }
+
+    public void test_build_ok()
+    {
+        Map<String, Object> params = new HashMap<String, Object>();
+
+        params.put( "start", 1 );
+        params.put( "num", 1 );
+        assertEquals( QueryBuilderImpl.BASE_URL + "&start=1&num=1", googleGadgetqueryBuilder.build( params ) );
+
+        params.put( "category", "news" );
+        assertEquals( QueryBuilderImpl.BASE_URL + "&start=1&num=1&cat=news", googleGadgetqueryBuilder.build( params ) );
+
+        params.put( "query", "hoge" );
+        assertEquals( QueryBuilderImpl.BASE_URL + "&start=1&num=1&cat=news&q=hoge", googleGadgetqueryBuilder
+            .build( params ) );
+
+        params.put( "language", "ja" );
+        assertEquals( QueryBuilderImpl.BASE_URL + "&start=1&num=1&cat=news&q=hoge&lang=ja", googleGadgetqueryBuilder
+            .build( params ) );
+    }
+
+    public void test_build_null_params()
+    {
+        try
+        {
+            googleGadgetqueryBuilder.build( null );
+            fail();
+        }
+        catch ( WidgetRuntimeException e )
+        {
+            // ok
+        }
+        catch ( Exception e )
+        {
+            fail();
+        }
+    }
+
+    public void test_build_empty_params()
+    {
+        Map<String, Object> params = new HashMap<String, Object>();
+        try
+        {
+            googleGadgetqueryBuilder.build( params );
+            fail();
+        }
+        catch ( WidgetRuntimeException e )
+        {
+            // ok
+        }
+        catch ( Exception e )
+        {
+            fail();
+        }
+    }
+}

Propchange: portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/google/builder/QueryBuilderImplTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/netvibes/builder/QueryBuilderImplTest.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/netvibes/builder/QueryBuilderImplTest.java?rev=748157&view=auto
==============================================================================
--- portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/netvibes/builder/QueryBuilderImplTest.java (added)
+++ portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/netvibes/builder/QueryBuilderImplTest.java Thu Feb 26 14:09:20 2009
@@ -0,0 +1,94 @@
+/*
+ * 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.portals.applications.widget.netvibes.builder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.portals.applications.widget.WidgetRuntimeException;
+import org.apache.portals.applications.widget.builder.QueryBuilder;
+import org.seasar.extension.unit.S2TestCase;
+
+public class QueryBuilderImplTest
+    extends S2TestCase
+{
+
+    public QueryBuilder netvibesWidgetQueryBuilder;
+
+    @Override
+    protected String getRootDicon()
+        throws Throwable
+    {
+        return "widget-netvibes.dicon";
+    }
+
+    public void test_build_ok()
+    {
+        Map<String, Object> params = new HashMap<String, Object>();
+
+        params.put( "start", 1 );
+        params.put( "num", 1 );
+        assertEquals( QueryBuilderImpl.BASE_URL + "&page=1&limit=1", netvibesWidgetQueryBuilder.build( params ) );
+
+        params.put( "category", "news" );
+        assertEquals( QueryBuilderImpl.BASE_URL + "&page=1&limit=1&category=news", netvibesWidgetQueryBuilder
+            .build( params ) );
+
+        params.put( "query", "hoge" );
+        assertEquals( QueryBuilderImpl.BASE_URL + "&page=1&limit=1&category=news&query=hoge",
+                      netvibesWidgetQueryBuilder.build( params ) );
+
+        params.put( "language", "ja" );
+        assertEquals( QueryBuilderImpl.BASE_URL + "&page=1&limit=1&category=news&query=hoge&region=ja",
+                      netvibesWidgetQueryBuilder.build( params ) );
+    }
+
+    public void test_build_null_params()
+    {
+        try
+        {
+            netvibesWidgetQueryBuilder.build( null );
+            fail();
+        }
+        catch ( WidgetRuntimeException e )
+        {
+            // ok
+        }
+        catch ( Exception e )
+        {
+            fail();
+        }
+    }
+
+    public void test_build_empty_params()
+    {
+        Map<String, Object> params = new HashMap<String, Object>();
+        try
+        {
+            netvibesWidgetQueryBuilder.build( params );
+            fail();
+        }
+        catch ( WidgetRuntimeException e )
+        {
+            // ok
+        }
+        catch ( Exception e )
+        {
+            fail();
+        }
+    }
+}

Propchange: portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/netvibes/builder/QueryBuilderImplTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/GoogleGadgetServiceTest.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/GoogleGadgetServiceTest.java?rev=748157&view=auto
==============================================================================
--- portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/GoogleGadgetServiceTest.java (added)
+++ portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/GoogleGadgetServiceTest.java Thu Feb 26 14:09:20 2009
@@ -0,0 +1,45 @@
+/*
+ * 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.portals.applications.widget.service;
+
+import org.apache.portals.applications.widget.entity.Widget;
+import org.apache.portals.applications.widget.entity.WidgetList;
+import org.apache.portals.applications.widget.pager.WidgetPager;
+import org.seasar.extension.unit.S2TestCase;
+
+public class GoogleGadgetServiceTest
+    extends S2TestCase
+{
+    public GoogleGadgetService googleGadgetService;
+
+    public WidgetPager widgetPager;
+
+    @Override
+    protected String getRootDicon()
+        throws Throwable
+    {
+        return "app.dicon";
+    }
+
+    public void test_getWidgetList_ok()
+    {
+        googleGadgetService.reset( widgetPager );
+        WidgetList<Widget> widgetList = googleGadgetService.getWidgetList( widgetPager );
+        assertNotNull( widgetList );
+        assertTrue( !widgetList.isEmpty() );
+    }
+}

Propchange: portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/GoogleGadgetServiceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/NetvibesWidgetServiceTest.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/NetvibesWidgetServiceTest.java?rev=748157&view=auto
==============================================================================
--- portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/NetvibesWidgetServiceTest.java (added)
+++ portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/NetvibesWidgetServiceTest.java Thu Feb 26 14:09:20 2009
@@ -0,0 +1,45 @@
+/*
+ * 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.portals.applications.widget.service;
+
+import org.apache.portals.applications.widget.entity.Widget;
+import org.apache.portals.applications.widget.entity.WidgetList;
+import org.apache.portals.applications.widget.pager.WidgetPager;
+import org.seasar.extension.unit.S2TestCase;
+
+public class NetvibesWidgetServiceTest
+    extends S2TestCase
+{
+    public NetvibesWidgetService netvibesWidgetService;
+
+    public WidgetPager widgetPager;
+
+    @Override
+    protected String getRootDicon()
+        throws Throwable
+    {
+        return "app.dicon";
+    }
+
+    public void test_getWidgetList_ok()
+    {
+        netvibesWidgetService.reset( widgetPager );
+        WidgetList<Widget> widgetList = netvibesWidgetService.getWidgetList( widgetPager );
+        assertNotNull( widgetList );
+        assertTrue( !widgetList.isEmpty() );
+    }
+}

Propchange: portals/applications/sandbox/widgets/trunk/src/test/java/org/apache/portals/applications/widget/service/NetvibesWidgetServiceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native