类org.junit.Ignore源码实例Demo

下面列出了怎么用org.junit.Ignore的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: batfish   文件: AutoCompleteUtilsTest.java
@Ignore
@Test
public void testIpSpaceSpecValidIpQuery() {
  CompletionMetadata completionMetadata = getMockCompletionMetadata();

  // Exact match first, then any addresses that contain ‘1.2.3.4’, then any operators that we can
  // provide completions for, then operators that we can’t provide completions for (we stop giving
  // suggestions if the user enters ‘:’ for an ip wildcard)
  assertThat(
      AutoCompleteUtils.autoComplete(
              "network",
              "snapshot",
              Type.IP_SPACE_SPEC,
              "1.2.3.4",
              15,
              completionMetadata,
              NodeRolesData.builder().build(),
              new ReferenceLibrary(ImmutableList.of()))
          .stream()
          .map(AutocompleteSuggestion::getText)
          .collect(ImmutableList.toImmutableList()),
      equalTo(ImmutableList.of("1.2.3.4", "11.2.3.4", "-", "/", "\\", "&", ",", ":")));
}
 
源代码2 项目: JAADAS   文件: UnitThrowAnalysisTest.java
@Ignore("Fails")
@Test
public void testGReturnStmt() {
    Stmt s = Grimp.v().newReturnStmt(IntConstant.v(1));

    Set expectedRep = new ExceptionHashSet(utility.VM_ERRORS);
    expectedRep.add(utility.ILLEGAL_MONITOR_STATE_EXCEPTION);
    assertTrue(ExceptionTestUtility.sameMembers(expectedRep, Collections.EMPTY_SET,
                unitAnalysis.mightThrow(s)));

    Set expectedCatch = new ExceptionHashSet(utility.VM_ERRORS_PLUS_SUPERTYPES);
    expectedCatch.add(utility.ILLEGAL_MONITOR_STATE_EXCEPTION);
    expectedCatch.add(utility.RUNTIME_EXCEPTION);
    expectedCatch.add(utility.EXCEPTION);
    assertEquals(expectedCatch, 
            utility.catchableSubset(unitAnalysis.mightThrow(s)));
}
 
源代码3 项目: phoenicis   文件: DirectoryWatcherFilesTest.java
@Test
@Ignore
public void testObservableDirectoryCreateANewFileObservableIsNotifiedTwice()
        throws InterruptedException, IOException {
    final File temporaryDirectory = Files.createTempDir();

    try (DirectoryWatcherFiles directoryWatcherFiles = new DirectoryWatcherFiles(mockExecutorService,
            temporaryDirectory.toPath())) {

        final Consumer<List<File>> mockConsumer = mock(Consumer.class);
        directoryWatcherFiles.setOnChange(mockConsumer);

        File createdFile = new File(temporaryDirectory, "file.txt");
        Thread.sleep(2 * CHECK_INTERVAL);
        createdFile.createNewFile();
        Thread.sleep(10 * CHECK_INTERVAL);

        temporaryDirectory.delete();

        verify(mockConsumer, times(2)).accept(any(List.class));
    }
}
 
@Ignore
@Test(expected = ConnectException.class)
public void test_NoUser() throws Throwable {
    ServiceInstance instance = new ServiceInstance();
    ArrayList<InstanceParameter> params = new ArrayList<InstanceParameter>();
    params.add(PUBLIC_IP);
    params.add(WSDL);
    params.add(PROTOCOL);
    params.add(PORT);
    instance.setInstanceParameters(params);
    try {
        getInstance(instance);
    } catch (BadResultException e) {
        throw e.getCause();
    }
}
 
源代码5 项目: io   文件: ReadTest.java
/**
 * Cellの取得で認証トークンにBasic形式で不正な値を指定した場合に認証エラーが返却されること.
 * TODO V1.1 Basic認証に対応後有効化する
 */
@Test
@Ignore
public final void Cellの取得で認証トークンにBasic形式で不正な値を指定した場合に認証エラーが返却されること() {
    HashMap<String, String> headers = new HashMap<String, String>();
    // コロンを含んだ文字列ををBase64化して、ヘッダーに指定
    headers.put(HttpHeaders.AUTHORIZATION, "Basic YzNzgUZpbm5vdg==");
    this.setHeaders(headers);

    DcResponse res = this.restGet(getUrl(this.cellId));

    // ステータスコード:401
    // コンテンツタイプ:application/json
    // Etagヘッダが存在しない
    // ボディのエラーコードチェック
    assertEquals(HttpStatus.SC_UNAUTHORIZED, res.getStatusCode());
    assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue());
    this.checkErrorResponse(res.bodyAsJson(), "PR401-AU-0004");
}
 
源代码6 项目: DDF   文件: ModelPersistenceTest.java
@Ignore
public void testModelSerialize2DDF() throws DDFException {
  DummyModel dummyModel = new DummyModel(20, "dummymodel2");
  Model model = new Model(dummyModel);
  DDFManager manager = DDFManager.get(DDFManager.EngineType.BASIC);

  DDF ddf = model.serialize2DDF(manager);

  Object obj = ddf.getRepresentationHandler().get(List.class, String.class);
  List<Schema.Column> cols = ddf.getSchema().getColumns();
  List<String> lsString = (List<String>) obj;

  Assert.assertTrue(obj != null);
  Assert.assertTrue(obj instanceof List);
  Assert.assertTrue(ddf != null);

  APersistenceHandler.PersistenceUri uri = ddf.persist();
  PersistenceHandler pHandler = new PersistenceHandler(null);
  DDF ddf2 = (DDF) pHandler.load(uri);
  Model model2 = Model.deserializeFromDDF((BasicDDF) ddf2);

  Assert.assertTrue(ddf2 != null);
  Assert.assertTrue(model2 != null);
  Assert.assertTrue(model2.getRawModel() instanceof DummyModel);
}
 
@Test
@Ignore(value = IgnoreReasonConstants.REAL_BROWSER)
public void realTest()
{
	util.getEngine().setDriverStr(DriverConstants.DRIVER_CHROME);
	util.getEngine().init();
	util.initData();

	AnnotationPage page = util.getPage(AnnotationPage.class);
	page.open();
	page.getToLoginBut().click();

	page.getPhoneText().fillNotBlankValue();
	page.getPasswordText().fillNotBlankValue();

	ThreadUtil.silentSleep(3000);
}
 
@Test
@Ignore
public void testDirtyChecking() {
    doInJPA(entityManager -> {
        List<Post> posts = posts(entityManager);
        for (int i = 0; i < 100_000; i++) {
            for (Post post : posts) {
                modifyEntities(post, i);
            }
            entityManager.flush();
        }
    });

    doInJPA(entityManager -> {
        enableMetrics= true;
        List<Post> posts = posts(entityManager);
        for (int i = 0; i < iterationCount; i++) {
            for (Post post : posts) {
                modifyEntities(post, i);
            }
            entityManager.flush();
        }
        LOGGER.info("Flushed {} entities", entityCount);
        logReporter.report();
    });
}
 
源代码9 项目: dubbox-hystrix   文件: BuilderTest.java
@Ignore
   @Test
   @SuppressWarnings({ "rawtypes", "unchecked" })
   public void testBuilder_MyList() throws Exception
{
       Builder<MyList> b1 = Builder.register(MyList.class);
	MyList list = new MyList();
	list.add(new boolean[]{ true,false });
	list.add(new int[]{ 1,2,3,4,5 });
	list.add("String");
	list.add(4);
	list.code = 4321;
	
	UnsafeByteArrayOutputStream os = new UnsafeByteArrayOutputStream();
	b1.writeTo(list, os);
	byte[] b = os.toByteArray();
	System.out.println(b.length+":"+Bytes.bytes2hex(b));
	MyList result = b1.parseFrom(b);

	assertEquals(4, result.size());
	assertEquals(result.code, 4321);
	assertEquals(result.id, "feedback");
}
 
@Test
@Ignore
public void assertContend() throws Exception {
    CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000));
    client.start();
    client.blockUntilConnected();
    ZookeeperElectionService service = new ZookeeperElectionService(HOST_AND_PORT, client, ELECTION_PATH, electionCandidate);
    service.start();
    ElectionCandidate anotherElectionCandidate = mock(ElectionCandidate.class);
    CuratorFramework anotherClient = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000));
    ZookeeperElectionService anotherService = new ZookeeperElectionService("ANOTHER_CLIENT:8899", anotherClient, ELECTION_PATH, anotherElectionCandidate);
    anotherClient.start();
    anotherClient.blockUntilConnected();
    anotherService.start();
    KillSession.kill(client.getZookeeperClient().getZooKeeper(), EmbedTestingServer.getConnectionString());
    service.stop();
    verify(anotherElectionCandidate).startLeadership();
}
 
源代码11 项目: Flink-CEPplus   文件: JavaTableEnvironmentITCase.java
@Ignore
@Test
public void testAsFromTupleToPojo() throws Exception {
	ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
	BatchTableEnvironment tableEnv = BatchTableEnvironment.create(env, config());

	List<Tuple4<String, Integer, Double, String>> data = new ArrayList<>();
	data.add(new Tuple4<>("Rofl", 1, 1.0, "Hi"));
	data.add(new Tuple4<>("lol", 2, 1.0, "Hi"));
	data.add(new Tuple4<>("Test me", 4, 3.33, "Hello world"));

	Table table = tableEnv
		.fromDataSet(env.fromCollection(data), "q, w, e, r")
		.select("q as a, w as b, e as c, r as d");

	DataSet<SmallPojo2> ds = tableEnv.toDataSet(table, SmallPojo2.class);
	List<SmallPojo2> results = ds.collect();
	String expected = "Rofl,1,1.0,Hi\n" + "lol,2,1.0,Hi\n" + "Test me,4,3.33,Hello world\n";
	compareResultAsText(results, expected);
}
 
源代码12 项目: tddl   文件: AtomDynamicChangeGlobalTest.java
@Ignore("oracle驱动暂时没依赖")
@Test
public void dynamicChangeGlobalDbTypeTest() throws InterruptedException {
    Map re = tddlJT.queryForMap("select * from normaltbl_0001 where pk=?", new Object[] { RANDOM_ID });
    Assert.assertEquals(time, String.valueOf(re.get("gmt_create")));
    MockServer.setConfigInfo(TAtomConstants.getGlobalDataId(DBKEY_0),
        "ip=10.232.31.154\r\nport=3306\r\ndbName=qatest_normal_0\r\ndbType=oracle\r\ndbStatus=RW\r\n");

    TimeUnit.SECONDS.sleep(SLEEP_TIME);
    try {
        tddlJT.queryForMap("select * from normaltbl_0001 where pk=?", new Object[] { RANDOM_ID });
        MockServer.setConfigInfo(TAtomConstants.getGlobalDataId(DBKEY_0),
            "ip=10.232.31.154\r\nport=3306\r\ndbName=qatest_normal_0\r\ndbType=oracle\r\ndbStatus=RW\r\n");
        TimeUnit.SECONDS.sleep(SLEEP_TIME);
        tddlJT.queryForMap("select * from normaltbl_0001 where pk=?", new Object[] { RANDOM_ID });
        Assert.fail();
    } catch (Exception ex) {
    }
    MockServer.setConfigInfo(TAtomConstants.getGlobalDataId(DBKEY_0),
        "ip=10.232.31.154\r\nport=3306\r\ndbName=qatest_normal_0\r\ndbType=mysql\r\ndbStatus=RW\r\n");
    TimeUnit.SECONDS.sleep(SLEEP_TIME);
    re = tddlJT.queryForMap("select * from normaltbl_0001 where pk=?", new Object[] { RANDOM_ID });
    Assert.assertEquals(time, String.valueOf(re.get("gmt_create")));
}
 
源代码13 项目: barge   文件: BaseStateTest.java
@Test
@Ignore
public void testCandidateWithGreaterTerm() {

  BaseState state = new EmptyState(mockRaftLog);

  RequestVote requestVote = RequestVote.newBuilder()
    .setCandidateId(candidate.toString())
    .setLastLogIndex(2)
    .setLastLogTerm(3)
    .setTerm(2)
    .build();

  Replica otherCandidate = config.getReplica("other");
  when(mockRaftLog.votedFor()).thenReturn(Optional.of(otherCandidate));
  boolean shouldVote = state.shouldVoteFor(mockRaftLog, requestVote);

  assertTrue(shouldVote);
}
 
源代码14 项目: cyclops   文件: AsyncConnectableTest.java
@Test @Ignore
public void backpressureScheduledDelayNonBlocking(){

    captured= "";

       diff =  System.currentTimeMillis();
      Queue<String> blockingQueue = new ManyToOneConcurrentArrayQueue<String>(1);


      range(0, Integer.MAX_VALUE)
          .limit(3)
          .peek(i->System.out.println("diff before is "  +diff))
          .peek(v-> diff = System.currentTimeMillis()-diff)
          .peek(i->System.out.println("diff is "  +diff))
          .map(i -> i.toString())
          .scheduleFixedDelay(1l, scheduled)
          .connect(blockingQueue)
          .onePer(1, TimeUnit.SECONDS)
          .peek(i->System.out.println("BQ " + blockingQueue))
          .peek(System.out::println)
          .forEach(c->captured=c);

      assertThat(diff,lessThan(500l));
}
 
源代码15 项目: pentaho-kettle   文件: RepositoryTestBase.java
@Test
@Ignore
public void testSetAcl() throws Exception {
  RepositoryDirectoryInterface rootDir = initRepo();
  JobMeta jobMeta = createJobMeta( EXP_JOB_NAME );
  RepositoryDirectoryInterface jobsDir = rootDir.findDirectory( DIR_JOBS );
  repository.save( jobMeta, VERSION_COMMENT_V1, null );
  deleteStack.push( jobMeta );
  assertNotNull( jobMeta.getObjectId() );
  ObjectRevision version = jobMeta.getObjectRevision();
  assertNotNull( version );
  assertTrue( hasVersionWithComment( jobMeta, VERSION_COMMENT_V1 ) );
  assertTrue( repository.exists( EXP_JOB_NAME, jobsDir, RepositoryObjectType.JOB ) );
  ObjectAcl acl = ( (IAclService) repository ).getAcl( jobMeta.getObjectId(), false );
  assertNotNull( acl );
  acl.setEntriesInheriting( false );
  ObjectAce ace =
      new RepositoryObjectAce( new RepositoryObjectRecipient( "suzy", Type.USER ), EnumSet
          .of( RepositoryFilePermission.READ ) );
  List<ObjectAce> aceList = new ArrayList<ObjectAce>();
  aceList.add( ace );
  acl.setAces( aceList );
  ( (IAclService) repository ).setAcl( jobMeta.getObjectId(), acl );
  ObjectAcl acl1 = ( (IAclService) repository ).getAcl( jobMeta.getObjectId(), false );
  assertEquals( Boolean.FALSE, acl1.isEntriesInheriting() );
  assertEquals( 1, acl1.getAces().size() );
  ObjectAce ace1 = acl1.getAces().get( 0 );
  assertEquals( ace1.getRecipient().getName(), "suzy" );
  assertTrue( ace1.getPermissions().contains( RepositoryFilePermission.READ ) );
}
 
源代码16 项目: java   文件: ErrorHandlingTest.java
@Ignore("Remove to run test")
@Test
public void testThrowAnyCheckedExceptionWithDetailMessage() {
    Exception expected =
        assertThrows(
            Exception.class,
            () -> errorHandling
                .handleErrorByThrowingAnyCheckedExceptionWithDetailMessage(
                    "This is the detail message."));
    assertThat(expected).isNotInstanceOf(RuntimeException.class);
    assertThat(expected).hasMessage("This is the detail message.");
}
 
源代码17 项目: tomee   文件: MockedPageBeanTest.java
@Ignore("Does no work because DS cannot mock dynamic repositories")
@Test
public void saveUserWithMockedBean() {
    final String userName = "gp";
    final String firstName = "Gerhard";
    final String lastName = "Petracek";

    // mockito doesn't support interfaces...seriously? but you can mock CDI impl
    // here we don't have one so implementing for the test the interface
    final UserRepository mockedUserRepository = (UserRepository) Proxy.newProxyInstance(
            Thread.currentThread().getContextClassLoader(),
            new Class<?>[]{UserRepository.class},
            new InvocationHandler() {
                @Override
                public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
                    return new User(userName, firstName, lastName.toUpperCase() /*just to illustrate that the mock-instance is used*/);
                }
            });
    mockManager.addMock(mockedUserRepository);


    this.windowContext.activateWindow("testWindow");

    this.registrationPage.getUser().setUserName(userName);
    this.registrationPage.getUser().setFirstName(firstName);
    this.registrationPage.getUser().setLastName(lastName);
    this.registrationPage.getUser().setPassword("123");

    final Class<? extends Pages> targetPage = this.registrationPage.register();

    Assert.assertEquals(Pages.Login.class, targetPage);
    Assert.assertFalse(FacesContext.getCurrentInstance().getMessageList().isEmpty());
    Assert.assertEquals(webappMessageBundle.msgUserRegistered(userName), FacesContext.getCurrentInstance().getMessageList().iterator().next().getSummary());

    final User user = this.userRepository.findByUserName(userName);
    Assert.assertNotNull(user);
    Assert.assertEquals(firstName, user.getFirstName());
    Assert.assertEquals(lastName.toUpperCase(), user.getLastName());
}
 
源代码18 项目: rocketmq   文件: UpdateKvConfigCommandTest.java
@Ignore
@Test
public void testExecute() throws SubCommandException {
    UpdateKvConfigCommand cmd = new UpdateKvConfigCommand();
    Options options = ServerUtil.buildCommandlineOptions(new Options());
    String[] subargs = new String[]{"-s namespace", "-k topicname", "-v unit_test"};
    final CommandLine commandLine =
            ServerUtil.parseCmdLine("mqadmin " + cmd.commandName() + cmd.commandDesc(), subargs, cmd.buildCommandlineOptions(options), new PosixParser());
    cmd.execute(commandLine, options, null);
}
 
@Ignore
@Test
public void testPlayerMultipleAudioVideoSeekS3Mp4() throws Exception {
  // Test data
  final String mediaUrl = "/video/30sec/rgb.mp4";
  initTest(S3, mediaUrl);
}
 
源代码20 项目: omise-java   文件: LiveScheduleRequestTest.java
@Test
@Ignore("only hit the network when we need to.")
public void testLiveScheduleListGet() throws IOException, OmiseException {
    Request<ScopedList<Schedule>> request =
            new Schedule.ListRequestBuilder()
                    .build();

    ScopedList<Schedule> scheduleList = client.sendRequest(request);

    System.out.println("get schedule list: " + scheduleList.getTotal());

    assertNotNull(scheduleList);
    Schedule schedule = scheduleList.getData().get(0);
    assertNotNull(schedule);
}
 
源代码21 项目: java   文件: WordCountTest.java
@Ignore("Remove to run test")
@Test
public void multipleSpacesNotDetectedAsAWord() {
    expectedWordCount.put("multiple", 1);
    expectedWordCount.put("whitespaces", 1);

    actualWordCount = wordCount.phrase(" multiple   whitespaces");
    assertEquals(
        expectedWordCount, actualWordCount
    );
}
 
源代码22 项目: java   文件: ForthEvaluatorTest.java
@Ignore("Remove to run test")
@Test
public void testErrorIfMultiplicationAttemptedWithNothingOnTheStack() {
    IllegalArgumentException expected =
        assertThrows(
            IllegalArgumentException.class,
            () -> forthEvaluator
                .evaluateProgram(Collections.singletonList("*")));

    assertThat(expected)
        .hasMessage(
            "Multiplication requires that the stack contain at least 2 values");
}
 
源代码23 项目: benten   文件: BentenJenkinsClientTest.java
@Test
@Ignore
public void testConsoleOutputForBuild(){
    String jobName = "BenTen-Env-Stability";
    int buildNumber = 344;
    Assert.assertNotNull(bentenJenkinsClient.showConsoleLogForJobWithBuildNumber(jobName,buildNumber));
}
 
源代码24 项目: openhab1-addons   文件: KNXCoreTypeMapperTest.java
/**
 * KNXCoreTypeMapper tests method typeMapper.toType() for type B1U3 KNX ID: 3.007 DPT_CONTROL_DIMMING
 *
 * @throws KNXFormatException
 */
@Test
@Ignore
public void testTypeMappingB1U3_3_007() throws KNXFormatException {
    testTypeMappingB1U3(DPTXlator3BitControlled.DPT_CONTROL_DIMMING, IncreaseDecreaseType.class, "decrease 5",
            "increase 5");
}
 
@Ignore("Hardcoded to illustrate use of RestAssured")
@Test
public void aUserCanNotAccessIfNoBasicAuthHeaderUsingRestAssured(){

    given().
            contentType("text/xml").
    expect().
            statusCode(401).
    when().
            get("http://192.168.17.129/todos.xml");

}
 
源代码26 项目: DDMQ   文件: ConsumerProgressSubCommandTest.java
@Ignore
@Test
public void testExecute() throws SubCommandException {
    ConsumerProgressSubCommand cmd = new ConsumerProgressSubCommand();
    Options options = ServerUtil.buildCommandlineOptions(new Options());
    String[] subargs = new String[] {"-g default-group"};
    final CommandLine commandLine =
        ServerUtil.parseCmdLine("mqadmin " + cmd.commandName(), subargs, cmd.buildCommandlineOptions(options), new PosixParser());
    cmd.execute(commandLine, options, null);
}
 
源代码27 项目: quark   文件: SimpleIntegTest.java
@Ignore
@Test
public void simpleExplainQueryOnNonDefaultQuery()
    throws SQLException, ClassNotFoundException {

  String query =
      "explain plan for select * from views.public.web_site_partition";
  ResultSet rs1 = conn.createStatement().executeQuery(query);

  String parsedQuery = "explain plan for select * from public.web_site_partition";
  ResultSet rs2 = executeQuery(viewUrl, parsedQuery);

  checkSameResultSet(rs1, rs2);
}
 
源代码28 项目: RIBs   文件: InteractorAnnotationVerifierTest.java
@Test
@Ignore
public void verify_whenTypeElementIsValid_shouldCompile() {
  addResourceToSources("fixtures/AnnotatedInteractor.java");
  assert_()
      .about(javaSources())
      .that(getSources())
      .withCompilerOptions("-source", "1.7", "-target", "1.7")
      .processedWith(getRibProcessor())
      .compilesWithoutError();
}
 
源代码29 项目: p4ic4idea   文件: GetDiffFilesOptionsTest.java
@Test
@Ignore
public void setImmutableTrueDiffNonText() throws Throwable {
    GetDiffFilesOptions getDiffFilesOptions = new GetDiffFilesOptions();
    getDiffFilesOptions.setImmutable(true);
    Valids valids = new Valids();
    valids.immutable = true;
    testMethod(false, valids, getDiffFilesOptions);
    getDiffFilesOptions.setDiffNonTextFiles(true);
    valids = new Valids();
    valids.immutable = true;
    valids.diffNonTextGet = true;
    testMethod(false, valids, getDiffFilesOptions);
}
 
@Override
@Test
@Ignore
public void testStreamQueryPauseInBatch(TestContext ctx) {
  // TODO streaming support
  super.testStreamQueryPauseInBatch(ctx);
}
 
 类所在包
 类方法
 同包方法