<commit_before>package com.orientechnologies.orient.core.metadata.schema;

import java.util.List;

import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import static org.testng.Assert.*;

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.sql.OCommandSQL;

public class TestMultiSuperClasses {
	private ODatabaseDocumentTx db;

	  @BeforeMethod
	  public void setUp() {
	    db = new ODatabaseDocumentTx("memory:" + TestMultiSuperClasses.class.getSimpleName());
	    if (db.exists()) {
	      db.open("admin", "admin");
	    } else
	      db.create();
	  }

	  @AfterMethod
	  public void after() {
	    db.close();
	  }
	  
	  @Test
	  public void testClassCreation()
	  {
		  final OSchema oSchema = db.getMetadata().getSchema();

		  OClass aClass = oSchema.createAbstractClass("javaA");
		  OClass bClass = oSchema.createAbstractClass("javaB");
		  OClass cClass = oSchema.createClass("javaC", aClass,bClass);
		  List<? extends OClass> superClasses;
		  //Run twice to be sure after schema reload
		  for(int i=0;i<2;i++)
		  {
			  superClasses = cClass.getSuperClasses();
			  assertTrue(superClasses.contains(aClass));
			  assertTrue(superClasses.contains(bClass));
			  assertTrue(cClass.isSubClassOf(aClass));
			  assertTrue(cClass.isSubClassOf(bClass));
			  assertTrue(aClass.isSuperClassOf(cClass));
			  assertTrue(bClass.isSuperClassOf(cClass));
			  oSchema.reload();
		  }
	  }
	  
	  @Test
	  public void testSql()<commit_msg>Add testcase for inheritance of properties with the same name<commit_after>package com.orientechnologies.orient.core.metadata.schema;

import java.util.List;

import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import static org.testng.Assert.*;

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.sql.OCommandSQL;

public class TestMultiSuperClasses {
	private ODatabaseDocumentTx db;

	  @BeforeMethod
	  public void setUp() {
	    db = new ODatabaseDocumentTx("memory:" + TestMultiSuperClasses.class.getSimpleName());
	    if (db.exists()) {
	      db.open("admin", "admin");
	    } else
	      db.create();
	  }

	  @AfterMethod
	  public void after() {
	    db.close();
	  }
	  
	  @Test
	  public void testClassCreation()
	  {
		  OSchema oSchema = db.getMetadata().getSchema();

		  OClass aClass = oSchema.createAbstractClass("javaA");
		  OClass bClass = oSchema.createAbstractClass("javaB");
		  aClass.createProperty("property", OType.INTEGER);
		  bClass.createProperty("property", OType.DOUBLE);
		  OClass cClass = oSchema.createClass("javaC", aClass,bClass);
		  testClassClreationBranch(aClass, bClass, cClass);
		  oSchema.reload();
		  testClassClreationBranch(aClass, bClass, cClass);
		  oSchema = db.getMetadata().getImmutableSchemaSnapshot();
		  aClass = oSchema.getClass("javaA");
		  bClass = oSchema.getClass("javaB");
		  cClass = oSchema.getClass("javaC");
		  testClassClreationBranch(aClass, bClass, cClass);
	  }
	  
	  private void testClassClreationBranch(OClass aClass, OClass bClass, OClass cClass)
	  {
		  List<? extends OClass> superClasses = cClass.getSuperClasses();
		  assertTrue(superClasses.contains(aClass));
		  assertTrue(superClasses.contains(bClass));
		  assertTrue(cClass.isSubClassOf(aClass));
		  assertTrue(cClass.isSubClassOf(bClass));
		  assertTrue(aClass.isSuperClassOf(cClass));
		  assertTrue(bClass.isSuperClassOf(cClass));
		  
		  OProperty property = cClass.getProperty("property");
		  assertEquals(OType.INTEGER, property.getType());
		  property = cClass.propertiesMap().get("property");
		  assertEquals(OType.INTEGER, property.getType());
	  }
	  
	  @Test
	  public void testSql()
{'fraction_non_alphanumeric': 0.12050685285751228, 'fraction_numerical': 0.000517196793379881, 'mean_word_length': 4.269754768392371, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '6992502', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1194, 'n_words': 208}