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

org.evosuite.runtime.javaee.JeeData Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
/**
 * Copyright (C) 2010-2017 Gordon Fraser, Andrea Arcuri and EvoSuite
 * contributors
 *
 * This file is part of EvoSuite.
 *
 * EvoSuite is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3.0 of the License, or
 * (at your option) any later version.
 *
 * EvoSuite is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with EvoSuite. If not, see .
 */
package org.evosuite.runtime.javaee;

import java.io.Serializable;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;

/**
 * Immutable class keeping track of which relevant parts of JEE were accessed by the SUT
 *
 * Created by Andrea Arcuri on 11/08/15.
 */
public class JeeData implements Serializable{

    /**
     * Keep track of all parameters that have been checked in a http servlet
     */
    public final Set httpRequestParameters;

    /**
     * Keep track of all http request dispatchers
     */
    public final Set dispatchers;

    /**
     * Did the SUT check the content type of the request or of any of its parts?
     */
    public final boolean readContentType;


    /**
     * Keep track of which parts were asked for.
     * The set is {@code null} if no part was ever read, not even with a get all.
     */
    public final Set partNames;

    /**
     * Check if there was any servlet that was initialized.
     * Note: servlet initialization is automatically added every time
     * a new servlet is instantiated with "new"
     *
     */
    public final boolean wasAServletInitialized;


    public final Set lookedUpContextNames;


    public JeeData(Set httpRequestParameters, Set dispatchers, boolean readContentType,
                   Set partNames, boolean wasAServletInitialized, Set lookedUpContextNames) {

        this.httpRequestParameters = Collections.unmodifiableSet(new LinkedHashSet<>(httpRequestParameters));
        this.dispatchers = Collections.unmodifiableSet(new LinkedHashSet<>(dispatchers));
        this.readContentType = readContentType;
        this.partNames = partNames==null ? null : Collections.unmodifiableSet(new LinkedHashSet<>(partNames));
        this.wasAServletInitialized = wasAServletInitialized;
        this.lookedUpContextNames = Collections.unmodifiableSet(new LinkedHashSet<>(lookedUpContextNames));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy