Codota Logo
RunWith.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.junit.runner.RunWith
constructor

Best Java code snippets using org.junit.runner.RunWith.<init> (Showing top 20 results out of 49,968)

Refine searchRefine arrow

  • Rule.<init>
  • Mock.<init>
  • Suite.SuiteClasses.<init>
  • Category.<init>
  • Common ways to obtain RunWith
private void myMethod () {
RunWith r =
  • Codota IconClass testClass;testClass.getAnnotation(RunWith.class)
  • Smart code suggestions by Codota
}
origin: Netflix/zuul

  @RunWith(MockitoJUnitRunner.class)
  public static class TestUnit
  {
    @Mock
    HttpResponse proxyResp;

    @Mock
    HttpRequestMessage request;

    @Test
    public void testIsValidResponseHeader()
    {
      Assert.assertTrue(isValidResponseHeader(HttpHeaderNames.get("test")));
      Assert.assertFalse(isValidResponseHeader(HttpHeaderNames.get("Keep-Alive")));
      Assert.assertFalse(isValidResponseHeader(HttpHeaderNames.get("keep-alive")));
    }
  }
}
origin: bumptech/glide

@RunWith(JUnit4.class)
public class EmptySignatureTest {
 @Rule public final KeyTester keyTester = new KeyTester();

 @Test
 public void testEquals() {
  keyTester
    .addEquivalenceGroup(
      EmptySignature.obtain(),
      EmptySignature.obtain())
    .addEquivalenceGroup(mock(Key.class))
    .addEmptyDigestRegressionTest(EmptySignature.obtain())
    .test();
 }
}

origin: org.apache.logging.log4j/log4j-core

@RunWith(Parameterized.class)
@Category(AsyncLoggers.class)
public class AsyncLoggerThreadContextGarbageFreeTest extends AbstractAsyncThreadContextTestBase {
  @Parameterized.Parameters(name = "{0} {1}")
  public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][] {
        { ContextImpl.GARBAGE_FREE, Mode.ALL_ASYNC},
        { ContextImpl.GARBAGE_FREE, Mode.BOTH_ALL_ASYNC_AND_MIXED},
    });
  }
  public AsyncLoggerThreadContextGarbageFreeTest(final ContextImpl contextImpl, final Mode asyncMode) {
    super(contextImpl, asyncMode);
  }
}

origin: spring-projects/spring-framework

/**
 * JUnit test suite for <em>bean definition profile</em> support in the
 * Spring TestContext Framework with annotation-based configuration.
 *
 * @author Sam Brannen
 * @since 3.1
 */
@RunWith(Suite.class)
// Note: the following 'multi-line' layout is for enhanced code readability.
@SuiteClasses({//
DefaultProfileAnnotationConfigTests.class,//
  DevProfileAnnotationConfigTests.class,//
  DevProfileResolverAnnotationConfigTests.class //
})
public class ProfileAnnotationConfigTestSuite {
}

origin: spring-projects/spring-framework

@RunWith(MockitoJUnitRunner.class)
public class WebConnectionHtmlUnitDriverTests {
  @Mock
  private WebConnection connection;
  @Rule
  public ExpectedException exception = ExpectedException.none();
origin: googleapis/google-cloud-java

/** Integration tests for database admin functionality: DDL etc. */
@Category(IntegrationTest.class)
@RunWith(JUnit4.class)
public class ITDatabaseTest {
 @ClassRule public static IntegrationTestEnv env = new IntegrationTestEnv();
 @Rule public ExpectedException expectedException = ExpectedException.none();

 @Test
 public void badDdl() {
  expectedException.expect(isSpannerException(ErrorCode.INVALID_ARGUMENT));
  expectedException.expectMessage("Syntax error on line 1");

  env.getTestHelper().createTestDatabase("CREATE TABLE T ( Illegal Way To Define A Table )");
 }
}

origin: bumptech/glide

@RunWith(JUnit4.class)
public class ObjectKeyTest {
 @Rule public final KeyTester keyTester = new KeyTester();

 @Test
 public void testEqualsHashCodeAndDigest() throws NoSuchAlgorithmException {
  Object object = new Object();
  keyTester
    .addEquivalenceGroup(new ObjectKey(object), new ObjectKey(object))
    .addEquivalenceGroup(new ObjectKey(new Object()))
    .addEquivalenceGroup(new ObjectKey("test"), new ObjectKey("test"))
    .addRegressionTest(
      new ObjectKey("test"),
      "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")
    .test();
 }
}

origin: Netflix/zuul

@RunWith(MockitoJUnitRunner.class)
public static class UnitTest {
  @Mock
  private File nonGroovyFile;
  @Mock
  private File groovyFile;
  @Mock
  private File directory;
origin: spring-projects/spring-framework

/**
 * JUnit test suite for <em>bean definition profile</em> support in the
 * Spring TestContext Framework with XML-based configuration.
 *
 * @author Sam Brannen
 * @since 3.1
 */
@RunWith(Suite.class)
// Note: the following 'multi-line' layout is for enhanced code readability.
@SuiteClasses({//
DefaultProfileXmlConfigTests.class,//
  DevProfileXmlConfigTests.class,//
  DevProfileResolverXmlConfigTests.class //
})
public class ProfileXmlConfigTestSuite {
}

origin: org.apache.logging.log4j/log4j-core

@RunWith(Parameterized.class)
@Category(AsyncLoggers.class)
public class AsyncLoggerThreadContextCopyOnWriteTest extends AbstractAsyncThreadContextTestBase {
  @Parameterized.Parameters(name = "{0} {1}")
  public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][] {
        { ContextImpl.COPY_ON_WRITE, Mode.ALL_ASYNC},
        { ContextImpl.COPY_ON_WRITE, Mode.BOTH_ALL_ASYNC_AND_MIXED}
    });
  }
  public AsyncLoggerThreadContextCopyOnWriteTest(final ContextImpl contextImpl, final Mode asyncMode) {
    super(contextImpl, asyncMode);
  }
}

origin: robolectric/robolectric

@RunWith(RobolectricTestRunner.class)
public class MockitoInjectMocksTest {
 @Rule
 public MockitoRule mockitoRule = MockitoJUnit.rule();

 @Mock
 TextView textView;

 @InjectMocks
 Activity activity = Robolectric.setupActivity(Activity.class);

 @Test
 public void testInjection() {
  activity.finish();
 }
}

origin: bumptech/glide

@RunWith(JUnit4.class)
public class MediaStoreSignatureTest {
 @Rule public final KeyTester keyTester = new KeyTester();

 @Test
 public void equalsHashCodeAndDigest() {
  keyTester
    .addEquivalenceGroup(
      new MediaStoreSignature("first", 100, 1),
      new MediaStoreSignature("first", 100, 1))
    .addEquivalenceGroup(new MediaStoreSignature("second", 100, 1))
    .addEquivalenceGroup(new MediaStoreSignature("first", 200, 1))
    .addEquivalenceGroup(new MediaStoreSignature("first", 100, 2))
    .addRegressionTest(
      new MediaStoreSignature("first", 100, 1),
      "04959925006b21081000fd10835cc376343c0e922df0bd7346897ede6f958adf")
    .test();
 }
}

origin: android10/Android-CleanArchitecture

@RunWith(MockitoJUnitRunner.class)
public class DefaultErrorBundleTest {
 private DefaultErrorBundle defaultErrorBundle;

 @Mock private Exception mockException;

 @Before
 public void setUp() {
  defaultErrorBundle = new DefaultErrorBundle(mockException);
 }

 @Test
 public void testGetErrorMessageInteraction() {
  defaultErrorBundle.getErrorMessage();

  verify(mockException).getMessage();
 }
}

origin: spring-projects/spring-framework

/**
 * Convenience test suite for integration tests that verify support for
 * {@link WebApplicationContext} {@linkplain ContextLoader context loaders}
 * in the TestContext framework.
 *
 * @author Sam Brannen
 * @since 3.2
 */
@RunWith(Suite.class)
// Note: the following 'multi-line' layout is for enhanced code readability.
@SuiteClasses({//
BasicXmlWacTests.class,//
  BasicAnnotationConfigWacTests.class,//
  RequestAndSessionScopedBeansWacTests.class //
})
public class WebContextLoaderTestSuite {
}

origin: org.apache.logging.log4j/log4j-core

@RunWith(Parameterized.class)
@Category(AsyncLoggers.class)
public class AsyncLoggerThreadContextDefaultTest extends AbstractAsyncThreadContextTestBase {
  @Parameterized.Parameters
  public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][] {
        { ContextImpl.WEBAPP, Mode.ALL_ASYNC},
        { ContextImpl.WEBAPP, Mode.BOTH_ALL_ASYNC_AND_MIXED},
    });
  }
  public AsyncLoggerThreadContextDefaultTest(final ContextImpl contextImpl, final Mode asyncMode) {
    super(contextImpl, asyncMode);
  }
}

origin: android10/Android-CleanArchitecture

@RunWith(MockitoJUnitRunner.class)
public class DiskUserDataStoreTest {

 private static final int FAKE_USER_ID = 11;

 private DiskUserDataStore diskUserDataStore;

 @Mock private UserCache mockUserCache;

 @Rule public ExpectedException expectedException = ExpectedException.none();

 @Before
 public void setUp() {
  diskUserDataStore = new DiskUserDataStore(mockUserCache);
 }

 @Test
 public void testGetUserEntityListUnsupported() {
  expectedException.expect(UnsupportedOperationException.class);
  diskUserDataStore.userEntityList();
 }

 @Test
 public void testGetUserEntityDetailesFromCache() {
  diskUserDataStore.userEntityDetails(FAKE_USER_ID);
  verify(mockUserCache).get(FAKE_USER_ID);
 }
}

origin: robolectric/robolectric

@RunWith(AndroidJUnit4.class)
public class ShadowIoUtilsTest {

 @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();

 @Test
 public void ioUtils() throws Exception {

  File file = temporaryFolder.newFile("test_file.txt");
  Files.asCharSink(file, StandardCharsets.UTF_8).write("some contents");

  String contents = IoUtils.readFileAsString(file.getAbsolutePath());
  assertThat(contents).isEqualTo("some contents");
 }
}

origin: square/picasso

@RunWith(RobolectricTestRunner.class)
public class AssetRequestHandlerTest {
 @Mock Context context;

 @Before public void setUp() {
  initMocks(this);
 }

 @Test public void truncatesFilePrefix() throws IOException {
  Uri uri = Uri.parse("file:///android_asset/foo/bar.png");
  Request request = new Request.Builder(uri).build();

  String actual = AssetRequestHandler.getFilePath(request);
  assertThat(actual).isEqualTo("foo/bar.png");
 }
}

origin: spring-projects/spring-framework

/**
 * JUnit 4 based test suite for functionality proposed in <a
 * href="http://opensource.atlassian.com/projects/spring/browse/SPR-3896"
 * target="_blank">SPR-3896</a>.
 *
 * @author Sam Brannen
 * @since 2.5
 */
@RunWith(Suite.class)
// Note: the following 'multi-line' layout is for enhanced code readability.
@SuiteClasses({

DefaultLocationsBaseTests.class,

DefaultLocationsInheritedTests.class,

ExplicitLocationsBaseTests.class,

ExplicitLocationsInheritedTests.class,

BeanOverridingDefaultLocationsInheritedTests.class,

BeanOverridingExplicitLocationsInheritedTests.class

})
public class Spr3896SuiteTests {
}

origin: apache/hbase

@RunWith(Parameterized.class)
@Category({ ReplicationTests.class, LargeTests.class })
public class TestReplicationSmallTestsSync extends TestReplicationSmallTests {

 @ClassRule
 public static final HBaseClassTestRule CLASS_RULE =
  HBaseClassTestRule.forClass(TestReplicationSmallTestsSync.class);

 @Override
 protected boolean isSyncPeer() {
  return true;
 }
}

org.junit.runnerRunWith<init>

Popular methods of RunWith

  • value

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JTable (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now