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

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

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

EasyMock.eq介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

expect(reader.getGridCoverageNames()).andReturn(new String[] {"TheCoverage"});
replay(reader);
expect(format.getReader(EasyMock.eq(rasterSource), EasyMock.anyObject(Hints.class)))
    .andReturn(reader)
    .anyTimes();

代码示例来源:origin: geoserver/geoserver

AbstractGridFormat format = createNiceMock("theFormat", AbstractGridFormat.class);
Capture<Hints> capturedHints = new Capture<>();
expect(format.getReader(EasyMock.eq(url), capture(capturedHints)))
    .andReturn(reader)
    .anyTimes();

代码示例来源:origin: org.geoserver.community/gs-jdbcstore

@Override
public void stubConfig(JDBCResourceStoreProperties config) {
  expect(config.getInitScript())
      .andStubReturn(
          URIs.asResource(
              JDBCResourceStoreProperties.class.getResource("init.h2.sql")));
  expect(config.getJdbcUrl()).andStubReturn(Optional.of("jdbc:h2:mem:test"));
  expect(config.getJndiName()).andStubReturn(Optional.<String>absent());
  expect(config.getProperty(eq("driverClassName"))).andStubReturn("org.h2.Driver");
  expect(config.getProperty(eq("driverClassName"), (String) anyObject()))
      .andStubReturn("org.h2.Driver");
}

代码示例来源:origin: org.geoserver.community/gs-jdbcstore

@Override
public void stubConfig(JDBCResourceStoreProperties config) {
  expect(config.getInitScript())
      .andStubReturn(
          URIs.asResource(
              JDBCResourceStoreProperties.class.getResource(
                  "init.postgres.sql")));
  expect(config.getJdbcUrl())
      .andStubReturn(Optional.of("jdbc:postgresql://localhost:5432/jdbcstoretest"));
  expect(config.getJndiName()).andStubReturn(Optional.<String>absent());
  expect(config.getProperty(eq("username"))).andStubReturn("jdbcstore");
  expect(config.getProperty(eq("username"), (String) anyObject())).andStubReturn("jdbcstore");
  expect(config.getProperty(eq("password"))).andStubReturn("jdbcstore");
  expect(config.getProperty(eq("password"), (String) anyObject())).andStubReturn("jdbcstore");
  expect(config.getProperty(eq("driverClassName"))).andStubReturn("org.postgresql.Driver");
  expect(config.getProperty(eq("driverClassName"), (String) anyObject()))
      .andStubReturn("org.postgresql.Driver");
}

代码示例来源:origin: org.geoserver.security/gs-security-tests

expect(manager.getSecurityFilter(eq(anonymous), eq(FeatureTypeInfo.class)))
expect(manager.getAccessLimits(eq(anonymous), eq(mockWSInfo)))
    .andStubReturn(new WorkspaceAccessLimits(CatalogMode.HIDE, true, false, false));
            eq(FeatureTypeInfo.class),
            capture(filterCapture),
            (Integer) isNull(),

代码示例来源:origin: org.geoserver.security/gs-security-tests

FeatureTypeInfo createMockFeatureType(
    String name,
    WorkspaceInfo ws,
    CatalogMode mode,
    Filter mockFilter,
    boolean read,
    boolean write) {
  DataStoreInfo mockStoreInfo = createMock(DataStoreInfo.class);
  FeatureTypeInfo mockFTInfo = createMock(FeatureTypeInfo.class);
  expect(mockFTInfo.getName()).andStubReturn(name);
  expect(mockFTInfo.getStore()).andStubReturn(mockStoreInfo);
  expect(mockStoreInfo.getWorkspace()).andStubReturn(ws);
  replay(mockStoreInfo);
  expect(manager.getAccessLimits(eq(anonymous), eq(mockFTInfo)))
      .andStubReturn(new VectorAccessLimits(mode, null, null, null, null));
  expect(mockFilter.evaluate(mockFTInfo))
      .andStubReturn(read || mode == CatalogMode.CHALLENGE);
  return mockFTInfo;
}

相关文章