aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbveliev2011-10-22 07:09:51 (EDT)
committerbveliev2011-10-22 07:09:51 (EDT)
commit40720c658e0ad12df8647b94ac03f63da7e2a494 (patch)
treef2a5d86699d03a3484f3baba62d74109435382ed
parent12ebd2a405457bd9c856fedc7c172b1b9c63eb90 (diff)
downloadorg.eclipse.rtp-40720c658e0ad12df8647b94ac03f63da7e2a494.zip
org.eclipse.rtp-40720c658e0ad12df8647b94ac03f63da7e2a494.tar.gz
org.eclipse.rtp-40720c658e0ad12df8647b94ac03f63da7e2a494.tar.bz2
NEW - bug 361725: [Configurator] Remove "refresh" command
https://bugs.eclipse.org/bugs/show_bug.cgi?id=361725
-rw-r--r--bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegate.java8
-rw-r--r--bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java8
-rw-r--r--bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/RTCommandProvider.java26
-rw-r--r--bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java6
-rw-r--r--bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/configurator/core/IConfiguratorService.java20
-rw-r--r--tests/org.eclipse.rtp.configurator.console.test/src/org/eclipse/rtp/configurator/console/RTCommandProviderTest.java43
6 files changed, 37 insertions, 74 deletions
diff --git a/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegate.java b/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegate.java
index a1b8220..aa90980 100644
--- a/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegate.java
+++ b/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegate.java
@@ -23,9 +23,7 @@ public interface CommandDelegate {
void show( List<String> anyListOf );
- void list( );
+ void list();
- void updateWorld( );
-
- void refresh( );
-} \ No newline at end of file
+ void updateWorld();
+}
diff --git a/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java b/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java
index 824c4ae..9be3c81 100644
--- a/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java
+++ b/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java
@@ -146,12 +146,4 @@ public class CommandDelegateImpl implements CommandDelegate {
*/
configurationService.updateWorld();
}
-
- @Override
- public void refresh() {
- /*
- * Should refresh the avalaible repos.
- */
- configurationService.refresh();
- }
}
diff --git a/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/RTCommandProvider.java b/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/RTCommandProvider.java
index 0a10238..f9fd5f8 100644
--- a/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/RTCommandProvider.java
+++ b/bundles/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/RTCommandProvider.java
@@ -1,12 +1,10 @@
-/*******************************************************************************
-* Copyright (c) 2011 EclipseSource and others. All rights reserved. This
-* program and the accompanying materials are made available under the terms of
-* the Eclipse Public License v1.0 which accompanies this distribution, and is
-* available at http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* EclipseSource - initial API and implementation
-*******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 2011 EclipseSource and others. All rights reserved. This program and the
+ * accompanying materials are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html Contributors: EclipseSource - initial API and
+ * implementation
+ *******************************************************************************/
package org.eclipse.rtp.configurator.console;
import java.util.ArrayList;
@@ -25,13 +23,12 @@ public class RTCommandProvider implements CommandProvider {
private static final String SHOW = "show";
private static final String LIST = "list";
private static final String UPDATE_WORLD = "update-world";
- private static final String REFRESH = "refresh";
- private CommandDelegate delegate;
+ private final CommandDelegate delegate;
public RTCommandProvider( CommandDelegate delegate ) {
this.delegate = delegate;
}
-
+
public RTCommandProvider() {
this.delegate = new CommandDelegateImpl();
}
@@ -48,7 +45,7 @@ public class RTCommandProvider implements CommandProvider {
}
private void distributeOperations( String operation, CommandInterpreter interpreter ) {
- List<String> parameter = extractParameter( interpreter );
+ List<String> parameter = extractParameter( interpreter );
if( operation.equals( INSTALL ) ) {
delegate.install( parameter );
} else if( operation.equals( UPDATE ) ) {
@@ -61,8 +58,6 @@ public class RTCommandProvider implements CommandProvider {
delegate.list();
} else if( operation.equals( UPDATE_WORLD ) ) {
delegate.updateWorld();
- } else if( operation.equals( REFRESH ) ) {
- delegate.refresh();
} else if( operation.equals( REMOVE ) ) {
delegate.remove( parameter );
} else {
@@ -85,5 +80,4 @@ public class RTCommandProvider implements CommandProvider {
buffer.append( "---RT Commands---\n" );
return buffer.toString();
}
-
}
diff --git a/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java b/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java
index c4933b9..d486c99 100644
--- a/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java
+++ b/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java
@@ -255,12 +255,6 @@ public class DefaultConfiguratorService implements IConfiguratorService {
return comparator;
}
- @Override
- public IStatus refresh() {
- // TODO Auto-generated method stub
- return null;
- }
-
private List<Source> searchSources( List<String> anyListOf, List<Source> sources ) {
List<Source> result = new ArrayList<Source>();
for( Source source : sources ) {
diff --git a/bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/configurator/core/IConfiguratorService.java b/bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/configurator/core/IConfiguratorService.java
index a803183..826286a 100644
--- a/bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/configurator/core/IConfiguratorService.java
+++ b/bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/configurator/core/IConfiguratorService.java
@@ -1,11 +1,9 @@
-/*******************************************************************************
- * Copyright (c) 2011 EclipseSource and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
+/*******************************************************************************
+ * Copyright (c) 2011 EclipseSource and others. All rights reserved. This program and the
+ * accompanying materials are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html Contributors: EclipseSource - initial API and
+ * implementation
*******************************************************************************/
package org.eclipse.rtp.configurator.core;
@@ -26,9 +24,7 @@ public interface IConfiguratorService {
List<String> show( List<String> anyListOf );
- List<String> list( ) throws CoreException;
+ List<String> list() throws CoreException;
- IStatus updateWorld( );
-
- IStatus refresh( );
+ IStatus updateWorld();
}
diff --git a/tests/org.eclipse.rtp.configurator.console.test/src/org/eclipse/rtp/configurator/console/RTCommandProviderTest.java b/tests/org.eclipse.rtp.configurator.console.test/src/org/eclipse/rtp/configurator/console/RTCommandProviderTest.java
index 61376f6..8169fba 100644
--- a/tests/org.eclipse.rtp.configurator.console.test/src/org/eclipse/rtp/configurator/console/RTCommandProviderTest.java
+++ b/tests/org.eclipse.rtp.configurator.console.test/src/org/eclipse/rtp/configurator/console/RTCommandProviderTest.java
@@ -1,11 +1,9 @@
-/*******************************************************************************
- * Copyright (c) 2011 EclipseSource and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
+/*******************************************************************************
+ * Copyright (c) 2011 EclipseSource and others. All rights reserved. This program and the
+ * accompanying materials are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html Contributors: EclipseSource - initial API and
+ * implementation
*******************************************************************************/
package org.eclipse.rtp.configurator.console;
@@ -20,9 +18,8 @@ import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.junit.Before;
import org.junit.Test;
-
public class RTCommandProviderTest {
-
+
private CommandDelegate fakeDelegate;
private RTCommandProvider provider;
private CommandInterpreter fakeInterpreter;
@@ -35,74 +32,66 @@ public class RTCommandProviderTest {
fakeInterpreter = mock( CommandInterpreter.class );
nullArg = null;
}
-
+
@Test
public void failWithoutParam() {
Object result = provider._rt( fakeInterpreter );
assertEquals( RTCommandProvider.FAIL, result );
}
-
+
@Test
public void withInvalidInstruction() {
when( fakeInterpreter.nextArgument() ).thenReturn( "asadf", nullArg );
provider._rt( fakeInterpreter );
verify( fakeDelegate ).unsupportedOperation( anyString() );
}
-
+
@Test
public void withInstall() {
when( fakeInterpreter.nextArgument() ).thenReturn( "install", nullArg );
provider._rt( fakeInterpreter );
verify( fakeDelegate ).install( anyListOf( String.class ) );
}
-
+
@Test
public void withUpdate() {
when( fakeInterpreter.nextArgument() ).thenReturn( "update", nullArg );
provider._rt( fakeInterpreter );
verify( fakeDelegate ).update( anyListOf( String.class ) );
}
-
+
@Test
public void withRemove() {
when( fakeInterpreter.nextArgument() ).thenReturn( "remove", nullArg );
provider._rt( fakeInterpreter );
verify( fakeDelegate ).remove( anyListOf( String.class ) );
}
-
+
@Test
public void withSearch() {
when( fakeInterpreter.nextArgument() ).thenReturn( "search", nullArg );
provider._rt( fakeInterpreter );
verify( fakeDelegate ).search( anyListOf( String.class ) );
}
-
+
@Test
public void withShow() {
when( fakeInterpreter.nextArgument() ).thenReturn( "show", nullArg );
provider._rt( fakeInterpreter );
verify( fakeDelegate ).show( anyListOf( String.class ) );
}
-
+
@Test
public void withList() {
when( fakeInterpreter.nextArgument() ).thenReturn( "list", nullArg );
provider._rt( fakeInterpreter );
verify( fakeDelegate ).list();
}
-
+
@Test
public void withUpdateWorld() {
when( fakeInterpreter.nextArgument() ).thenReturn( "update-world", nullArg );
provider._rt( fakeInterpreter );
verify( fakeDelegate ).updateWorld();
}
-
- @Test
- public void withRefresh() {
- when( fakeInterpreter.nextArgument() ).thenReturn( "refresh", nullArg );
- provider._rt( fakeInterpreter );
- verify( fakeDelegate ).refresh();
- }
-
}