<commit_before>/*
 * Copyright 2016-2018 Red Hat, Inc. and/or its affiliates
 * and other contributors as indicated by the @author tags.
 *
 * Licensed 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.jboss.as.test.layers;

import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;

import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author <EMAIL>
 */
public class LayersTestCase {
    // Packages that are provisioned by the test-standalone-reference installation
    // but not used in the test-all-layers installation.
    // This is the expected set of not provisioned modules when all layers are provisioned.
    private static final String[] NOT_USED = {
        // TODO  WFLY-16452 we need to add a mod_cluster layer
        "org.wildfly.extension.mod_cluster",
        "org.wildfly.mod_cluster.undertow",
        "org.jboss.mod_cluster.container.spi",
        "org.jboss.mod_cluster.core",
        "org.jboss.mod_cluster.load.spi",
        // TODO we need to add an rts layer
        "org.wildfly.extension.rts",
        "org.jboss.narayana.rts",
        // TODO we need to add an xts layer
        "org.jboss.as.xts",
        // TODO  WFLY-16453 we need to add a clustering singleton layer
        "org.wildfly.extension.clustering.singleton",
        // TODO we need to add an agroal layer
        "org.wildfly.extension.datasources-agroal",
        "io.agroal",
        // TODO we need to add an elytron-oidc-client layer
        "org.wildfly.extension.elytron-oidc-client",
        "org.wildfly.security.elytron-http-oidc",
        "org.wildfly.security.elytron-jose-jwk",
        "org.wildfly.security.elytron-jose-util",
        // Messaging broker not included in the messaging-activemq layer
        "org.jboss.xnio.netty.netty-xnio-transport",
        "org.apache.activemq.artemis.protocol.amqp",
        "org.apache.activemq.artemis.protocol.hornetq",
        "org.apache.activemq.artemis.protocol.stomp",
        "org.apache.qpid.proton",
        "org.hornetq.client",
        // No patching modules in layers
        "org.jboss.as.patching",
        "org.jboss.as.patching.cli",
        // TODO should an undertow layer specify this?
        "org.wildfly.event.logger",
        // Legacy subsystem modules are not available via layers
        "org.jboss.as.security",
        "org.wildfly.extension.picketlink",
        "org.jboss.as.jacorb",
        "org.jboss.as.jsr77",
        "org.jboss.as.messaging",
        "org.jboss.as.web",
        // TODO nothing references this
        "org.wildfly.security.http.sfbasic",
        // TODO Legacy Seam integration. Does it even work with EE 10?
        "org.jboss.integration.ext-content",
        // Misc alternative variants of things that we don't provide via layers
        "org.jboss.as.jpa.hibernate:4",
        "org.hibernate:5.0",
        "org.hibernate.jipijapa-hibernate5",
        "org.eclipse.persistence",
        "org.jboss.as.jpa.openjpa",
        "org.apache.openjpa",
        "org.jboss.genericjms",
        // Appclient support is not provided by a layer
        "org.jboss.as.appclient",
        "org.jboss.metadata.appclient",
        // TODO WFLY-16562 seems to be cruft
        "org.jboss.deployers.jboss-service-deployer",
        // TODO WFLY-16571 -- cruft
        "com.github.spullara.mustache",
        // TODO WFLY-16576 -- cruft?
        "org.bouncycastle",
        // TODO WFLY-16583 -- cruft
        "javax.management.j2ee.api",
        // TODO WFLY-16585 -- cruft
        "io.jaegertracing",
        // TODO possible cruft? https://wildfly.zulipchat.com/#narrow/stream/174184-wildfly-developers/topic/org.2Ejboss.2Ews.2Ecxf.2Ests.20module
        "org.jboss.resteasy.jose-jwt",
        "org.jboss.resteasy.resteasy-rxjava2",
        // TODO WFLY-16582 -- cruft
        "org.jboss.ejb.remote.protocol",
        // TODO WFLY-16586 microprofile-reactive-streams-operators layer should provision this
        "org.wildfly.reactive.dep.jts",
        // Used by Hibernate Search 6 TODO remove these entries as part of the big-bang, as they are used, just not in javax Hibernate Search
        "com.carrotsearch.hppc",
        "org.elasticsearch.client.rest-client",
        // Used by Hibernate Search 5 but not part of the jpa layer (aiui they are optional aspects of Hibernate Search)
        // These modules are dropped with Hibernate Search 6 so no point evaluating whether they should be provisioned
        // by the jpa layer
        "org.hibernate.search.backend-jms",
        "org.hibernate.search.serialization-avro",
        "org.apache.avro",
        // Optionally used by Hibernate Search 6 but not provided by the jpa layer
        // TODO determine if they should be
        "org.hibernate.search.backend.elasticsearch",
        "org.hibernate.search.backend.lucene",
        "org.apache.lucene",
        "org.apache.lucene.internal",
        // TODO WFLY-16589 the core-tools layer should provision this but does not
        "org.wildfly.security.elytron-tool",
        // TODO these implement SPIs from RESTEasy or JBoss WS but I don't know how they integrate
        // as there is no ref to them in any module.xml nor any in WF java code.
        // Perhaps via deployment descriptor? In any case, no layer provides them
        "org.wildfly.security.jakarta.client.resteasy",
        "org.wildfly.security.jakarta.client.webservices",
        "org.jboss.resteasy.microprofile.config",
        // TODO remove in the big-bang. No longer referenced by org.hibernate in Hibernate 6<commit_msg>[WFLY-16582] Remove the LayersTestCase TODO<commit_after>/*
 * Copyright 2016-2018 Red Hat, Inc. and/or its affiliates
 * and other contributors as indicated by the @author tags.
 *
 * Licensed 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.jboss.as.test.layers;

import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;

import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author <EMAIL>
 */
public class LayersTestCase {
    // Packages that are provisioned by the test-standalone-reference installation
    // but not used in the test-all-layers installation.
    // This is the expected set of not provisioned modules when all layers are provisioned.
    private static final String[] NOT_USED = {
        // TODO  WFLY-16452 we need to add a mod_cluster layer
        "org.wildfly.extension.mod_cluster",
        "org.wildfly.mod_cluster.undertow",
        "org.jboss.mod_cluster.container.spi",
        "org.jboss.mod_cluster.core",
        "org.jboss.mod_cluster.load.spi",
        // TODO we need to add an rts layer
        "org.wildfly.extension.rts",
        "org.jboss.narayana.rts",
        // TODO we need to add an xts layer
        "org.jboss.as.xts",
        // TODO  WFLY-16453 we need to add a clustering singleton layer
        "org.wildfly.extension.clustering.singleton",
        // TODO we need to add an agroal layer
        "org.wildfly.extension.datasources-agroal",
        "io.agroal",
        // TODO we need to add an elytron-oidc-client layer
        "org.wildfly.extension.elytron-oidc-client",
        "org.wildfly.security.elytron-http-oidc",
        "org.wildfly.security.elytron-jose-jwk",
        "org.wildfly.security.elytron-jose-util",
        // Messaging broker not included in the messaging-activemq layer
        "org.jboss.xnio.netty.netty-xnio-transport",
        "org.apache.activemq.artemis.protocol.amqp",
        "org.apache.activemq.artemis.protocol.hornetq",
        "org.apache.activemq.artemis.protocol.stomp",
        "org.apache.qpid.proton",
        "org.hornetq.client",
        // No patching modules in layers
        "org.jboss.as.patching",
        "org.jboss.as.patching.cli",
        // TODO should an undertow layer specify this?
        "org.wildfly.event.logger",
        // Legacy subsystem modules are not available via layers
        "org.jboss.as.security",
        "org.wildfly.extension.picketlink",
        "org.jboss.as.jacorb",
        "org.jboss.as.jsr77",
        "org.jboss.as.messaging",
        "org.jboss.as.web",
        // TODO nothing references this
        "org.wildfly.security.http.sfbasic",
        // TODO Legacy Seam integration. Does it even work with EE 10?
        "org.jboss.integration.ext-content",
        // Misc alternative variants of things that we don't provide via layers
        "org.jboss.as.jpa.hibernate:4",
        "org.hibernate:5.0",
        "org.hibernate.jipijapa-hibernate5",
        "org.eclipse.persistence",
        "org.jboss.as.jpa.openjpa",
        "org.apache.openjpa",
        "org.jboss.genericjms",
        // Appclient support is not provided by a layer
        "org.jboss.as.appclient",
        "org.jboss.metadata.appclient",
        // TODO WFLY-16562 seems to be cruft
        "org.jboss.deployers.jboss-service-deployer",
        // TODO WFLY-16571 -- cruft
        "com.github.spullara.mustache",
        // TODO WFLY-16576 -- cruft?
        "org.bouncycastle",
        // TODO WFLY-16583 -- cruft
        "javax.management.j2ee.api",
        // TODO WFLY-16585 -- cruft
        "io.jaegertracing",
        // TODO possible cruft? https://wildfly.zulipchat.com/#narrow/stream/174184-wildfly-developers/topic/org.2Ejboss.2Ews.2Ecxf.2Ests.20module
        "org.jboss.resteasy.jose-jwt",
        "org.jboss.resteasy.resteasy-rxjava2",
        // TODO WFLY-16586 microprofile-reactive-streams-operators layer should provision this
        "org.wildfly.reactive.dep.jts",
        // Used by Hibernate Search 6 TODO remove these entries as part of the big-bang, as they are used, just not in javax Hibernate Search
        "com.carrotsearch.hppc",
        "org.elasticsearch.client.rest-client",
        // Used by Hibernate Search 5 but not part of the jpa layer (aiui they are optional aspects of Hibernate Search)
        // These modules are dropped with Hibernate Search 6 so no point evaluating whether they should be provisioned
        // by the jpa layer
        "org.hibernate.search.backend-jms",
        "org.hibernate.search.serialization-avro",
        "org.apache.avro",
        // Optionally used by Hibernate Search 6 but not provided by the jpa layer
        // TODO determine if they should be
        "org.hibernate.search.backend.elasticsearch",
        "org.hibernate.search.backend.lucene",
        "org.apache.lucene",
        "org.apache.lucene.internal",
        // TODO WFLY-16589 the core-tools layer should provision this but does not
        "org.wildfly.security.elytron-tool",
        // TODO these implement SPIs from RESTEasy or JBoss WS but I don't know how they integrate
        // as there is no ref to them in any module.xml nor any in WF java code.
        // Perhaps via deployment descriptor? In any case, no layer provides them
        "org.wildfly.security.jakarta.client.resteasy",
        "org.wildfly.security.jakarta.client.webservices",
        "org.jboss.resteasy.microprofile.config",
        // TODO remove in the big-bang. No longer referenced by org.hibernate in Hibernate 6
{'fraction_non_alphanumeric': 0.10533627523085724, 'fraction_numerical': 0.014546048868186646, 'mean_word_length': 2.4757171258165296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '421191', 'n_tokens_mistral': 4005, 'n_tokens_neox': 3682, 'n_words': 1027}