Update of /cvsroot/nodal/j-test/src/test/storage/http
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12471/src/test/storage/http
Added Files:
Suite.java TestHttpRepository.java
Log Message:
First commit separating j-test from j-src
--- NEW FILE: Suite.java ---
package test.storage.http;
import junit.framework.Test;
import junit.framework.TestSuite;
/** JUnit TestSuite.
* @testfamily JUnit
* @testkind testsuite
* @testsetup Default TestSuite
* @testpackage test.storage*/
public class Suite extends TestSuite {
public Suite(String name) {
super (name);
}
public static Test suite() {
TestSuite result = new TestSuite ("Test storage.http");
// Add calls to test cases here!
result.addTestSuite(TestHttpRepository.class);
return result;
}
public static void main(String[] args) {
junit.textui.TestRunner.run (suite());
}
}
--- NEW FILE: TestHttpRepository.java ---
/*
* Distributed under the Apache Software License, Version 1.1
* (see below, or the file LICENSE for terms and conditions)
*
* Copyright (c) 2003 University of British Columbia. All rights reserved.
*
* Created on Nov 5, 2003
*/
package test.storage.http;
import org.nodal.Nodal;
import org.nodal.Repository;
import org.nodal.filesystem.Document;
import org.nodal.model.Node;
import org.nodal.model.NodeContent;
import org.nodal.nav.Path.Failure;
import junit.framework.TestCase;
/**
*
* Created on Nov 5, 2003
* @author leei
*/
public class TestHttpRepository extends TestCase {
/**
*
*/
public TestHttpRepository(String name) {
super(name);
}
protected void setUp() {
}
protected void tearDown() {
}
public void testW3C() {
try {
Repository r = Nodal.openRepository("http://w3c.org");
Document doc1 = r.document("/");
assertTrue (doc1 != null);
Node doc1Root = doc1.root();
assertTrue (doc1Root != null);
NodeContent content1 = doc1Root.content();
assertTrue (content1 != null);
Document doc2 = r.document("Overview.html");
assertTrue (doc2 != null);
Node doc2Root = doc2.root();
assertTrue (doc2Root != null);
NodeContent content2 = doc2Root.content();
assertTrue (content2 != null);
} catch (Failure e) {
fail();
}
}
}
|