/*
 * Copyright © 2012-2025 by Data Virtuality GmbH
 */
package org.teiid.util;

import org.junit.jupiter.params.provider.Arguments;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.unittest.RealMetadataFactory;

import java.util.stream.Stream;

import static org.teiid.core.types.ResourceType.*;


/**
 * @author Arseniy Kaleshnyk
 * @date 2025.03.18
 */
public class TestingDataArguments {

    private static final QueryMetadataInterface example1Metadata = RealMetadataFactory.example1Cached();
    private static final QueryMetadataInterface bqtMetadata =  RealMetadataFactory.exampleBQT();

    public static Stream<Arguments> tableViews1() {
        return Stream.of(
                Arguments.of("pm1.g1", TABLE, example1Metadata),
                Arguments.of("pm5.g3", TABLE, example1Metadata),
                Arguments.of("vm1.g37", VIEW, example1Metadata),
                Arguments.of("vm1.g1b", VIEW, example1Metadata),
                Arguments.of("vm1.g19", VIEW, example1Metadata),

                Arguments.of("bqt1.MediumA", TABLE, bqtMetadata),
                Arguments.of("VQT.SmallA_2589", VIEW, bqtMetadata)
        );
    }

    public static Stream<Arguments> invalidTableViews1() {
        return Stream.of(
                Arguments.of("g1", UNDEFINED, example1Metadata), // missing 'pm1.'
                Arguments.of("xmltest2.docA", UNDEFINED, example1Metadata), // xml
                Arguments.of("pm5.g3nn", UNDEFINED, example1Metadata), // doesn't exist
                Arguments.of("vm1", UNDEFINED, example1Metadata) // missing '.g1'
        );
    }

}
