All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.webbeans.arquillian.standalone.OwbStandaloneConfiguration Maven / Gradle / Ivy

Go to download

Arquillian container for Apache OpenWebBeans standalone. This is intended for running in unit tests.

There is a newer version: 4.0.2
Show newest version
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.webbeans.arquillian.standalone;

import org.jboss.arquillian.container.spi.ConfigurationException;
import org.jboss.arquillian.container.spi.client.container.ContainerConfiguration;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * Validate if the Owb Container is correctly configured
 */
public class OwbStandaloneConfiguration implements ContainerConfiguration
{
    /**
     * used to skip classpath resources which are not in the archive,
     * can be useful when a resource should appear a single time in an app
     */
    private boolean useOnlyArchiveResources;
    private String useOnlyArchiveResourcesExcludes;

    /**
     * config
     */
    private String properties;

    @Override
    public void validate() throws ConfigurationException
    {
        // not needed right now
    }

    public boolean isUseOnlyArchiveResources()
    {
        return useOnlyArchiveResources;
    }

    public void setUseOnlyArchiveResources(boolean useOnlyArchiveResources)
    {
        this.useOnlyArchiveResources = useOnlyArchiveResources;
    }

    public String getUseOnlyArchiveResourcesExcludes()
    {
        return useOnlyArchiveResourcesExcludes;
    }

    public void setUseOnlyArchiveResourcesExcludes(String useOnlyArchiveResourcesExcludes)
    {
        this.useOnlyArchiveResourcesExcludes = useOnlyArchiveResourcesExcludes;
    }

    public String getProperties()
    {
        return properties;
    }

    public void setProperties(String properties)
    {
        this.properties = properties;
    }

    public Properties properties()
    {
        Properties instance = new Properties();
        if (properties == null)
        {
            return instance;
        }

        ByteArrayInputStream bais = new ByteArrayInputStream(properties.getBytes());
        try
        {
            instance.load(bais);
        }
        catch (IOException e)
        {
            // no-op
        }

        return instance;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy