<commit_before>/*<license>
Copyright 2004 - $Date$ by PeopleWare n.v..

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.
</license>*/

package org.ppwcode.vernacular.persistence_III;


import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.ppwcode.bean_VI.AbstractRousseauBeanTest;
import org.ppwcode.bean_VI.CompoundPropertyException;
import org.ppwcode.bean_VI.PropertyException;


public class AbstractPersistentBeanTest {

  public static class AbstractPersistentBeanSTUB<_IdType_>
    extends AbstractPersistentBean<_IdType_> {

    public AbstractPersistentBeanSTUB(_IdType_ id, String property1,
            Date property2, Set<String> property3, int[] property4) {
      super();
      setId(id);
      $property1 = property1;
      $property2 = property2;
      $property3 = property3;
      $property4 = property4;
    }

    public final String getProperty1() {
      return $property1;
    }

    public final void setProperty1(String property1) {
      $property1 = property1;
    }

    private String $property1;


    public final Date getProperty2() {
      return $property2;
    }

    public final void setProperty2(Date property2) {
      $property2 = property2;
    }

    private Date $property2;

    public final Set<String> getProperty3() {
      return $property3;
    }

    public final void setProperty3(Set<String> property3) {
      $property3 = property3;
    }

    private Set<String> $property3;

    public final int[] getProperty4() {
      return $property4;
    }

    public final void setProperty4(int[] property4) {
      $property4 = property4;
    }

    private int[] $property4;

  }

  public static class AbstractPersistentBeanWILD<_IdType_>
    extends AbstractPersistentBeanSTUB<_IdType_> {

    public AbstractPersistentBeanWILD( _IdType_ id, String property1,
        Date property2, Set<String> property3, int[] property4) {
      super(id, property1, property2, property3, property4);
    }

    @Override
    public CompoundPropertyException getWildExceptions() {
      CompoundPropertyException cpe = super.getWildExceptions();
      cpe.addElementException(new PropertyException(this, "property1", null, null));
      cpe.addElementException(new PropertyException(this, "property1", null, null));
      cpe.addElementException(new PropertyException(this, "property2", null, null));
      cpe.addElementException(new PropertyException(this, "property2", null, null));
      cpe.addElementException(new PropertyException(this, "property3", null, null));
      cpe.addElementException(new PropertyException(this, "property3", null, null));
      return cpe;
    }

  }

  public static class AbstractPersistentBeanNOPROPERTIES<_IdType_>
    extends AbstractPersistentBean<_IdType_> {
    // NOP
  }


  private List<AbstractPersistentBean<?>> subjects;

  @Before
  public void setUp() throws Exception {
    subjects = new ArrayList<AbstractPersistentBean<?>>();
    AbstractPersistentBeanSTUB<?> subject =
      new AbstractPersistentBeanSTUB<Integer>(null, null, null, null, null);
    subjects.add(subject);
    Integer id = 9;
    Set<String> stringSet = new HashSet<String>();
    stringSet.add("string 1");
    stringSet.add("string 2");
    stringSet.add(null);
    int[] intArray = {5, 6, 4, 8};
    subject = new AbstractPersistentBeanSTUB<Integer>(id, null, null, null, null);
    subjects.add(subject);
    subject = new AbstractPersistentBeanSTUB<Integer>(null,"PROPERTY 1", null, null, null);
    subjects.add(subject);
    subject = new AbstractPersistentBeanSTUB<Integer>(null, null, new Date(), null, null);
    subjects.add(subject);<commit_msg>updated: generic type _Id_ must extend Serializable<commit_after>/*<license>
Copyright 2004 - $Date$ by PeopleWare n.v..

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.
</license>*/

package org.ppwcode.vernacular.persistence_III;


import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.ppwcode.bean_VI.AbstractRousseauBeanTest;
import org.ppwcode.bean_VI.CompoundPropertyException;
import org.ppwcode.bean_VI.PropertyException;


public class AbstractPersistentBeanTest {

  public static class AbstractPersistentBeanSTUB<_Id_ extends Serializable>
    extends AbstractPersistentBean<_Id_> {

    public AbstractPersistentBeanSTUB(_Id_ id, String property1,
            Date property2, Set<String> property3, int[] property4) {
      super();
      setId(id);
      $property1 = property1;
      $property2 = property2;
      $property3 = property3;
      $property4 = property4;
    }

    public final String getProperty1() {
      return $property1;
    }

    public final void setProperty1(String property1) {
      $property1 = property1;
    }

    private String $property1;


    public final Date getProperty2() {
      return $property2;
    }

    public final void setProperty2(Date property2) {
      $property2 = property2;
    }

    private Date $property2;

    public final Set<String> getProperty3() {
      return $property3;
    }

    public final void setProperty3(Set<String> property3) {
      $property3 = property3;
    }

    private Set<String> $property3;

    public final int[] getProperty4() {
      return $property4;
    }

    public final void setProperty4(int[] property4) {
      $property4 = property4;
    }

    private int[] $property4;

  }

  public static class AbstractPersistentBeanWILD<_Id_ extends Serializable>
    extends AbstractPersistentBeanSTUB<_Id_> {

    public AbstractPersistentBeanWILD( _Id_ id, String property1,
        Date property2, Set<String> property3, int[] property4) {
      super(id, property1, property2, property3, property4);
    }

    @Override
    public CompoundPropertyException getWildExceptions() {
      CompoundPropertyException cpe = super.getWildExceptions();
      cpe.addElementException(new PropertyException(this, "property1", null, null));
      cpe.addElementException(new PropertyException(this, "property1", null, null));
      cpe.addElementException(new PropertyException(this, "property2", null, null));
      cpe.addElementException(new PropertyException(this, "property2", null, null));
      cpe.addElementException(new PropertyException(this, "property3", null, null));
      cpe.addElementException(new PropertyException(this, "property3", null, null));
      return cpe;
    }

  }

  public static class AbstractPersistentBeanNOPROPERTIES<_Id_ extends Serializable>
    extends AbstractPersistentBean<_Id_> {
    // NOP
  }


  private List<AbstractPersistentBean<?>> subjects;

  @Before
  public void setUp() throws Exception {
    subjects = new ArrayList<AbstractPersistentBean<?>>();
    AbstractPersistentBeanSTUB<?> subject =
      new AbstractPersistentBeanSTUB<Integer>(null, null, null, null, null);
    subjects.add(subject);
    Integer id = 9;
    Set<String> stringSet = new HashSet<String>();
    stringSet.add("string 1");
    stringSet.add("string 2");
    stringSet.add(null);
    int[] intArray = {5, 6, 4, 8};
    subject = new AbstractPersistentBeanSTUB<Integer>(id, null, null, null, null);
    subjects.add(subject);
    subject = new AbstractPersistentBeanSTUB<Integer>(null,"PROPERTY 1", null, null, null);
    subjects.add(subject);
    subject = new AbstractPersistentBeanSTUB<Integer>(null, null, new Date(), null, null);
    subjects.add(subject);
{'fraction_non_alphanumeric': 0.09771689497716896, 'fraction_numerical': 0.01598173515981735, 'mean_word_length': 4.020630372492836, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7493822', 'n_tokens_mistral': 2581, 'n_tokens_neox': 2493, 'n_words': 699}