Package uk.ac.uea.threadr.tests.references

Examples of uk.ac.uea.threadr.tests.references.ReferenceTask


   
    instance = new Threadr();
    ParallelTask[] tasks = new ParallelTask[REFERENCE_COUNT];
   
    for (int i = 0; i < REFERENCE_COUNT; i++) {
      tasks[i] = new ReferenceTask();
    }
    instance.addTasks(tasks);
   
    assertNotNull("Instance returned null tasks.", instance.getTasks());
    assertEquals("Incorrect number of tasks found.", REFERENCE_COUNT,
View Full Code Here


   */
  @Test
  public final void testAddTasksTestResultsMap() {
   
    HashMap<ParallelTask, ThreadSafety> tasks = new HashMap<>();
    ParallelTask task1 = new ReferenceTask();
    tasks.put(task1, ThreadSafety.SEQUENTIAL);
    tasks.put(new ReferenceVMTask(), ThreadSafety.VM);
    tasks.put(new ReferenceUnsafeTask(), ThreadSafety.THREAD);
   
    instance = new Threadr();
View Full Code Here

    assertEquals("Incorrect number of results found.", 1, results.size());
    assertEquals(results.get(ReferenceTask.class), ThreadSafety.THREAD);
   
    /* Test the thread safety tester with provided safety values. */
    testAddTasksTestResultsMap();
    instance.addTask(new ReferenceTask(), null); // Force this to test.
    instance.testSafety();
    results = instance.getThreadSafetyResults();
    /* Ensure the results are there and the correct size first. */
    assertNotNull("Returned safety results were null.", results);
    assertEquals("Incorrect number of results found.", 3, results.size());
View Full Code Here

   */
  @Test
  public final void testExecute() {
   
    instance = new Threadr();
    ReferenceTask task = new ReferenceTask();
    ReferenceVMTask vmTask = new ReferenceVMTask();
    ReferenceUnsafeTask unsafeTask = new ReferenceUnsafeTask();
    /* Create copies of the arrays as a reference. */
    int[] refData = Arrays.copyOf(task.getData(), ReferenceTask.SIZE);
    int[] refVMData = Arrays.copyOf(vmTask.getData(), ReferenceTask.SIZE);
    int[] refUnsafeData = Arrays.copyOf(unsafeTask.getData(),
        ReferenceTask.SIZE);
   
    List<ParallelTask> tasks = new ArrayList<>();
View Full Code Here

   * Test the {@link VMWrapper#equals(Object)} method is working correctly.
   */
  @Test
  public final void testEquality() {
       
    ParallelTask task1 = new ReferenceTask();
   
    VMWrapper wrapper1Task1 = new VMWrapper(task1);
    VMWrapper wrapper2Task1 = new VMWrapper(task1);
    VMWrapper wrapper1Task2 = new VMWrapper(new ParallelTask() {     
      @Override
View Full Code Here

TOP

Related Classes of uk.ac.uea.threadr.tests.references.ReferenceTask

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.