Package com.sonymobile.tools.gerrit.gerritevents

Examples of com.sonymobile.tools.gerrit.gerritevents.Handler


     * @throws PluginNotFoundException throw if plugin is not found.
     * @throws PluginStatusException throw if plugin status is wrong.
     */
    @Test
    public void onReceiveTest() throws PluginNotFoundException, PluginStatusException {
        Handler handlerMock = mock(Handler.class);
        doReturn(handlerMock).when(apiMock).getHandler();

        RabbitMQMessageListenerImpl listener = new RabbitMQMessageListenerImpl();
        Whitebox.setInternalState(listener, GerritTriggerApi.class, apiMock);
        listener.onBind("TEST");
View Full Code Here


     * @throws PluginNotFoundException throw if plugin is not found.
     * @throws PluginStatusException throw if plugin status is wrong.
     */
    @Test
    public void onReceiveWithHeaderTest() throws PluginNotFoundException, PluginStatusException {
        Handler handlerMock = mock(Handler.class);
        doReturn(handlerMock).when(apiMock).getHandler();

        RabbitMQMessageListenerImpl listener = new RabbitMQMessageListenerImpl();
        Whitebox.setInternalState(listener, GerritTriggerApi.class, apiMock);

View Full Code Here

     * @throws PluginNotFoundException throw if plugin is not found.
     * @throws PluginStatusException throw if plugin status is wrong.
     */
    @Test
    public void onReceiveFromUnknownQueueTest() throws PluginNotFoundException, PluginStatusException {
        Handler handlerMock = mock(Handler.class);
        doReturn(handlerMock).when(apiMock).getHandler();

        RabbitMQMessageListenerImpl listener = new RabbitMQMessageListenerImpl();
        Whitebox.setInternalState(listener, GerritTriggerApi.class, apiMock);

View Full Code Here

     * @throws PluginNotFoundException throw if plugin is not found.
     * @throws PluginStatusException throw if plugin status is wrong.
     */
    @Test
    public void onReceiveWithUnknownContentTypeTest() throws PluginNotFoundException, PluginStatusException {
        Handler handlerMock = mock(Handler.class);
        doReturn(handlerMock).when(apiMock).getHandler();

        RabbitMQMessageListenerImpl listener = new RabbitMQMessageListenerImpl();
        Whitebox.setInternalState(listener, GerritTriggerApi.class, apiMock);

View Full Code Here

     * @throws PluginNotFoundException throw if plugin is not found.
     * @throws PluginStatusException throw if plugin status is wrong.
     */
    @Test
    public void onReceiveAfterUnbindTest() throws PluginNotFoundException, PluginStatusException {
        Handler handlerMock = mock(Handler.class);
        doReturn(handlerMock).when(apiMock).getHandler();

        RabbitMQMessageListenerImpl listener = new RabbitMQMessageListenerImpl();
        Whitebox.setInternalState(listener, GerritTriggerApi.class, apiMock);

View Full Code Here

        PluginImpl.getInstance().addServer(gerritServer);
        gerritServer.start();
        FreeStyleProject project = DuplicatesUtil.createGerritTriggeredJob(j, projectName, gerritServerName);

        GerritTriggerApi api = new GerritTriggerApi();
        Handler handler = null;
        try {
            handler = api.getHandler();
        } catch (GerritTriggerException ex) {
            fail(ex.getMessage());
        }
        assertNotNull(handler);
        handler.post(Setup.createPatchsetCreated(gerritServerName));
        TestUtils.waitForBuilds(project, 1);

        FreeStyleBuild buildOne = project.getLastCompletedBuild();
        assertSame(Result.SUCCESS, buildOne.getResult());
        assertEquals(1, project.getLastCompletedBuild().getNumber());
View Full Code Here

            if (api == null) {
                api = new GerritTriggerApi();
            }
            try {
                Handler handler = api.getHandler();
                handler.post(new String(body, "UTF-8"), provider);
            } catch (Exception ex) {
                logger.warn("No handler for Gerrit Trigger. Message would be lost.");
            }
        } else {
            logger.debug("Message from unknown queue or unknown content type. This will be discarded.");
View Full Code Here

TOP

Related Classes of com.sonymobile.tools.gerrit.gerritevents.Handler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.