<%@ include file="/shared/initBeans.inc" %> <%@ page language="Java" import="kotkabeans.*,kakibeans.*,java.util.*, java.sql.*, java.net.*" session="true" autoFlush="true" isThreadSafe="true" isErrorPage="false" errorPage="/shared/showError.jsp" %> <% /***************************************************************************** * PAGE DESCRIPTION ****************************************************************************** * * NAME: testCombo * LANGUAGE: JSP * DATE: 21.4.2004 * AUTHOR: Sami Kosonen, Jyväskylän yliopisto * ****************************************************************************** * COPYRIGHT (C) KUIKKA team * Limited rights granted. Please refer to license *****************************************************************************/ /***************************************************************************** * UPDATES ****************************************************************************** * * *****************************************************************************/ pageContext.setAttribute("checkMethod", "GUEST"); %> <%@ include file="/shared/userCheck.inc" %> <%@ include file="/shared/header.inc" %>

testComboYear

<%@ include file="/shared/showErrorBlock.code" %> <% int[] years = {0, 1994, 2002, 2003, 2004, 2005, 2006, 2013, 999999}; StringBuffer buff = new StringBuffer(); buff.append("selected, wanted to be selected
"); for(int i = 0; i < years.length; i++){ ComboYear.print(buff, "combo" + i, i, years[i]); buff.append(" = " + years[i]); buff.append("
"); } %>
<%=buff.toString()%>

testComboTerm

<% int[] terms = {-1, 0, 1, 2, 3, 4}; buff = new StringBuffer(); buff.append("selected, wanted to be selected
"); for(int i = 0; i < terms.length; i++){ ComboTerm.print(buff, user, "term" + i, i, terms[i]); buff.append(" = " + terms[i]); buff.append("
"); } %>
<%=buff.toString()%>

ComboTerm.getTerm(Timestamp) and Timestamp as parameter

<% int[] correct = { 2, 1, 3 }; long days30 = 2592 * 1000000; long[] timesInLong = {0, days30 * 5, days30 * 10}; buff = new StringBuffer(); for (int i = 0; i < timesInLong.length; i++) { int term = ComboTerm.getTerm(new Timestamp(timesInLong[i])); ComboTerm.print(buff, user, "term" + i, i, new Timestamp(timesInLong[i])); buff.append(" "); buff.append(term); buff.append(" = "); buff.append(new Timestamp(timesInLong[i])); buff.append(correct[i] == term ? " - OK" : " - ERROR!"); buff.append("
"); } %>
<%=buff.toString()%>
<%@ include file="/shared/footer.inc" %>