<commit_before>package at.ac.univie.isc.asio;

import at.ac.univie.isc.asio.integration.IntegrationTest;
import com.google.common.collect.ImmutableTable;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpStatus;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import static at.ac.univie.isc.asio.matcher.RestAssuredMatchers.compatibleTo;
import static at.ac.univie.isc.asio.matcher.RestAssuredMatchers.sqlCsvEqualTo;
import static org.hamcrest.CoreMatchers.is;

/**
 * Extended functionality of SQL protocol endpoints.
 */
@Category(Integration.class)
public class FeatureSql extends IntegrationTest {
  
  private static final String NOOP_UPDATE = "DROP TABLE IF EXISTS test_table_gaga";
  private static final String NOOP_SELECT = "SELECT 1 AS RESULT";

  // @formatter:off

  @Test
  public void deny_update_with_read_permission() throws Exception {
    ensureSecured();
    given().role("read").and()<commit_msg>Skip FeatureSql if sql is not supported<commit_after>package at.ac.univie.isc.asio;

import at.ac.univie.isc.asio.integration.IntegrationTest;
import com.google.common.collect.ImmutableTable;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpStatus;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import static at.ac.univie.isc.asio.matcher.RestAssuredMatchers.compatibleTo;
import static at.ac.univie.isc.asio.matcher.RestAssuredMatchers.sqlCsvEqualTo;
import static org.hamcrest.CoreMatchers.is;

/**
 * Extended functionality of SQL protocol endpoints.
 */
@Category(Integration.class)
public class FeatureSql extends IntegrationTest {
  
  private static final String NOOP_UPDATE = "DROP TABLE IF EXISTS test_table_gaga";
  private static final String NOOP_SELECT = "SELECT 1 AS RESULT";

  @Before
  public void skipIfUnsupported() {
    ensureLanguageSupported("sql");
  }

  // @formatter:off

  @Test
  public void deny_update_with_read_permission() throws Exception {
    ensureSecured();
    given().role("read").and()
{'fraction_non_alphanumeric': 0.10142857142857142, 'fraction_numerical': 0.0009523809523809524, 'mean_word_length': 5.271641791044776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2652185', 'n_tokens_mistral': 668, 'n_tokens_neox': 641, 'n_words': 142}