Skip to content

Package: MockConcurrentSessionProvider

MockConcurrentSessionProvider

nameinstructionbranchcomplexitylinemethod
MockConcurrentSessionProvider()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getInstance()
M: 4 C: 4
50%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
getSessionId()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
registerListenerWithSession(UISessionListener)
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Neil Mackenzie - initial implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.core.rap.sessionprovider.concurrent.test;
15:
16: import org.eclipse.emf.ecp.core.rap.SessionProvider;
17: import org.eclipse.rap.rwt.service.UISessionListener;
18:
19: /**
20: * This s a mock session provider for testing, it does not
21: * receive a web session.
22: *
23: * @author neil
24: *
25: */
26: public class MockConcurrentSessionProvider implements SessionProvider {
27:
28:         /**
29:          * The singleton instance.
30:          */
31:         private static MockConcurrentSessionProvider instance;
32:
33:         /**
34:          * default constructor.
35:          */
36:         public MockConcurrentSessionProvider() {
37:                 instance = this;
38:         }
39:
40:         /**
41:          * returns the sessionprovider instance.
42:          *
43:          * @return the sessionprovider instance
44:          */
45:         public static MockConcurrentSessionProvider getInstance() {
46:•                if (instance == null) {
47:                         instance = new MockConcurrentSessionProvider();
48:                 }
49:                 return instance;
50:         }
51:
52:         @Override
53:         public final String getSessionId() {
54:
55:                 return Thread.currentThread().getName();
56:
57:         }
58:
59:         /**
60:          * {@inheritDoc}
61:          *
62:          * @see org.eclipse.emf.ecp.core.rap.SessionProvider#registerListenerWithSession(UISessionListener)
63:          */
64:         @Override
65:         public void registerListenerWithSession(UISessionListener listener) {
66:                 // do nothing since this is the Mock implementation.
67:         }
68:
69: }