Tabnine Logo
Result.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.junit.runner.Result
constructor

Best Java code snippets using org.junit.runner.Result.<init> (Showing top 20 results out of 315)

origin: junit-team/junit4

private Object readResolve()  {
  return new Result(serializedForm);
}
origin: junit-team/junit4

  public Result result() {
    Result result = new Result();
    RunListener listener = result.createListener();
    for (Failure failure : failures) {
      try {
        listener.testFailure(failure);
      } catch (Exception e) {
        throw new RuntimeException("I can't believe this happened");
      }
    }
    return result;
  }
}
origin: google/j2objc

  public Result result() {
    Result result = new Result();
    RunListener listener = result.createListener();
    for (Failure failure : failures) {
      try {
        listener.testFailure(failure);
      } catch (Exception e) {
        throw new RuntimeException("I can't believe this happened");
      }
    }
    return result;
  }
}
origin: junit-team/junit4

/**
 * Do not use. Testing purposes only.
 */
public Result run(Runner runner) {
  Result result = new Result();
  RunListener listener = result.createListener();
  notifier.addFirstListener(listener);
  try {
    notifier.fireTestRunStarted(runner.getDescription());
    runner.run(notifier);
    notifier.fireTestRunFinished(result);
  } finally {
    removeListener(listener);
  }
  return result;
}
origin: org.apache.logging.log4j/log4j-api

@Test
public void testDeserializationOfUnknownClass() throws Exception {
  final SortedArrayStringMap original = new SortedArrayStringMap();
  original.putValue("a", "avalue");
  original.putValue("serializableButNotInClasspathOfDeserializer", new org.junit.runner.Result());
  original.putValue("zz", "last");
  final File file = new File("target/SortedArrayStringMap.ser");
  try (FileOutputStream fout = new FileOutputStream(file, false)) {
    fout.write(serialize(original));
    fout.flush();
  }
  final String classpath = createClassPath(SortedArrayStringMap.class, DeserializerHelper.class);
  final Process process = new ProcessBuilder("java", "-cp", classpath,
      DeserializerHelper.class.getName(), file.getPath()).start();
  final BufferedReader in = new BufferedReader(new InputStreamReader(process.getErrorStream()));
  final int exitValue = process.waitFor();
  file.delete();
  if (exitValue != 0) {
    final StringBuilder sb = new StringBuilder();
    sb.append("DeserializerHelper exited with error code ").append(exitValue);
    sb.append(". Classpath='").append(classpath);
    sb.append("'. Process output: ");
    int c = -1;
    while ((c = in.read()) != -1) {
      sb.append((char) c);
    }
    fail(sb.toString());
  }
}
origin: google/j2objc

/**
 * Do not use. Testing purposes only.
 */
public Result run(Runner runner) {
  Result result = new Result();
  RunListener listener = result.createListener();
  fNotifier.addFirstListener(listener);
  try {
    fNotifier.fireTestRunStarted(runner.getDescription());
    runner.run(fNotifier);
    fNotifier.fireTestRunFinished(result);
  } finally {
    removeListener(listener);
  }
  return result;
}
origin: robolectric/robolectric

private Result run(Runner runner) throws InitializationError {
 RunNotifier notifier = new RunNotifier();
 Result result = new Result();
 notifier.addListener(result.createListener());
 runner.run(notifier);
 return result;
}
origin: camunda/camunda-bpm-platform

  public Result result() {
    Result result = new Result();
    RunListener listener = result.createListener();
    for (Failure failure : failures) {
      try {
        listener.testFailure(failure);
      } catch (Exception e) {
        throw new RuntimeException("I can't believe this happened");
      }
    }
    return result;
  }
}
origin: camunda/camunda-bpm-platform

/**
 * Do not use. Testing purposes only.
 */
public Result run(Runner runner) {
  Result result = new Result();
  RunListener listener = result.createListener();
  fNotifier.addFirstListener(listener);
  try {
    fNotifier.fireTestRunStarted(runner.getDescription());
    runner.run(fNotifier);
    fNotifier.fireTestRunFinished(result);
  } finally {
    removeListener(listener);
  }
  return result;
}
origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit

private Object readResolve()  {
  return new Result(serializedForm);
}
origin: usethesource/rascal

  @Override
  public void done() {
    notifier.fireTestRunFinished(new Result());
  }
}
origin: usethesource/rascal

  @Override
  public void done() {
    notifier.fireTestRunFinished(new Result());
  }
}
origin: usethesource/rascal

  @Override
  public void done() {
    results.add(notifier -> notifier.fireTestRunFinished(new Result()));
  }
}
origin: io.tourniquet.junit/tourniquet-core

private Result copy(Result old) throws Exception {
  final Result result = new Result();
  copyFields(old, result);
  copyFailures(old, result);
  return result;
}
origin: usethesource/rascal

@Override
public void run(RunNotifier notifier) {
  assert rootDesc != null;
  notifier.fireTestRunStarted(rootDesc);
  long start = System.nanoTime();
  runTests(notifier);
  long stop = System.nanoTime();
  reportTime("Testing modules", start, stop);
  notifier.fireTestRunFinished(new Result());
}
origin: usethesource/rascal

@Override
public void run(RunNotifier notifier) {
  assert rootDesc != null;
  notifier.fireTestRunStarted(rootDesc);
  long start = System.nanoTime();
  runTests(notifier);
  long stop = System.nanoTime();
  reportTime("Testing modules", start, stop);
  notifier.fireTestRunFinished(new Result());
}
origin: net.sf.jexample/jexample

private static Object runExample(Example e) {
  Result result= new Result();
  RunNotifier notifier = new RunNotifier();
  notifier.addFirstListener(result.createListener());
  e.run(notifier);
  if (!e.wasSuccessful()) {
    if (result.getFailures().size() != 1) throw new RuntimeException("Oops, what do we now!?");
    throw new RuntimeException(result.getFailures().iterator().next().getException());
  }
  return e.getReturnValue().getValue();
}
origin: org.unitils/unitils-test

public void runTests(Class<?>... testClasses) throws Exception {
  result = new Result();
  RunNotifier runNotifier = new RunNotifier();
  runNotifier.addListener(result.createListener());
  
  for (Class<?> testClass : testClasses) {
    UnitilsJUnit4TestClassRunner testClassRunner = new TestUnitilsJUnit4TestClassRunner(testClass);
    testClassRunner.run(runNotifier);
  }
}
 
origin: arquillian/arquillian-testrunner-spock

@Override
public TestResult execute(final Class<?> testClass, final String methodName) {
  final Result testResult = new Result();
  try {
    final Sputnik spockRunner = new ArquillianSputnik(testClass);
    spockRunner.filter(new SpockSpecificationFilter(spockRunner, methodName));
    runTest(spockRunner, testResult);
  } catch (Exception e) {
    return TestResult.failed(e);
  }
  return convertToTestResult(testResult);
}
origin: ch.qos.mistletoe/mistletoe-core

private Result run(Runner runner) {
 Result result = new Result();
 RunListener listener = result.createListener();
 notifier.addFirstListener(listener);
 notifier.addListener(swRunListener);
 try {
  notifier.fireTestRunStarted(runner.getDescription());
  runner.run(notifier);
  notifier.fireTestRunFinished(result);
 } finally {
  notifier.removeListener(listener);
 }
 return result;
}
org.junit.runnerResult<init>

Popular methods of Result

  • getFailures
  • getFailureCount
  • wasSuccessful
  • getRunCount
  • getRunTime
  • getIgnoreCount
  • createListener
    Internal use only.

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best plugins for Eclipse
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