You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by pr...@apache.org on 2002/04/09 12:56:44 UTC
cvs commit: jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/valueparam ValidValueParamTest.java
prickett 02/04/09 03:56:44
Modified: periodicity/src/java/org/apache/commons/periodicity/ical/parameters
RoleParam.java RsvpParam.java
periodicity/src/java/org/apache/commons/periodicity/test/encodingparam
ValidEncodingParamTest.java
Added: periodicity/src/java/org/apache/commons/periodicity/test/dirparam
ValidDirParamTest.java
periodicity/src/java/org/apache/commons/periodicity/test/freebusyparam
ValidFreeBusyParamTest.java
periodicity/src/java/org/apache/commons/periodicity/test/participation
ValidParticipationParamTest.java
periodicity/src/java/org/apache/commons/periodicity/test/relationship
ValidRelationshipTest.java
periodicity/src/java/org/apache/commons/periodicity/test/roleparam
ValidRoleParamTest.java
periodicity/src/java/org/apache/commons/periodicity/test/rsvpparam
ValidRsvpParamTest.java
periodicity/src/java/org/apache/commons/periodicity/test/valueparam
ValidValueParamTest.java
Log:
Another fine contribution, by Mike George, to our growing suite of JUnit tests
This includes:
A patch to add a constuctor that takes a string argument to RsvpParam
A more thorough test of the Encoding Parameter
A new test to test for a valid directory parameter
A new test to test for a valid freebusy parameter
A new test to test for a valid participation parameter
A new test to test for a valid relationship parameter
A new test to test for a valid role parameter
A new test to test for a valid rsvp parameter
A new test to test for a valid value parameter
Revision Changes Path
1.2 +1 -1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/ical/parameters/RoleParam.java
Index: RoleParam.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/ical/parameters/RoleParam.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RoleParam.java 16 Mar 2002 23:56:22 -0000 1.1
+++ RoleParam.java 9 Apr 2002 10:56:44 -0000 1.2
@@ -155,7 +155,7 @@
* @return A boolean value that tells whether or not this is the
* Optional Participant Role.
*/
- public boolean isOptionalParticpant()
+ public boolean isOptionalParticipant()
{
return getValue().equals(OPT_PARTICIPANT);
}
1.2 +11 -1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/ical/parameters/RsvpParam.java
Index: RsvpParam.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/ical/parameters/RsvpParam.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RsvpParam.java 16 Mar 2002 23:56:22 -0000 1.1
+++ RsvpParam.java 9 Apr 2002 10:56:44 -0000 1.2
@@ -80,7 +80,17 @@
* given initial value.
* @param newval The initial value of the new RSVP Parameter
*/
- public RsvpParam(boolean newval)
+ public RsvpParam(boolean newval) throws ICalendarException
+ {
+ setValue(newval);
+ }
+
+ /**
+ * The purpose of this method is to create a new RSVP Parameter with the
+ * given initial value.
+ * @param newval The initial value of the new RSVP Parameter
+ */
+ public RsvpParam(String newval) throws ICalendarException
{
setValue(newval);
}
1.1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/dirparam/ValidDirParamTest.java
Index: ValidDirParamTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.periodicity.test.dirparam;
import org.apache.commons.periodicity.ical.parameters.DirParam;
import org.apache.commons.periodicity.util.ICalendarException;
import junit.framework.TestCase;
import java.lang.reflect.Array;
/**
* The purpose of this class is to test the Directory Reference Entry
* Parameter of the iCalendar protocol (rfc2445). This parameter is used
* to set the directory associated with a particular iCal user.
* Valid values are any URI. This parameter is covered in RFC 2445 Section 4.2.6
* @author Mike George
* <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
*/
public class ValidDirParamTest extends TestCase
{
//Array to hold URI values
public static final String[] URI_VALUES = new String[]
{
"mailto:javajoe2975@comcast.com",
"http://jakarta.apache.org",
"ftp://ftp.apache.org/",
"news://news.grc.com",
"nntp://nntp.perl.org",
"telnet://ax4.ppp.smu.edu",
"wais://www.ncsa.uiuc.edu:8001",
"http://info.cern.ch/albert/bertram/marie-claude",
"http://info.cern.ch/albert/bertram/marie%2Dclaude",
"http://info.cern.ch/albert/bertram/marie-claude",
"http://info.cern.ch/albert/bertram%2Fmarie-claude",
"http://info.cern.ch:8000/imaginary/test",
"http://www.myu.edu/org/admin/people#andy",
"http://info.my.org/AboutUs/Index/Phonebook?dobbins",
"http://www.amazon.com/obidos/ASIN/052/qid=10928/sr=8-1/ref=sr_8_71_1/103-5734792-5447027",
"file://c:/somedirectory/somefile.htm"
};
/**
* This public constructor passes a String to the TestCase
* constructor.
* @param A name that helps uniquely identify the test, i.e. a date, test#.
*/
public ValidDirParamTest(String name) throws Throwable
{
super("ValidDirParamTest:" + name);
TestCase.assertEquals(3, 3);
runTest();
}
/**
* This method passes a valid URI to an AltRep object using
* the one-arg constructor. The value is retrieved from the object
* using a get method and then compared with the original
* to make sure that the value was processed and stored correctly.
*/
public void test_setValidDirParamOneArg() throws ICalendarException
{
final int length = Array.getLength(URI_VALUES);
for (int i = 0; i < length; i++)
{
DirParam testDirParam = new DirParam(URI_VALUES[i]);
TestCase.assertEquals(testDirParam.getValue(), URI_VALUES[i]);
}
}
/**
* This method passes a valid URI to an AltRep object using
* a set method. The value is retrieved from the object
* using a get method and then compared with the original
* to make sure that the value was processed and stored correctly.
*/
public void test_setValidDirParamNoArg() throws ICalendarException
{
final int length = Array.getLength(URI_VALUES);
DirParam testDirParam = new DirParam();
for (int i = 0; i < length; i++)
{
testDirParam.setValue(URI_VALUES[i]);
TestCase.assertEquals(testDirParam.getValue(), URI_VALUES[i]);
}
}
/**
* This method runs the test.
*/
public void runTest() throws Throwable
{
test_setValidDirParamOneArg();
test_setValidDirParamNoArg();
}
}
1.2 +166 -172 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/encodingparam/ValidEncodingParamTest.java
Index: ValidEncodingParamTest.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/encodingparam/ValidEncodingParamTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ValidEncodingParamTest.java 3 Apr 2002 04:38:24 -0000 1.1
+++ ValidEncodingParamTest.java 9 Apr 2002 10:56:44 -0000 1.2
@@ -1,173 +1,167 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Jetspeed" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
- * written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache" or
- * "Apache Jetspeed", nor may "Apache" appear in their name, without
- * prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.commons.periodicity.test.encodingparam;
-
-import org.apache.commons.periodicity.ical.parameters.EncodingParam;
-import org.apache.commons.periodicity.util.ICalendarException;
-import junit.framework.TestCase;
-
-/**
- * This class tests to ensure that valid inputs to the
- * EncodingParam class can be set and retrieved correctly. The
- * valid values for this parameter are "8BIT", "BASE64", iana-token, and
- * x-name. This parameter is covered in RFC 2445 Section 4.2.7
- * @author Mike George
- * <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
- */
-public class ValidEncodingParamTest extends TestCase
-{
-
- /**
- * This public constructor passes a String to the TestCase
- * constructor.
- * @param A name that helps uniquely identify the test, i.e. a date, test#.
- */
- public ValidEncodingParamTest(String name) throws Throwable
- {
- super("ValidTZIDParamTest:" + name);
- runTest();
- }
-
- /**
- * This method tests the no-arg constructor and the set/get
- * methods.
- * @param A valid Encoding Parameter value
- */
- public void test_NoArgConstructor() throws ICalendarException
- {
- //Test the no arg constructor alone
- EncodingParam first = new EncodingParam();
- assertEquals(first.getValue(), null);
-
- //Test the set/get BASE64 string entry
- EncodingParam e1 = new EncodingParam();
- e1.setValue("BASE64");
- assertEquals(e1.getValue(), "BASE64");
-
- //Test the set/get 8BIT string entry
- EncodingParam e2 = new EncodingParam();
- e2.setValue("8BIT");
- assertEquals(e2.getValue(), "8BIT");
-
- //Test using the constant variables
- EncodingParam e3 = new EncodingParam();
- e3.setValue(EncodingParam.BASE_64_ENCODING);
- assertEquals(e3.getValue(), EncodingParam.BASE_64_ENCODING);
-
- EncodingParam e4 = new EncodingParam();
- e4.setValue(EncodingParam.EIGHT_BIT_ENCODING);
- assertEquals(e4.getValue(), EncodingParam.EIGHT_BIT_ENCODING);
-
- //Test for X-Name case
- EncodingParam e5 = new EncodingParam();
- e5.setValue("X-TEST");
- assertEquals(e5.getValue(), "X-TEST");
- }
-
- /**
- * This method tests the no-arg constructor and the set/get
- * methods.
- * @param A valid Encoding Parameter value
- */
- public void test_OneArgConstructor() throws ICalendarException
- {
-
- //Test the set/get BASE64 string entry
- EncodingParam e1 = new EncodingParam("BASE64");
- assertEquals(e1.getValue(), "BASE64");
-
- //Test the set/get 8BIT string entry
- EncodingParam e2 = new EncodingParam("8BIT");
- assertEquals(e2.getValue(), "8BIT");
-
- //Test using the constant variables
- EncodingParam e3 = new EncodingParam(EncodingParam.BASE_64_ENCODING);
- assertEquals(e3.getValue(), EncodingParam.BASE_64_ENCODING);
-
- EncodingParam e4 = new EncodingParam(EncodingParam.EIGHT_BIT_ENCODING);
- assertEquals(e4.getValue(), EncodingParam.EIGHT_BIT_ENCODING);
-
- //Test for X-Name case
- EncodingParam e5 = new EncodingParam("X-TEST");
- assertEquals(e5.getValue(), "X-TEST");
- }
-
- /**
- * Test to make sure that the isEightBit() and
- * isBase64() methods work correctly.
- */
- public void test_EncodingType() throws ICalendarException
- {
- boolean t = true;
- boolean f = false;
-
- EncodingParam e1 = new EncodingParam("8BIT");
- assertEquals(e1.isEightBit(), t);
- assertEquals(e1.isEightBit(), f);
-
- EncodingParam e2 = new EncodingParam("BASE64");
- assertEquals(e2.isBase64(), t);
- assertEquals(e2.isBase64(), f);
- }
-
- /**
- * This method runs the test.
- */
- public void runTest() throws Throwable
- {
- test_NoArgConstructor();
- test_OneArgConstructor();
- test_EncodingType();
- }
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Jetspeed" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
+ * written permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache" or
+ * "Apache Jetspeed", nor may "Apache" appear in their name, without
+ * prior written permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+package org.apache.commons.periodicity.test.encodingparam;
+
+import org.apache.commons.periodicity.ical.parameters.EncodingParam;
+import org.apache.commons.periodicity.util.ICalendarException;
+import junit.framework.TestCase;
+
+/**
+ * This class tests to ensure that valid inputs to the
+ * EncodingParam class can be set and retrieved correctly. The
+ * valid values for this parameter are "8BIT", "BASE64", iana-token, and
+ * x-name. This parameter is covered in RFC 2445 Section 4.2.7
+ * @author Mike George
+ * <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
+ */
+public class ValidEncodingParamTest extends TestCase
+{
+
+ /**
+ * This public constructor passes a String to the TestCase
+ * constructor.
+ * @param A name that helps uniquely identify the test, i.e. a date, test#.
+ */
+ public ValidEncodingParamTest(String name) throws Throwable
+ {
+ super("ValidEncodingParamTest:" + name);
+ runTest();
+ }
+
+ /**
+ * This method tests the no-arg constructor and the set/get
+ * methods.
+ */
+ public void test_NoArgConstructor() throws ICalendarException
+ {
+ //Test the set/get BASE64 string entry
+ EncodingParam e1 = new EncodingParam();
+ e1.setValue("BASE64");
+ assertEquals(e1.getValue(), "BASE64");
+
+ //Test the set/get 8BIT string entry
+ EncodingParam e2 = new EncodingParam();
+ e2.setValue("8BIT");
+ assertEquals(e2.getValue(), "8BIT");
+
+ //Test using the constant variables
+ EncodingParam e3 = new EncodingParam();
+ e3.setValue(EncodingParam.BASE_64_ENCODING);
+ assertEquals(e3.getValue(), EncodingParam.BASE_64_ENCODING);
+
+ EncodingParam e4 = new EncodingParam();
+ e4.setValue(EncodingParam.EIGHT_BIT_ENCODING);
+ assertEquals(e4.getValue(), EncodingParam.EIGHT_BIT_ENCODING);
+
+ //Test for X-Name case
+ EncodingParam e5 = new EncodingParam();
+ e5.setValue("X-TEST");
+ assertEquals(e5.getValue(), "X-TEST");
+ }
+
+ /**
+ * This method tests the one-arg constructor and the get
+ * methods.
+ */
+ public void test_OneArgConstructor() throws ICalendarException
+ {
+
+ //Test the BASE64 string entry
+ EncodingParam e1 = new EncodingParam("BASE64");
+ assertEquals(e1.getValue(), "BASE64");
+
+ //Test the 8BIT string entry
+ EncodingParam e2 = new EncodingParam("8BIT");
+ assertEquals(e2.getValue(), "8BIT");
+
+ //Test using the constant variables
+ EncodingParam e3 = new EncodingParam(EncodingParam.BASE_64_ENCODING);
+ assertEquals(e3.getValue(), EncodingParam.BASE_64_ENCODING);
+
+ EncodingParam e4 = new EncodingParam(EncodingParam.EIGHT_BIT_ENCODING);
+ assertEquals(e4.getValue(), EncodingParam.EIGHT_BIT_ENCODING);
+
+ //Test for X-Name case
+ EncodingParam e5 = new EncodingParam("X-TEST");
+ assertEquals(e5.getValue(), "X-TEST");
+ }
+
+ /**
+ * Test to make sure that the isEightBit() and
+ * isBase64() methods work correctly.
+ */
+ public void test_EncodingType() throws ICalendarException
+ {
+ boolean t = true;
+ boolean f = false;
+
+ EncodingParam e1 = new EncodingParam("8BIT");
+ assertEquals(e1.isEightBit(), t);
+ assertEquals(e1.isBase64(), f);
+
+ EncodingParam e2 = new EncodingParam("BASE64");
+ assertEquals(e2.isBase64(), t);
+ assertEquals(e2.isEightBit(), f);
+ }
+
+ /**
+ * This method runs the test.
+ */
+ public void runTest() throws Throwable
+ {
+ test_NoArgConstructor();
+ test_OneArgConstructor();
+ test_EncodingType();
+ }
}
1.1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/freebusyparam/ValidFreeBusyParamTest.java
Index: ValidFreeBusyParamTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.periodicity.test.freebusyparam;
import org.apache.commons.periodicity.ical.parameters.FreeBusyParam;
import org.apache.commons.periodicity.util.ICalendarException;
import junit.framework.TestCase;
/**
* This class tests to ensure that valid inputs to the
* FreeBusyParam class can be set and retrieved correctly. The
* valid values for this parameter are "FREE", "BUSY",
* "BUSY-UNAVAILABLE", "BUSY-TENTATIVE", iana-token, and
* x-name. This parameter is covered in RFC 2445 Section 4.2.9
* @author Mike George
* <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
*/
public class ValidFreeBusyParamTest extends TestCase
{
/**
* This public constructor passes a String to the TestCase
* constructor.
* @param A name that helps uniquely identify the test, i.e. a date, test#.
*/
public ValidFreeBusyParamTest(String name) throws Throwable
{
super("ValidFreeBusyParamTest:" + name);
runTest();
}
/**
* This method tests the no-arg constructor and the set/get
* methods.
*/
public void test_NoArgConstructor() throws ICalendarException
{
//Test the set/get "FREE" string entry
FreeBusyParam e1 = new FreeBusyParam();
e1.setValue("FREE");
assertEquals(e1.getValue(), "FREE");
//Test the set/get "BUSY" string entry
FreeBusyParam e2 = new FreeBusyParam();
e2.setValue("BUSY");
assertEquals(e2.getValue(), "BUSY");
//Test the set/get "BUSY-UNAVAILABLE" string entry
FreeBusyParam e3 = new FreeBusyParam();
e3.setValue("BUSY-UNAVAILABLE");
assertEquals(e3.getValue(), "BUSY-UNAVAILABLE");
//Test the set/get "BUSY-TENTATIVE" string entry
FreeBusyParam e4 = new FreeBusyParam();
e4.setValue("BUSY-TENTATIVE");
assertEquals(e4.getValue(), "BUSY-TENTATIVE");
//Test the set/get "X-TEST" string entry
FreeBusyParam e5 = new FreeBusyParam();
e5.setValue("X-TEST");
assertEquals(e5.getValue(), "X-TEST");
}
/**
* This method tests the one-arg constructor and the get
* methods.
*/
public void test_OneArgConstructor() throws ICalendarException
{
//Test the set/get "FREE" string entry
FreeBusyParam e1 = new FreeBusyParam("FREE");
assertEquals(e1.getValue(), "FREE");
//Test the set/get "BUSY" string entry
FreeBusyParam e2 = new FreeBusyParam("BUSY");
assertEquals(e2.getValue(), "BUSY");
//Test the set/get "BUSY-UNAVAILABLE" string entry
FreeBusyParam e3 = new FreeBusyParam("BUSY-UNAVAILABLE");
assertEquals(e3.getValue(), "BUSY-UNAVAILABLE");
//Test the set/get "BUSY-TENTATIVE" string entry
FreeBusyParam e4 = new FreeBusyParam("BUSY-TENTATIVE");
assertEquals(e4.getValue(), "BUSY-TENTATIVE");
//Test the set/get "X-TEST" string entry
FreeBusyParam e5 = new FreeBusyParam("X-TEST");
assertEquals(e5.getValue(), "X-TEST");
//Test the FreeBusy constant FreeBusyParam.FREE_TIME
FreeBusyParam e6 = new FreeBusyParam(FreeBusyParam.FREE_TIME);
assertEquals(e6.getValue(), FreeBusyParam.FREE_TIME);
//Test the FreeBusy constant FreeBusyParam.BUSY_TIME
FreeBusyParam e7 = new FreeBusyParam(FreeBusyParam.BUSY_TIME);
assertEquals(e7.getValue(), FreeBusyParam.BUSY_TIME);
//Test the FreeBusy constant FreeBusyParam.BUSY_UNAVAILABLE_TIME
FreeBusyParam e8 = new FreeBusyParam(FreeBusyParam.BUSY_UNAVAILABLE_TIME);
assertEquals(e8.getValue(), FreeBusyParam.BUSY_UNAVAILABLE_TIME);
//Test the FreeBusy constant FreeBusyParam.BUSY_TENTATIVE_TIME
FreeBusyParam e9 = new FreeBusyParam(FreeBusyParam.BUSY_TENTATIVE_TIME);
assertEquals(e9.getValue(), FreeBusyParam.BUSY_TENTATIVE_TIME);
}
/**
* Test to make sure that the boolean methods work correctly.
*/
public void test_FreeBusyBooleans() throws ICalendarException
{
boolean t = true;
boolean f = false;
FreeBusyParam e1 = new FreeBusyParam("FREE");
assertEquals(e1.isFree(), t);
assertEquals(e1.isBusy(), f);
assertEquals(e1.isUnavailableBusy(), f);
assertEquals(e1.isTentativeBusy(), f);
FreeBusyParam e2 = new FreeBusyParam("BUSY");
assertEquals(e2.isFree(), f);
assertEquals(e2.isBusy(), t);
assertEquals(e2.isUnavailableBusy(), f);
assertEquals(e2.isTentativeBusy(), f);
FreeBusyParam e3 = new FreeBusyParam("BUSY-UNAVAILABLE");
assertEquals(e3.isFree(), f);
assertEquals(e3.isBusy(), f);
assertEquals(e3.isUnavailableBusy(), t);
assertEquals(e3.isTentativeBusy(), f);
FreeBusyParam e4 = new FreeBusyParam("BUSY-TENTATIVE");
assertEquals(e4.isFree(), f);
assertEquals(e4.isBusy(), f);
assertEquals(e4.isUnavailableBusy(), f);
assertEquals(e4.isTentativeBusy(), t);
}
/**
* This method runs the test.
*/
public void runTest() throws Throwable
{
test_NoArgConstructor();
test_OneArgConstructor();
test_FreeBusyBooleans();
}
}
1.1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/participation/ValidParticipationParamTest.java
Index: ValidParticipationParamTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.periodicity.test.participation;
import org.apache.commons.periodicity.ical.parameters.Participation;
import org.apache.commons.periodicity.util.ICalendarException;
import junit.framework.TestCase;
import java.lang.reflect.Array;
/**
* This class tests to ensure that valid inputs to the
* Participation class can be set and retrieved correctly. The
* valid values for this parameter are "NEEDS-ACTION", "ACCEPTED",
* "DECLINED", "TENTATIVE", "DELEGATED", "COMPLETED",
* and "IN-PROCESS".
* This parameter is covered in RFC 2445 Section 4.2.12
* @author Mike George
* <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
*/
public class ValidParticipationParamTest extends TestCase
{
//Create the static arrays for testing
public static final String[] VALIDVALUES = {
"NEEDS-ACTION", "ACCEPTED", "DECLINED", "TENTATIVE",
"DELEGATED", "COMPLETED", "IN-PROCESS"
};
public static final String[] VALIDCONSTANTS = {
Participation.NEEDS_ACTION, Participation.ACCEPTED,
Participation.DECLINED, Participation.TENTATIVE,
Participation.DELEGATED, Participation.COMPLETED,
Participation.IN_PROCESS
};
final int valLength = Array.getLength(VALIDVALUES);
final int conLength = Array.getLength(VALIDCONSTANTS);
/**
* This public constructor passes a String to the TestCase
* constructor.
* @param A name that helps uniquely identify the test, i.e. a date, test#.
*/
public ValidParticipationParamTest(String name) throws Throwable
{
super("ValidParticipationParamTest:" + name);
runTest();
}
/**
* This method tests the no-arg constructor and the set/get
* methods.
*/
public void test_NoArgConstructor() throws ICalendarException
{
for (int i = 0; i < valLength; i++)
{
Participation e1 = new Participation();
e1.setValue(VALIDVALUES[i]);
assertEquals(e1.getValue(), VALIDVALUES[i]);
}
for (int i = 0; i < conLength; i++)
{
Participation e1 = new Participation();
e1.setValue(VALIDCONSTANTS[i]);
assertEquals(e1.getValue(), VALIDCONSTANTS[i]);
}
}
/**
* This method tests the one-arg constructor and the get
* methods.
*/
public void test_OneArgConstructor() throws ICalendarException
{
for (int i = 0; i < valLength; i++)
{
Participation e1 = new Participation(VALIDVALUES[i]);
assertEquals(e1.getValue(), VALIDVALUES[i]);
}
for (int i = 0; i < conLength; i++)
{
Participation e1 = new Participation(VALIDCONSTANTS[i]);
assertEquals(e1.getValue(), VALIDCONSTANTS[i]);
}
}
/**
* Test to make sure that the boolean methods work correctly.
*/
public void test_ParticipationBooleans() throws ICalendarException
{
boolean t = true;
boolean f = false;
Participation p1 = new Participation();
p1.setValue("NEEDS-ACTION");
assertEquals(p1.needsAction(), t);
assertEquals(p1.isAccepted(), f);
assertEquals(p1.isDeclined(), f);
assertEquals(p1.isTentative(), f);
assertEquals(p1.isDelegated(), f);
assertEquals(p1.isCompleted(), f);
assertEquals(p1.isInProcess(), f);
p1.setValue("ACCEPTED");
assertEquals(p1.needsAction(), f);
assertEquals(p1.isAccepted(), t);
assertEquals(p1.isDeclined(), f);
assertEquals(p1.isTentative(), f);
assertEquals(p1.isDelegated(), f);
assertEquals(p1.isCompleted(), f);
assertEquals(p1.isInProcess(), f);
p1.setValue("DECLINED");
assertEquals(p1.needsAction(), f);
assertEquals(p1.isAccepted(), f);
assertEquals(p1.isDeclined(), t);
assertEquals(p1.isTentative(), f);
assertEquals(p1.isDelegated(), f);
assertEquals(p1.isCompleted(), f);
assertEquals(p1.isInProcess(), f);
p1.setValue("TENTATIVE");
assertEquals(p1.needsAction(), f);
assertEquals(p1.isAccepted(), f);
assertEquals(p1.isDeclined(), f);
assertEquals(p1.isTentative(), t);
assertEquals(p1.isDelegated(), f);
assertEquals(p1.isCompleted(), f);
assertEquals(p1.isInProcess(), f);
p1.setValue("DELEGATED");
assertEquals(p1.needsAction(), f);
assertEquals(p1.isAccepted(), f);
assertEquals(p1.isDeclined(), f);
assertEquals(p1.isTentative(), f);
assertEquals(p1.isDelegated(), t);
assertEquals(p1.isCompleted(), f);
assertEquals(p1.isInProcess(), f);
p1.setValue("COMPLETED");
assertEquals(p1.needsAction(), f);
assertEquals(p1.isAccepted(), f);
assertEquals(p1.isDeclined(), f);
assertEquals(p1.isTentative(), f);
assertEquals(p1.isDelegated(), f);
assertEquals(p1.isCompleted(), t);
assertEquals(p1.isInProcess(), f);
p1.setValue("IN-PROCESS");
assertEquals(p1.needsAction(), f);
assertEquals(p1.isAccepted(), f);
assertEquals(p1.isDeclined(), f);
assertEquals(p1.isTentative(), f);
assertEquals(p1.isDelegated(), f);
assertEquals(p1.isCompleted(), f);
assertEquals(p1.isInProcess(), t);
}
/**
* This method runs the test.
*/
public void runTest() throws Throwable
{
test_NoArgConstructor();
test_OneArgConstructor();
test_ParticipationBooleans();
}
}
1.1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/relationship/ValidRelationshipTest.java
Index: ValidRelationshipTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.periodicity.test.relationship;
import org.apache.commons.periodicity.ical.parameters.Relationship;
import org.apache.commons.periodicity.util.ICalendarException;
import junit.framework.TestCase;
/**
* This class tests to ensure that valid inputs to the
* Relationship class can be set and retrieved correctly. The
* valid values for this parameter are "PARENT", "CHILD" and
* "SIBLING".
* This parameter is covered in RFC 2445 Section 4.2.15
* @author Mike George
* <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
*/
public class ValidRelationshipTest extends TestCase
{
/**
* This public constructor passes a String to the TestCase
* constructor.
* @param A name that helps uniquely identify the test, i.e. a date, test#.
*/
public ValidRelationshipTest(String name) throws Throwable
{
super("ValidRelationshipTest:" + name);
runTest();
}
/**
* This method tests the no-arg constructor and the set/get
* methods.
*/
public void test_NoArgConstructor() throws ICalendarException
{
Relationship r1 = new Relationship();
r1.setValue("PARENT");
assertEquals(r1.getValue(), "PARENT");
Relationship r2 = new Relationship();
r2.setValue("CHILD");
assertEquals(r2.getValue(), "CHILD");
Relationship r3 = new Relationship();
r3.setValue("SIBLING");
assertEquals(r3.getValue(), "SIBLING");
Relationship r4 = new Relationship();
r4.setValue(Relationship.PARENT);
assertEquals(r4.getValue(), Relationship.PARENT);
Relationship r5 = new Relationship();
r5.setValue(Relationship.CHILD);
assertEquals(r5.getValue(), Relationship.CHILD);
Relationship r6 = new Relationship();
r6.setValue(Relationship.SIBLING);
assertEquals(r6.getValue(), Relationship.SIBLING);
}
/**
* This method tests the one-arg constructor and the get
* methods.
*/
public void test_OneArgConstructor() throws ICalendarException
{
Relationship r1 = new Relationship("PARENT");
assertEquals(r1.getValue(), "PARENT");
Relationship r2 = new Relationship("CHILD");
assertEquals(r2.getValue(), "CHILD");
Relationship r3 = new Relationship("SIBLING");
assertEquals(r3.getValue(), "SIBLING");
Relationship r4 = new Relationship(Relationship.PARENT);
assertEquals(r4.getValue(), Relationship.PARENT);
Relationship r5 = new Relationship(Relationship.CHILD);
assertEquals(r5.getValue(), Relationship.CHILD);
Relationship r6 = new Relationship(Relationship.SIBLING);
assertEquals(r6.getValue(), Relationship.SIBLING);
}
public void test_RelationshipBooleans() throws ICalendarException
{
boolean t = true;
boolean f = false;
Relationship r1 = new Relationship();
r1.setValue("PARENT");
assertEquals(r1.isParent(), t);
assertEquals(r1.isChild(), f);
assertEquals(r1.isSibling(), f);
r1.setValue("CHILD");
assertEquals(r1.isParent(), f);
assertEquals(r1.isChild(), t);
assertEquals(r1.isSibling(), f);
r1.setValue("SIBLING");
assertEquals(r1.isParent(), f);
assertEquals(r1.isChild(), f);
assertEquals(r1.isSibling(), t);
r1.setValue(Relationship.PARENT);
assertEquals(r1.isParent(), t);
assertEquals(r1.isChild(), f);
assertEquals(r1.isSibling(), f);
r1.setValue(Relationship.CHILD);
assertEquals(r1.isParent(), f);
assertEquals(r1.isChild(), t);
assertEquals(r1.isSibling(), f);
r1.setValue(Relationship.SIBLING);
assertEquals(r1.isParent(), f);
assertEquals(r1.isChild(), f);
assertEquals(r1.isSibling(), t);
}
/**
* This method runs the test.
*/
public void runTest() throws Throwable
{
test_NoArgConstructor();
test_OneArgConstructor();
test_RelationshipBooleans();
}
}
1.1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/roleparam/ValidRoleParamTest.java
Index: ValidRoleParamTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.periodicity.test.roleparam;
import org.apache.commons.periodicity.ical.parameters.RoleParam;
import org.apache.commons.periodicity.util.ICalendarException;
import junit.framework.TestCase;
import java.lang.reflect.Array;
/**
* This class tests to ensure that valid inputs to the
* Participation class can be set and retrieved correctly. The
* valid values for this parameter are "CHAIR", "REQ-PARTICIPANT",
* "OPT-PARTICIPANT", AND "NON-PARTICIPANT".
* This parameter is covered in RFC 2445 Section 4.2.16.
* @author Mike George
* <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
*/
public class ValidRoleParamTest extends TestCase
{
//Create the static arrays for testing
public static final String[] VALIDVALUES = {
"CHAIR", "REQ-PARTICIPANT",
"OPT-PARTICIPANT", "NON-PARTICIPANT"
};
public static final String[] VALIDCONSTANTS = {
RoleParam.CHAIRMAN_ROLE, RoleParam.REQ_PARTICIPANT,
RoleParam.OPT_PARTICIPANT, RoleParam.NON_PARTICIPANT
};
final int valLength = Array.getLength(VALIDVALUES);
final int conLength = Array.getLength(VALIDCONSTANTS);
/**
* This public constructor passes a String to the TestCase
* constructor.
* @param A name that helps uniquely identify the test, i.e. a date, test#.
*/
public ValidRoleParamTest(String name) throws Throwable
{
super("ValidRoleParamTest:" + name);
runTest();
}
/**
* This method tests the no-arg constructor and the set/get
* methods.
*/
public void test_NoArgConstructor() throws ICalendarException
{
for (int i = 0; i < valLength; i++)
{
RoleParam e1 = new RoleParam();
e1.setValue(VALIDVALUES[i]);
assertEquals(e1.getValue(), VALIDVALUES[i]);
}
for (int i = 0; i < conLength; i++)
{
RoleParam e1 = new RoleParam();
e1.setValue(VALIDCONSTANTS[i]);
assertEquals(e1.getValue(), VALIDCONSTANTS[i]);
}
}
/**
* This method tests the one-arg constructor and the get
* methods.
*/
public void test_OneArgConstructor() throws ICalendarException
{
for (int i = 0; i < valLength; i++)
{
RoleParam e1 = new RoleParam(VALIDVALUES[i]);
assertEquals(e1.getValue(), VALIDVALUES[i]);
}
for (int i = 0; i < conLength; i++)
{
RoleParam e1 = new RoleParam(VALIDCONSTANTS[i]);
assertEquals(e1.getValue(), VALIDCONSTANTS[i]);
}
}
/**
* Test to make sure that the boolean methods work correctly.
*/
public void test_RoleParamBooleans() throws ICalendarException
{
boolean t = true;
boolean f = false;
RoleParam p1 = new RoleParam();
p1.setValue("CHAIR");
assertEquals(p1.isChairman(), t);
assertEquals(p1.isRequiredParticipant(), f);
assertEquals(p1.isOptionalParticipant(), f);
assertEquals(p1.isNonParticipant(), f);
p1.setValue("REQ-PARTICIPANT");
assertEquals(p1.isChairman(), f);
assertEquals(p1.isRequiredParticipant(), t);
assertEquals(p1.isOptionalParticipant(), f);
assertEquals(p1.isNonParticipant(), f);
p1.setValue("OPT-PARTICIPANT");
assertEquals(p1.isChairman(), f);
assertEquals(p1.isRequiredParticipant(), f);
assertEquals(p1.isOptionalParticipant(), t);
assertEquals(p1.isNonParticipant(), f);
p1.setValue("NON-PARTICIPANT");
assertEquals(p1.isChairman(), f);
assertEquals(p1.isRequiredParticipant(), f);
assertEquals(p1.isOptionalParticipant(), f);
assertEquals(p1.isNonParticipant(), t);
p1.setValue(RoleParam.CHAIRMAN_ROLE);
assertEquals(p1.isChairman(), t);
assertEquals(p1.isRequiredParticipant(), f);
assertEquals(p1.isOptionalParticipant(), f);
assertEquals(p1.isNonParticipant(), f);
p1.setValue(RoleParam.REQ_PARTICIPANT);
assertEquals(p1.isChairman(), f);
assertEquals(p1.isRequiredParticipant(), t);
assertEquals(p1.isOptionalParticipant(), f);
assertEquals(p1.isNonParticipant(), f);
p1.setValue(RoleParam.OPT_PARTICIPANT);
assertEquals(p1.isChairman(), f);
assertEquals(p1.isRequiredParticipant(), f);
assertEquals(p1.isOptionalParticipant(), t);
assertEquals(p1.isNonParticipant(), f);
p1.setValue(RoleParam.NON_PARTICIPANT);
assertEquals(p1.isChairman(), f);
assertEquals(p1.isRequiredParticipant(), f);
assertEquals(p1.isOptionalParticipant(), f);
assertEquals(p1.isNonParticipant(), t);
}
/**
* This method runs the test.
*/
public void runTest() throws Throwable
{
test_NoArgConstructor();
test_OneArgConstructor();
test_RoleParamBooleans();
}
}
1.1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/rsvpparam/ValidRsvpParamTest.java
Index: ValidRsvpParamTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.periodicity.test.rsvpparam;
import org.apache.commons.periodicity.ical.parameters.RsvpParam;
import org.apache.commons.periodicity.util.ICalendarException;
import junit.framework.TestCase;
/**
* This class tests to ensure that valid inputs to the
* RsvpParam class can be set and retrieved correctly. The
* valid values for this parameter are "TRUE and "FALSE".
* This parameter is covered in RFC 2445 Section 4.2.17.
* @author Mike George
* <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
*/
public class ValidRsvpParamTest extends TestCase
{
/**
* This public constructor passes a String to the TestCase
* constructor.
* @param A name that helps uniquely identify the test, i.e. a date, test#.
*/
public ValidRsvpParamTest(String name) throws Throwable
{
super("ValidRsvpParamTest:" + name);
runTest();
}
/**
* This method tests the no-arg constructor and the set/get
* methods.
*/
public void test_NoArgConstructor() throws ICalendarException
{
boolean t = true;
boolean f = false;
RsvpParam e1 = new RsvpParam();
e1.setValue("TRUE");
assertEquals(e1.getValue(), t);
RsvpParam e2 = new RsvpParam();
e2.setValue("FALSE");
assertEquals(e2.getValue(), f);
RsvpParam e3 = new RsvpParam();
e3.setValue(t);
assertEquals(e3.getValue(), t);
RsvpParam e4 = new RsvpParam();
e4.setValue(f);
assertEquals(e4.getValue(), f);
}
/**
* This method tests the one-arg constructor and the get
* methods.
*/
public void test_OneArgConstructor() throws ICalendarException
{
boolean t = true;
boolean f = false;
RsvpParam e1 = new RsvpParam("TRUE");
assertEquals(e1.getValue(), t);
RsvpParam e2 = new RsvpParam("FALSE");
assertEquals(e2.getValue(), f);
RsvpParam e3 = new RsvpParam(t);
assertEquals(e3.getValue(), t);
RsvpParam e4 = new RsvpParam(f);
assertEquals(e4.getValue(), f);
}
/**
* Test to make sure that the boolean methods work correctly.
*/
public void test_RsvpToString() throws ICalendarException
{
boolean t = true;
boolean f = false;
RsvpParam e1 = new RsvpParam("TRUE");
assertEquals(e1.toString(), "TRUE");
RsvpParam e2 = new RsvpParam("FALSE");
assertEquals(e2.toString(), "FALSE");
RsvpParam e3 = new RsvpParam(t);
assertEquals(e3.toString(), "TRUE");
RsvpParam e4 = new RsvpParam(f);
assertEquals(e4.toString(), "FALSE");
}
/**
* This method runs the test.
*/
public void runTest() throws Throwable
{
test_NoArgConstructor();
test_OneArgConstructor();
test_RsvpToString();
}
}
1.1 jakarta-commons-sandbox/periodicity/src/java/org/apache/commons/periodicity/test/valueparam/ValidValueParamTest.java
Index: ValidValueParamTest.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache" or
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.periodicity.test.valueparam;
import org.apache.commons.periodicity.ical.parameters.ValueParam;
import org.apache.commons.periodicity.util.ICalendarException;
import junit.framework.TestCase;
import java.lang.reflect.Array;
/**
* This class tests to ensure that valid inputs to the
* Participation class can be set and retrieved correctly.
* This parameter is covered in RFC 2445 Section 4.2.20.
* @author Mike George
* <a href="mailto:javajoe2975@comcast.net">javajoe2975@comcast.net</a>
*/
public class ValidValueParamTest extends TestCase
{
//Create the static arrays for testing
public static final String[] VALIDVALUES = {
"BINARY", "BOOLEAN", "CAL-ADDRESS", "DATE", "DATE-TIME",
"DURATION", "FLOAT", "INTEGER", "PERIOD", "RECUR", "TEXT",
"TIME", "URI", "UTC-OFFSET"
};
public static final String[] VALIDCONSTANTS = {
ValueParam.BINARY_TYPE, ValueParam.BOOLEAN_TYPE,
ValueParam.CAL_ADDRESS_TYPE, ValueParam.DATE_TYPE,
ValueParam.DATE_TIME_TYPE, ValueParam.DURATION_TYPE,
ValueParam.FLOAT_TYPE, ValueParam.INTEGER_TYPE,
ValueParam.PERIOD_TYPE, ValueParam.RECUR_TYPE,
ValueParam.TEXT_TYPE, ValueParam.TIME_TYPE,
ValueParam.URI_TYPE, ValueParam.UTC_OFFSET_TYPE,
};
final int valLength = Array.getLength(VALIDVALUES);
final int conLength = Array.getLength(VALIDCONSTANTS);
/**
* This public constructor passes a String to the TestCase
* constructor.
* @param A name that helps uniquely identify the test, i.e. a date, test#.
*/
public ValidValueParamTest(String name) throws Throwable
{
super("ValidValueParamTest:" + name);
runTest();
}
/**
* This method tests the no-arg constructor and the set/get
* methods.
*/
public void test_NoArgConstructor() throws ICalendarException
{
for (int i = 0; i < valLength; i++)
{
ValueParam e1 = new ValueParam();
e1.setValue(VALIDVALUES[i]);
assertEquals(e1.getValue(), VALIDVALUES[i]);
}
for (int i = 0; i < conLength; i++)
{
ValueParam e1 = new ValueParam();
e1.setValue(VALIDCONSTANTS[i]);
assertEquals(e1.getValue(), VALIDCONSTANTS[i]);
}
}
/**
* This method tests the one-arg constructor and the get
* methods.
*/
public void test_OneArgConstructor() throws ICalendarException
{
for (int i = 0; i < valLength; i++)
{
ValueParam e1 = new ValueParam(VALIDVALUES[i]);
assertEquals(e1.getValue(), VALIDVALUES[i]);
}
for (int i = 0; i < conLength; i++)
{
ValueParam e1 = new ValueParam(VALIDCONSTANTS[i]);
assertEquals(e1.getValue(), VALIDCONSTANTS[i]);
}
}
/**
* Test to make sure that the boolean methods work correctly.
*/
public void test_ValueParamBooleans() throws ICalendarException
{
boolean tru = true;
boolean f = false;
ValueParam p1 = new ValueParam();
p1.setValue("BINARY");
assertEquals(p1.isBinary(), tru);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.BINARY_TYPE);
assertEquals(p1.isBinary(), tru);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("BOOLEAN");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), tru);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.BOOLEAN_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), tru);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("CAL-ADDRESS");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), tru);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.CAL_ADDRESS_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), tru);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("DATE");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), tru);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.DATE_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), tru);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("DATE-TIME");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), tru);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.DATE_TIME_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), tru);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("DURATION");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), tru);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.DURATION_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), tru);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("FLOAT");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), tru);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.FLOAT_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), tru);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("INTEGER");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), tru);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.INTEGER_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), tru);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("PERIOD");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), tru);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.PERIOD_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), tru);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("RECUR");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), tru);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.RECUR_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), tru);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("TEXT");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), tru);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.TEXT_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), tru);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("TIME");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), tru);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.TIME_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), tru);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("URI");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), tru);
assertEquals(p1.isUTCOffset(), f);
p1.setValue(ValueParam.URI_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), tru);
assertEquals(p1.isUTCOffset(), f);
p1.setValue("UTC-OFFSET");
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), tru);
p1.setValue(ValueParam.UTC_OFFSET_TYPE);
assertEquals(p1.isBinary(), f);
assertEquals(p1.isBoolean(), f);
assertEquals(p1.isCalendarAddress(), f);
assertEquals(p1.isDate(), f);
assertEquals(p1.isDateTime(), f);
assertEquals(p1.isDuration(), f);
assertEquals(p1.isFloat(), f);
assertEquals(p1.isInteger(), f);
assertEquals(p1.isPeriod(), f);
assertEquals(p1.isRecurrence(), f);
assertEquals(p1.isText(), f);
assertEquals(p1.isTime(), f);
assertEquals(p1.isURI(), f);
assertEquals(p1.isUTCOffset(), tru);
}
/**
* This method runs the test.
*/
public void runTest() throws Throwable
{
test_NoArgConstructor();
test_OneArgConstructor();
test_ValueParamBooleans();
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>