Package thread.concurrencyCookbook.chapter3.recipe6

Examples of thread.concurrencyCookbook.chapter3.recipe6.Student


    Assert.assertFalse(UserManager.getInstance().addTeacher("NAME1"));
  }
 
  @Test public void addStudentTest1() {
    UserManager.getInstance().addStudent("NAME1");
    Assert.assertTrue(UserManager.getInstance().contains(new Student("NAME1")));
  }
View Full Code Here


  @Test public void singletonTest() {
    Assert.assertTrue(EnrolmentManager.getInstance() == EnrolmentManager.getInstance());
  }
 
  @Test public void createDeleteTest() {
    Student s = new Student("Name");
    ClassGroup cls = new ClassGroup("name", "description");
    Enrolment enrol = EnrolmentManager.getInstance().addEnrolment(s, cls);
    Assert.assertTrue(EnrolmentManager.getInstance().contains(enrol));
    Assert.assertTrue(EnrolmentManager.getInstance().delete(enrol));
    Assert.assertFalse(EnrolmentManager.getInstance().contains(enrol));
View Full Code Here

public class StudentTest {
 
  @Test
  public void creationTest1() {
    new Student("Name");
  }
View Full Code Here

    new Student("Name");
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void creationTest2() {
    new Student("");
  }
View Full Code Here

    new Student("");
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void creationTest3() {
    new Student(null);
  }
View Full Code Here

  public void creationTest3() {
    new Student(null);
  }

  @Test public void equalityTest1() {
    Assert.assertTrue(new Student("Name").equals(new Student("Name")));
  }
View Full Code Here

  @Test public void equalityTest1() {
    Assert.assertTrue(new Student("Name").equals(new Student("Name")));
  }

  @Test public void equalityTest2() {
    Assert.assertFalse(new Student("Name").equals(new Student("Different Name")));
  }
View Full Code Here

   * @param args
   */
  public static void main(String[] args) {

    // Creates and starts a DataSourceLoader runnable object
    DataSourcesLoader dsLoader = new DataSourcesLoader();
    Thread thread1 = new Thread(dsLoader,"DataSourceThread");
    thread1.start();

    // Creates and starts a NetworkConnectionsLoader runnable object
    NetworkConnectionsLoader ncLoader = new NetworkConnectionsLoader();
View Full Code Here

    DataSourcesLoader dsLoader = new DataSourcesLoader();
    Thread thread1 = new Thread(dsLoader,"DataSourceThread");
    thread1.start();

    // Creates and starts a NetworkConnectionsLoader runnable object
    NetworkConnectionsLoader ncLoader = new NetworkConnectionsLoader();
    Thread thread2 = new Thread(ncLoader,"NetworkConnectionLoader");
    thread2.start();

    // Wait for the finalization of the two threads
    try {
View Full Code Here

    FileMock mock=new FileMock(101, 10);
   
    /**
     * Creates a buffer with a maximum of 20 lines
     */
    Buffer buffer=new Buffer(20);
   
    /**
     * Creates a producer and a thread to run it
     */
    Producer producer=new Producer(mock, buffer);
View Full Code Here

TOP

Related Classes of thread.concurrencyCookbook.chapter3.recipe6.Student

Copyright © 2018 www.massapicom. 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.