target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testInScope() throws Exception { final int limit = 10; StringBuilder constant = new StringBuilder("hello"); final boolean[] ran = new boolean[1]; class One implements ThrowingFunction<Integer, Void> { @Override public Void apply(Integer argument) throws Exception { ran[0] = true; assertNotNull(depende... | public boolean inScope() { List<?> l = this.lists.get(); return l != null && !l.isEmpty(); } | ReentrantScope extends AbstractScope { public boolean inScope() { List<?> l = this.lists.get(); return l != null && !l.isEmpty(); } } | ReentrantScope extends AbstractScope { public boolean inScope() { List<?> l = this.lists.get(); return l != null && !l.isEmpty(); } ReentrantScope(); ReentrantScope(Provider<String> injectionInfoProvider); } | ReentrantScope extends AbstractScope { public boolean inScope() { List<?> l = this.lists.get(); return l != null && !l.isEmpty(); } ReentrantScope(); ReentrantScope(Provider<String> injectionInfoProvider); QuietAutoCloseable enter(Object... o); @Override void exit(); boolean inScope(); } | ReentrantScope extends AbstractScope { public boolean inScope() { List<?> l = this.lists.get(); return l != null && !l.isEmpty(); } ReentrantScope(); ReentrantScope(Provider<String> injectionInfoProvider); QuietAutoCloseable enter(Object... o); @Override void exit(); boolean inScope(); } |
@Test public void testSomeMethod() throws IOException, InterruptedException, ExecutionException { Dependencies deps = new Dependencies(new M()); Thing thing = deps.getInstance(Thing.class); ExecutorService exe = deps.getInstance(ExecutorService.class); assertNotNull(exe); assertSame(thing.p.get(), exe); exe.submit(() -... | @Override public ExecutorService get() { ExecutorService result = null; if (registered.compareAndSet(false, true)) { synchronized (this) { if (exe == null) { result = exe = svc.get(); reg.get().add(exe); } else { result = exe; } } } if (result == null) { synchronized (this) { result = exe; } assert result != null; } re... | ExecutorServiceProvider implements Provider<ExecutorService> { @Override public ExecutorService get() { ExecutorService result = null; if (registered.compareAndSet(false, true)) { synchronized (this) { if (exe == null) { result = exe = svc.get(); reg.get().add(exe); } else { result = exe; } } } if (result == null) { sy... | ExecutorServiceProvider implements Provider<ExecutorService> { @Override public ExecutorService get() { ExecutorService result = null; if (registered.compareAndSet(false, true)) { synchronized (this) { if (exe == null) { result = exe = svc.get(); reg.get().add(exe); } else { result = exe; } } } if (result == null) { sy... | ExecutorServiceProvider implements Provider<ExecutorService> { @Override public ExecutorService get() { ExecutorService result = null; if (registered.compareAndSet(false, true)) { synchronized (this) { if (exe == null) { result = exe = svc.get(); reg.get().add(exe); } else { result = exe; } } } if (result == null) { sy... | ExecutorServiceProvider implements Provider<ExecutorService> { @Override public ExecutorService get() { ExecutorService result = null; if (registered.compareAndSet(false, true)) { synchronized (this) { if (exe == null) { result = exe = svc.get(); reg.get().add(exe); } else { result = exe; } } } if (result == null) { sy... |
@Test public void testNamedSettings() throws Throwable { MutableSettings settings = SettingsBuilder.createDefault().buildMutableSettings(); settings.setString("stuff", "This is stuff"); assertEquals("This is stuff", settings.getString("stuff")); assertTrue(settings.allKeys().contains("stuff")); assertTrue(settings.toPr... | public <T> T getInstance(Class<T> type) { return getInjector().getInstance(type); } | Dependencies { public <T> T getInstance(Class<T> type) { return getInjector().getInstance(type); } } | Dependencies { public <T> T getInstance(Class<T> type) { return getInjector().getInstance(type); } Dependencies(Module... modules); Dependencies(Settings configuration, Module... modules); Dependencies(boolean mergeNamespaces, Map<String, Settings> settings, Set<SettingsBindings> settingsBindings, Module... modules)... | Dependencies { public <T> T getInstance(Class<T> type) { return getInjector().getInstance(type); } Dependencies(Module... modules); Dependencies(Settings configuration, Module... modules); Dependencies(boolean mergeNamespaces, Map<String, Settings> settings, Set<SettingsBindings> settingsBindings, Module... modules)... | Dependencies { public <T> T getInstance(Class<T> type) { return getInjector().getInstance(type); } Dependencies(Module... modules); Dependencies(Settings configuration, Module... modules); Dependencies(boolean mergeNamespaces, Map<String, Settings> settings, Set<SettingsBindings> settingsBindings, Module... modules)... |
@Test public void testSimpleDelay() throws Throwable { Runner run = new Runner(); Reschedulable r = rs.withSimpleDelay(Duration.ofMillis(100), run); run.assertWasNotRun(); Thread.sleep(150); run.assertWasNotRun(); long now = System.currentTimeMillis(); r.touch(); Thread.sleep(150); run.assertWasRun(); run.assertRunCoun... | public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } } | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... |
@Test public void testTemporaryDelay() throws Throwable { Runner run = new Runner(); Reschedulable r = rs.withSimpleDelay(Duration.ofMillis(100), run); run.assertWasNotRun(); Thread.sleep(150); run.assertWasNotRun(); long now = System.currentTimeMillis(); r.touch(Duration.ofMillis(200)); Thread.sleep(150); run.assertWa... | public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } } | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... |
@Test public void testResettingDelay() throws Throwable { Runner run = new Runner(); Reschedulable r = rs.withResettingDelay(Duration.ofMillis(100), run); run.assertWasNotRun(); r.touch(); Thread.sleep(40); long now = System.currentTimeMillis(); r.touch(); Thread.sleep(150); run.assertWasRun(); run.assertRunCount(1); u... | public Reschedulable withResettingDelay(Duration delay, Runnable runnable) { return withResettingDelay(delay, new CallableForRunnable(runnable)); } | Reschedulables { public Reschedulable withResettingDelay(Duration delay, Runnable runnable) { return withResettingDelay(delay, new CallableForRunnable(runnable)); } } | Reschedulables { public Reschedulable withResettingDelay(Duration delay, Runnable runnable) { return withResettingDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegi... | Reschedulables { public Reschedulable withResettingDelay(Duration delay, Runnable runnable) { return withResettingDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegi... | Reschedulables { public Reschedulable withResettingDelay(Duration delay, Runnable runnable) { return withResettingDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegi... |
@Test public void testSettingDelay() throws Throwable { Runner run = new Runner(); Reschedulable r = rs.withSimpleDelay(Duration.ofMillis(100), run); run.assertWasNotRun(); long now = System.currentTimeMillis(); r.touch(Duration.ofMillis(200)); Thread.sleep(120); run.assertWasNotRun(); Thread.sleep(100); run.assertWasR... | public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } } | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... | Reschedulables { public Reschedulable withSimpleDelay(Duration delay, Runnable runnable) { return withSimpleDelay(delay, new CallableForRunnable(runnable)); } @Inject Reschedulables(Settings settings, ShutdownHookRegistry reg, UncaughtExceptionHandler onError); private Reschedulables(int count, ShutdownHookRegistry r... |
@Test public void testRollback(@Named("stuff") Provider<MongoCollection<Document>> stuff, @Named("migrations") Provider<MongoCollection<Document>> migrations, Provider<MongoDatabase> db, Provider<MongoClient> client, Provider<Dependencies> deps) throws InterruptedException, Throwable { Function<Class<? extends Migratio... | private void rollback(MongoDatabase db, Document agg) { CountDownLatch latch = new CountDownLatch(backupQueryForCollection.size() - 1); Document rollbacks = new Document(); agg.append("rollback", rollbacks); for (String s : backupQueryForCollection.keySet()) { MongoCollection<Document> from = db.getCollection(backupCol... | Migration { private void rollback(MongoDatabase db, Document agg) { CountDownLatch latch = new CountDownLatch(backupQueryForCollection.size() - 1); Document rollbacks = new Document(); agg.append("rollback", rollbacks); for (String s : backupQueryForCollection.keySet()) { MongoCollection<Document> from = db.getCollecti... | Migration { private void rollback(MongoDatabase db, Document agg) { CountDownLatch latch = new CountDownLatch(backupQueryForCollection.size() - 1); Document rollbacks = new Document(); agg.append("rollback", rollbacks); for (String s : backupQueryForCollection.keySet()) { MongoCollection<Document> from = db.getCollecti... | Migration { private void rollback(MongoDatabase db, Document agg) { CountDownLatch latch = new CountDownLatch(backupQueryForCollection.size() - 1); Document rollbacks = new Document(); agg.append("rollback", rollbacks); for (String s : backupQueryForCollection.keySet()) { MongoCollection<Document> from = db.getCollecti... | Migration { private void rollback(MongoDatabase db, Document agg) { CountDownLatch latch = new CountDownLatch(backupQueryForCollection.size() - 1); Document rollbacks = new Document(); agg.append("rollback", rollbacks); for (String s : backupQueryForCollection.keySet()) { MongoCollection<Document> from = db.getCollecti... |
@Test @DisplayName("publish messages individually") void publishMessagesIndividually() throws Exception { Channel ch = connection.createChannel(); ch.confirmSelect(); for (int i = 0; i < messageCount; i++) { String body = String.valueOf(i); ch.basicPublish("", queue, null, body.getBytes()); ch.waitForConfirmsOrDie(5_00... | static void publishMessagesIndividually() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); long start = System.nanoTime(); for (int i = 0; i < ... | PublisherConfirms { static void publishMessagesIndividually() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); long start = System.nanoTime(); ... | PublisherConfirms { static void publishMessagesIndividually() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); long start = System.nanoTime(); ... | PublisherConfirms { static void publishMessagesIndividually() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); long start = System.nanoTime(); ... | PublisherConfirms { static void publishMessagesIndividually() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); long start = System.nanoTime(); ... |
@Test @DisplayName("publish messages in batch") void publishMessagesInBatch() throws Exception { Channel ch = connection.createChannel(); ch.confirmSelect(); int batchSize = 100; int outstandingMessageCount = 0; for (int i = 0; i < messageCount; i++) { String body = String.valueOf(i); ch.basicPublish("", queue, null, b... | static void publishMessagesInBatch() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); int batchSize = 100; int outstandingMessageCount = 0; lon... | PublisherConfirms { static void publishMessagesInBatch() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); int batchSize = 100; int outstandingM... | PublisherConfirms { static void publishMessagesInBatch() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); int batchSize = 100; int outstandingM... | PublisherConfirms { static void publishMessagesInBatch() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); int batchSize = 100; int outstandingM... | PublisherConfirms { static void publishMessagesInBatch() throws Exception { try (Connection connection = createConnection()) { Channel ch = connection.createChannel(); String queue = UUID.randomUUID().toString(); ch.queueDeclare(queue, false, false, true, null); ch.confirmSelect(); int batchSize = 100; int outstandingM... |
@Test @DisplayName("allow max of outstanding confirms") void allowMaxOfOutstandingConfirms() throws Exception { int maxOutstandingConfirms = 100; Semaphore semaphore = new Semaphore(maxOutstandingConfirms); Channel ch = connection.createChannel(); ch.confirmSelect(); ConcurrentSkipListSet<Long> outstandingConfirms = ne... | static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } static void main(String[] args); } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } static void main(String[] args); } |
@Test @DisplayName("resend unconfirmed messages") void resendUnconfirmedMessagesIntegration() throws Exception { Channel ch = connection.createChannel(); ch.confirmSelect(); Map<Long, String> outstandingConfirms = resendUnconfirmedMessages(ch); assertThat(waitUntil(Duration.ofSeconds(5), () -> outstandingConfirms.isEmp... | static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } static void main(String[] args); } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } static void main(String[] args); } |
@Test @DisplayName("resend unconfirmed messages with lower bound and map confirm handling") void resendUnconfirmedMessagesUseLowerBoundAndConcurrentMapIntegration() throws Exception { Channel ch = connection.createChannel(); ch.confirmSelect(); Map<Long, String> outstandingConfirms = resendUnconfirmedMessagesUseLowerBo... | static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } static void main(String[] args); } | PublisherConfirms { static boolean waitUntil(Duration timeout, BooleanSupplier condition) throws InterruptedException { int waited = 0; while (!condition.getAsBoolean() && waited < timeout.toMillis()) { Thread.sleep(100L); waited = +100; } return condition.getAsBoolean(); } static void main(String[] args); } |
@Test public void testHessianProtocol() { HessianServiceImpl server = new HessianServiceImpl(); Assertions.assertFalse(server.isCalled()); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).get... | public HessianProtocol() { super(HessianException.class); } | HessianProtocol extends AbstractProxyProtocol { public HessianProtocol() { super(HessianException.class); } } | HessianProtocol extends AbstractProxyProtocol { public HessianProtocol() { super(HessianException.class); } HessianProtocol(); } | HessianProtocol extends AbstractProxyProtocol { public HessianProtocol() { super(HessianException.class); } HessianProtocol(); void setHttpBinder(HttpBinder httpBinder); @Override int getDefaultPort(); @Override void destroy(); } | HessianProtocol extends AbstractProxyProtocol { public HessianProtocol() { super(HessianException.class); } HessianProtocol(); void setHttpBinder(HttpBinder httpBinder); @Override int getDefaultPort(); @Override void destroy(); } |
@Test public void testEagerThreadPool() throws Exception { String name = "eager-tf"; int queues = 5; int cores = 5; int threads = 10; long alive = 1000; TaskQueue<Runnable> taskQueue = new TaskQueue<Runnable>(queues); final EagerThreadPoolExecutor executor = new EagerThreadPoolExecutor(cores, threads, alive, TimeUnit.M... | @Override public void execute(Runnable command) { if (command == null) { throw new NullPointerException(); } submittedTaskCount.incrementAndGet(); try { super.execute(command); } catch (RejectedExecutionException rx) { final TaskQueue queue = (TaskQueue) super.getQueue(); try { if (!queue.retryOffer(command, 0, TimeUni... | EagerThreadPoolExecutor extends ThreadPoolExecutor { @Override public void execute(Runnable command) { if (command == null) { throw new NullPointerException(); } submittedTaskCount.incrementAndGet(); try { super.execute(command); } catch (RejectedExecutionException rx) { final TaskQueue queue = (TaskQueue) super.getQue... | EagerThreadPoolExecutor extends ThreadPoolExecutor { @Override public void execute(Runnable command) { if (command == null) { throw new NullPointerException(); } submittedTaskCount.incrementAndGet(); try { super.execute(command); } catch (RejectedExecutionException rx) { final TaskQueue queue = (TaskQueue) super.getQue... | EagerThreadPoolExecutor extends ThreadPoolExecutor { @Override public void execute(Runnable command) { if (command == null) { throw new NullPointerException(); } submittedTaskCount.incrementAndGet(); try { super.execute(command); } catch (RejectedExecutionException rx) { final TaskQueue queue = (TaskQueue) super.getQue... | EagerThreadPoolExecutor extends ThreadPoolExecutor { @Override public void execute(Runnable command) { if (command == null) { throw new NullPointerException(); } submittedTaskCount.incrementAndGet(); try { super.execute(command); } catch (RejectedExecutionException rx) { final TaskQueue queue = (TaskQueue) super.getQue... |
@Test public void getExecutor1() throws Exception { URL url = URL.valueOf("dubbo: Constants.THREAD_NAME_KEY + "=demo&" + Constants.CORE_THREADS_KEY + "=1&" + Constants.THREADS_KEY + "=2&" + Constants.ALIVE_KEY + "=1000&" + Constants.QUEUES_KEY + "=0"); ThreadPool threadPool = new EagerThreadPool(); ThreadPoolExecutor e... | @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KEY, Integer.MAX_VALUE); int queues = url.... | EagerThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KE... | EagerThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KE... | EagerThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KE... | EagerThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KE... |
@Test public void getExecutor2() throws Exception { URL url = URL.valueOf("dubbo: ThreadPool threadPool = new EagerThreadPool(); ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor(url); assertThat(executor.getQueue().remainingCapacity(), is(2)); } | @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KEY, Integer.MAX_VALUE); int queues = url.... | EagerThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KE... | EagerThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KE... | EagerThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KE... | EagerThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KE... |
@Test public void getExecutor1() throws Exception { URL url = URL.valueOf("dubbo: Constants.THREAD_NAME_KEY + "=demo&" + Constants.CORE_THREADS_KEY + "=1&" + Constants.THREADS_KEY + "=2&" + Constants.QUEUES_KEY + "=0"); ThreadPool threadPool = new FixedThreadPool(); ThreadPoolExecutor executor = (ThreadPoolExecutor) th... | @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES); return new ThreadPoo... | FixedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constan... | FixedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constan... | FixedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constan... | FixedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constan... |
@Test public void getExecutor2() throws Exception { URL url = URL.valueOf("dubbo: ThreadPool threadPool = new FixedThreadPool(); ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor(url); assertThat(executor.getQueue(), Matchers.<BlockingQueue<Runnable>>instanceOf(LinkedBlockingQueue.class)); } | @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES); return new ThreadPoo... | FixedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constan... | FixedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constan... | FixedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constan... | FixedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS); int queues = url.getParameter(Constants.QUEUES_KEY, Constan... |
@Test public void getExecutor1() throws Exception { URL url = URL.valueOf("dubbo: Constants.THREAD_NAME_KEY + "=demo&" + Constants.CORE_THREADS_KEY + "=1&" + Constants.THREADS_KEY + "=2&" + Constants.ALIVE_KEY + "=1000&" + Constants.QUEUES_KEY + "=0"); ThreadPool threadPool = new CachedThreadPool(); ThreadPoolExecutor ... | @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KEY, Integer.MAX_VALUE); int queues = url.... | CachedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_K... | CachedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_K... | CachedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_K... | CachedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_K... |
@Test public void getExecutor2() throws Exception { URL url = URL.valueOf("dubbo: ThreadPool threadPool = new CachedThreadPool(); ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor(url); assertThat(executor.getQueue(), Matchers.<BlockingQueue<Runnable>>instanceOf(LinkedBlockingQueue.class)); } | @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_KEY, Integer.MAX_VALUE); int queues = url.... | CachedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_K... | CachedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_K... | CachedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_K... | CachedThreadPool implements ThreadPool { @Override public Executor getExecutor(URL url) { String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME); int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS); int threads = url.getParameter(Constants.THREADS_K... |
@Test public void test_watch_when_create_path() throws InterruptedException { String path = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers"; String child = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers/demoService1"; final CountDownLatch notNotified = new CountDownLatch(1); ChildListener childListener = (p... | @Override public void delete(String path) { clientWrapper.delete(path); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... |
@Test public void testJsonrpcProtocol() { JsonRpcServiceImpl server = new JsonRpcServiceImpl(); assertFalse(server.isCalled()); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExt... | public JsonRpcProtocol() { super(HttpException.class, JsonRpcClientException.class); } | JsonRpcProtocol extends AbstractProxyProtocol { public JsonRpcProtocol() { super(HttpException.class, JsonRpcClientException.class); } } | JsonRpcProtocol extends AbstractProxyProtocol { public JsonRpcProtocol() { super(HttpException.class, JsonRpcClientException.class); } JsonRpcProtocol(); } | JsonRpcProtocol extends AbstractProxyProtocol { public JsonRpcProtocol() { super(HttpException.class, JsonRpcClientException.class); } JsonRpcProtocol(); void setHttpBinder(HttpBinder httpBinder); @Override int getDefaultPort(); @Override void destroy(); } | JsonRpcProtocol extends AbstractProxyProtocol { public JsonRpcProtocol() { super(HttpException.class, JsonRpcClientException.class); } JsonRpcProtocol(); void setHttpBinder(HttpBinder httpBinder); @Override int getDefaultPort(); @Override void destroy(); static final String ACCESS_CONTROL_ALLOW_ORIGIN_HEADER; static fi... |
@Test public void test_watch_when_modify() { String path = "/dubbo/config/jetcd-client-unit-test/configurators"; String endpoint = "http: CountDownLatch latch = new CountDownLatch(1); ByteSequence key = ByteSequence.from(path, UTF_8); Watch.Listener listener = Watch.listener(response -> { for (WatchEvent event : respon... | @Override public boolean put(String key, String value) { return clientWrapper.put(key, value); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public boolean put(String key, String value) { return clientWrapper.put(key, value); } } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public boolean put(String key, String value) { return clientWrapper.put(key, value); } JEtcdClient(URL url); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public boolean put(String key, String value) { return clientWrapper.put(key, value); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String pat... | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public boolean put(String key, String value) { return clientWrapper.put(key, value); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String pat... |
@Test public void test_watch_when_create_wrong_path() throws InterruptedException { String path = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers"; String child = "/dubbo/com.alibaba.dubbo.demo.DemoService/routers/demoService1"; final CountDownLatch notNotified = new CountDownLatch(1); ChildListener childListener ... | @Override public void delete(String path) { clientWrapper.delete(path); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... |
@Test public void test_watch_when_delete_path() throws InterruptedException { String path = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers"; String child = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers/demoService1"; final CountDownLatch notNotified = new CountDownLatch(1); ChildListener childListener = (p... | @Override public void delete(String path) { clientWrapper.delete(path); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... |
@Test public void test_watch_then_unwatch() throws InterruptedException { String path = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers"; String child = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers/demoService2"; final CountDownLatch notNotified = new CountDownLatch(1); final CountDownLatch notTwiceNotifie... | @Override public void delete(String path) { clientWrapper.delete(path); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... |
@Test public void test_watch_on_recoverable_connection() throws InterruptedException { String path = "/dubbo/com.alibaba.dubbo.demo.DemoService/connection"; String child = "/dubbo/com.alibaba.dubbo.demo.DemoService/connection/demoService1"; final CountDownLatch notNotified = new CountDownLatch(1); final CountDownLatch ... | @Override public void delete(String path) { clientWrapper.delete(path); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); } | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... | JEtcdClient extends AbstractEtcdClient<JEtcdClient.EtcdWatcher> { @Override public void delete(String path) { clientWrapper.delete(path); } JEtcdClient(URL url); @Override void doCreatePersistent(String path); @Override long doCreateEphemeral(String path); @Override boolean checkExists(String path); @Override EtcdWatch... |
@Test public void testJoin() throws RemotingException, InterruptedException { final String groupURL = "multicast: MulticastExchangeNetworker multicastExchangeNetworker = new MulticastExchangeNetworker(); final CountDownLatch countDownLatch = new CountDownLatch(1); Peer peer1 = multicastExchangeNetworker.lookup(URL.valu... | @Override public ExchangeGroup lookup(URL url) throws RemotingException { return new MulticastExchangeGroup(url); } | MulticastExchangeNetworker implements ExchangeNetworker { @Override public ExchangeGroup lookup(URL url) throws RemotingException { return new MulticastExchangeGroup(url); } } | MulticastExchangeNetworker implements ExchangeNetworker { @Override public ExchangeGroup lookup(URL url) throws RemotingException { return new MulticastExchangeGroup(url); } } | MulticastExchangeNetworker implements ExchangeNetworker { @Override public ExchangeGroup lookup(URL url) throws RemotingException { return new MulticastExchangeGroup(url); } @Override ExchangeGroup lookup(URL url); } | MulticastExchangeNetworker implements ExchangeNetworker { @Override public ExchangeGroup lookup(URL url) throws RemotingException { return new MulticastExchangeGroup(url); } @Override ExchangeGroup lookup(URL url); } |
@Test public void testJoin(@TempDir Path folder) throws RemotingException, InterruptedException { final String groupURL = "file: FileNetworker networker = new FileNetworker(); Group group = networker.lookup(URL.valueOf(groupURL)); final CountDownLatch countDownLatch = new CountDownLatch(1); Peer peer1 = group.join(URL.... | @Override public Group lookup(URL url) throws RemotingException { return new FileGroup(url); } | FileNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new FileGroup(url); } } | FileNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new FileGroup(url); } } | FileNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new FileGroup(url); } @Override Group lookup(URL url); } | FileNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new FileGroup(url); } @Override Group lookup(URL url); } |
@Test public void testJoin() throws RemotingException, InterruptedException { final String groupURL = "multicast: final String peerURL = "dubbo: final CountDownLatch countDownLatch = new CountDownLatch(1); Peer peer1 = Networkers.join(groupURL, peerURL, new ChannelHandlerAdapter() { @Override public void received(Chann... | @Override public Group lookup(URL url) throws RemotingException { return new MulticastGroup(url); } | MulticastNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new MulticastGroup(url); } } | MulticastNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new MulticastGroup(url); } } | MulticastNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new MulticastGroup(url); } @Override Group lookup(URL url); } | MulticastNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new MulticastGroup(url); } @Override Group lookup(URL url); } |
@Test public void testTimeout() throws Exception { try { System.clearProperty("sun.rmi.transport.tcp.responseTimeout"); ConsumerConfig consumer = new ConsumerConfig(); consumer.setTimeout(10); assertThat(consumer.getTimeout(), is(10)); assertThat(System.getProperty("sun.rmi.transport.tcp.responseTimeout"), equalTo("10"... | @Override public void setTimeout(Integer timeout) { super.setTimeout(timeout); String rmiTimeout = System.getProperty("sun.rmi.transport.tcp.responseTimeout"); if (timeout != null && timeout > 0 && (StringUtils.isEmpty(rmiTimeout))) { System.setProperty("sun.rmi.transport.tcp.responseTimeout", String.valueOf(timeout));... | ConsumerConfig extends AbstractReferenceConfig { @Override public void setTimeout(Integer timeout) { super.setTimeout(timeout); String rmiTimeout = System.getProperty("sun.rmi.transport.tcp.responseTimeout"); if (timeout != null && timeout > 0 && (StringUtils.isEmpty(rmiTimeout))) { System.setProperty("sun.rmi.transpor... | ConsumerConfig extends AbstractReferenceConfig { @Override public void setTimeout(Integer timeout) { super.setTimeout(timeout); String rmiTimeout = System.getProperty("sun.rmi.transport.tcp.responseTimeout"); if (timeout != null && timeout > 0 && (StringUtils.isEmpty(rmiTimeout))) { System.setProperty("sun.rmi.transpor... | ConsumerConfig extends AbstractReferenceConfig { @Override public void setTimeout(Integer timeout) { super.setTimeout(timeout); String rmiTimeout = System.getProperty("sun.rmi.transport.tcp.responseTimeout"); if (timeout != null && timeout > 0 && (StringUtils.isEmpty(rmiTimeout))) { System.setProperty("sun.rmi.transpor... | ConsumerConfig extends AbstractReferenceConfig { @Override public void setTimeout(Integer timeout) { super.setTimeout(timeout); String rmiTimeout = System.getProperty("sun.rmi.transport.tcp.responseTimeout"); if (timeout != null && timeout > 0 && (StringUtils.isEmpty(rmiTimeout))) { System.setProperty("sun.rmi.transpor... |
@Test public void testEnvironment2() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> { ApplicationConfig application = new ApplicationConfig("app"); application.setEnvironment("illegal-env"); }); } | public void setEnvironment(String environment) { checkName(Constants.ENVIRONMENT, environment); if (environment != null) { if (!(Constants.DEVELOPMENT_ENVIRONMENT.equals(environment) || Constants.TEST_ENVIRONMENT.equals(environment) || Constants.PRODUCTION_ENVIRONMENT.equals(environment))) { throw new IllegalStateExcep... | ApplicationConfig extends AbstractConfig { public void setEnvironment(String environment) { checkName(Constants.ENVIRONMENT, environment); if (environment != null) { if (!(Constants.DEVELOPMENT_ENVIRONMENT.equals(environment) || Constants.TEST_ENVIRONMENT.equals(environment) || Constants.PRODUCTION_ENVIRONMENT.equals(e... | ApplicationConfig extends AbstractConfig { public void setEnvironment(String environment) { checkName(Constants.ENVIRONMENT, environment); if (environment != null) { if (!(Constants.DEVELOPMENT_ENVIRONMENT.equals(environment) || Constants.TEST_ENVIRONMENT.equals(environment) || Constants.PRODUCTION_ENVIRONMENT.equals(e... | ApplicationConfig extends AbstractConfig { public void setEnvironment(String environment) { checkName(Constants.ENVIRONMENT, environment); if (environment != null) { if (!(Constants.DEVELOPMENT_ENVIRONMENT.equals(environment) || Constants.TEST_ENVIRONMENT.equals(environment) || Constants.PRODUCTION_ENVIRONMENT.equals(e... | ApplicationConfig extends AbstractConfig { public void setEnvironment(String environment) { checkName(Constants.ENVIRONMENT, environment); if (environment != null) { if (!(Constants.DEVELOPMENT_ENVIRONMENT.equals(environment) || Constants.TEST_ENVIRONMENT.equals(environment) || Constants.PRODUCTION_ENVIRONMENT.equals(e... |
@Test public void testJsonrpcProtocolForServerJetty9() { JsonRpcServiceImpl server = new JsonRpcServiceImpl(); assertFalse(server.isCalled()); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class)... | @Override public void destroy() { super.destroy(); for (String key : new ArrayList<>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close jsonrpc server " + server.getUrl()); } server.close(); } catch (Throwable t) { logger.warn(t... | JsonRpcProtocol extends AbstractProxyProtocol { @Override public void destroy() { super.destroy(); for (String key : new ArrayList<>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close jsonrpc server " + server.getUrl()); } serve... | JsonRpcProtocol extends AbstractProxyProtocol { @Override public void destroy() { super.destroy(); for (String key : new ArrayList<>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close jsonrpc server " + server.getUrl()); } serve... | JsonRpcProtocol extends AbstractProxyProtocol { @Override public void destroy() { super.destroy(); for (String key : new ArrayList<>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close jsonrpc server " + server.getUrl()); } serve... | JsonRpcProtocol extends AbstractProxyProtocol { @Override public void destroy() { super.destroy(); for (String key : new ArrayList<>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close jsonrpc server " + server.getUrl()); } serve... |
@Test public void testParameters() throws Exception { ApplicationConfig application = new ApplicationConfig("app"); application.setQosAcceptForeignIp(true); Map<String, String> parameters = new HashMap<String, String>(); parameters.put("k1", "v1"); ApplicationConfig.appendParameters(parameters, application); assertThat... | public void setQosAcceptForeignIp(Boolean qosAcceptForeignIp) { this.qosAcceptForeignIp = qosAcceptForeignIp; } | ApplicationConfig extends AbstractConfig { public void setQosAcceptForeignIp(Boolean qosAcceptForeignIp) { this.qosAcceptForeignIp = qosAcceptForeignIp; } } | ApplicationConfig extends AbstractConfig { public void setQosAcceptForeignIp(Boolean qosAcceptForeignIp) { this.qosAcceptForeignIp = qosAcceptForeignIp; } ApplicationConfig(); ApplicationConfig(String name); } | ApplicationConfig extends AbstractConfig { public void setQosAcceptForeignIp(Boolean qosAcceptForeignIp) { this.qosAcceptForeignIp = qosAcceptForeignIp; } ApplicationConfig(); ApplicationConfig(String name); @Parameter(key = Constants.APPLICATION_KEY, required = true, useKeyAsProperty = false) String getName(); void s... | ApplicationConfig extends AbstractConfig { public void setQosAcceptForeignIp(Boolean qosAcceptForeignIp) { this.qosAcceptForeignIp = qosAcceptForeignIp; } ApplicationConfig(); ApplicationConfig(String name); @Parameter(key = Constants.APPLICATION_KEY, required = true, useKeyAsProperty = false) String getName(); void s... |
@Test public void testCheckRegistry2() { Assertions.assertThrows(IllegalStateException.class, () -> { InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkRegistry(); }); } | protected void checkRegistry() { loadRegistriesFromBackwardConfig(); convertRegistryIdsToRegistries(); for (RegistryConfig registryConfig : registries) { if (!registryConfig.isValid()) { throw new IllegalStateException("No registry config found or it's not a valid config! " + "The registry config is: " + registryConfig... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkRegistry() { loadRegistriesFromBackwardConfig(); convertRegistryIdsToRegistries(); for (RegistryConfig registryConfig : registries) { if (!registryConfig.isValid()) { throw new IllegalStateException("No registry config found or it's not a valid ... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkRegistry() { loadRegistriesFromBackwardConfig(); convertRegistryIdsToRegistries(); for (RegistryConfig registryConfig : registries) { if (!registryConfig.isValid()) { throw new IllegalStateException("No registry config found or it's not a valid ... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkRegistry() { loadRegistriesFromBackwardConfig(); convertRegistryIdsToRegistries(); for (RegistryConfig registryConfig : registries) { if (!registryConfig.isValid()) { throw new IllegalStateException("No registry config found or it's not a valid ... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkRegistry() { loadRegistriesFromBackwardConfig(); convertRegistryIdsToRegistries(); for (RegistryConfig registryConfig : registries) { if (!registryConfig.isValid()) { throw new IllegalStateException("No registry config found or it's not a valid ... |
@Test public void checkApplication2() { Assertions.assertThrows(IllegalStateException.class, () -> { InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkApplication(); }); } | @SuppressWarnings("deprecation") protected void checkApplication() { createApplicationIfAbsent(); if (!application.isValid()) { throw new IllegalStateException("No application config found or it's not a valid config! " + "Please add <dubbo:application name=\"...\" /> to your spring config."); } ApplicationModel.setAppl... | AbstractInterfaceConfig extends AbstractMethodConfig { @SuppressWarnings("deprecation") protected void checkApplication() { createApplicationIfAbsent(); if (!application.isValid()) { throw new IllegalStateException("No application config found or it's not a valid config! " + "Please add <dubbo:application name=\"...\" ... | AbstractInterfaceConfig extends AbstractMethodConfig { @SuppressWarnings("deprecation") protected void checkApplication() { createApplicationIfAbsent(); if (!application.isValid()) { throw new IllegalStateException("No application config found or it's not a valid config! " + "Please add <dubbo:application name=\"...\" ... | AbstractInterfaceConfig extends AbstractMethodConfig { @SuppressWarnings("deprecation") protected void checkApplication() { createApplicationIfAbsent(); if (!application.isValid()) { throw new IllegalStateException("No application config found or it's not a valid config! " + "Please add <dubbo:application name=\"...\" ... | AbstractInterfaceConfig extends AbstractMethodConfig { @SuppressWarnings("deprecation") protected void checkApplication() { createApplicationIfAbsent(); if (!application.isValid()) { throw new IllegalStateException("No application config found or it's not a valid config! " + "Please add <dubbo:application name=\"...\" ... |
@Test public void testLoadRegistries() { System.setProperty("dubbo.registry.address", "addr1"); InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkRegistry(); List<URL> urls = interfaceConfig.loadRegistries(true); Assertions.assertEquals(1, urls.size()); URL url = urls.get(0); Assertions.asse... | protected List<URL> loadRegistries(boolean provider) { List<URL> registryList = new ArrayList<URL>(); if (CollectionUtils.isNotEmpty(registries)) { for (RegistryConfig config : registries) { String address = config.getAddress(); if (StringUtils.isEmpty(address)) { address = Constants.ANYHOST_VALUE; } if (!RegistryConfi... | AbstractInterfaceConfig extends AbstractMethodConfig { protected List<URL> loadRegistries(boolean provider) { List<URL> registryList = new ArrayList<URL>(); if (CollectionUtils.isNotEmpty(registries)) { for (RegistryConfig config : registries) { String address = config.getAddress(); if (StringUtils.isEmpty(address)) { ... | AbstractInterfaceConfig extends AbstractMethodConfig { protected List<URL> loadRegistries(boolean provider) { List<URL> registryList = new ArrayList<URL>(); if (CollectionUtils.isNotEmpty(registries)) { for (RegistryConfig config : registries) { String address = config.getAddress(); if (StringUtils.isEmpty(address)) { ... | AbstractInterfaceConfig extends AbstractMethodConfig { protected List<URL> loadRegistries(boolean provider) { List<URL> registryList = new ArrayList<URL>(); if (CollectionUtils.isNotEmpty(registries)) { for (RegistryConfig config : registries) { String address = config.getAddress(); if (StringUtils.isEmpty(address)) { ... | AbstractInterfaceConfig extends AbstractMethodConfig { protected List<URL> loadRegistries(boolean provider) { List<URL> registryList = new ArrayList<URL>(); if (CollectionUtils.isNotEmpty(registries)) { for (RegistryConfig config : registries) { String address = config.getAddress(); if (StringUtils.isEmpty(address)) { ... |
@Test public void testLoadMonitor() { System.setProperty("dubbo.monitor.address", "monitor-addr:12080"); System.setProperty("dubbo.monitor.protocol", "monitor"); InterfaceConfig interfaceConfig = new InterfaceConfig(); URL url = interfaceConfig.loadMonitor(new URL("dubbo", "addr1", 9090)); Assertions.assertEquals("moni... | protected URL loadMonitor(URL registryURL) { checkMonitor(); Map<String, String> map = new HashMap<String, String>(); map.put(Constants.INTERFACE_KEY, MonitorService.class.getName()); appendRuntimeParameters(map); String hostToRegistry = ConfigUtils.getSystemProperty(Constants.DUBBO_IP_TO_REGISTRY); if (StringUtils.isE... | AbstractInterfaceConfig extends AbstractMethodConfig { protected URL loadMonitor(URL registryURL) { checkMonitor(); Map<String, String> map = new HashMap<String, String>(); map.put(Constants.INTERFACE_KEY, MonitorService.class.getName()); appendRuntimeParameters(map); String hostToRegistry = ConfigUtils.getSystemProper... | AbstractInterfaceConfig extends AbstractMethodConfig { protected URL loadMonitor(URL registryURL) { checkMonitor(); Map<String, String> map = new HashMap<String, String>(); map.put(Constants.INTERFACE_KEY, MonitorService.class.getName()); appendRuntimeParameters(map); String hostToRegistry = ConfigUtils.getSystemProper... | AbstractInterfaceConfig extends AbstractMethodConfig { protected URL loadMonitor(URL registryURL) { checkMonitor(); Map<String, String> map = new HashMap<String, String>(); map.put(Constants.INTERFACE_KEY, MonitorService.class.getName()); appendRuntimeParameters(map); String hostToRegistry = ConfigUtils.getSystemProper... | AbstractInterfaceConfig extends AbstractMethodConfig { protected URL loadMonitor(URL registryURL) { checkMonitor(); Map<String, String> map = new HashMap<String, String>(); map.put(Constants.INTERFACE_KEY, MonitorService.class.getName()); appendRuntimeParameters(map); String hostToRegistry = ConfigUtils.getSystemProper... |
@Test public void checkInterfaceAndMethods1() { Assertions.assertThrows(IllegalStateException.class, () -> { InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkInterfaceAndMethods(null, null); }); } | protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); }... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... |
@Test public void checkInterfaceAndMethods2() { Assertions.assertThrows(IllegalStateException.class, () -> { InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkInterfaceAndMethods(AbstractInterfaceConfigTest.class, null); }); } | protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); }... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... |
@Test public void checkInterfaceAndMethod3() { Assertions.assertThrows(IllegalStateException.class, () -> { MethodConfig methodConfig = new MethodConfig(); InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkInterfaceAndMethods(Greeting.class, Collections.singletonList(methodConfig)); }); } | protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); }... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... |
@Test public void checkInterfaceAndMethod4() { Assertions.assertThrows(IllegalStateException.class, () -> { MethodConfig methodConfig = new MethodConfig(); methodConfig.setName("nihao"); InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkInterfaceAndMethods(Greeting.class, Collections.singlet... | protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); }... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... |
@Test public void checkInterfaceAndMethod5() { MethodConfig methodConfig = new MethodConfig(); methodConfig.setName("hello"); InterfaceConfig interfaceConfig = new InterfaceConfig(); interfaceConfig.checkInterfaceAndMethods(Greeting.class, Collections.singletonList(methodConfig)); } | protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); }... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... | AbstractInterfaceConfig extends AbstractMethodConfig { protected void checkInterfaceAndMethods(Class<?> interfaceClass, List<MethodConfig> methods) { Assert.notNull(interfaceClass, new IllegalStateException("interface not allow null!")); if (!interfaceClass.isInterface()) { throw new IllegalStateException("The interfac... |
@Test public void testInvokeToString() throws Throwable { String methodName = "toString"; when(invoker.toString()).thenReturn(methodName); Method method = invoker.getClass().getMethod(methodName); Object result = invokerInvocationHandler.invoke(null, method, new Object[]{}); Assertions.assertEquals(methodName, result);... | @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); Class<?>[] parameterTypes = method.getParameterTypes(); if (method.getDeclaringClass() == Object.class) { return method.invoke(invoker, args); } if ("toString".equals(methodName) && parame... | InvokerInvocationHandler implements InvocationHandler { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); Class<?>[] parameterTypes = method.getParameterTypes(); if (method.getDeclaringClass() == Object.class) { return method.invoke(invok... | InvokerInvocationHandler implements InvocationHandler { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); Class<?>[] parameterTypes = method.getParameterTypes(); if (method.getDeclaringClass() == Object.class) { return method.invoke(invok... | InvokerInvocationHandler implements InvocationHandler { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); Class<?>[] parameterTypes = method.getParameterTypes(); if (method.getDeclaringClass() == Object.class) { return method.invoke(invok... | InvokerInvocationHandler implements InvocationHandler { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); Class<?>[] parameterTypes = method.getParameterTypes(); if (method.getDeclaringClass() == Object.class) { return method.invoke(invok... |
@Test public void testDestroy() throws Exception { Protocol protocol = Mockito.mock(Protocol.class); MockProtocol2.delegate = protocol; ProtocolConfig protocolConfig = new ProtocolConfig(); protocolConfig.setName("mockprotocol2"); protocolConfig.destroy(); Mockito.verify(protocol).destroy(); } | public void destroy() { if (name != null) { ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(name).destroy(); } } | ProtocolConfig extends AbstractConfig { public void destroy() { if (name != null) { ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(name).destroy(); } } } | ProtocolConfig extends AbstractConfig { public void destroy() { if (name != null) { ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(name).destroy(); } } ProtocolConfig(); ProtocolConfig(String name); ProtocolConfig(String name, int port); } | ProtocolConfig extends AbstractConfig { public void destroy() { if (name != null) { ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(name).destroy(); } } ProtocolConfig(); ProtocolConfig(String name); ProtocolConfig(String name, int port); @Parameter(excluded = true) String getName(); final void setNam... | ProtocolConfig extends AbstractConfig { public void destroy() { if (name != null) { ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(name).destroy(); } } ProtocolConfig(); ProtocolConfig(String name); ProtocolConfig(String name, int port); @Parameter(excluded = true) String getName(); final void setNam... |
@Test public void testAppendParameters1() throws Exception { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("default.num", "one"); parameters.put("num", "ONE"); AbstractConfig.appendParameters(parameters, new ParameterConfig(1, "hello/world", 30, "password"), "prefix"); Assertions.assert... | protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... |
@Test public void testAppendParameters2() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> { Map<String, String> parameters = new HashMap<String, String>(); AbstractConfig.appendParameters(parameters, new ParameterConfig()); }); } | protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... |
@Test public void testAppendParameters3() throws Exception { Map<String, String> parameters = new HashMap<String, String>(); AbstractConfig.appendParameters(parameters, null); assertTrue(parameters.isEmpty()); } | protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... |
@Test public void testAppendParameters4() throws Exception { Map<String, String> parameters = new HashMap<String, String>(); AbstractConfig.appendParameters(parameters, new ParameterConfig(1, "hello/world", 30, "password")); Assertions.assertEquals("one", parameters.get("key.1")); Assertions.assertEquals("two", paramet... | protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... | AbstractConfig implements Serializable { protected static void appendParameters(Map<String, String> parameters, Object config) { appendParameters(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... |
@Test public void testAppendAttributes1() throws Exception { Map<String, Object> parameters = new HashMap<String, Object>(); AbstractConfig.appendAttributes(parameters, new AttributeConfig('l', true, (byte) 0x01), "prefix"); Assertions.assertEquals('l', parameters.get("prefix.let")); Assertions.assertEquals(true, param... | protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } | AbstractConfig implements Serializable { protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... | AbstractConfig implements Serializable { protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... |
@Test public void testAppendAttributes2() throws Exception { Map<String, Object> parameters = new HashMap<String, Object>(); AbstractConfig.appendAttributes(parameters, new AttributeConfig('l', true, (byte) 0x01)); Assertions.assertEquals('l', parameters.get("let")); Assertions.assertEquals(true, parameters.get("activa... | protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } | AbstractConfig implements Serializable { protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } } | AbstractConfig implements Serializable { protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... | AbstractConfig implements Serializable { protected static void appendAttributes(Map<String, Object> parameters, Object config) { appendAttributes(parameters, config, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... |
@Test public void checkExtension() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> AbstractConfig.checkExtension(Greeting.class, "hello", "world")); } | protected static void checkExtension(Class<?> type, String property, String value) { checkName(property, value); if (StringUtils.isNotEmpty(value) && !ExtensionLoader.getExtensionLoader(type).hasExtension(value)) { throw new IllegalStateException("No such extension " + value + " for " + property + "/" + type.getName())... | AbstractConfig implements Serializable { protected static void checkExtension(Class<?> type, String property, String value) { checkName(property, value); if (StringUtils.isNotEmpty(value) && !ExtensionLoader.getExtensionLoader(type).hasExtension(value)) { throw new IllegalStateException("No such extension " + value + "... | AbstractConfig implements Serializable { protected static void checkExtension(Class<?> type, String property, String value) { checkName(property, value); if (StringUtils.isNotEmpty(value) && !ExtensionLoader.getExtensionLoader(type).hasExtension(value)) { throw new IllegalStateException("No such extension " + value + "... | AbstractConfig implements Serializable { protected static void checkExtension(Class<?> type, String property, String value) { checkName(property, value); if (StringUtils.isNotEmpty(value) && !ExtensionLoader.getExtensionLoader(type).hasExtension(value)) { throw new IllegalStateException("No such extension " + value + "... | AbstractConfig implements Serializable { protected static void checkExtension(Class<?> type, String property, String value) { checkName(property, value); if (StringUtils.isNotEmpty(value) && !ExtensionLoader.getExtensionLoader(type).hasExtension(value)) { throw new IllegalStateException("No such extension " + value + "... |
@Test public void checkMultiExtension1() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> AbstractConfig.checkMultiExtension(Greeting.class, "hello", "default,world")); } | protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX)) { v = v.substring(1); } if (Constants.... | AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX... | AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX... | AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX... | AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX... |
@Test public void checkMultiExtension2() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> AbstractConfig.checkMultiExtension(Greeting.class, "hello", "default,-world")); } | protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX)) { v = v.substring(1); } if (Constants.... | AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX... | AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX... | AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX... | AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (StringUtils.isNotEmpty(value)) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX... |
@Test public void testGetContext() { RpcContext rpcContext = RpcContext.getContext(); Assertions.assertNotNull(rpcContext); RpcContext.removeContext(); Assertions.assertNotNull(RpcContext.getContext()); Assertions.assertNotEquals(rpcContext, RpcContext.getContext()); RpcContext serverRpcContext = RpcContext.getServerCo... | public static RpcContext getContext() { return LOCAL.get(); } | RpcContext { public static RpcContext getContext() { return LOCAL.get(); } } | RpcContext { public static RpcContext getContext() { return LOCAL.get(); } protected RpcContext(); } | RpcContext { public static RpcContext getContext() { return LOCAL.get(); } protected RpcContext(); static RpcContext getServerContext(); static void restoreServerContext(RpcContext oldServerContext); static void removeServerContext(); static RpcContext getContext(); static void restoreContext(RpcContext oldContext); R... | RpcContext { public static RpcContext getContext() { return LOCAL.get(); } protected RpcContext(); static RpcContext getServerContext(); static void restoreServerContext(RpcContext oldServerContext); static void removeServerContext(); static RpcContext getContext(); static void restoreContext(RpcContext oldContext); R... |
@Test public void checkLength() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> { StringBuilder builder = new StringBuilder(); for (int i = 0; i <= 200; i++) { builder.append("a"); } AbstractConfig.checkLength("hello", builder.toString()); }); } | protected static void checkLength(String property, String value) { checkProperty(property, value, MAX_LENGTH, null); } | AbstractConfig implements Serializable { protected static void checkLength(String property, String value) { checkProperty(property, value, MAX_LENGTH, null); } } | AbstractConfig implements Serializable { protected static void checkLength(String property, String value) { checkProperty(property, value, MAX_LENGTH, null); } } | AbstractConfig implements Serializable { protected static void checkLength(String property, String value) { checkProperty(property, value, MAX_LENGTH, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Parameter(excluded ... | AbstractConfig implements Serializable { protected static void checkLength(String property, String value) { checkProperty(property, value, MAX_LENGTH, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Parameter(excluded ... |
@Test public void checkPathLength() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> { StringBuilder builder = new StringBuilder(); for (int i = 0; i <= 200; i++) { builder.append("a"); } AbstractConfig.checkPathLength("hello", builder.toString()); }); } | protected static void checkPathLength(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, null); } | AbstractConfig implements Serializable { protected static void checkPathLength(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, null); } } | AbstractConfig implements Serializable { protected static void checkPathLength(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, null); } } | AbstractConfig implements Serializable { protected static void checkPathLength(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Parameter(... | AbstractConfig implements Serializable { protected static void checkPathLength(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, null); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Parameter(... |
@Test public void checkName() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> AbstractConfig.checkName("hello", "world%")); } | protected static void checkName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); } | AbstractConfig implements Serializable { protected static void checkName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); } } | AbstractConfig implements Serializable { protected static void checkName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); } } | AbstractConfig implements Serializable { protected static void checkName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Parameter(exc... | AbstractConfig implements Serializable { protected static void checkName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Parameter(exc... |
@Test public void checkNameHasSymbol() throws Exception { try { AbstractConfig.checkNameHasSymbol("hello", ":*,/ -0123\tabcdABCD"); AbstractConfig.checkNameHasSymbol("mock", "force:return world"); } catch (Exception e) { fail("the value should be legal."); } } | protected static void checkNameHasSymbol(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME_HAS_SYMBOL); } | AbstractConfig implements Serializable { protected static void checkNameHasSymbol(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME_HAS_SYMBOL); } } | AbstractConfig implements Serializable { protected static void checkNameHasSymbol(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME_HAS_SYMBOL); } } | AbstractConfig implements Serializable { protected static void checkNameHasSymbol(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME_HAS_SYMBOL); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaDa... | AbstractConfig implements Serializable { protected static void checkNameHasSymbol(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_NAME_HAS_SYMBOL); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaDa... |
@Test public void checkKey() throws Exception { try { AbstractConfig.checkKey("hello", "*,-0123abcdABCD"); } catch (Exception e) { fail("the value should be legal."); } } | protected static void checkKey(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_KEY); } | AbstractConfig implements Serializable { protected static void checkKey(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_KEY); } } | AbstractConfig implements Serializable { protected static void checkKey(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_KEY); } } | AbstractConfig implements Serializable { protected static void checkKey(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_KEY); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Parameter(exclu... | AbstractConfig implements Serializable { protected static void checkKey(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_KEY); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Parameter(exclu... |
@Test public void checkMultiName() throws Exception { try { AbstractConfig.checkMultiName("hello", ",-._0123abcdABCD"); } catch (Exception e) { fail("the value should be legal."); } } | protected static void checkMultiName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_MULTI_NAME); } | AbstractConfig implements Serializable { protected static void checkMultiName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_MULTI_NAME); } } | AbstractConfig implements Serializable { protected static void checkMultiName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_MULTI_NAME); } } | AbstractConfig implements Serializable { protected static void checkMultiName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_MULTI_NAME); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Pa... | AbstractConfig implements Serializable { protected static void checkMultiName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_MULTI_NAME); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Pa... |
@Test public void checkPathName() throws Exception { try { AbstractConfig.checkPathName("hello", "/-$._0123abcdABCD"); } catch (Exception e) { fail("the value should be legal."); } } | protected static void checkPathName(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, PATTERN_PATH); } | AbstractConfig implements Serializable { protected static void checkPathName(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, PATTERN_PATH); } } | AbstractConfig implements Serializable { protected static void checkPathName(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, PATTERN_PATH); } } | AbstractConfig implements Serializable { protected static void checkPathName(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, PATTERN_PATH); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... | AbstractConfig implements Serializable { protected static void checkPathName(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, PATTERN_PATH); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @Para... |
@Test public void checkMethodName() throws Exception { try { AbstractConfig.checkMethodName("hello", "abcdABCD0123abcd"); } catch (Exception e) { fail("the value should be legal."); } try { AbstractConfig.checkMethodName("hello", "0a"); fail("the value should be illegal."); } catch (Exception e) { } } | protected static void checkMethodName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_METHOD_NAME); } | AbstractConfig implements Serializable { protected static void checkMethodName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_METHOD_NAME); } } | AbstractConfig implements Serializable { protected static void checkMethodName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_METHOD_NAME); } } | AbstractConfig implements Serializable { protected static void checkMethodName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_METHOD_NAME); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @... | AbstractConfig implements Serializable { protected static void checkMethodName(String property, String value) { checkProperty(property, value, MAX_LENGTH, PATTERN_METHOD_NAME); } @Parameter(excluded = true) String getId(); void setId(String id); void updateIdIfAbsent(String value); Map<String, String> getMetaData(); @... |
@Test public void checkParameterName() throws Exception { Map<String, String> parameters = Collections.singletonMap("hello", ":*,/-._0123abcdABCD"); try { AbstractConfig.checkParameterName(parameters); } catch (Exception e) { fail("the value should be legal."); } } | protected static void checkParameterName(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return; } for (Map.Entry<String, String> entry : parameters.entrySet()) { checkNameHasSymbol(entry.getKey(), entry.getValue()); } } | AbstractConfig implements Serializable { protected static void checkParameterName(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return; } for (Map.Entry<String, String> entry : parameters.entrySet()) { checkNameHasSymbol(entry.getKey(), entry.getValue()); } } } | AbstractConfig implements Serializable { protected static void checkParameterName(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return; } for (Map.Entry<String, String> entry : parameters.entrySet()) { checkNameHasSymbol(entry.getKey(), entry.getValue()); } } } | AbstractConfig implements Serializable { protected static void checkParameterName(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return; } for (Map.Entry<String, String> entry : parameters.entrySet()) { checkNameHasSymbol(entry.getKey(), entry.getValue()); } } @Parameter(excluded = tru... | AbstractConfig implements Serializable { protected static void checkParameterName(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return; } for (Map.Entry<String, String> entry : parameters.entrySet()) { checkNameHasSymbol(entry.getKey(), entry.getValue()); } } @Parameter(excluded = tru... |
@Test @Config(interfaceClass = Greeting.class, filter = {"f1, f2"}, listener = {"l1, l2"}, parameters = {"k1", "v1", "k2", "v2"}) public void appendAnnotation() throws Exception { Config config = getClass().getMethod("appendAnnotation").getAnnotation(Config.class); AnnotationConfig annotationConfig = new AnnotationConf... | protected void appendAnnotation(Class<?> annotationClass, Object annotation) { Method[] methods = annotationClass.getMethods(); for (Method method : methods) { if (method.getDeclaringClass() != Object.class && method.getReturnType() != void.class && method.getParameterTypes().length == 0 && Modifier.isPublic(method.get... | AbstractConfig implements Serializable { protected void appendAnnotation(Class<?> annotationClass, Object annotation) { Method[] methods = annotationClass.getMethods(); for (Method method : methods) { if (method.getDeclaringClass() != Object.class && method.getReturnType() != void.class && method.getParameterTypes().le... | AbstractConfig implements Serializable { protected void appendAnnotation(Class<?> annotationClass, Object annotation) { Method[] methods = annotationClass.getMethods(); for (Method method : methods) { if (method.getDeclaringClass() != Object.class && method.getReturnType() != void.class && method.getParameterTypes().le... | AbstractConfig implements Serializable { protected void appendAnnotation(Class<?> annotationClass, Object annotation) { Method[] methods = annotationClass.getMethods(); for (Method method : methods) { if (method.getDeclaringClass() != Object.class && method.getReturnType() != void.class && method.getParameterTypes().le... | AbstractConfig implements Serializable { protected void appendAnnotation(Class<?> annotationClass, Object annotation) { Method[] methods = annotationClass.getMethods(); for (Method method : methods) { if (method.getDeclaringClass() != Object.class && method.getReturnType() != void.class && method.getParameterTypes().le... |
@Test public void testRefreshAll() { try { OverrideConfig overrideConfig = new OverrideConfig(); overrideConfig.setAddress("override-config: overrideConfig.setProtocol("override-config"); overrideConfig.setEscape("override-config: overrideConfig.setExclude("override-config"); Map<String, String> external = new HashMap<... | public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.getInstance().isConfigCenterFirst()) { comp... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... |
@Test public void testRefreshSystem() { try { OverrideConfig overrideConfig = new OverrideConfig(); overrideConfig.setAddress("override-config: overrideConfig.setProtocol("override-config"); overrideConfig.setEscape("override-config: overrideConfig.setExclude("override-config"); System.setProperty("dubbo.override.addre... | public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.getInstance().isConfigCenterFirst()) { comp... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... |
@Test public void testRefreshProperties() throws Exception{ try { Environment.getInstance().setExternalConfigMap(new HashMap<>()); OverrideConfig overrideConfig = new OverrideConfig(); overrideConfig.setAddress("override-config: overrideConfig.setProtocol("override-config"); overrideConfig.setEscape("override-config: P... | public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.getInstance().isConfigCenterFirst()) { comp... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... |
@Test public void testRefreshExternal() { try { OverrideConfig overrideConfig = new OverrideConfig(); overrideConfig.setAddress("override-config: overrideConfig.setProtocol("override-config"); overrideConfig.setEscape("override-config: overrideConfig.setExclude("override-config"); Map<String, String> external = new Has... | public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.getInstance().isConfigCenterFirst()) { comp... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... | AbstractConfig implements Serializable { public void refresh() { try { CompositeConfiguration compositeConfiguration = Environment.getInstance().getConfiguration(getPrefix(), getId()); InmemoryConfiguration config = new InmemoryConfiguration(getPrefix(), getId()); config.addProperties(getMetaData()); if (Environment.ge... |
@Test public void testFilter() throws Exception { ServiceConfig serviceConfig = new ServiceConfig(); serviceConfig.setFilter("mockfilter"); assertThat(serviceConfig.getFilter(), equalTo("mockfilter")); Map<String, String> parameters = new HashMap<String, String>(); parameters.put(Constants.SERVICE_FILTER_KEY, "prefilte... | @Override @Parameter(key = Constants.SERVICE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } | AbstractServiceConfig extends AbstractInterfaceConfig { @Override @Parameter(key = Constants.SERVICE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } } | AbstractServiceConfig extends AbstractInterfaceConfig { @Override @Parameter(key = Constants.SERVICE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } } | AbstractServiceConfig extends AbstractInterfaceConfig { @Override @Parameter(key = Constants.SERVICE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } String getVersion(); void setVersion(String version); String getGroup(); void setGroup(String group); Integer getDelay(); void setDelay... | AbstractServiceConfig extends AbstractInterfaceConfig { @Override @Parameter(key = Constants.SERVICE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } String getVersion(); void setVersion(String version); String getGroup(); void setGroup(String group); Integer getDelay(); void setDelay... |
@Test public void testDestroy() throws Exception { ReferenceConfigCache cache = ReferenceConfigCache.getCache(); MockReferenceConfig config = buildMockReferenceConfig("FooService", "group1", "1.0.0"); cache.get(config); MockReferenceConfig configCopy = buildMockReferenceConfig("XxxService", "group1", "1.0.0"); cache.ge... | public <T> void destroy(ReferenceConfig<T> referenceConfig) { String key = generator.generateKey(referenceConfig); destroyKey(key); } | ReferenceConfigCache { public <T> void destroy(ReferenceConfig<T> referenceConfig) { String key = generator.generateKey(referenceConfig); destroyKey(key); } } | ReferenceConfigCache { public <T> void destroy(ReferenceConfig<T> referenceConfig) { String key = generator.generateKey(referenceConfig); destroyKey(key); } private ReferenceConfigCache(String name, KeyGenerator generator); } | ReferenceConfigCache { public <T> void destroy(ReferenceConfig<T> referenceConfig) { String key = generator.generateKey(referenceConfig); destroyKey(key); } private ReferenceConfigCache(String name, KeyGenerator generator); static ReferenceConfigCache getCache(); static ReferenceConfigCache getCache(String name); stat... | ReferenceConfigCache { public <T> void destroy(ReferenceConfig<T> referenceConfig) { String key = generator.generateKey(referenceConfig); destroyKey(key); } private ReferenceConfigCache(String name, KeyGenerator generator); static ReferenceConfigCache getCache(); static ReferenceConfigCache getCache(String name); stat... |
@Test public void testDestroyAll() throws Exception { ReferenceConfigCache cache = ReferenceConfigCache.getCache(); MockReferenceConfig config = buildMockReferenceConfig("FooService", "group1", "1.0.0"); cache.get(config); MockReferenceConfig configCopy = buildMockReferenceConfig("XxxService", "group1", "1.0.0"); cache... | public void destroyAll() { Set<String> set = new HashSet<String>(cache.keySet()); for (String key : set) { destroyKey(key); } } | ReferenceConfigCache { public void destroyAll() { Set<String> set = new HashSet<String>(cache.keySet()); for (String key : set) { destroyKey(key); } } } | ReferenceConfigCache { public void destroyAll() { Set<String> set = new HashSet<String>(cache.keySet()); for (String key : set) { destroyKey(key); } } private ReferenceConfigCache(String name, KeyGenerator generator); } | ReferenceConfigCache { public void destroyAll() { Set<String> set = new HashSet<String>(cache.keySet()); for (String key : set) { destroyKey(key); } } private ReferenceConfigCache(String name, KeyGenerator generator); static ReferenceConfigCache getCache(); static ReferenceConfigCache getCache(String name); static Ref... | ReferenceConfigCache { public void destroyAll() { Set<String> set = new HashSet<String>(cache.keySet()); for (String key : set) { destroyKey(key); } } private ReferenceConfigCache(String name, KeyGenerator generator); static ReferenceConfigCache getCache(); static ReferenceConfigCache getCache(String name); static Ref... |
@Test public void testExport() throws Exception { service.export(); assertThat(service.getExportedUrls(), hasSize(1)); URL url = service.toUrl(); assertThat(url.getProtocol(), equalTo("mockprotocol2")); assertThat(url.getPath(), equalTo(DemoService.class.getName())); assertThat(url.getParameters(), hasEntry(Constants.A... | public synchronized void export() { checkAndUpdateSubConfigs(); if (!shouldExport()) { return; } if (shouldDelay()) { delayExportExecutor.schedule(this::doExport, getDelay(), TimeUnit.MILLISECONDS); } else { doExport(); } } | ServiceConfig extends AbstractServiceConfig { public synchronized void export() { checkAndUpdateSubConfigs(); if (!shouldExport()) { return; } if (shouldDelay()) { delayExportExecutor.schedule(this::doExport, getDelay(), TimeUnit.MILLISECONDS); } else { doExport(); } } } | ServiceConfig extends AbstractServiceConfig { public synchronized void export() { checkAndUpdateSubConfigs(); if (!shouldExport()) { return; } if (shouldDelay()) { delayExportExecutor.schedule(this::doExport, getDelay(), TimeUnit.MILLISECONDS); } else { doExport(); } } ServiceConfig(); ServiceConfig(Service service); ... | ServiceConfig extends AbstractServiceConfig { public synchronized void export() { checkAndUpdateSubConfigs(); if (!shouldExport()) { return; } if (shouldDelay()) { delayExportExecutor.schedule(this::doExport, getDelay(), TimeUnit.MILLISECONDS); } else { doExport(); } } ServiceConfig(); ServiceConfig(Service service); ... | ServiceConfig extends AbstractServiceConfig { public synchronized void export() { checkAndUpdateSubConfigs(); if (!shouldExport()) { return; } if (shouldDelay()) { delayExportExecutor.schedule(this::doExport, getDelay(), TimeUnit.MILLISECONDS); } else { doExport(); } } ServiceConfig(); ServiceConfig(Service service); ... |
@Test @Disabled("cannot pass in travis") public void testUnexport() throws Exception { System.setProperty(Constants.SHUTDOWN_WAIT_KEY, "0"); try { service.export(); service.unexport(); Thread.sleep(1000); Mockito.verify(exporter, Mockito.atLeastOnce()).unexport(); } finally { System.clearProperty(Constants.SHUTDOWN_TIM... | public synchronized void unexport() { if (!exported) { return; } if (unexported) { return; } if (!exporters.isEmpty()) { for (Exporter<?> exporter : exporters) { try { exporter.unexport(); } catch (Throwable t) { logger.warn("Unexpected error occured when unexport " + exporter, t); } } exporters.clear(); } unexported =... | ServiceConfig extends AbstractServiceConfig { public synchronized void unexport() { if (!exported) { return; } if (unexported) { return; } if (!exporters.isEmpty()) { for (Exporter<?> exporter : exporters) { try { exporter.unexport(); } catch (Throwable t) { logger.warn("Unexpected error occured when unexport " + expor... | ServiceConfig extends AbstractServiceConfig { public synchronized void unexport() { if (!exported) { return; } if (unexported) { return; } if (!exporters.isEmpty()) { for (Exporter<?> exporter : exporters) { try { exporter.unexport(); } catch (Throwable t) { logger.warn("Unexpected error occured when unexport " + expor... | ServiceConfig extends AbstractServiceConfig { public synchronized void unexport() { if (!exported) { return; } if (unexported) { return; } if (!exporters.isEmpty()) { for (Exporter<?> exporter : exporters) { try { exporter.unexport(); } catch (Throwable t) { logger.warn("Unexpected error occured when unexport " + expor... | ServiceConfig extends AbstractServiceConfig { public synchronized void unexport() { if (!exported) { return; } if (unexported) { return; } if (!exporters.isEmpty()) { for (Exporter<?> exporter : exporters) { try { exporter.unexport(); } catch (Throwable t) { logger.warn("Unexpected error occured when unexport " + expor... |
@Test public void testInterface1() throws Exception { Assertions.assertThrows(IllegalStateException.class, () -> { ServiceConfig<DemoService> service = new ServiceConfig<DemoService>(); service.setInterface(DemoServiceImpl.class); }); } | public void setInterface(Class<?> interfaceClass) { if (interfaceClass != null && !interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); } this.interfaceClass = interfaceClass; setInterface(interfaceClass == null ? null : interfaceClass.getNam... | ServiceConfig extends AbstractServiceConfig { public void setInterface(Class<?> interfaceClass) { if (interfaceClass != null && !interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); } this.interfaceClass = interfaceClass; setInterface(interfa... | ServiceConfig extends AbstractServiceConfig { public void setInterface(Class<?> interfaceClass) { if (interfaceClass != null && !interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); } this.interfaceClass = interfaceClass; setInterface(interfa... | ServiceConfig extends AbstractServiceConfig { public void setInterface(Class<?> interfaceClass) { if (interfaceClass != null && !interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); } this.interfaceClass = interfaceClass; setInterface(interfa... | ServiceConfig extends AbstractServiceConfig { public void setInterface(Class<?> interfaceClass) { if (interfaceClass != null && !interfaceClass.isInterface()) { throw new IllegalStateException("The interface class " + interfaceClass + " is not a interface!"); } this.interfaceClass = interfaceClass; setInterface(interfa... |
@Test public void testNoExecuteLimitInvoke() throws Exception { Invoker invoker = Mockito.mock(Invoker.class); when(invoker.invoke(any(Invocation.class))).thenReturn(new RpcResult("result")); when(invoker.getUrl()).thenReturn(URL.valueOf("test: Invocation invocation = Mockito.mock(Invocation.class); when(invocation.get... | @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, methodName, max)) { throw new RpcException("... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... |
@Test public void testGeneric2() throws Exception { Assertions.assertThrows(IllegalArgumentException.class, () -> { ServiceConfig service = new ServiceConfig(); service.setGeneric("illegal"); }); } | public void setGeneric(String generic) { if (StringUtils.isEmpty(generic)) { return; } if (ProtocolUtils.isGeneric(generic)) { this.generic = generic; } else { throw new IllegalArgumentException("Unsupported generic type " + generic); } } | ServiceConfig extends AbstractServiceConfig { public void setGeneric(String generic) { if (StringUtils.isEmpty(generic)) { return; } if (ProtocolUtils.isGeneric(generic)) { this.generic = generic; } else { throw new IllegalArgumentException("Unsupported generic type " + generic); } } } | ServiceConfig extends AbstractServiceConfig { public void setGeneric(String generic) { if (StringUtils.isEmpty(generic)) { return; } if (ProtocolUtils.isGeneric(generic)) { this.generic = generic; } else { throw new IllegalArgumentException("Unsupported generic type " + generic); } } ServiceConfig(); ServiceConfig(Ser... | ServiceConfig extends AbstractServiceConfig { public void setGeneric(String generic) { if (StringUtils.isEmpty(generic)) { return; } if (ProtocolUtils.isGeneric(generic)) { this.generic = generic; } else { throw new IllegalArgumentException("Unsupported generic type " + generic); } } ServiceConfig(); ServiceConfig(Ser... | ServiceConfig extends AbstractServiceConfig { public void setGeneric(String generic) { if (StringUtils.isEmpty(generic)) { return; } if (ProtocolUtils.isGeneric(generic)) { this.generic = generic; } else { throw new IllegalArgumentException("Unsupported generic type " + generic); } } ServiceConfig(); ServiceConfig(Ser... |
@Test public void testMock() throws Exception { Assertions.assertThrows(IllegalArgumentException.class, () -> { ServiceConfig service = new ServiceConfig(); service.setMock("true"); }); } | @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } | ServiceConfig extends AbstractServiceConfig { @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } } | ServiceConfig extends AbstractServiceConfig { @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } ServiceConfig(); ServiceConfig(Service service); } | ServiceConfig extends AbstractServiceConfig { @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } ServiceConfig(); ServiceConfig(Service service); URL toUrl(); List<URL> toUrls(); @Parameter(excluded = true) boolean isExported(); @Parameter(exclu... | ServiceConfig extends AbstractServiceConfig { @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } ServiceConfig(); ServiceConfig(Service service); URL toUrl(); List<URL> toUrls(); @Parameter(excluded = true) boolean isExported(); @Parameter(exclu... |
@Test public void testMock2() throws Exception { Assertions.assertThrows(IllegalArgumentException.class, () -> { ServiceConfig service = new ServiceConfig(); service.setMock(true); }); } | @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } | ServiceConfig extends AbstractServiceConfig { @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } } | ServiceConfig extends AbstractServiceConfig { @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } ServiceConfig(); ServiceConfig(Service service); } | ServiceConfig extends AbstractServiceConfig { @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } ServiceConfig(); ServiceConfig(Service service); URL toUrl(); List<URL> toUrls(); @Parameter(excluded = true) boolean isExported(); @Parameter(exclu... | ServiceConfig extends AbstractServiceConfig { @Override public void setMock(Boolean mock) { throw new IllegalArgumentException("mock doesn't support on provider side"); } ServiceConfig(); ServiceConfig(Service service); URL toUrl(); List<URL> toUrls(); @Parameter(excluded = true) boolean isExported(); @Parameter(exclu... |
@Test public void testFilter() throws Exception { ReferenceConfig referenceConfig = new ReferenceConfig(); referenceConfig.setFilter("mockfilter"); assertThat(referenceConfig.getFilter(), equalTo("mockfilter")); Map<String, String> parameters = new HashMap<String, String>(); parameters.put(Constants.REFERENCE_FILTER_KE... | @Override @Parameter(key = Constants.REFERENCE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } | AbstractReferenceConfig extends AbstractInterfaceConfig { @Override @Parameter(key = Constants.REFERENCE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } } | AbstractReferenceConfig extends AbstractInterfaceConfig { @Override @Parameter(key = Constants.REFERENCE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } } | AbstractReferenceConfig extends AbstractInterfaceConfig { @Override @Parameter(key = Constants.REFERENCE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } Boolean isCheck(); void setCheck(Boolean check); Boolean isInit(); void setInit(Boolean init); @Parameter(excluded = true) Boolean ... | AbstractReferenceConfig extends AbstractInterfaceConfig { @Override @Parameter(key = Constants.REFERENCE_FILTER_KEY, append = true) public String getFilter() { return super.getFilter(); } Boolean isCheck(); void setCheck(Boolean check); Boolean isInit(); void setInit(Boolean init); @Parameter(excluded = true) Boolean ... |
@Test public void testStubevent() throws Exception { ReferenceConfig referenceConfig = new ReferenceConfig(); referenceConfig.setOnconnect("onConnect"); Map<String, String> parameters = new HashMap<String, String>(); AbstractInterfaceConfig.appendParameters(parameters, referenceConfig); assertThat(parameters, hasKey(Co... | @Override public void setOnconnect(String onconnect) { if (onconnect != null && onconnect.length() > 0) { this.stubevent = true; } super.setOnconnect(onconnect); } | AbstractReferenceConfig extends AbstractInterfaceConfig { @Override public void setOnconnect(String onconnect) { if (onconnect != null && onconnect.length() > 0) { this.stubevent = true; } super.setOnconnect(onconnect); } } | AbstractReferenceConfig extends AbstractInterfaceConfig { @Override public void setOnconnect(String onconnect) { if (onconnect != null && onconnect.length() > 0) { this.stubevent = true; } super.setOnconnect(onconnect); } } | AbstractReferenceConfig extends AbstractInterfaceConfig { @Override public void setOnconnect(String onconnect) { if (onconnect != null && onconnect.length() > 0) { this.stubevent = true; } super.setOnconnect(onconnect); } Boolean isCheck(); void setCheck(Boolean check); Boolean isInit(); void setInit(Boolean init); @P... | AbstractReferenceConfig extends AbstractInterfaceConfig { @Override public void setOnconnect(String onconnect) { if (onconnect != null && onconnect.length() > 0) { this.stubevent = true; } super.setOnconnect(onconnect); } Boolean isCheck(); void setCheck(Boolean check); Boolean isInit(); void setInit(Boolean init); @P... |
@Test public void testProtocol() throws Exception { ProviderConfig provider = new ProviderConfig(); provider.setProtocol("protocol"); assertThat(provider.getProtocol().getName(), equalTo("protocol")); } | @Deprecated public void setProtocol(String protocol) { this.protocols = new ArrayList<>(Arrays.asList(new ProtocolConfig(protocol))); } | ProviderConfig extends AbstractServiceConfig { @Deprecated public void setProtocol(String protocol) { this.protocols = new ArrayList<>(Arrays.asList(new ProtocolConfig(protocol))); } } | ProviderConfig extends AbstractServiceConfig { @Deprecated public void setProtocol(String protocol) { this.protocols = new ArrayList<>(Arrays.asList(new ProtocolConfig(protocol))); } } | ProviderConfig extends AbstractServiceConfig { @Deprecated public void setProtocol(String protocol) { this.protocols = new ArrayList<>(Arrays.asList(new ProtocolConfig(protocol))); } @Deprecated void setProtocol(String protocol); @Parameter(excluded = true) Boolean isDefault(); @Deprecated void setDefault(Boolean isDe... | ProviderConfig extends AbstractServiceConfig { @Deprecated public void setProtocol(String protocol) { this.protocols = new ArrayList<>(Arrays.asList(new ProtocolConfig(protocol))); } @Deprecated void setProtocol(String protocol); @Parameter(excluded = true) Boolean isDefault(); @Deprecated void setDefault(Boolean isDe... |
@Test public void testExecuteLimitInvoke() throws Exception { Invoker invoker = Mockito.mock(Invoker.class); when(invoker.invoke(any(Invocation.class))).thenReturn(new RpcResult("result")); when(invoker.getUrl()).thenReturn(URL.valueOf("test: Invocation invocation = Mockito.mock(Invocation.class); when(invocation.getMe... | @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, methodName, max)) { throw new RpcException("... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... |
@Test void name() { ApplicationBuilder builder = new ApplicationBuilder(); builder.name("app"); Assertions.assertEquals("app", builder.build().getName()); } | public ApplicationBuilder name(String name) { this.name = name; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder name(String name) { this.name = name; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder name(String name) { this.name = name; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder name(String name) { this.name = name; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilder organizati... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder name(String name) { this.name = name; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilder organizati... |
@Test void version() { ApplicationBuilder builder = new ApplicationBuilder(); builder.version("version"); Assertions.assertEquals("version", builder.build().getVersion()); } | public ApplicationBuilder version(String version) { this.version = version; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder version(String version) { this.version = version; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder version(String version) { this.version = version; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder version(String version) { this.version = version; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilde... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder version(String version) { this.version = version; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilde... |
@Test void owner() { ApplicationBuilder builder = new ApplicationBuilder(); builder.owner("owner"); Assertions.assertEquals("owner", builder.build().getOwner()); } | public ApplicationBuilder owner(String owner) { this.owner = owner; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder owner(String owner) { this.owner = owner; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder owner(String owner) { this.owner = owner; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder owner(String owner) { this.owner = owner; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilder organi... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder owner(String owner) { this.owner = owner; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilder organi... |
@Test void organization() { ApplicationBuilder builder = new ApplicationBuilder(); builder.organization("organization"); Assertions.assertEquals("organization", builder.build().getOrganization()); } | public ApplicationBuilder organization(String organization) { this.organization = organization; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder organization(String organization) { this.organization = organization; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder organization(String organization) { this.organization = organization; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder organization(String organization) { this.organization = organization; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder organization(String organization) { this.organization = organization; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner... |
@Test void architecture() { ApplicationBuilder builder = new ApplicationBuilder(); builder.architecture("architecture"); Assertions.assertEquals("architecture", builder.build().getArchitecture()); } | public ApplicationBuilder architecture(String architecture) { this.architecture = architecture; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder architecture(String architecture) { this.architecture = architecture; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder architecture(String architecture) { this.architecture = architecture; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder architecture(String architecture) { this.architecture = architecture; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder architecture(String architecture) { this.architecture = architecture; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner... |
@Test void environment() { ApplicationBuilder builder = new ApplicationBuilder(); Assertions.assertEquals("product", builder.build().getEnvironment()); builder.environment("develop"); Assertions.assertEquals("develop", builder.build().getEnvironment()); builder.environment("test"); Assertions.assertEquals("test", build... | public ApplicationBuilder environment(String environment) { this.environment = environment; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder environment(String environment) { this.environment = environment; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder environment(String environment) { this.environment = environment; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder environment(String environment) { this.environment = environment; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); A... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder environment(String environment) { this.environment = environment; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); A... |
@Test public void testExecuteLimitInvokeWitException() throws Exception { Invoker invoker = Mockito.mock(Invoker.class); doThrow(new RpcException()) .when(invoker).invoke(any(Invocation.class)); URL url = URL.valueOf("test: when(invoker.getUrl()).thenReturn(url); Invocation invocation = Mockito.mock(Invocation.class); ... | @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, methodName, max)) { throw new RpcException("... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... | ExecuteLimitFilter implements Filter { @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = url.getMethodParameter(methodName, Constants.EXECUTES_KEY, 0); if (!RpcStatus.beginCount(url, metho... |
@Test void compiler() { ApplicationBuilder builder = new ApplicationBuilder(); builder.compiler("compiler"); Assertions.assertEquals("compiler", builder.build().getCompiler()); } | public ApplicationBuilder compiler(String compiler) { this.compiler = compiler; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder compiler(String compiler) { this.compiler = compiler; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder compiler(String compiler) { this.compiler = compiler; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder compiler(String compiler) { this.compiler = compiler; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBu... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder compiler(String compiler) { this.compiler = compiler; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBu... |
@Test void logger() { ApplicationBuilder builder = new ApplicationBuilder(); builder.logger("log4j"); Assertions.assertEquals("log4j", builder.build().getLogger()); } | public ApplicationBuilder logger(String logger) { this.logger = logger; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder logger(String logger) { this.logger = logger; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder logger(String logger) { this.logger = logger; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder logger(String logger) { this.logger = logger; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilder or... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder logger(String logger) { this.logger = logger; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); ApplicationBuilder or... |
@Test void addRegistry() { RegistryConfig registry = new RegistryConfig(); ApplicationBuilder builder = new ApplicationBuilder(); builder.addRegistry(registry); Assertions.assertNotNull(builder.build().getRegistry()); Assertions.assertEquals(1, builder.build().getRegistries().size()); Assertions.assertSame(registry, bu... | public ApplicationBuilder addRegistry(RegistryConfig registry) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.add(registry); return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistry(RegistryConfig registry) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.add(registry); return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistry(RegistryConfig registry) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.add(registry); return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistry(RegistryConfig registry) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.add(registry); return getThis(); } ApplicationBuilder name(String name); Application... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistry(RegistryConfig registry) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.add(registry); return getThis(); } ApplicationBuilder name(String name); Application... |
@Test void addRegistries() { RegistryConfig registry = new RegistryConfig(); ApplicationBuilder builder = new ApplicationBuilder(); builder.addRegistries(Collections.singletonList(registry)); Assertions.assertNotNull(builder.build().getRegistry()); Assertions.assertEquals(1, builder.build().getRegistries().size()); Ass... | public ApplicationBuilder addRegistries(List<? extends RegistryConfig> registries) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.addAll(registries); return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistries(List<? extends RegistryConfig> registries) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.addAll(registries); return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistries(List<? extends RegistryConfig> registries) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.addAll(registries); return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistries(List<? extends RegistryConfig> registries) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.addAll(registries); return getThis(); } ApplicationBuilder name(... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder addRegistries(List<? extends RegistryConfig> registries) { if (this.registries == null) { this.registries = new ArrayList<>(); } this.registries.addAll(registries); return getThis(); } ApplicationBuilder name(... |
@Test void registryIds() { ApplicationBuilder builder = new ApplicationBuilder(); builder.registryIds("registryIds"); Assertions.assertEquals("registryIds", builder.build().getRegistryIds()); } | public ApplicationBuilder registryIds(String registryIds) { this.registryIds = registryIds; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder registryIds(String registryIds) { this.registryIds = registryIds; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder registryIds(String registryIds) { this.registryIds = registryIds; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder registryIds(String registryIds) { this.registryIds = registryIds; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); A... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder registryIds(String registryIds) { this.registryIds = registryIds; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); A... |
@Test void monitor() { MonitorConfig monitor = new MonitorConfig("monitor-addr"); ApplicationBuilder builder = new ApplicationBuilder(); builder.monitor(monitor); Assertions.assertSame(monitor, builder.build().getMonitor()); Assertions.assertEquals("monitor-addr", builder.build().getMonitor().getAddress()); } | public ApplicationBuilder monitor(MonitorConfig monitor) { this.monitor = monitor; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder monitor(MonitorConfig monitor) { this.monitor = monitor; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder monitor(MonitorConfig monitor) { this.monitor = monitor; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder monitor(MonitorConfig monitor) { this.monitor = monitor; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); Applicatio... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder monitor(MonitorConfig monitor) { this.monitor = monitor; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); Applicatio... |
@Test void isDefault() { ApplicationBuilder builder = new ApplicationBuilder(); builder.isDefault(true); Assertions.assertTrue(builder.build().isDefault()); builder.isDefault(false); Assertions.assertFalse(builder.build().isDefault()); builder.isDefault(null); Assertions.assertNull(builder.build().isDefault()); } | public ApplicationBuilder isDefault(Boolean isDefault) { this.isDefault = isDefault; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder isDefault(Boolean isDefault) { this.isDefault = isDefault; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder isDefault(Boolean isDefault) { this.isDefault = isDefault; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder isDefault(Boolean isDefault) { this.isDefault = isDefault; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); Applicat... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder isDefault(Boolean isDefault) { this.isDefault = isDefault; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); Applicat... |
@Test void dumpDirectory() { ApplicationBuilder builder = new ApplicationBuilder(); builder.dumpDirectory("dumpDirectory"); Assertions.assertEquals("dumpDirectory", builder.build().getDumpDirectory()); } | public ApplicationBuilder dumpDirectory(String dumpDirectory) { this.dumpDirectory = dumpDirectory; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder dumpDirectory(String dumpDirectory) { this.dumpDirectory = dumpDirectory; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder dumpDirectory(String dumpDirectory) { this.dumpDirectory = dumpDirectory; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder dumpDirectory(String dumpDirectory) { this.dumpDirectory = dumpDirectory; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String o... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder dumpDirectory(String dumpDirectory) { this.dumpDirectory = dumpDirectory; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String o... |
@Test void qosEnable() { ApplicationBuilder builder = new ApplicationBuilder(); builder.qosEnable(true); Assertions.assertTrue(builder.build().getQosEnable()); builder.qosEnable(false); Assertions.assertFalse(builder.build().getQosEnable()); builder.qosEnable(null); Assertions.assertNull(builder.build().getQosEnable())... | public ApplicationBuilder qosEnable(Boolean qosEnable) { this.qosEnable = qosEnable; return getThis(); } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder qosEnable(Boolean qosEnable) { this.qosEnable = qosEnable; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder qosEnable(Boolean qosEnable) { this.qosEnable = qosEnable; return getThis(); } } | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder qosEnable(Boolean qosEnable) { this.qosEnable = qosEnable; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); Applicat... | ApplicationBuilder extends AbstractBuilder<ApplicationConfig, ApplicationBuilder> { public ApplicationBuilder qosEnable(Boolean qosEnable) { this.qosEnable = qosEnable; return getThis(); } ApplicationBuilder name(String name); ApplicationBuilder version(String version); ApplicationBuilder owner(String owner); Applicat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.