
test.junit.fedora.utilities.install.container.TestTomcatServerXML Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fcrepo-client Show documentation
Show all versions of fcrepo-client Show documentation
The Fedora Client is a Java Library that allows API access to a Fedora Repository. The client is typically one part of a full Fedora installation.
The newest version!
/* The contents of this file are subject to the license and copyright terms
* detailed in the license directory at the root of the source tree (also
* available online at http://www.fedora.info/license/).
*/
package fedora.utilities.install.container;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import fedora.utilities.install.InstallOptions;
/**
*
* @author Edwin Shin
*/
public class TestTomcatServerXML {
private InputStream is;
private InstallOptions installOptions;
/** The default server.xml shipped with Tomcat 5.5.23 (stripped of comments) */
private static byte[] defaultServerXML;
static {
StringBuilder sb = new StringBuilder();
sb.append("");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
sb.append(" ");
try {
defaultServerXML = sb.toString().getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
// should never happen with UTF-8
}
}
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
is = new ByteArrayInputStream(defaultServerXML);
installOptions = getDefaultOptions();
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
if (is != null) {
is.close();
}
}
@Test
public void testUpdate() throws Exception {
TomcatServerXML serverXML;
serverXML = new TomcatServerXML(is, installOptions);
serverXML.update();
}
private InstallOptions getDefaultOptions() throws Exception {
Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy