org.easymock.EasyMock.anyBoolean()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.easymock.EasyMock.anyBoolean()方法的一些代码示例,展示了EasyMock.anyBoolean()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EasyMock.anyBoolean()方法的具体详情如下:
包路径:org.easymock.EasyMock
类名称:EasyMock
方法名:anyBoolean

EasyMock.anyBoolean介绍

[英]Expects any boolean argument. For details, see the EasyMock documentation.
[中]需要任何布尔参数。有关详细信息,请参阅EasyMock文档。

代码示例

代码示例来源:origin: info.magnolia/magnolia-core

/**
 * @deprecated since 5.6.
 */
@Deprecated
public static void mockObservation(MockHierarchyManager hm) throws RepositoryException, UnsupportedRepositoryOperationException {
  // fake observation
  Workspace ws = createMock(Workspace.class);
  ObservationManager om = createMock(ObservationManager.class);
  om.addEventListener(isA(EventListener.class), anyInt(), isA(String.class), anyBoolean(), (String[]) anyObject(), (String[]) anyObject(), anyBoolean());
  expect(ws.getObservationManager()).andStubReturn(om);
  hm.setWorkspace(ws);
  replay(ws, om);
}

代码示例来源:origin: j256/ormlite-core

if (throwExecute) {
  expect(conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class), anyInt(),
      anyBoolean())).andThrow(new SQLException("you asked us to!!"));
} else {
  expect(conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class), anyInt(),
      anyBoolean())).andReturn(stmt);
  expect(stmt.runExecute()).andReturn(rowN);
  stmt.close();
  if (queryAfter != null) {
    expect(conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class),
        anyInt(), anyBoolean())).andReturn(stmt);
    results = createMock(DatabaseResults.class);
    expect(results.first()).andReturn(false);

代码示例来源:origin: com.nesscomputing.components/ness-quartz

@Before
public void setUp() throws Exception
{
  config = Config.getConfig(URI.create("classpath:/test-config"), "builder");
  nessJobConfig = config.getConfiguration("ness.job");
  scheduler = createMock(Scheduler.class);
  EasyMock.expect(scheduler.scheduleJob(EasyMock.capture(jobDetailCapture), EasyMock.capture(triggerCapture))).andReturn(null).anyTimes();
  scheduler.addJob(EasyMock.capture(jobAddCapture), EasyMock.anyBoolean());
  EasyMock.expectLastCall().anyTimes();
  replayAll();
}

代码示例来源:origin: NationalSecurityAgency/datawave

}).anyTimes();
mock.getBoolean(EasyMock.anyObject(String.class), EasyMock.anyBoolean());
EasyMock.expectLastCall().andAnswer(() -> {

代码示例来源:origin: NationalSecurityAgency/datawave

}).anyTimes();
mock.getBoolean(EasyMock.anyObject(String.class), EasyMock.anyBoolean());
EasyMock.expectLastCall().andAnswer(() -> {

代码示例来源:origin: bedatadriven/activityinfo

private void expectSetActionEnabled() {
  view.setActionEnabled(isA(String.class), anyBoolean());
  expectLastCall().andAnswer(new IAnswer<Void>() {
    @Override
    public Void answer() throws Throwable {
      String actionId = (String) getCurrentArguments()[0];
      Boolean enabled = (Boolean) getCurrentArguments()[1];
      if (enabled) {
        disabledActions.remove(actionId);
      } else {
        disabledActions.add(actionId);
      }
      return null;
    }
  }).anyTimes();
}

代码示例来源:origin: NationalSecurityAgency/datawave

}).anyTimes();
mock.getBoolean(EasyMock.anyObject(String.class), EasyMock.anyBoolean());
EasyMock.expectLastCall().andAnswer(() -> {

代码示例来源:origin: j256/ormlite-core

final CompiledStatement stmt = createMock(CompiledStatement.class);
expect(conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class), anyInt(),
    anyBoolean())).andAnswer(new IAnswer<CompiledStatement>() {
      private int stmtC = 0;

代码示例来源:origin: j256/ormlite-core

final CompiledStatement stmt = createMock(CompiledStatement.class);
expect(conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class), anyInt(),
    anyBoolean())).andAnswer(new IAnswer<CompiledStatement>() {
      private int stmtC = 0;

代码示例来源:origin: j256/ormlite-core

final CompiledStatement stmt = createMock(CompiledStatement.class);
expect(conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class), anyInt(),
    anyBoolean())).andAnswer(new IAnswer<CompiledStatement>() {
      private int stmtC = 0;

代码示例来源:origin: org.apache.shindig/shindig-gadgets

@Test
public void testCajaJsRequest() throws Exception {
 registerGadgetsHandler(null);
 Capture<Uri> uriCapture = new Capture<Uri>();
 Capture<String> containerCapture = new Capture<String>();
 Capture<String> mimeCapture = new Capture<String>();
 String goldenMime = "text/javascript";
 CajoledResult golden = cajole(JS_URL, goldenMime, "alert('hi');");
 EasyMock.expect(
     cajaContentRewriter.rewrite(EasyMock.capture(uriCapture),
         EasyMock.capture(containerCapture), EasyMock.capture(mimeCapture),
         EasyMock.eq(true), EasyMock.anyBoolean())).andReturn(golden).anyTimes();
 replay();
 JSONObject request = makeCajaRequest(goldenMime, JS_URL.toString());
 RpcHandler operation = registry.getRpcHandler(request);
 Object result = operation.execute(emptyFormItems, authContext, converter).get();
 assertEquals(CONTAINER, containerCapture.getValue());
 assertEquals(JS_URL, uriCapture.getValue());
 assertTrue(mimeCapture.getValue().contains("javascript"));
 JSONObject response = new JSONObject(converter.convertToString(result));
 assertTrue(response.has(JS_URL.toString()));
 JSONObject cajaResponse = response.getJSONObject(JS_URL.toString());
 // Pure js url - no html produced
 assertFalse(cajaResponse.has("html"));
 assertTrue(cajaResponse.has("js"));
 assertTrue(cajaResponse.has("messages"));
 assertTrue(cajaResponse.getString("js").contains("alert"));
 assertTrue(cajaResponse.getJSONArray("messages").length() > 0);
}

代码示例来源:origin: org.apache.shindig/shindig-gadgets

cajaContentRewriter.rewrite(EasyMock.capture(uriCapture),
        EasyMock.capture(containerCapture), EasyMock.capture(mimeCapture),
        EasyMock.eq(true), EasyMock.anyBoolean())).andReturn(golden).anyTimes();
replay();

代码示例来源:origin: org.wso2.org.apache.shindig/shindig-gadgets

cajaContentRewriter.rewrite(EasyMock.capture(uriCapture),
        EasyMock.capture(containerCapture), EasyMock.capture(mimeCapture),
        EasyMock.eq(true), EasyMock.anyBoolean())).andReturn(golden).anyTimes();
replay();

代码示例来源:origin: NationalSecurityAgency/datawave

}).anyTimes();
mocked.getBoolean(EasyMock.anyObject(String.class), EasyMock.anyBoolean());
EasyMock.expectLastCall().andAnswer(() -> {
}).anyTimes();
mocked.setBoolean(EasyMock.anyObject(String.class), EasyMock.anyBoolean());
EasyMock.expectLastCall().andAnswer(() -> {

代码示例来源:origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void testCajaJsRequest() throws Exception {
 registerGadgetsHandler(null);
 Capture<Uri> uriCapture = new Capture<Uri>();
 Capture<String> containerCapture = new Capture<String>();
 Capture<String> mimeCapture = new Capture<String>();
 String goldenMime = "text/javascript";
 CajoledResult golden = cajole(JS_URL, goldenMime, "alert('hi');");
 EasyMock.expect(
     cajaContentRewriter.rewrite(EasyMock.capture(uriCapture),
         EasyMock.capture(containerCapture), EasyMock.capture(mimeCapture),
         EasyMock.eq(true), EasyMock.anyBoolean())).andReturn(golden).anyTimes();
 replay();
 JSONObject request = makeCajaRequest(goldenMime, JS_URL.toString());
 RpcHandler operation = registry.getRpcHandler(request);
 Object result = operation.execute(emptyFormItems, authContext, converter).get();
 assertEquals(CONTAINER, containerCapture.getValue());
 assertEquals(JS_URL, uriCapture.getValue());
 assertTrue(mimeCapture.getValue().contains("javascript"));
 JSONObject response = new JSONObject(converter.convertToString(result));
 assertTrue(response.has(JS_URL.toString()));
 JSONObject cajaResponse = response.getJSONObject(JS_URL.toString());
 // Pure js url - no html produced
 assertFalse(cajaResponse.has("html"));
 assertTrue(cajaResponse.has("js"));
 assertTrue(cajaResponse.has("messages"));
 assertTrue(cajaResponse.getString("js").contains("alert"));
 assertTrue(cajaResponse.getJSONArray("messages").length() > 0);
}

代码示例来源:origin: NationalSecurityAgency/datawave

}).anyTimes();
mocked.getBoolean(EasyMock.anyObject(String.class), EasyMock.anyBoolean());
EasyMock.expectLastCall().andAnswer(() -> {
  String key = (String) EasyMock.getCurrentArguments()[0];

代码示例来源:origin: NationalSecurityAgency/datawave

}).anyTimes();
mocked.getBoolean(EasyMock.anyObject(String.class), EasyMock.anyBoolean());
EasyMock.expectLastCall().andAnswer(() -> {
  String key = (String) EasyMock.getCurrentArguments()[0];

相关文章