Package de.fuberlin.wiwiss.d2rq.dbschema

Source Code of de.fuberlin.wiwiss.d2rq.dbschema.ISWCSchemaTest

package de.fuberlin.wiwiss.d2rq.dbschema;

import junit.framework.TestCase;
import de.fuberlin.wiwiss.d2rq.algebra.Attribute;
import de.fuberlin.wiwiss.d2rq.sql.ConnectedDB;

public class ISWCSchemaTest extends TestCase {
  private final static String driverClass = "com.mysql.jdbc.Driver";
  private final static String jdbcURL = "jdbc:mysql://127.0.0.1/iswc?user=root";
 
  private ConnectedDB db;
 
  public void setUp() throws Exception {
    Class.forName(driverClass);
    db = new ConnectedDB(jdbcURL, null, null);
  }
 
  public void tearDown() {
    db.close();
  }
 
  public void testRecognizeNullableColumn() {
    Attribute personEmail = new Attribute(null, "persons", "Email");
    assertTrue(db.isNullable(personEmail));
  }
 
  public void testRecognizeNonNullableColumn() {
    Attribute personID = new Attribute(null, "persons", "PerID");
    assertFalse(db.isNullable(personID));
  }
}
TOP

Related Classes of de.fuberlin.wiwiss.d2rq.dbschema.ISWCSchemaTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.