1 33 34 package edu.rice.cs.drjava.model.junit; 35 36 import java.util.List ; 37 import edu.rice.cs.drjava.model.EventNotifier; 38 import edu.rice.cs.drjava.model.OpenDefinitionsDocument; 39 import edu.rice.cs.drjava.model.compiler.CompilerListener; 40 import edu.rice.cs.util.classloader.ClassFileError; 41 import edu.rice.cs.util.swing.Utilities; 42 43 75 class JUnitEventNotifier extends EventNotifier<JUnitListener> implements JUnitListener { 76 77 public void addListener(JUnitListener jul) { 78 super.addListener(jul); 79 } 81 82 85 public void nonTestCase(boolean isTestAll) { 86 _lock.startRead(); 87 try { for (JUnitListener jul : _listeners) { jul.nonTestCase(isTestAll); } } 88 finally { _lock.endRead(); } 89 } 90 91 public void classFileError(ClassFileError e) { 92 _lock.startRead(); 93 try { for (JUnitListener jul : _listeners) { jul.classFileError(e); } } 94 finally { _lock.endRead(); } 95 } 96 97 98 public void compileBeforeJUnit(final CompilerListener cl) { 99 _lock.startRead(); 100 try { for (JUnitListener jul : _listeners) { jul.compileBeforeJUnit(cl); } } 101 finally { _lock.endRead(); } 102 } 103 104 105 public void junitStarted() { 106 _lock.startRead(); 107 try { for (JUnitListener jul : _listeners) { jul.junitStarted(); } } 108 finally { _lock.endRead(); } 109 } 110 111 112 public void junitClassesStarted() { 113 _lock.startRead(); 114 try { for (JUnitListener jul : _listeners) { jul.junitClassesStarted(); } } 115 finally { _lock.endRead(); } 116 } 117 118 121 public void junitSuiteStarted(int numTests) { 122 _lock.startRead(); 123 try { for (JUnitListener jul : _listeners) { jul.junitSuiteStarted(numTests); } } 124 finally { _lock.endRead(); } 125 } 126 127 130 public void junitTestStarted(String name) { 131 _lock.startRead(); 132 try { for (JUnitListener jul : _listeners) { jul.junitTestStarted(name); } } 133 finally { _lock.endRead(); } 134 } 135 136 141 public void junitTestEnded(String name, boolean wasSuccessful, boolean causedError) { 142 _lock.startRead(); 143 try { for (JUnitListener jul : _listeners) { jul.junitTestEnded(name, wasSuccessful, causedError); } } 144 finally { _lock.endRead(); } 145 } 146 147 148 public void junitEnded() { 149 _lock.startRead(); 151 try { for(JUnitListener jul : _listeners) { jul.junitEnded(); } } 153 finally { _lock.endRead(); } 154 } 155 } 156 157 | Popular Tags |