Package org.javalite.activejdbc

Source Code of org.javalite.activejdbc.BelongsToParentsTest

package org.javalite.activejdbc;

import org.junit.Test;

import org.javalite.activejdbc.test.ActiveJDBCTest;
import org.javalite.activejdbc.test_models.Computer;
import org.javalite.activejdbc.test_models.Keyboard;
import org.javalite.activejdbc.test_models.Motherboard;

public class BelongsToParentsTest extends ActiveJDBCTest {

  public void before() throws Exception {
    super.before();

        deleteFromTable("computers");
        deleteFromTable("motherboards");
        deleteFromTable("keyboards");

        populateTable("motherboards");
        populateTable("keyboards");
        populateTable("computers");
  }
 
  @Test
  public void shouldCheckThatComputerBelongsTo2DifferentParents() {
    Computer computer = Computer.findById(1);
    a(computer.parent(Motherboard.class)).shouldNotBeNull();
    a(computer.parent(Keyboard.class)).shouldNotBeNull();
  }
}
TOP

Related Classes of org.javalite.activejdbc.BelongsToParentsTest

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.