下面列出了java.util.concurrent.ThreadPoolExecutor.AbortPolicy#org.junit.Ignore 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@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", "-", "/", "\\", "&", ",", ":")));
}
@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)));
}
@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();
}
}
/**
* 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");
}
@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();
});
}
@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();
}
@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);
}
@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")));
}
@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);
}
@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));
}
@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 ) );
}
@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.");
}
@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());
}
@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);
}
@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);
}
@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
);
}
@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");
}
@Test
@Ignore
public void testConsoleOutputForBuild(){
String jobName = "BenTen-Env-Stability";
int buildNumber = 344;
Assert.assertNotNull(bentenJenkinsClient.showConsoleLogForJobWithBuildNumber(jobName,buildNumber));
}
/**
* 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");
}
@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);
}
@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);
}
@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();
}
@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);
}