congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RunSettings
Code IndexAdd Tabnine to your IDE (free)

How to use
RunSettings
in
com.novocode.junit

Best Java code snippets using com.novocode.junit.RunSettings (Showing top 18 results out of 315)

origin: com.novocode/junit-interface

String buildInfoMessage(Throwable t) {
 return buildColoredMessage(t, NNAME2);
}
origin: com.novocode/junit-interface

String buildInfoName(Description desc) {
 return buildColoredName(desc, NNAME1, NNAME2, NNAME3);
}
origin: com.novocode/junit-interface

 InfoEvent(Description desc, Status status) {
  super(settings.buildInfoName(desc), null, status, elapsedTime(desc), null);
 }
}
origin: com.novocode/junit-interface

 ErrorEvent(Failure failure, Status status) {
  super(settings.buildErrorName(failure.getDescription()),
     settings.buildErrorMessage(failure.getException()),
     status,
     elapsedTime(failure.getDescription()),
     failure.getException());
 }
}
origin: com.novocode/junit-interface

private void recordStartTime(Description description) {
 startTimes.putIfAbsent(settings.buildPlainName(description), System.currentTimeMillis());
}
origin: com.novocode/junit-interface

String buildColoredMessage(Throwable t, String c1) {
 if(t == null) return "null";
 if(!logExceptionClass || (!logAssert && (t instanceof AssertionError)))  return t.getMessage();
 StringBuilder b = new StringBuilder();
 String cn = decodeName(t.getClass().getName());
 int pos1 = cn.indexOf('$');
 int pos2 = pos1 == -1 ? cn.lastIndexOf('.') : cn.lastIndexOf('.', pos1);
 if(pos2 == -1) b.append(c(cn, c1));
 else {
  b.append(cn.substring(0, pos2));
  b.append('.');
  b.append(c(cn.substring(pos2+1), c1));
 }
 b.append(": ").append(t.getMessage());
 return b.toString();
}
origin: com.novocode/junit-interface

String decodeName(String name) {
 return decodeScalaNames ? decodeScalaName(name) : name;
}
origin: com.novocode/junit-interface

private boolean shouldRun(Fingerprint fingerprint, Class<?> clazz, RunSettings settings) {
 if(JUNIT_FP.equals(fingerprint)) {
  // Ignore classes which are matched by the other fingerprints
  if(TestCase.class.isAssignableFrom(clazz)) return false;
  for(Annotation a : clazz.getDeclaredAnnotations()) {
   if(a.annotationType().equals(RunWith.class)) return false;
  }
  return true;
 } else {
  RunWith rw = clazz.getAnnotation(RunWith.class);
  if(rw != null) return !settings.ignoreRunner(rw.value().getName());
  else return true;
 }
}
origin: com.novocode/junit-interface

void testExecutionFailed(String testName, Throwable err)
{
 post(new Event(Ansi.c(testName, Ansi.ERRMSG), settings.buildErrorMessage(err), Status.Error, 0l, err) {
  void logTo(RichLogger logger) {
   logger.error("Execution of test "+ansiName+" failed: "+ansiMsg, error);
  }
 });
}
origin: com.novocode/junit-interface

  new RunSettings(!nocolor, decodeScalaNames, quiet, verbose, logAssert, ignoreRunners, logExceptionClass);
RichLogger logger = new RichLogger(loggers, settings, testClassName);
EventDispatcher ed = new EventDispatcher(logger, eventHandler, settings, fingerprint);
origin: com.novocode/junit-interface

private Long elapsedTime(Description description) {
 Long startTime = startTimes.get(settings.buildPlainName(description));
 if( startTime == null ) {
  return 0l;
 } else {
  return System.currentTimeMillis() - startTime;
 }
}
origin: com.novocode/junit-interface

private String buildColoredName(Description desc, String c1, String c2, String c3) {
 StringBuilder b = new StringBuilder();
 
 String cn = decodeName(desc.getClassName());
 int pos1 = cn.indexOf('$');
 int pos2 = pos1 == -1 ? cn.lastIndexOf('.') : cn.lastIndexOf('.', pos1);
 if(pos2 == -1) b.append(c(cn, c1));
 else {
  b.append(cn.substring(0, pos2));
  b.append('.');
  b.append(c(cn.substring(pos2+1), c1));
 }
 String m = desc.getMethodName();
 if(m != null) {
  b.append('.');
  int mpos1 = m.lastIndexOf('[');
  int mpos2 = m.lastIndexOf(']');
  if(mpos1 == -1 || mpos2 < mpos1) b.append(c(decodeName(m), c2));
  else {
   b.append(c(decodeName(m.substring(0, mpos1)), c2));
   b.append('[');
   b.append(c(m.substring(mpos1+1, mpos2), c3));
   b.append(']');
  }
 }
 return b.toString();
}
origin: com.novocode/junit-interface

String buildErrorName(Description desc) {
 return buildColoredName(desc, ENAME1, ENAME2, ENAME3);
}
origin: com.novocode/junit-interface

@Override
public boolean shouldRun(Description d)
{
 if(d.isSuite()) return true;
 String plainName = settings.buildPlainName(d);
 for(Pattern p : patterns)
  if(p.matcher(plainName).matches()) return true;
 return false;
}
origin: com.novocode/junit-interface

private String stackTraceElementToString(StackTraceElement e, String testClassName, String testFileName)
{
 boolean highlight = settings.color && (
   testClassName.equals(e.getClassName()) ||
   (testFileName != null && testFileName.equals(e.getFileName()))
  );
 StringBuilder b = new StringBuilder();
 b.append(settings.decodeName(e.getClassName() + '.' + e.getMethodName()));
 b.append('(');
 if(e.isNativeMethod()) b.append(c("Native Method", highlight ? TESTFILE2 : null));
 else if(e.getFileName() == null) b.append(c("Unknown Source", highlight ? TESTFILE2 : null));
 else
 {
  b.append(c(e.getFileName(), highlight ? TESTFILE1 : null));
  if(e.getLineNumber() >= 0)
   b.append(':').append(c(String.valueOf(e.getLineNumber()), highlight ? TESTFILE2 : null));
 }
 return b.append(')').toString();
}
origin: com.novocode/junit-interface

@Override
public void testStarted(Description description)
{
 recordStartTime(description);
 logger.pushCurrentTestClassName(description.getClassName());
 debugOrInfo("Test " + settings.buildInfoName(description) + " started");
 capture();
}
origin: com.novocode/junit-interface

String buildErrorMessage(Throwable t) {
 return buildColoredMessage(t, ENAME2);
}
origin: com.novocode/junit-interface

String buildPlainName(Description desc) {
 return buildColoredName(desc, null, null, null);
}
com.novocode.junitRunSettings

Most used methods

  • <init>
  • buildColoredMessage
  • buildColoredName
  • buildErrorMessage
  • buildErrorName
  • buildInfoName
  • buildPlainName
  • decodeName
  • decodeScalaName
  • ignoreRunner

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now