001: /*
002: * This file is part of the WfMOpen project.
003: * Copyright (C) 2001-2004 Danet GmbH (www.danet.de), GS-AN.
004: * All rights reserved.
005: *
006: * This program is free software; you can redistribute it and/or modify
007: * it under the terms of the GNU General Public License as published by
008: * the Free Software Foundation; either version 2 of the License, or
009: * (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: * $Id: JellyLdapTest.java,v 1.3 2006/09/29 12:32:09 drmlipp Exp $
021: *
022: * $Log: JellyLdapTest.java,v $
023: * Revision 1.3 2006/09/29 12:32:09 drmlipp
024: * Consistently using WfMOpen as projct name now.
025: *
026: * Revision 1.2 2005/09/05 09:41:49 drmlipp
027: * Synchronized with 1.3.2.
028: *
029: * Revision 1.1.2.4 2005/09/01 15:04:45 drmlipp
030: * Delete tag workfing.
031: *
032: * Revision 1.1.2.3 2005/09/01 11:37:21 drmlipp
033: * Insert Tag workfing.
034: *
035: * Revision 1.1.2.2 2005/08/30 14:37:43 drmlipp
036: * LDAP query workging.
037: *
038: * Revision 1.1.2.1 2005/08/29 15:21:44 drmlipp
039: * Started Jelly LDAP taglib.
040: *
041: * Revision 1.1.1.1 2004/08/18 15:18:47 drmlipp
042: * Update to 1.2
043: *
044: * Revision 1.2 2004/06/28 14:58:33 lipp
045: * Got test running.
046: *
047: * Revision 1.1 2004/06/23 15:07:35 lipp
048: * Jelly evaluation.
049: *
050: */
051: package util;
052:
053: import java.io.File;
054:
055: import org.apache.commons.jelly.JellyContext;
056: import org.apache.commons.jelly.JellyException;
057: import org.apache.commons.jelly.XMLOutput;
058:
059: import junit.framework.Test;
060: import junit.framework.TestCase;
061: import junit.framework.TestSuite;
062:
063: /**
064: * This class provides ...
065: *
066: * @author <a href="mailto:lipp@danet.de"></a>
067: * @version $Revision: 1.3 $
068: */
069: /**
070: * Test class for sax utility classes
071: */
072: public class JellyLdapTest extends TestCase {
073:
074: /**
075: * Konstruktor zum Erzeugen eines TestCase
076: */
077: public JellyLdapTest(String name) {
078: super (name);
079: }
080:
081: /**
082: * Assembling the test suite
083: */
084: public static Test suite() throws Exception {
085: TestSuite suite = new TestSuite();
086: suite.addTest(new JellyLdapTest("connect"));
087: suite.addTest(new JellyLdapTest("query"));
088: suite.addTest(new JellyLdapTest("insert"));
089: suite.addTest(new JellyLdapTest("update"));
090: suite.addTest(new JellyLdapTest("delete"));
091: return suite;
092: }
093:
094: /**
095: * Simple connection
096: */
097: public void connect() throws Exception {
098: JellyContext context = new JellyContext();
099: XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
100: context.runScript(new File("util/ldap-connect.jelly"),
101: xmlOutput);
102: xmlOutput.flush();
103: }
104:
105: /**
106: * Simple query
107: */
108: public void query() throws Exception {
109: JellyContext context = new JellyContext();
110: XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
111: context.runScript(new File("util/ldap-query.jelly"), xmlOutput);
112: xmlOutput.flush();
113: }
114:
115: /**
116: * Simple insert
117: */
118: public void insert() throws Exception {
119: JellyContext context = new JellyContext();
120: XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
121: context
122: .runScript(new File("util/ldap-insert.jelly"),
123: xmlOutput);
124: xmlOutput.flush();
125: }
126:
127: /**
128: * Simple update
129: */
130: public void update() throws Exception {
131: JellyContext context = new JellyContext();
132: XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
133: context
134: .runScript(new File("util/ldap-update.jelly"),
135: xmlOutput);
136: xmlOutput.flush();
137: }
138:
139: /**
140: * Simple delete
141: */
142: public void delete() throws Exception {
143: JellyContext context = new JellyContext();
144: XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
145: context
146: .runScript(new File("util/ldap-delete.jelly"),
147: xmlOutput);
148: xmlOutput.flush();
149: }
150:
151: }
|