public static HashedWheelTimerCloseable newInstance(final @Nullable ThreadFactory threadFactory,
final @Nullable Long duration, final @Nullable Integer ticksPerWheel) {
TimeUnit unit = TimeUnit.MILLISECONDS;
- if(!nullOrNonPositive(duration) && threadFactory == null && nullOrNonPositive(ticksPerWheel)) {
+ if (!nullOrNonPositive(duration) && threadFactory == null && nullOrNonPositive(ticksPerWheel)) {
return new HashedWheelTimerCloseable(new HashedWheelTimer(duration, unit));
}
- if(!nullOrNonPositive(duration) && threadFactory == null && !nullOrNonPositive(ticksPerWheel)) {
+ if (!nullOrNonPositive(duration) && threadFactory == null && !nullOrNonPositive(ticksPerWheel)) {
return new HashedWheelTimerCloseable(new HashedWheelTimer(duration, unit, ticksPerWheel));
}
- if(nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
+ if (nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
return new HashedWheelTimerCloseable(new HashedWheelTimer(threadFactory));
}
- if(!nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
+ if (!nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
return new HashedWheelTimerCloseable(
new HashedWheelTimer(threadFactory, duration, unit));
}
- if(!nullOrNonPositive(duration) && threadFactory != null && !nullOrNonPositive(ticksPerWheel)) {
+ if (!nullOrNonPositive(duration) && threadFactory != null && !nullOrNonPositive(ticksPerWheel)) {
return new HashedWheelTimerCloseable(
new HashedWheelTimer(threadFactory, duration, unit, ticksPerWheel));
}
return new HashedWheelTimerCloseable(new HashedWheelTimer());
}
- private static boolean nullOrNonPositive(final Number n) {
- return n == null || n.longValue() <= 0;
+ private static boolean nullOrNonPositive(final Number num) {
+ return num == null || num.longValue() <= 0;
}
}
final String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf.features",
"org.apache.karaf.features.core");
options = OptionUtils.combine(options, new VMOption[] {
- new VMOption("--add-reads=java.xml=java.logging"),
- new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
- new VMOption("--patch-module"),
- new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-" + karafVersion + ".jar"),
- new VMOption("--patch-module"),
- new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-" + karafVersion + ".jar"),
- new VMOption("--add-opens"),
- new VMOption("java.base/java.security=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.base/java.net=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.base/java.lang=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.base/java.util=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
- new VMOption("--add-opens"),
- new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
- new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
- new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
- new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
- new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
- new VMOption("-classpath"),
- new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
+ new VMOption("--add-reads=java.xml=java.logging"),
+ new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
+ new VMOption("--patch-module"),
+ new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-" + karafVersion + ".jar"),
+ new VMOption("--patch-module"),
+ new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-" + karafVersion + ".jar"),
+ new VMOption("--add-opens"),
+ new VMOption("java.base/java.security=ALL-UNNAMED"),
+ new VMOption("--add-opens"),
+ new VMOption("java.base/java.net=ALL-UNNAMED"),
+ new VMOption("--add-opens"),
+ new VMOption("java.base/java.lang=ALL-UNNAMED"),
+ new VMOption("--add-opens"),
+ new VMOption("java.base/java.util=ALL-UNNAMED"),
+ new VMOption("--add-opens"),
+ new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
+ new VMOption("--add-opens"),
+ new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
+ new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
+ new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
+ new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
+ new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
+ new VMOption("-classpath"),
+ new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
});
}
*
* @param eventSource the EventSource instance to register
* @return an EventSourceRegistration instance that is used to unregister the EventSource
- * via {@link EventSourceRegistration#close()}.
+ * via {@link EventSourceRegistration#close()}.
*/
<T extends EventSource> EventSourceRegistration<T> registerEventSource(T eventSource);
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-/**
- * FIXME: THis test should be moved to sal-binding-broker and rewritten to use new DataBroker API
- */
+// FIXME: THis test should be moved to sal-binding-broker and rewritten to use new DataBroker API
public class ConcurrentImplicitCreateTest extends AbstractDataServiceTest {
private static final TopLevelListKey FOO_KEY = new TopLevelListKey("foo");
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-/**
- * FIXME: THis test should be moved to compat test-suite
- */
+// FIXME: This test should be moved to compat test-suite
public class WildcardedDataChangeListenerTest extends AbstractDataTreeChangeListenerTest {
private static final TopLevelListKey TOP_LEVEL_LIST_0_KEY = new TopLevelListKey("test:0");
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
/**
- * This testsuite test Hydrogen-level API and regression for most of it,
- *
- * FIXME: this testsuite needs to be refactored to use new DataBroker API,
- * moved to sal-binding-broker-impl and uses models only from sal-test-model.
- *
+ * This testsuite test Hydrogen-level API and regression for most of it.
*/
+// FIXME: this testsuite needs to be refactored to use new DataBroker API, moved to sal-binding-broker-impl
+// and uses models only from sal-test-model.
package org.opendaylight.controller.sal.binding.test.bugfix;
\ No newline at end of file
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
/**
- * Test case for reported bug 560
+ * Test case for reported bug 560.
*
* @author Lukas Sedlak
* @see <a
*/
public class DOMRpcServiceTestBugfix560 {
- private final static String RPC_SERVICE_NAMESPACE = "urn:opendaylight:params:xml:ns:yang:controller:md:sal:test:bi:ba:rpcservice";
- private final static String REVISION_DATE = "2014-07-01";
- private final static QName RPC_NAME = QName.create(RPC_SERVICE_NAMESPACE,
- REVISION_DATE, "rock-the-house");
+ private static final String RPC_SERVICE_NAMESPACE =
+ "urn:opendaylight:params:xml:ns:yang:controller:md:sal:test:bi:ba:rpcservice";
+ private static final String REVISION_DATE = "2014-07-01";
+ private static final QName RPC_NAME = QName.create(RPC_SERVICE_NAMESPACE, REVISION_DATE, "rock-the-house");
private static final String TLL_NAME = "id";
private static final QName TLL_NAME_QNAME = QName.create(TopLevelList.QNAME, "name");
private static final InstanceIdentifier<TopLevelList> BA_MOUNT_ID = createBATllIdentifier(TLL_NAME);
- private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_MOUNT_ID = createBITllIdentifier(TLL_NAME);
+ private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_MOUNT_ID =
+ createBITllIdentifier(TLL_NAME);
private BindingTestContext testContext;
private DOMMountPointService domMountPointService;
private MountPointService bindingMountPointService;
private SchemaContext schemaContext;
- /**
- * @throws java.lang.Exception
- */
@Before
public void setUp() throws Exception {
final BindingBrokerTestFactory testFactory = new BindingBrokerTestFactory();
@Test
public void test() throws ExecutionException, InterruptedException {
// FIXME: This is made to only make sure instance identifier codec for path is instantiated.
- domMountPointService
- .createMountPoint(BI_MOUNT_ID).addService(DOMRpcService.class, new DOMRpcService() {
-
- @Override
- public <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(final T arg0) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath arg0, final NormalizedNode<?, ?> arg1) {
- final DOMRpcResult result = new DefaultDOMRpcResult((NormalizedNode<?, ?>) null);
- return Futures.immediateCheckedFuture(result);
- }
- }).register();
+ domMountPointService.createMountPoint(BI_MOUNT_ID).addService(DOMRpcService.class, new DOMRpcService() {
+ @Override
+ public <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(final T arg0) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath arg0,
+ final NormalizedNode<?, ?> arg1) {
+ return Futures.immediateCheckedFuture(new DefaultDOMRpcResult((NormalizedNode<?, ?>) null));
+ }
+ }).register();
final Optional<MountPoint> mountInstance = bindingMountPointService.getMountPoint(BA_MOUNT_ID);
assertTrue(mountInstance.isPresent());
}
}
- /**
- * @throws java.lang.Exception
- */
@After
public void teardown() {
testContext.close();
return knockKnockResult;
}
- public MessageCapturingFlowService setKnockKnockResult(final ListenableFuture<RpcResult<KnockKnockOutput>> kkOutput) {
+ public MessageCapturingFlowService setKnockKnockResult(
+ final ListenableFuture<RpcResult<KnockKnockOutput>> kkOutput) {
this.knockKnockResult = kkOutput;
return this;
}
registration.close();
}
- public MessageCapturingFlowService registerPath(final Class<? extends BaseIdentity> context, final InstanceIdentifier<?> path) {
+ public MessageCapturingFlowService registerPath(final Class<? extends BaseIdentity> context,
+ final InstanceIdentifier<?> path) {
registration.registerPath(context, path);
return this;
}
- public MessageCapturingFlowService unregisterPath(final Class<? extends BaseIdentity> context, final InstanceIdentifier<?> path) {
+ public MessageCapturingFlowService unregisterPath(final Class<? extends BaseIdentity> context,
+ final InstanceIdentifier<?> path) {
registration.unregisterPath(context, path);
return this;
}
receivedKnocks.put(input.getKnockerId(), input);
return knockKnockResult;
}
-
-
}