Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 373 for fail (0.19 sec)

  1. guava-testlib/src/com/google/common/collect/testing/google/UnmodifiableCollectionTests.java

      public static void assertMapEntryIsUnmodifiable(Entry<?, ?> entry) {
        try {
          // fine because the call is going to fail without modifying the entry
          @SuppressWarnings("unchecked")
          Entry<?, @Nullable Object> nullableValueEntry = (Entry<?, @Nullable Object>) entry;
          nullableValueEntry.setValue(null);
          fail("setValue on unmodifiable Map.Entry succeeded");
        } catch (UnsupportedOperationException expected) {
        }
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Feb 26 19:46:10 GMT 2024
    - 15K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/base/PreconditionsTest.java

          Preconditions.checkArgument(false);
          fail("no exception thrown");
        } catch (IllegalArgumentException expected) {
        }
      }
    
      public void testCheckArgument_simpleMessage_success() {
        Preconditions.checkArgument(true, IGNORE_ME);
      }
    
      public void testCheckArgument_simpleMessage_failure() {
        try {
          Preconditions.checkArgument(false, new Message());
          fail("no exception thrown");
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/RangeTest.java

          range.lowerEndpoint();
          fail();
        } catch (IllegalStateException expected) {
        }
        try {
          range.lowerBoundType();
          fail();
        } catch (IllegalStateException expected) {
        }
      }
    
      private static void assertUnboundedAbove(Range<Integer> range) {
        assertFalse(range.hasUpperBound());
        try {
          range.upperEndpoint();
          fail();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Feb 21 10:16:44 GMT 2024
    - 24.1K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/collect/IterablesTest.java

        List<String> list = newArrayList("a", "b", "c");
        Iterable<String> tail = skip(list, 2);
        list.subList(0, 2).clear();
        assertTrue(Iterables.isEmpty(tail));
      }
    
      public void testSkip_illegalArgument() {
        List<String> list = newArrayList("a", "b", "c");
        try {
          skip(list, -1);
          fail();
        } catch (IllegalArgumentException expected) {
        }
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 47.5K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/net/HostAndPortTest.java

        assertEquals(81, hp.getPort());
    
        try {
          HostAndPort.fromParts("gmail.com:80", 81);
          fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
        }
    
        try {
          HostAndPort.fromParts("gmail.com", -1);
          fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 11:19:47 GMT 2023
    - 10K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/TableCollectorsTest.java

          fail("Expected NullPointerException");
        } catch (NullPointerException expected) {
        }
        collector =
            TableCollectors.toImmutableTable(Cell::getRowKey, Cell::getColumnKey, Cell::getValue);
        try {
          Stream.of(immutableCell("one", "uno", 1), immutableCell("one", "uno", (Integer) null))
              .collect(collector);
          fail("Expected NullPointerException");
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Mar 05 16:03:18 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  7. guava-testlib/test/com/google/common/testing/ClassSanityTesterTest.java

                      + ".");
          return;
        }
        fail();
      }
    
      public void testEqualsOnReturnValues_bad() throws Exception {
        try {
          tester.forAllPublicStaticMethods(BadEqualsFactory.class).testEquals();
        } catch (AssertionFailedError expected) {
          return;
        }
        fail();
      }
    
      private static class BadEqualsFactory {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Nov 16 15:12:31 GMT 2023
    - 36.3K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/base/JoinerTest.java

        checkResult(J, ITERABLE_123, "1-2-3");
    
        try {
          J.join(ITERABLE_NULL);
          fail();
        } catch (NullPointerException expected) {
        }
        try {
          J.join(ITERABLE_1_NULL_2);
          fail();
        } catch (NullPointerException expected) {
        }
    
        try {
          J.join(ITERABLE_NULL.iterator());
          fail();
        } catch (NullPointerException expected) {
        }
        try {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.6K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java

        try {
          iia.get(-1);
          fail();
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
          iia.get(3);
          fail();
        } catch (IndexOutOfBoundsException expected) {
        }
    
        iia = iia.subArray(1, 2);
        try {
          iia.get(-1);
          fail();
        } catch (IndexOutOfBoundsException expected) {
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Jun 01 09:32:35 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java

        // The opposite order should fail (Policies.THROW).
        PotentialDeadlockException firstException = null;
        lockB.lock();
        PotentialDeadlockException expected =
            assertThrows(PotentialDeadlockException.class, () -> lockA.lock());
        checkMessage(expected, "LockB -> LockA", "LockA -> LockB");
        firstException = expected;
        // Second time should also fail, with a cached causal chain.
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.1K bytes
    - Viewed (0)
Back to top