KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > db > test > TestConnection


1 /*
2   (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: TestConnection.java,v 1.22 2005/02/21 12:03:16 andy_seaborne Exp $
5 */

6
7 package com.hp.hpl.jena.db.test;
8
9 /**
10  *
11  * This tests basic open/create operations on the modelRDB.
12  *
13  * To run, you must have a mySQL database operational on
14  * localhost with a database name of "test" and allow use
15  * by a user named "test" with an empty password.
16  *
17  * (based in part on model tests written earlier by bwm and kers)
18  *
19  * @author csayers
20  * @version 0.1
21 */

22
23 import com.hp.hpl.jena.db.*;
24 import com.hp.hpl.jena.db.impl.IRDBDriver;
25
26
27 import junit.framework.*;
28
29 import com.hp.hpl.jena.rdf.model.*;
30 import com.hp.hpl.jena.shared.*;
31 import com.hp.hpl.jena.vocabulary.DB;
32
33 public class TestConnection extends TestCase {
34     
35     String JavaDoc DefModel = GraphRDB.DEFAULT;
36         
37     public TestConnection( String JavaDoc name )
38         { super( name ); }
39     
40     public static TestSuite suite()
41         { return new TestSuite( TestConnection.class ); }
42     
43     protected void setUp() throws java.lang.Exception JavaDoc {
44     }
45     
46     protected void tearDown() throws java.lang.Exception JavaDoc {
47     }
48     
49     private static void loadClass()
50         {
51         try { Class.forName(TestPackage.M_DBDRIVER_CLASS); }
52         catch (Exception JavaDoc e) { throw new JenaException( e ); }
53         }
54         
55     public static IDBConnection makeTestConnection()
56         {
57         loadClass();
58         return new DBConnection
59             (
60             TestPackage.M_DB_URL,
61             TestPackage.M_DB_USER,
62             TestPackage.M_DB_PASSWD,
63             TestPackage.M_DB
64             );
65         }
66         
67     public static IDBConnection makeAndCleanTestConnection()
68         {
69         IDBConnection result = makeTestConnection();
70         boolean tryClean = true;
71         boolean didClean = false;
72         boolean tryUnlock = true;
73         String JavaDoc err = null;
74         while ( tryClean && !didClean ) {
75             try {
76                 result.cleanDB();
77                 didClean = true;
78             } catch (Exception JavaDoc e) {
79                 err = err + "\n" + e;
80                 if ( tryUnlock ) {
81                     tryUnlock = false;
82                     if ( result.getDriver().DBisLocked() )
83                         try {
84                             result.getDriver().unlockDB();
85                         } catch ( Exception JavaDoc e1 ) {
86                             err = err + "\n" + e1;
87                         }
88                 } else
89                     tryClean = false;
90             }
91         }
92         if ( didClean == false )
93             throw new JenaException("Failed to clean database.\n" + err);
94         return result;
95         }
96         
97 /* public void testNoClass() throws java.lang.Exception {
98         try {
99             IDBConnection conn = new DBConnection(
100             TestPackage.M_DB_URL,
101             TestPackage.M_DB_USER,
102             TestPackage.M_DB_PASSWD,
103             TestPackage.M_DB);
104             conn.cleanDB();
105             assertTrue(false); // should not get here
106         } catch (Exception e) {
107         }
108     } */

109
110     public void testRecovery() throws java.lang.Exception JavaDoc {
111         IDBConnection conn = makeAndCleanTestConnection();
112         ModelRDB m = null;
113         try {
114         m = ModelRDB.createModel(conn, "myName");
115         m.close();
116         } catch ( Exception JavaDoc e ) {
117             assertTrue(false);
118         }
119         try {
120             m = ModelRDB.createModel(conn, "myName");
121             assertTrue(false);
122         } catch ( Exception JavaDoc e ) {
123         }
124         conn.close();
125     }
126
127     
128     public void testDBConnect() throws java.lang.Exception JavaDoc {
129         IDBConnection conn = makeTestConnection();
130         conn.close();
131     }
132     
133     public void testBadConnection() throws java.lang.Exception JavaDoc {
134         /*
135          * try { IDBConnection conn = new DBConnection( "Bad URL",
136          * TestPackage.M_DB_USER, TestPackage.M_DB_PASSWD, TestPackage.M_DB);
137          * conn.cleanDB(); assertTrue(false); // should not get here } catch
138          * (Exception e) { }
139          */

140         try {
141             IDBConnection conn = new DBConnection(
142             TestPackage.M_DB_URL,
143             TestPackage.M_DB_USER,
144             TestPackage.M_DB_PASSWD,
145             "Bad DB");
146             conn.cleanDB();
147             assertTrue(false); // should not get here
148
} catch (Exception JavaDoc e) {
149         }
150     }
151     
152     
153     public void testConstructDefaultModel() throws java.lang.Exception JavaDoc {
154         IDBConnection conn = makeAndCleanTestConnection();
155         ModelRDB m = ModelRDB.createModel(conn);
156         m.remove();
157         conn.close();
158     }
159     
160     public void testConstructAndOpenDefaultModel() throws java.lang.Exception JavaDoc {
161         IDBConnection conn = makeAndCleanTestConnection();
162         ModelRDB m = ModelRDB.createModel(conn);
163         m.close();
164         ModelRDB m2 = ModelRDB.open(conn);
165         m2.remove();
166         conn.close();
167     }
168         
169     public void testConstructNamedModel() throws java.lang.Exception JavaDoc {
170         IDBConnection conn = makeAndCleanTestConnection();
171         ModelRDB m = ModelRDB.createModel(conn, "myName");
172         m.remove();
173         conn.close();
174     }
175     
176     public void testBadNamedModel() throws java.lang.Exception JavaDoc {
177         IDBConnection conn = makeAndCleanTestConnection();
178         ModelRDB m = null;
179         try {
180             m = ModelRDB.createModel(conn, DefModel);
181             assertTrue(false);
182         } catch (Exception JavaDoc e) {
183         }
184         conn.close();
185     }
186     
187     public void testBadNamedFactoryModel() throws java.lang.Exception JavaDoc {
188         IDBConnection conn = makeAndCleanTestConnection();
189         ModelMaker maker = ModelFactory.createModelRDBMaker(conn);
190         Model m = null;
191         try {
192             m = maker.createModel(DefModel);
193             assertTrue(false);
194         } catch (Exception JavaDoc e) {
195         }
196         conn.close();
197     }
198     
199     public void testReconstructDefaultModel() throws java.lang.Exception JavaDoc {
200         IDBConnection conn = makeAndCleanTestConnection();
201         ModelRDB m = ModelRDB.createModel(conn);
202         m.remove();
203         ModelRDB m1 = ModelRDB.createModel(conn);
204         m1.remove();
205         conn.close();
206     }
207     
208     public void testReconstructNamedModel() throws java.lang.Exception JavaDoc {
209         IDBConnection conn = makeAndCleanTestConnection();
210         ModelRDB m = ModelRDB.createModel(conn, "myName");
211         m.remove();
212         ModelRDB m1 = ModelRDB.createModel(conn, "myName");
213         m1.remove();
214         conn.close();
215     }
216
217         
218     public void testConstructAndOpenNamedModel() throws java.lang.Exception JavaDoc {
219         IDBConnection conn = makeAndCleanTestConnection();
220         ModelRDB m = ModelRDB.createModel(conn, "myName");
221         m.close();
222         ModelRDB m2 = ModelRDB.open(conn, "myName");
223         m2.remove();
224         conn.close();
225     }
226         
227     public void testConstructParamaterizedModel() throws java.lang.Exception JavaDoc {
228         IDBConnection conn = makeAndCleanTestConnection();
229         ModelRDB m = ModelRDB.createModel(conn, ModelRDB.getDefaultModelProperties(conn));
230         m.remove();
231         conn.close();
232     }
233         
234     public void testConstructAndOpenParamaterizedModel() throws java.lang.Exception JavaDoc {
235         IDBConnection conn = makeAndCleanTestConnection();
236         ModelRDB m = ModelRDB.createModel(conn, ModelRDB.getDefaultModelProperties(conn));
237         m.close();
238         ModelRDB m2 = ModelRDB.open(conn);
239         m2.remove();
240         conn.close();
241     }
242         
243     public void testConstructNamedParamaterizedModel() throws java.lang.Exception JavaDoc {
244         IDBConnection conn = makeAndCleanTestConnection();
245         ModelRDB m = ModelRDB.createModel(conn, "myName", ModelRDB.getDefaultModelProperties(conn));
246         m.remove();
247         conn.close();
248     }
249         
250     public void testConstructAndOpenNamedParamaterizedModel() throws java.lang.Exception JavaDoc {
251         IDBConnection conn = makeAndCleanTestConnection();
252         ModelRDB m = ModelRDB.createModel(conn, "myName", ModelRDB.getDefaultModelProperties(conn));
253         m.close();
254         ModelRDB m2 = ModelRDB.open(conn, "myName");
255         m2.remove();
256         conn.close();
257     }
258     
259     public void testOpenNamedNonExistentModel() throws java.lang.Exception JavaDoc {
260         IDBConnection conn = makeTestConnection();
261         try {
262             ModelRDB m2 = ModelRDB.open(conn, "myName");
263             m2.remove();
264             conn.close();
265             assertTrue("Successfully opened non-existent model", false);
266         } catch ( RDFRDBException e ) {
267             conn.close();
268         }
269     }
270
271     public void testOpenUnnamedNonExistentModel() throws java.lang.Exception JavaDoc {
272         IDBConnection conn = makeTestConnection();
273         try {
274             conn.cleanDB();
275             ModelRDB m2 = ModelRDB.open(conn);
276             m2.remove();
277             conn.close();
278             assertTrue("Successfully opened unnamed non-existent model", false);
279         } catch ( RDFRDBException e ) {
280             conn.close();
281         }
282     }
283
284     public void testCreateExistingModel() throws java.lang.Exception JavaDoc {
285         IDBConnection conn = makeAndCleanTestConnection();
286         ModelRDB m = ModelRDB.createModel(conn, "myName", ModelRDB.getDefaultModelProperties(conn));
287         try {
288             ModelRDB m2 = ModelRDB.createModel(conn, "myName", ModelRDB.getDefaultModelProperties(conn));
289             m.remove(); m2.remove();
290             conn.close();
291             assertTrue("Successfully created pre-existing model", false);
292         } catch ( RDFRDBException e ) {
293             m.remove();
294             conn.close();
295         }
296     }
297     
298     public void addToDBGraphProp ( Model model, Property prop, String JavaDoc val ) {
299         // first, get URI of the graph
300
StmtIterator iter = model.listStatements(
301             new SimpleSelector(null, DB.graphName, (RDFNode) null));
302         assertTrue(iter.hasNext());
303         
304         Statement stmt = iter.nextStatement();
305         assertTrue(iter.hasNext() == false);
306         Resource graphURI = stmt.getSubject();
307         Literal l = model.createLiteral(val);
308         Statement s = model.createStatement(graphURI,prop,l);
309         model.add(s);
310         assertTrue(model.contains(s));
311     }
312     
313     public void testConstructDefSchemaModel() throws java.lang.Exception JavaDoc {
314         IDBConnection conn = makeAndCleanTestConnection();
315         conn.getDriver().setStoreWithModel("");
316         // Model props = ModelRDB.getDefaultModelProperties(conn);
317
// addToDBGraphProp(props,DB.graphDBSchema,DefModel);
318
// ModelRDB m = ModelRDB.createModel(conn, props);
319
ModelRDB m = ModelRDB.createModel(conn);
320         m.remove();
321         conn.close();
322     }
323     
324     public void testConstructBadSchemaModel() throws java.lang.Exception JavaDoc {
325         IDBConnection conn = makeAndCleanTestConnection();
326         // Model props = ModelRDB.getDefaultModelProperties(conn);
327
// addToDBGraphProp(props,DB.graphDBSchema,"SCHEMA_DOES_NOT_EXIST");
328
conn.getDriver().setStoreWithModel(DefModel);
329         try {
330             // ModelRDB m = ModelRDB.createModel(conn, props);
331
ModelRDB m = ModelRDB.createModel(conn);
332             m.remove();
333             assertFalse("Created model with non-existent schema",true);
334         } catch (RDFRDBException e) {
335         }
336         conn.getDriver().setStoreWithModel("MODEL_DOES_NOT_EXIST");
337         try {
338             // ModelRDB m = ModelRDB.createModel(conn, props);
339
ModelRDB m = ModelRDB.createModel(conn);
340             m.remove();
341             assertFalse("Created model with non-existent schema",true);
342         } catch (RDFRDBException e) {
343         }
344         conn.close();
345     }
346     
347     public void testConstructNamedModelDefSchema() throws java.lang.Exception JavaDoc {
348         // this named model uses the default schema
349
IDBConnection conn = makeAndCleanTestConnection();
350         // Model props = ModelRDB.getDefaultModelProperties(conn);
351
// addToDBGraphProp(props,DB.graphDBSchema,DefModel);
352
conn.getDriver().setStoreWithModel(null);
353         // ModelRDB m = ModelRDB.createModel(conn, "myName", props);
354
ModelRDB m = ModelRDB.createModel(conn, "myName");
355         m.remove();
356         conn.close();
357     }
358
359     public void testConstructNamedModelDefSchema1() throws java.lang.Exception JavaDoc {
360         // same as testConstructNamedModelDefSchema except the default model already exists.
361
// should new model should share tables with default. no way now to verify this
362
// from the API though. have to check it manually.
363
IDBConnection conn = makeAndCleanTestConnection();
364         // ModelRDB mdef = ModelRDB.createModel(conn, ModelRDB.getDefaultModelProperties(conn));
365
// Model props = ModelRDB.getDefaultModelProperties(conn);
366
// addToDBGraphProp(props,DB.graphDBSchema,DefModel);
367
// ModelRDB m = ModelRDB.createModel(conn, "myName", props);
368
ModelRDB mdef = ModelRDB.createModel(conn);
369         conn.getDriver().setStoreWithModel(DefModel);
370         ModelRDB m = ModelRDB.createModel(conn, "myName");
371         mdef.remove(); m.remove();
372         conn.close();
373     }
374     
375     public void testConstructNamedModelDefSchema2() throws java.lang.Exception JavaDoc {
376         // similar to testConstructNamedModelDefSchema1 except the newly created
377
// model should not share the default schema.
378
IDBConnection conn = makeAndCleanTestConnection();
379         // ModelRDB mdef = ModelRDB.createModel(conn, ModelRDB.getDefaultModelProperties(conn));
380
// Model props = ModelRDB.getDefaultModelProperties(conn);
381
// addToDBGraphProp(props,DB.graphDBSchema,DefModel);
382
// ModelRDB m = ModelRDB.createModel(conn, "myName", props);
383
ModelRDB mdef = ModelRDB.createModel(conn);
384         conn.getDriver().setStoreWithModel(null);
385         ModelRDB m = ModelRDB.createModel(conn, "myName");
386         mdef.remove(); m.remove();
387         conn.close();
388     }
389
390     public void testConstructNamedModelSchema() throws java.lang.Exception JavaDoc {
391         // construct two named models that share a schema
392
IDBConnection conn = makeAndCleanTestConnection();
393         // ModelRDB m1 = ModelRDB.createModel(conn, "model1", ModelRDB.getDefaultModelProperties(conn));
394
ModelRDB m1 = ModelRDB.createModel(conn, "model1");
395         // Model props = ModelRDB.getDefaultModelProperties(conn);
396
// addToDBGraphProp(props,DB.graphDBSchema,"model1");
397
// ModelRDB m2 = ModelRDB.createModel(conn, "model2", props);
398
conn.getDriver().setStoreWithModel("model1");
399         ModelRDB m2 = ModelRDB.createModel(conn, "model2");
400         m1.remove(); m2.remove();
401         conn.close();
402     }
403     
404     public void testNamedPrefixedModel() throws java.lang.Exception JavaDoc {
405         IDBConnection conn = makeAndCleanTestConnection();
406         IRDBDriver d = conn.getDriver();
407         d.setTableNamePrefix("foo_");
408         conn.cleanDB(); // just in case any crud lying about from previous test
409
ModelRDB m = ModelRDB.createModel(conn, "myName");
410         m.remove();
411         conn.cleanDB();
412         conn.close();
413     }
414     
415     public void testNamedPrefixedPersists() throws java.lang.Exception JavaDoc {
416         IDBConnection conn = makeTestConnection();
417         IRDBDriver d = conn.getDriver();
418         String JavaDoc pfx = "foo_";
419         d.setTableNamePrefix(pfx);
420         conn.cleanDB(); // just in case any crud lying about from previous test
421
ModelRDB m = ModelRDB.createModel(conn, "myName");
422         m.close();
423         conn.close();
424         conn = makeTestConnection();
425         d = conn.getDriver();
426         d.setTableNamePrefix(pfx);
427         m = ModelRDB.open(conn, "myName");
428         assertTrue(d.getTableNamePrefix().equalsIgnoreCase(pfx));
429         conn.cleanDB();
430     }
431
432     public void testNamedPrefixFailure() throws java.lang.Exception JavaDoc {
433         IDBConnection conn = makeAndCleanTestConnection();
434         IRDBDriver d = conn.getDriver();
435         String JavaDoc longPfx =
436             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
437             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
438             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
439             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
440             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
441             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
442             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
443             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
444             "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
445         try {
446             d.setTableNamePrefix(longPfx);
447             assertTrue(false); // should not get here
448
} catch (Exception JavaDoc e) {
449         }
450         ModelRDB m = ModelRDB.createModel(conn);
451         try {
452             d.setTableNamePrefix("foo_");
453             assertTrue(false); // should not get here
454
} catch (Exception JavaDoc e) {
455         }
456         m.close();
457         conn.close();
458     }
459     
460     public void testDBMutex() {
461         IDBConnection conn = makeAndCleanTestConnection();
462         IRDBDriver d = conn.getDriver();
463
464         d.lockDB();
465         try {
466             ModelRDB foo = ModelRDB.createModel(conn,"foo");
467             assertTrue(false); // db lock should prevent model create
468
} catch ( Exception JavaDoc e) {
469         }
470
471         d.unlockDB();
472         
473         if ( d.isDBFormatOK() )
474             assertTrue(false); // db contains no model
475

476         if ( conn.containsModel("foo") )
477             assertTrue(false);
478         
479         // check that containsModel does not format db
480
if ( d.isDBFormatOK() )
481             assertTrue(false); // db contains no model
482

483         ModelRDB foo = ModelRDB.createModel(conn,"foo");
484         
485         if ( d.isDBFormatOK() == false )
486             assertTrue(false); // db should be formatted
487

488         if ( conn.containsModel("foo") == false )
489             assertTrue(false);
490         
491         if ( conn.containsModel("bar") )
492             assertTrue(false);
493
494         // now, delete a system table so db fmt is bad
495
d.deleteTable(d.getSystemTableName(0));
496         
497         if ( d.isDBFormatOK() )
498             assertTrue(false); // db should not be formatted
499

500         try {
501             conn.close();
502         } catch ( Exception JavaDoc e) {
503             assertTrue(false);
504         }
505         
506         conn = makeTestConnection();
507         d = conn.getDriver();
508
509         if ( conn.containsModel("foo") )
510             assertTrue(false);
511         
512         if ( d.isDBFormatOK() )
513             assertTrue(false); // db should still not be formatted
514

515         // following should format db
516
ModelRDB bar = ModelRDB.createModel(conn,"bar");
517         
518         if ( d.isDBFormatOK() == false )
519             assertTrue(false); // db should be formatted
520

521         if ( conn.containsModel("foo") )
522             assertTrue(false);
523
524         if ( conn.containsModel("bar") == false )
525             assertTrue(false);
526         
527         bar.begin();
528         
529         try {
530             bar.remove(); // should fail due to active xact
531
assertTrue(false);
532         } catch ( Exception JavaDoc e) {
533         }
534         
535         bar.abort();
536         
537         bar.remove();
538         
539         try {
540             conn.close();
541         } catch ( Exception JavaDoc e) {
542             assertTrue(false);
543         }
544     }
545
546     // helper class to sync threads
547
public class syncOnCount {
548         private int count;
549         
550         public syncOnCount () { count = 0; }
551         
552         public synchronized boolean testCount ( int i ) {
553             return count >= i;
554         }
555         
556         public synchronized void incCount() {
557             count++;
558         }
559  
560         public void waitOnCount ( int cnt ) {
561             int i = 0;
562             for ( i=0; i<100; i++ )
563                 try {
564                     if ( !testCount(cnt) ) {
565                         Thread.yield();
566                         Thread.sleep(1000);
567                     }
568                 } catch ( Exception JavaDoc e ) {
569                     throw new RuntimeException JavaDoc("waitOnCount interrupted" + e);
570                 }
571             assertTrue(testCount(cnt));
572         }
573
574     }
575     
576     syncOnCount s;
577
578     public void testConcurrentThread() {
579         class thread1 extends Thread JavaDoc {
580             syncOnCount s;
581
582             public thread1(syncOnCount sc) {
583                 super("thread1");
584                 s = sc;
585             }
586
587             public void run() {
588                 IDBConnection conn = makeAndCleanTestConnection();
589                 ModelRDB foo = ModelRDB.createModel(conn, "foo");
590                 s.incCount(); // count is now 1
591
s.waitOnCount(2);
592                 Resource u = foo.createResource("test#subject");
593                 Property p = foo.createProperty("test#predicate");
594                 Resource o = foo.createResource("test#object");
595                 Statement stmt = foo.createStatement(u, p, o);
596                 assertFalse(foo.contains(stmt));
597                 s.incCount();
598                 s.waitOnCount(4);
599                 assertTrue(foo.contains(stmt));
600                 foo.remove(stmt);
601                 s.incCount();
602                 try {
603                     conn.close();
604                 } catch (Exception JavaDoc e) {
605                     assertTrue(false);
606                 }
607             }
608         }
609
610         class thread2 extends Thread JavaDoc {
611             syncOnCount s;
612
613             public thread2(syncOnCount sc) {
614                 super("thread2");
615                 s = sc;
616             }
617
618             public void run() {
619                 s.waitOnCount(1);
620                 IDBConnection conn = makeTestConnection();
621                 ModelRDB foo = ModelRDB.open(conn, "foo");
622                 foo.begin();
623                 Resource u = foo.createResource("test#subject");
624                 Property p = foo.createProperty("test#predicate");
625                 Resource o = foo.createResource("test#object");
626                 Statement stmt = foo.createStatement(u, p, o);
627                 foo.add(stmt);
628                 s.incCount();
629                 s.waitOnCount(3);
630                 assertTrue(foo.contains(stmt));
631                 try {
632                     foo.commit();
633                 } catch (Exception JavaDoc e) {
634                     assertTrue(false);
635                 }
636                 s.incCount(); // wake up thread1
637
s.waitOnCount(5); // thread1 has now removed stmt
638
assertFalse(foo.contains(stmt));
639                 try {
640                     conn.close();
641                 } catch (Exception JavaDoc e) {
642                     assertTrue(false);
643                 }
644             }
645         }
646
647         syncOnCount s = new syncOnCount();
648         Thread JavaDoc t1 = new thread1(s);
649         Thread JavaDoc t2 = new thread2(s);
650         t2.start();
651         t1.start();
652         try {
653             t1.join();
654             t2.join();
655         } catch (Exception JavaDoc e) {
656             assertTrue(false);
657         }
658     }
659
660 }
661         
662
663 /*
664     (c) Copyright 2002, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
665     All rights reserved.
666
667     Redistribution and use in source and binary forms, with or without
668     modification, are permitted provided that the following conditions
669     are met:
670
671     1. Redistributions of source code must retain the above copyright
672        notice, this list of conditions and the following disclaimer.
673
674     2. Redistributions in binary form must reproduce the above copyright
675        notice, this list of conditions and the following disclaimer in the
676        documentation and/or other materials provided with the distribution.
677
678     3. The name of the author may not be used to endorse or promote products
679        derived from this software without specific prior written permission.
680
681     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
682     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
683     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
684     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
685     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
686     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
687     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
688     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
689     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
690     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
691 */

692
Popular Tags