本文整理汇总了Java中org.jboss.arquillian.container.spi.ConfigurationException类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationException类的具体用法?Java ConfigurationException怎么用?Java ConfigurationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationException类属于org.jboss.arquillian.container.spi包,在下文中一共展示了ConfigurationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadConfiguration
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
public static InputStream loadConfiguration(String resourceName, boolean isDefault) {
InputStream stream = loadResource(resourceName);
if (stream == null) {
if (isDefault) {
throw new IllegalStateException(
"Could not find built-in configuration as file nor classloader resource: " + resourceName + ". " +
"Make sure that this file exists in classpath resource or in the project folder.");
} else {
throw new ConfigurationException(
"Could not locate configured containerConfigurationFile as file" +
" nor classloader resource: " + resourceName);
}
}
return stream;
}
示例2: from
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
public static Target from(String source) {
Target target = new Target();
String[] sections = source.split(":");
if (sections.length < 2 || sections.length > 3) {
throw new ConfigurationException("Wrong target format [" + source + "] server:version:type");
}
target.server = sections[0].toLowerCase();
target.version = sections[1];
if (sections.length > 2) {
for (Type type : Type.values()) {
if (sections[2].toLowerCase().contains(type.name().toLowerCase())) {
target.type = type;
break;
}
}
if (target.type == null) {
throw new ConfigurationException(
"Unknown target type " + sections[2] + ". Supported " + Target.Type.values());
}
} else {
target.type = Type.Default;
}
return target;
}
示例3: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
public void validate() throws ConfigurationException {
if (chameleonTarget == null) {
throw new ConfigurationException("chameleonTarget must be provided in format server:version:type");
}
// Trigger possible Exception case during File/Resource load
getChameleonContainerConfigurationFileStream();
File resolveCache = getChameleonResolveCacheFolder();
if (!resolveCache.exists()) {
if (!resolveCache.mkdirs()) {
throw new ConfigurationException("Could not create all resolve cache folders: " + resolveCache);
}
}
// Try to parse to 'trigger' ConfigurationException
getParsedTarget();
}
示例4: getStatusCheckURI
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
private URI getStatusCheckURI(URI contextURI, String contextPath) {
URI uri = null;
try {
uri = new URI(
contextURI.getScheme(),
contextURI.getUserInfo(),
contextURI.getHost(),
contextURI.getPort(),
(contextURI.getPath() + "/" + contextPath).replaceAll("(//)+", "/"),
contextURI.getQuery(),
null);
} catch (URISyntaxException ex) {
throw new ConfigurationException(ex);
}
return uri;
}
示例5: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.jboss.arquillian.container.spi.client.container.ContainerConfiguration#validate()
*/
@Override
public void validate() throws ConfigurationException {
if (host == null || host.length() == 0) {
this.host = "localhost";
}
if (port == null || port.length() == 0) {
this.port = "12345";
}
}
示例6: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
public void validate() throws ConfigurationException {
if (cubeConfiguration == null)
throw new ConfigurationException("CubeConfiguration is null");
if (isNullOrEmpty(cubeConfiguration.getMasterUrl().toString()))
throw new ConfigurationException("NULL master URL");
if ((isNullOrEmpty(openshiftUsername) || isNullOrEmpty(openshiftPassword)) && isNullOrEmpty(token)) {
throw new ConfigurationException("Missing OpenShift authentification -- username/password or token!");
}
}
示例7: shouldFailOnMissingContainerFile
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void shouldFailOnMissingContainerFile() throws Exception {
ChameleonConfiguration configuration = new ChameleonConfiguration();
configuration.setChameleonContainerConfigurationFile("MISSING");
configuration.setChameleonTarget("wildfly:8.2.0.Final:managed");
configuration.validate();
}
示例8: getAppURI
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
/**
*
* @return URI of application form configuration
*/
private URI getAppURI() {
URI uri = null;
try {
uri = new URI(configurationProducer.get().getBaseURI());
} catch (URISyntaxException e) {
throw new ConfigurationException("Parameter \"baseURI\" does not represent a valid URI", e);
}
return uri;
}
示例9: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
@Override
public void validate() throws ConfigurationException {
super.validate();
Validate.configurationDirectoryExists(jbossHome, "jbossHome '" + jbossHome + "' must exist");
if (javaHome != null) {
Validate.configurationDirectoryExists(javaHome, "javaHome must exist");
}
}
示例10: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.jboss.as.arquillian.container.CommonContainerConfiguration#validate()
*/
@Override
public void validate() throws ConfigurationException {
super.validate();
Validate.configurationDirectoryExists(jbossHome, "jbossHome '" + jbossHome + "' must exist");
Validate.configurationDirectoryExists(modulePath, "modulePath '" + modulePath + "' must exist");
}
示例11: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
@Override
public void validate() throws ConfigurationException {
super.validate();
if (jbossHome != null)
Validate.configurationDirectoryExists(jbossHome, "jbossHome '" + jbossHome + "' must exist");
if (javaHome != null)
Validate.configurationDirectoryExists(javaHome, "javaHome '" + javaHome + "' must exist");
}
示例12: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
@Override
public void validate() throws ConfigurationException
{
if (Strings.isNullOrEmpty(classifier))
{
throw new ConfigurationException("Classifier should not be null or empty");
}
}
示例13: shouldFailOnMissingContainerType
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
@Test(expected = ConfigurationException.class)
public void shouldFailOnMissingContainerType() throws Exception {
ChameleonConfiguration configuration = new ChameleonConfiguration();
configuration.setChameleonTarget("wildfly:8.2.0.Final:UNKNOWN");
configuration.validate();
}
示例14: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
@Override
public void validate() throws ConfigurationException {
}
示例15: validate
import org.jboss.arquillian.container.spi.ConfigurationException; //导入依赖的package包/类
public void validate() throws ConfigurationException {
if (bindHttpPort == RANDOM_PORT_FLAG) {
bindHttpPort = generateRandomPort();
}
}