コード例 #1
0
  protected void setUp() throws Exception {
    super.setUp();

    listener = new Mock(IFeedListener.class);

    feed = new DummyNetworkFeed();
    feed.addListener((IFeedListener) listener.proxy());
  }
コード例 #2
0
  protected void setUp() throws Exception {
    super.setUp();

    fileUtil = mock(FileUtil.class);

    reader = new ShuntNioRecordReader(FILE);
    reader.setRecordLength(5);
    reader.setFileUtil((FileUtil) fileUtil.proxy());
  }
コード例 #3
0
  protected void setUp() throws Exception {
    super.setUp();

    mockRequest = mock(HttpServletRequest.class);

    mockRequest
        .stubs()
        .method("getParameterNames")
        .will(returnValue(new Vector<String>().elements()));
    mockRequest.stubs().method("getRequestURI").will(returnValue("/YourRhn.do"));
  }
コード例 #4
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    ofact = getOperationFactory();
    genericCallback =
        new OperationCallback() {
          public void complete() {
            fail("Unexpected invocation");
          }

          public void receivedStatus(OperationStatus status) {
            fail("Unexpected status:  " + status);
          }
        };

    testData = new byte[64];
    new Random().nextBytes(testData);
  }
コード例 #5
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    // store initial security context for later restoration
    initialSecurityContext = SecurityContextHolder.getContext();

    SecurityContext context = new SecurityContextImpl();
    User user = new User("user");
    user.setId(1L);
    user.setPassword("password");
    user.addRole(new Role(Constants.USER_ROLE));

    UsernamePasswordAuthenticationToken token =
        new UsernamePasswordAuthenticationToken(
            user.getUsername(), user.getPassword(), user.getAuthorities());
    token.setDetails(user);
    context.setAuthentication(token);
    SecurityContextHolder.setContext(context);
  }
コード例 #6
0
 protected void setUp() throws Exception {
   super.setUp();
   connectionBuilder = new MockConnectionBuilder();
 }
コード例 #7
0
 protected void tearDown() throws Exception {
   super.tearDown();
   windowContext.close();
   KeyboardFocusManager.setCurrentKeyboardFocusManager(defaultKeyboardFocusManager);
 }
コード例 #8
0
 protected void setUp() throws Exception {
   super.setUp();
   windowContext = new DefaultWindowContext();
   defaultKeyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
 }
 protected void setUp() throws Exception {
   super.setUp();
   pico = new DefaultPicoContainer();
   mBeanProvider = new ComponentKeyConventionMBeanInfoProvider();
 }
コード例 #10
0
 protected void setUp() throws Exception {
   super.setUp();
   reflectionProvider = createReflectionProvider();
 }