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());
  }
  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"));
  }
  @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);
  }
  @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);
  }
 protected void setUp() throws Exception {
   super.setUp();
   connectionBuilder = new MockConnectionBuilder();
 }
 protected void tearDown() throws Exception {
   super.tearDown();
   windowContext.close();
   KeyboardFocusManager.setCurrentKeyboardFocusManager(defaultKeyboardFocusManager);
 }
 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();
 }
 protected void setUp() throws Exception {
   super.setUp();
   reflectionProvider = createReflectionProvider();
 }