aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbveliev2012-02-15 13:19:40 (EST)
committerbveliev2012-02-15 13:19:40 (EST)
commit76625b78f0ace5178afc1e470b4f1ad556775b70 (patch)
tree1c10f3c98beca36fab02f5b4055d03efd4084d69
parent34f884ea90f3954e234efff0478d4de411ec1dae (diff)
downloadorg.eclipse.rtp-76625b78f0ace5178afc1e470b4f1ad556775b70.zip
org.eclipse.rtp-76625b78f0ace5178afc1e470b4f1ad556775b70.tar.gz
org.eclipse.rtp-76625b78f0ace5178afc1e470b4f1ad556775b70.tar.bz2
369337: Provide all provisioning APIs via REST-APIs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369337
-rw-r--r--bundles/org.eclipse.rtp.configurator.console/RT Configurator Console.launch9
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/.classpath7
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/.project33
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.jdt.core.prefs353
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/META-INF/MANIFEST.MF17
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/OSGI-INF/rtpConfiguratorServiceReference.xml7
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/about.html31
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/build.properties7
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/plugin.properties12
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/pom.xml20
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/RestProviderActivator.java100
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/RuntimeProvisioningServlet.java88
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/DeleteRequestHandler.java53
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/GetRequestHandler.java152
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/PutRequestHandler.java55
-rw-r--r--bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/util/PathInfoUtil.java72
-rw-r--r--bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/Source.java6
-rw-r--r--bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/SourceUnMarshaller.java5
-rw-r--r--bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/internal/SourceUnMarshallerImpl.java16
-rw-r--r--bundles/org.eclipse.rtp.core.service.provider/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/RuntimeProvisioningServiceImpl.java19
-rw-r--r--bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/util/P2Util.java7
-rw-r--r--bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/core/util/ModelUtil.java21
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/.classpath7
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/.project33
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.jdt.core.prefs353
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/META-INF/MANIFEST.MF11
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/build.properties4
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/pom.xml20
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/DeleteRequestHandlerTest.java110
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/GetRequestHandlerTest.java229
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/PutRequestHandlerTest.java131
-rw-r--r--tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/util/PathInfoUtilTest.java145
-rw-r--r--tests/org.eclipse.rtp.core.model.test/src/org/eclipse/rtp/core/model/SourceUnMarshallerTest.java33
-rw-r--r--tests/org.eclipse.rtp.core.model.test/tmp.txt1
39 files changed, 2152 insertions, 32 deletions
diff --git a/bundles/org.eclipse.rtp.configurator.console/RT Configurator Console.launch b/bundles/org.eclipse.rtp.configurator.console/RT Configurator Console.launch
index 9c92466..81fb1e1 100644
--- a/bundles/org.eclipse.rtp.configurator.console/RT Configurator Console.launch
+++ b/bundles/org.eclipse.rtp.configurator.console/RT Configurator Console.launch
@@ -6,19 +6,20 @@
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/RTP Console"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/RT Configurator Console"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="default_auto_start" value="true"/>
<intAttribute key="default_start_level" value="4"/>
+<stringAttribute key="deselected_workspace_plugins" value="org.eclipse.rtp.configurator.ui,org.eclipse.rtp.httpdeployer,org.eclipse.rtp.httpdeployer.launch,org.eclipse.rtp.httpdeployer.launch.test,org.eclipse.rtp.httpdeployer.launch.ui,org.eclipse.rtp.httpdeployer.test"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.osgi.service.http.port=8080"/>
<stringAttribute key="pde.version" value="3.3"/>
<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="target_bundles" value="com.google.gson@default:default,javax.servlet@default:default,org.apache.ant@default:default,org.apache.commons.io@default:default,org.easymock@default:default,org.eclipse.ant.core@default:default,org.eclipse.ant.optional.junit@default:false,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.win32.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@default:true,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.publisher.eclipse@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.win32.x86_64@default:false,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.hamcrest.integration@default:default,org.hamcrest.library@default:default,org.hamcrest.text@default:default,org.hamcrest@default:default,org.junit*4.8.2.v4_8_2_v20110321-1705@default:default,org.mockito@default:default,org.objenesis@default:default,org.sat4j.core@default:default,org.sat4j.pb@default:default"/>
+<stringAttribute key="target_bundles" value="com.google.gson@default:default,javax.servlet@default:default,org.apache.ant@default:default,org.apache.commons.io@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.core.net.win32.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@default:true,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.publisher.eclipse@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.win32.x86@default:false,org.eclipse.equinox.security.win32.x86_64@default:false,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.equinox.util@default:default,org.eclipse.jetty.continuation@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.junit@default:default,org.mockito@default:default,org.objenesis@default:default,org.sat4j.core@default:default,org.sat4j.pb@default:default"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<stringAttribute key="workspace_bundles" value="org.eclipse.rtp.configurator.console@default:default,org.eclipse.rtp.configurator.test@default:false,org.eclipse.rtp.core.model.test@default:false,org.eclipse.rtp.core.model@default:default,org.eclipse.rtp.core.service.provider.test@default:false,org.eclipse.rtp.core.service.provider@default:default,org.eclipse.rtp.core.test@default:default,org.eclipse.rtp.core@default:default"/>
+<stringAttribute key="workspace_bundles" value="org.eclipse.rtp.configurator.console.test@default:false,org.eclipse.rtp.configurator.console@default:default,org.eclipse.rtp.configurator.rest.provider.test@default:false,org.eclipse.rtp.configurator.rest.provider@default:default,org.eclipse.rtp.core.model.test@default:false,org.eclipse.rtp.core.model@default:default,org.eclipse.rtp.core.service.provider.test@default:false,org.eclipse.rtp.core.service.provider@default:default,org.eclipse.rtp.core.test@default:false,org.eclipse.rtp.core@default:default,org.hamcrest.core@default:default"/>
</launchConfiguration>
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/.classpath b/bundles/org.eclipse.rtp.configurator.rest.provider/.classpath
new file mode 100644
index 0000000..8a8f166
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/.project b/bundles/org.eclipse.rtp.configurator.rest.provider/.project
new file mode 100644
index 0000000..cce12f8
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.rtp.configurator.rest.provider</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..3dd9ba6
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,353 @@
+#Tue Aug 02 10:24:10 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=82
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=82
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=82
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=82
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=50
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=52
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=51
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=52
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=82
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=82
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=84
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=36
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=36
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=36
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=36
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=0
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=0
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line_on_wrap
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line_on_wrap
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=true
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=0
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..dacffb7
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,4 @@
+#Fri Jul 29 11:29:44 CEST 2011
+eclipse.preferences.version=1
+formatter_profile=_pe
+formatter_settings_version=12
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..7d61edf
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Mon Jul 25 11:09:19 CEST 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/META-INF/MANIFEST.MF b/bundles/org.eclipse.rtp.configurator.rest.provider/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..e1a93b2
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.rtp.configurator.rest.provider;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.rtp.configurator.rest.provider.RestProviderActivator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.rtp.core;bundle-version="1.0.0",
+ org.eclipse.rtp.core.model;bundle-version="1.0.0",
+ org.eclipse.osgi.services;bundle-version="3.3.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %bundleVendor
+Service-Component: OSGI-INF/rtpConfiguratorServiceReference.xml
+Import-Package: javax.servlet;version="2.6.0",
+ javax.servlet.http;version="2.6.0",
+ org.eclipse.rtp.configurator.service.provider.internal.util
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/OSGI-INF/rtpConfiguratorServiceReference.xml b/bundles/org.eclipse.rtp.configurator.rest.provider/OSGI-INF/rtpConfiguratorServiceReference.xml
new file mode 100644
index 0000000..6769f45
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/OSGI-INF/rtpConfiguratorServiceReference.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activateServices" deactivate="deactivateServices" name="org.eclipse.rtp.configurator.rest.provider">
+ <implementation class="org.eclipse.rtp.configurator.rest.provider.RestProviderActivator"/>
+ <reference bind="setUp" cardinality="1..1" interface="org.eclipse.rtp.core.RuntimeProvisioningService" name="RuntimeProvisioningService" policy="static" unbind="shutDown"/>
+ <reference bind="setUpHttpService" cardinality="1..1" interface="org.osgi.service.http.HttpService" name="HttpService" policy="static" unbind="shutDownHttpService"/>
+ <reference bind="setUpSourceUnmarshaller" cardinality="1..1" interface="org.eclipse.rtp.core.model.SourceUnMarshaller" name="SourceUnMarshaller" policy="static" unbind="shutDownSourceUnmarshaller"/>
+</scr:component>
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/about.html b/bundles/org.eclipse.rtp.configurator.rest.provider/about.html
new file mode 100644
index 0000000..366647d
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/about.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>January 12, 2012</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+<h3>Third Party Content</h3>
+
+<p>No Third Party Content<p>
+</body>
+</html>
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/build.properties b/bundles/org.eclipse.rtp.configurator.rest.provider/build.properties
new file mode 100644
index 0000000..d43b7eb
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/,\
+ about.html,\
+ plugin.properties
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/plugin.properties b/bundles/org.eclipse.rtp.configurator.rest.provider/plugin.properties
new file mode 100644
index 0000000..5613592
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2012 by 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
+###############################################################################
+bundleVendor = Eclipse RTP
+bundleName = Configurator REST API Provider \ No newline at end of file
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/pom.xml b/bundles/org.eclipse.rtp.configurator.rest.provider/pom.xml
new file mode 100644
index 0000000..b85a2eb
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/pom.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2012, 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 -->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>rtp-packages-parent</artifactId>
+ <groupId>org.eclipse</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../packages/org.eclipse.rtp.releng/pom.xml</relativePath>
+ </parent>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.rtp.configurator.rest.provider</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/RestProviderActivator.java b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/RestProviderActivator.java
new file mode 100644
index 0000000..0241e4a
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/RestProviderActivator.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.rest.provider;
+
+import org.eclipse.rtp.core.RuntimeProvisioningService;
+import org.eclipse.rtp.core.model.SourceUnMarshaller;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.http.HttpService;
+
+public class RestProviderActivator implements BundleActivator {
+
+ private static BundleContext context;
+ private static RuntimeProvisioningService provisioningService;
+ private static RestProviderActivator instance;
+ private static HttpService httpService;
+ private static SourceUnMarshaller sourceUnmarshallerServie;
+
+ public static void setUp( RuntimeProvisioningService service ) {
+ provisioningService = service;
+ }
+
+ public static void shutDown( RuntimeProvisioningService service ) {
+ provisioningService = null;
+ }
+
+ public RuntimeProvisioningService getProvisioningService() {
+ return provisioningService;
+ }
+
+ public static void setUpHttpService( HttpService service ) {
+ httpService = service;
+ }
+
+ public static void shutDownHttpService( HttpService service ) {
+ httpService = null;
+ }
+
+ public HttpService getHttpService() {
+ return httpService;
+ }
+
+ public static void setUpSourceUnmarshaller( SourceUnMarshaller service ) {
+ sourceUnmarshallerServie = service;
+ }
+
+ public static void shutDownSourceUnmarshaller( SourceUnMarshaller service ) {
+ sourceUnmarshallerServie = null;
+ }
+
+ public SourceUnMarshaller getMarshalService() {
+ return sourceUnmarshallerServie;
+ }
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ public static RestProviderActivator getDefault() {
+ return instance;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start( BundleContext bundleContext ) throws Exception {
+ RestProviderActivator.context = bundleContext;
+ RestProviderActivator.instance = this;
+ }
+
+ public static void activateServices() {
+ try {
+ httpService.registerServlet( "/rt", new RuntimeProvisioningServlet(), null, null );
+ } catch( Exception e ) {
+ System.out.println( "Failed to register servlets" );
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop( BundleContext bundleContext ) throws Exception {
+ RestProviderActivator.context = null;
+ RestProviderActivator.instance = null;
+ }
+
+ public static void deactivateServices() {
+ httpService.unregister( "/rt" );
+ }
+}
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/RuntimeProvisioningServlet.java b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/RuntimeProvisioningServlet.java
new file mode 100644
index 0000000..a22d912
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/RuntimeProvisioningServlet.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.rest.provider;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.rtp.configurator.rest.provider.internal.DeleteRequestHandler;
+import org.eclipse.rtp.configurator.rest.provider.internal.GetRequestHandler;
+import org.eclipse.rtp.configurator.rest.provider.internal.PutRequestHandler;
+
+public class RuntimeProvisioningServlet extends HttpServlet implements Servlet {
+
+ private static final int ERROR_STATUS = 500;
+ private static final int OK_STATUS = 200;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet( HttpServletRequest req, HttpServletResponse resp )
+ throws ServletException, IOException
+ {
+ GetRequestHandler getRequestHandler = new GetRequestHandler();
+ String resultList = "";
+ try {
+ resultList = getRequestHandler.handleRequest( req );
+ resp.setStatus( OK_STATUS );
+ } catch( CoreException e ) {
+ resp.setStatus( ERROR_STATUS );
+ System.out.println( "Failed to handle get request" );
+ System.out.println( e.getStackTrace() );
+ }
+ PrintWriter writer = resp.getWriter();
+ writer.write( resultList );
+ writer.flush();
+ }
+
+ @Override
+ protected void doDelete( HttpServletRequest req, HttpServletResponse resp )
+ throws ServletException, IOException
+ {
+ DeleteRequestHandler deleteRequestHandler = new DeleteRequestHandler();
+ IStatus requestStatus = deleteRequestHandler.handleRequest( req,
+ RestProviderActivator.getDefault()
+ .getProvisioningService() );
+ PrintWriter writer = resp.getWriter();
+ if( requestStatus.isOK() ) {
+ resp.setStatus( OK_STATUS );
+ } else {
+ writer.write( requestStatus.getMessage() );
+ resp.setStatus( ERROR_STATUS );
+ writer.flush();
+ }
+ }
+
+ @Override
+ protected void doPut( HttpServletRequest req, HttpServletResponse resp )
+ throws ServletException, IOException
+ {
+ PutRequestHandler putRequestHandler = new PutRequestHandler();
+ IStatus requestStatus = putRequestHandler.handleRequest( req,
+ RestProviderActivator.getDefault()
+ .getProvisioningService() );
+ if( requestStatus.isOK() ) {
+ resp.setStatus( OK_STATUS );
+ } else {
+ resp.setStatus( ERROR_STATUS );
+ PrintWriter writer = resp.getWriter();
+ writer.write( requestStatus.getMessage() );
+ writer.flush();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/DeleteRequestHandler.java b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/DeleteRequestHandler.java
new file mode 100644
index 0000000..516ecb7
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/DeleteRequestHandler.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.rest.provider.internal;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.rtp.configurator.rest.provider.internal.util.PathInfoUtil;
+import org.eclipse.rtp.core.RuntimeProvisioningService;
+import org.eclipse.rtp.core.model.Source;
+import org.eclipse.rtp.core.model.SourceVersion;
+import org.eclipse.rtp.core.util.ModelUtil;
+
+public class DeleteRequestHandler {
+
+ public IStatus handleRequest( HttpServletRequest request,
+ RuntimeProvisioningService provisioningService )
+ {
+ IStatus result = Status.CANCEL_STATUS;
+ String pathInfo = request.getPathInfo();
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ if( pathInfo == null || pathInfo.length() == 0 ) {
+ result = Status.CANCEL_STATUS;
+ } else if( pathInfoUtil.isProvisioning( pathInfo, getModelUtil(), getSources() ) ) {
+ SourceVersion sourceVerionToRemove = pathInfoUtil.getSourceVersion( pathInfo,
+ getModelUtil(),
+ getSources() );
+ List<SourceVersion> sourceVersoinsToDelte = Arrays.asList( new SourceVersion[]{
+ sourceVerionToRemove
+ } );
+ result = provisioningService.remove( sourceVersoinsToDelte );
+ }
+ return result;
+ }
+
+ protected List<Source> getSources() {
+ List<Source> sources = ModelUtil.getSourceProvider().getSources();
+ return sources;
+ }
+
+ protected ModelUtil getModelUtil() {
+ return new ModelUtil();
+ }
+}
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/GetRequestHandler.java b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/GetRequestHandler.java
new file mode 100644
index 0000000..d4a4e71
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/GetRequestHandler.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.rest.provider.internal;
+
+import java.util.ArrayList;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.rtp.configurator.rest.provider.RestProviderActivator;
+import org.eclipse.rtp.configurator.rest.provider.internal.util.PathInfoUtil;
+import org.eclipse.rtp.configurator.service.provider.internal.util.P2Util;
+import org.eclipse.rtp.core.model.Source;
+import org.eclipse.rtp.core.model.SourceUnMarshaller;
+import org.eclipse.rtp.core.model.SourceVersion;
+import org.eclipse.rtp.core.util.ModelUtil;
+
+@SuppressWarnings( "restriction" )
+public class GetRequestHandler {
+
+ public String handleRequest( HttpServletRequest request ) throws CoreException {
+ String result = null;
+ String pathInfo = request.getPathInfo();
+ String[] pathSegments = new PathInfoUtil().splitPathInfo( pathInfo );
+ if( pathInfo == null || pathInfo.length() == 0 ) {
+ result = "";
+ } else if( "list".equalsIgnoreCase( pathSegments[ 0 ] ) ) {
+ result = handleListRequest( pathSegments );
+ } else if( "show".equalsIgnoreCase( pathSegments[ 0 ] ) ) {
+ result = handleShowRequest( pathInfo, request.getParameter( "query" ) );
+ } else if( "search".equalsIgnoreCase( pathSegments[ 0 ] ) ) {
+ result = handleSearchRequest( pathInfo, request.getParameter( "query" ) );
+ } else {
+ result = "Unsupported GET REST API";
+ }
+ return result;
+ }
+
+ private String handleListRequest( String[] pathSegments ) throws CoreException {
+ List<Source> sources = getModelUtil().list();
+ if( pathSegments.length == 2 && "installed".equalsIgnoreCase( pathSegments[ 1 ] ) ) {
+ sources = filterUninstalledSourceVersions( sources );
+ } else if( pathSegments.length == 2 && "uninstalled".equalsIgnoreCase( pathSegments[ 1 ] ) ) {
+ sources = filterInstalledSourceVersions( sources );
+ }
+ String result = sourcesToString( sources );
+ return result;
+ }
+
+ private List<Source> filterUninstalledSourceVersions( List<Source> sources ) {
+ List<Source> result = new ArrayList<Source>();
+ P2Util p2Util = getP2Util();
+ for( Source source : sources ) {
+ Source sourceToAdd = new Source( source.getName(),
+ source.getDescription(),
+ source.getInfoUrl() );
+ filterUninstalled( p2Util, source.getVersions(), sourceToAdd );
+ if( sourceToAdd.getVersions().size() > 0 ) {
+ result.add( sourceToAdd );
+ }
+ }
+ return result;
+ }
+
+ private List<Source> filterInstalledSourceVersions( List<Source> sources ) {
+ List<Source> result = new ArrayList<Source>();
+ P2Util p2Util = getP2Util();
+ for( Source source : sources ) {
+ Source sourceToAdd = new Source( source.getName(),
+ source.getDescription(),
+ source.getInfoUrl() );
+ filterInstalled( p2Util, source.getVersions(), sourceToAdd );
+ if( sourceToAdd.getVersions().size() > 0 ) {
+ result.add( sourceToAdd );
+ }
+ }
+ return result;
+ }
+
+ private void filterUninstalled( P2Util p2Util, List<SourceVersion> versions, Source sourceToAdd )
+ {
+ for( SourceVersion sourceVersion : versions ) {
+ if( p2Util.isSourceVersionInstalled( sourceVersion ) ) {
+ sourceToAdd.addVersion( sourceVersion );
+ }
+ }
+ }
+
+ private void filterInstalled( P2Util p2Util, List<SourceVersion> versions, Source sourceToAdd ) {
+ for( SourceVersion sourceVersion : versions ) {
+ if( !p2Util.isSourceVersionInstalled( sourceVersion ) ) {
+ sourceToAdd.addVersion( sourceVersion );
+ }
+ }
+ }
+
+ private String handleShowRequest( String pathInfo, String query ) {
+ String result = null;
+ if( query == null || query.length() == 0 ) {
+ result = "";
+ } else {
+ List<String> queryList = Arrays.asList( new String[]{
+ query
+ } );
+ List<Source> sources = getModelUtil().search( queryList );
+ result = sourcesToString( sources );
+ }
+ return result;
+ }
+
+ private String handleSearchRequest( String pathInfo, String query ) {
+ String result = null;
+ if( query == null || query.length() == 0 ) {
+ result = "";
+ } else {
+ List<String> queryList = Arrays.asList( new String[]{
+ query
+ } );
+ List<Source> sources = getModelUtil().search( queryList );
+ result = sourcesToString( sources );
+ }
+ return result;
+ }
+
+ private String sourcesToString( List<Source> sources ) {
+ SourceUnMarshaller marshalService = getMarshalService();
+ String result = marshalService.unmarshal( sources );
+ return result;
+ }
+
+ protected ModelUtil getModelUtil() {
+ return new ModelUtil();
+ }
+
+ protected P2Util getP2Util() {
+ return new P2Util();
+ }
+
+ protected SourceUnMarshaller getMarshalService() {
+ RestProviderActivator restProviderActivator = RestProviderActivator.getDefault();
+ SourceUnMarshaller sourceUnmarshallerService = restProviderActivator.getMarshalService();
+ return sourceUnmarshallerService;
+ }
+}
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/PutRequestHandler.java b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/PutRequestHandler.java
new file mode 100644
index 0000000..0d8b399
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/PutRequestHandler.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.rest.provider.internal;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.rtp.configurator.rest.provider.internal.util.PathInfoUtil;
+import org.eclipse.rtp.core.RuntimeProvisioningService;
+import org.eclipse.rtp.core.model.Source;
+import org.eclipse.rtp.core.model.SourceVersion;
+import org.eclipse.rtp.core.util.ModelUtil;
+
+public class PutRequestHandler {
+
+ public IStatus handleRequest( HttpServletRequest request,
+ RuntimeProvisioningService provisioningService )
+ {
+ IStatus result = Status.CANCEL_STATUS;
+ String pathInfo = request.getPathInfo();
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ if( pathInfo == null || pathInfo.length() == 0 ) {
+ result = Status.CANCEL_STATUS;
+ } else if( "/updateworld".equalsIgnoreCase( pathInfo ) ) {
+ result = handleUpdateWorldRequest( provisioningService );
+ } else if( pathInfoUtil.isProvisioning( pathInfo, getModelUtil(), getSources() ) ) {
+ SourceVersion searchSourceVerions = pathInfoUtil.getSourceVersion( pathInfo,
+ getModelUtil(),
+ getSources() );
+ result = provisioningService.install( searchSourceVerions );
+ }
+ return result;
+ }
+
+ private IStatus handleUpdateWorldRequest( RuntimeProvisioningService provisioningService ) {
+ return provisioningService.updateWorld();
+ }
+
+ protected List<Source> getSources() {
+ List<Source> sources = ModelUtil.getSourceProvider().getSources();
+ return sources;
+ }
+
+ protected ModelUtil getModelUtil() {
+ return new ModelUtil();
+ }
+}
diff --git a/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/util/PathInfoUtil.java b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/util/PathInfoUtil.java
new file mode 100644
index 0000000..9ae0139
--- /dev/null
+++ b/bundles/org.eclipse.rtp.configurator.rest.provider/src/org/eclipse/rtp/configurator/rest/provider/internal/util/PathInfoUtil.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.rest.provider.internal.util;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.rtp.core.model.Source;
+import org.eclipse.rtp.core.model.SourceVersion;
+import org.eclipse.rtp.core.util.ModelUtil;
+
+public class PathInfoUtil {
+
+ public SourceVersion getSourceVersion( String pathInfo, ModelUtil modelUtil, List<Source> sources )
+ {
+ String sourceName = getSourceName( pathInfo );
+ List<Source> searchSources = modelUtil.searchSources( Arrays.asList( new String[]{
+ sourceName
+ } ), sources );
+ String sourceVersion = getSourceVersion( pathInfo );
+ SourceVersion searchSourceVerions = modelUtil.searchSourceVerions( sourceVersion, searchSources );
+ return searchSourceVerions;
+ }
+
+ public String getSourceVersion( String pathInfo ) {
+ String[] provisioningInfo = getProvisioningInfo( pathInfo );
+ return provisioningInfo[ 1 ];
+ }
+
+ public String getSourceName( String pathInfo ) {
+ String[] provisioningInfo = getProvisioningInfo( pathInfo );
+ return provisioningInfo[ 0 ];
+ }
+
+ public boolean isProvisioning( String pathInfo, ModelUtil modelUtil, List<Source> sources ) {
+ boolean result = false;
+ String[] provisioningInfo = getProvisioningInfo( pathInfo );
+ if( provisioningInfo.length == 2 ) {
+ List<String> sourceQuery = Arrays.asList( new String[]{
+ provisioningInfo[ 0 ]
+ } );
+ List<Source> searchResult = modelUtil.searchSources( sourceQuery, sources );
+ result = !searchResult.isEmpty();
+ }
+ return result;
+ }
+
+ public String[] getProvisioningInfo( String pathInfo ) {
+ String[] provisioningInfo = new String[ 0 ];
+ if( pathInfo != null && pathInfo.length() > 0 ) {
+ Path path = new Path( pathInfo );
+ if( path.segmentCount() == 2 ) {
+ provisioningInfo = path.segments();
+ }
+ }
+ return provisioningInfo;
+ }
+
+ public String[] splitPathInfo( String pathInfo ) {
+ String[] result = new String[ 0 ];
+ if( pathInfo != null && pathInfo.length() > 0 ) {
+ result = new Path( pathInfo ).segments();
+ }
+ return result;
+ }
+}
diff --git a/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/Source.java b/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/Source.java
index 0c82c8b..105c14e 100644
--- a/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/Source.java
+++ b/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/Source.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 EclipseSource and others. All rights reserved. This program and the
+ * Copyright (c) 2012 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
@@ -35,6 +35,10 @@ public class Source {
public void addVersion( SourceVersion version ) {
versions.add( version );
}
+
+ public void removeVersion( SourceVersion version ) {
+ versions.remove( version );
+ }
public List<SourceVersion> getVersions() {
return new ArrayList<SourceVersion>( versions );
diff --git a/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/SourceUnMarshaller.java b/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/SourceUnMarshaller.java
index 8485960..6434783 100644
--- a/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/SourceUnMarshaller.java
+++ b/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/SourceUnMarshaller.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2011 EclipseSource and others. All rights reserved. This
+* Copyright (c) 2012 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
@@ -10,9 +10,12 @@
package org.eclipse.rtp.core.model;
import java.io.InputStream;
+import java.util.List;
public interface SourceUnMarshaller {
SourceProvider marshal( InputStream sources );
+
+ String unmarshal( List<Source> sources);
}
diff --git a/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/internal/SourceUnMarshallerImpl.java b/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/internal/SourceUnMarshallerImpl.java
index 4eb9b2e..7701d9f 100644
--- a/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/internal/SourceUnMarshallerImpl.java
+++ b/bundles/org.eclipse.rtp.core.model/src/org/eclipse/rtp/core/model/internal/SourceUnMarshallerImpl.java
@@ -12,7 +12,9 @@ package org.eclipse.rtp.core.model.internal;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
+import java.util.List;
+import org.eclipse.rtp.core.model.Source;
import org.eclipse.rtp.core.model.SourceProvider;
import org.eclipse.rtp.core.model.SourceUnMarshaller;
@@ -29,4 +31,18 @@ public class SourceUnMarshallerImpl implements SourceUnMarshaller {
JsonReader reader = new JsonReader( streamReader );
return gson.fromJson( reader, SourceProvider.class );
}
+
+ @Override
+ public String unmarshal( List<Source> sources) {
+ SourceProvider sourceProvider = createSourceProvider( sources );
+ return new Gson().toJson( sourceProvider );
+ }
+
+ private SourceProvider createSourceProvider( List<Source> sources ) {
+ SourceProvider sourceProvider = new SourceProvider();
+ for( Source source : sources ) {
+ sourceProvider.addSource( source );
+ }
+ return sourceProvider;
+ }
}
diff --git a/bundles/org.eclipse.rtp.core.service.provider/META-INF/MANIFEST.MF b/bundles/org.eclipse.rtp.core.service.provider/META-INF/MANIFEST.MF
index 45f9233..d225ed2 100644
--- a/bundles/org.eclipse.rtp.core.service.provider/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.rtp.core.service.provider/META-INF/MANIFEST.MF
@@ -25,3 +25,4 @@ Import-Package: org.apache.commons.io;version="[2.0.1,2.1.0)",
org.eclipse.rtp.core.model;version="[1.0.0,1.1.0)",
org.eclipse.rtp.core.util;version="[1.0.0,1.1.0)",
org.osgi.framework;version="[1.7.0,2.0.0)"
+Export-Package: org.eclipse.rtp.configurator.service.provider.internal.util;x-internal:=true
diff --git a/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/RuntimeProvisioningServiceImpl.java b/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/RuntimeProvisioningServiceImpl.java
index 6f440f3..c4aeba5 100644
--- a/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/RuntimeProvisioningServiceImpl.java
+++ b/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/RuntimeProvisioningServiceImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 EclipseSource and others. All rights reserved. This program and the
+ * Copyright (c) 2012 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
@@ -117,23 +117,21 @@ public class RuntimeProvisioningServiceImpl implements RuntimeProvisioningServic
@Override
public List<String> search( List<String> anyListOf ) {
- List<Source> sources = ModelUtil.getSourceProvider().getSources();
- List<Source> result = searchSources( sources, anyListOf );
+ List<Source> result = new ModelUtil().search( anyListOf );
return sourcesToStringSorted( result, false );
}
@Override
public List<String> show( List<String> anyListOf ) {
- List<Source> sources = ModelUtil.getSourceProvider().getSources();
List<String> showSource = new ArrayList<String>();
showSource.add( anyListOf.get( 0 ) );
- List<Source> result = searchSources( sources, showSource );
+ List<Source> result = new ModelUtil().search( showSource );
return sourcesToStringSorted( result, false );
}
@Override
public List<String> list() throws CoreException {
- List<Source> sources = ModelUtil.getSourceProvider().getSources();
+ List<Source> sources = new ModelUtil().list();
List<String> sourcesAsString = sourcesToStringSorted( sources, true );
return sourcesAsString;
}
@@ -150,9 +148,8 @@ public class RuntimeProvisioningServiceImpl implements RuntimeProvisioningServic
@Override
public IStatus update( List<String> anyListOf ) {
- List<Source> sources = ModelUtil.getSourceProvider().getSources();
System.out.println( "Searching for updates" );
- List<Source> sourceToUpdate = searchSources( sources, anyListOf );
+ List<Source> sourceToUpdate = new ModelUtil().search( anyListOf );
System.out.println( "Update started" );
IStatus result = updateSources( sourceToUpdate );
System.out.println( "Update successful" );
@@ -164,11 +161,6 @@ public class RuntimeProvisioningServiceImpl implements RuntimeProvisioningServic
return p2Util.getRepositoryManager().getRepositories();
}
- protected List<Source> searchSources( List<Source> sources, List<String> showSource ) {
- List<Source> result = new ModelUtil().searchSources( showSource, sources );
- return result;
- }
-
@Override
public IStatus updateWorld() {
List<Source> sources = ModelUtil.getSourceProvider().getSources();
@@ -205,7 +197,6 @@ public class RuntimeProvisioningServiceImpl implements RuntimeProvisioningServic
}
protected List<String> sourcesToString( List<Source> sources, boolean addInstalledInfo ) {
- Collections.sort( sources, new ModelUtil().getSourceComparator() );
List<String> sourcesAsString = new ArrayList<String>();
for( Source source : sources ) {
sourcesAsString.add( source.toString() );
diff --git a/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/util/P2Util.java b/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/util/P2Util.java
index 6dd9f47..1755e2f 100644
--- a/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/util/P2Util.java
+++ b/bundles/org.eclipse.rtp.core.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/util/P2Util.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2011 EclipseSource and others. All rights reserved. This
+* Copyright (c) 2012 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
@@ -17,6 +17,7 @@ import org.eclipse.equinox.p2.core.IProvisioningAgentProvider;
import org.eclipse.rtp.configurator.service.provider.internal.ProviderActivator;
import org.eclipse.rtp.configurator.service.provider.internal.deploy.FeatureManager;
import org.eclipse.rtp.configurator.service.provider.internal.deploy.RepositoryManager;
+import org.eclipse.rtp.core.model.SourceVersion;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -57,6 +58,10 @@ public class P2Util {
configurator = null;
}
+ public boolean isSourceVersionInstalled(SourceVersion sourceVersion){
+ return featureManager.isInstalled( sourceVersion );
+ }
+
private static IProvisioningAgent getAgent() throws CoreException {
BundleContext bundleContext = ProviderActivator.getBundleContext();
IProvisioningAgentProvider agentProvider = getService(bundleContext, IProvisioningAgentProvider.class, IProvisioningAgentProvider.SERVICE_NAME);
diff --git a/bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/core/util/ModelUtil.java b/bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/core/util/ModelUtil.java
index 77cf788..4b8e5c7 100644
--- a/bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/core/util/ModelUtil.java
+++ b/bundles/org.eclipse.rtp.core/src/org/eclipse/rtp/core/util/ModelUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 EclipseSource and others. All rights reserved. This program and the
+ * Copyright (c) 2012 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
@@ -13,6 +13,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.rtp.core.internal.CoreActivator;
@@ -98,7 +99,7 @@ public class ModelUtil {
return comparator;
}
- public Comparator<Source> getSourceComparator() {
+ private Comparator<Source> getSourceComparator() {
Comparator<Source> comparator = new Comparator<Source>() {
@Override
@@ -126,8 +127,8 @@ public class ModelUtil {
public SourceVersion searchSourceVerions( String sourceVersion, List<Source> sources ) {
SourceVersion result = null;
- for( Source source : sources ) {
- List<SourceVersion> versions = source.getVersions();
+ for( int i = 0; i < sources.size() && result == null; i++ ) {
+ List<SourceVersion> versions = sources.get( i ).getVersions();
result = getVersion( sourceVersion, versions );
}
return result;
@@ -147,4 +148,16 @@ public class ModelUtil {
}
return result;
}
+
+ public List<Source> list() throws CoreException {
+ List<Source> sources = getSourceProvider().getSources();
+ Collections.sort( sources, getSourceComparator() );
+ return sources;
+ }
+
+ public List<Source> search( List<String> searchQueries ) {
+ List<Source> sources = getSourceProvider().getSources();
+ List<Source> result = new ModelUtil().searchSources( searchQueries, sources );
+ return result;
+ }
}
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/.classpath b/tests/org.eclipse.rtp.configurator.rest.provider.test/.classpath
new file mode 100644
index 0000000..8a8f166
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/.project b/tests/org.eclipse.rtp.configurator.rest.provider.test/.project
new file mode 100644
index 0000000..0513433
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.rtp.configurator.rest.provider.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..3dd9ba6
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,353 @@
+#Tue Aug 02 10:24:10 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=82
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=82
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=82
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=82
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=50
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=52
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=51
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=52
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=82
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=82
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=84
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=36
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=36
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=36
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=36
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=0
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=0
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line_on_wrap
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=next_line_on_wrap
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line_on_wrap
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line_on_wrap
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line_on_wrap
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=true
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=0
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..dacffb7
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,4 @@
+#Fri Jul 29 11:29:44 CEST 2011
+eclipse.preferences.version=1
+formatter_profile=_pe
+formatter_settings_version=12
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.pde.core.prefs b/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..7d61edf
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Mon Jul 25 11:09:19 CEST 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/META-INF/MANIFEST.MF b/tests/org.eclipse.rtp.configurator.rest.provider.test/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..06b005a
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Rest Provider Test
+Bundle-SymbolicName: org.eclipse.rtp.configurator.rest.provider.test
+Bundle-Version: 1.0.0.qualifier
+Fragment-Host: org.eclipse.rtp.configurator.rest.provider;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.rtp.core.model;bundle-version="1.0.0",
+ org.junit;bundle-version="4.8.2",
+ org.mockito;bundle-version="1.8.4"
+Import-Package: org.objenesis;version="1.0.0"
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/build.properties b/tests/org.eclipse.rtp.configurator.rest.provider.test/build.properties
new file mode 100644
index 0000000..e256c3f
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/build.properties
@@ -0,0 +1,4 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .
+source.. = src/
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/pom.xml b/tests/org.eclipse.rtp.configurator.rest.provider.test/pom.xml
new file mode 100644
index 0000000..bc3216c
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/pom.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2012, 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 -->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>rtp-packages-parent</artifactId>
+ <groupId>org.eclipse</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../packages/org.eclipse.rtp.releng/pom.xml</relativePath>
+ </parent>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.rtp.configurator.rest.provider.test</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/DeleteRequestHandlerTest.java b/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/DeleteRequestHandlerTest.java
new file mode 100644
index 0000000..770f411
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/DeleteRequestHandlerTest.java
@@ -0,0 +1,110 @@
+package org.eclipse.rtp.configurator.rest.provider.internal;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.rtp.core.RuntimeProvisioningService;
+import org.eclipse.rtp.core.model.Source;
+import org.eclipse.rtp.core.model.SourceVersion;
+import org.junit.Before;
+import org.junit.Test;
+
+public class DeleteRequestHandlerTest {
+
+ private Source source;
+ private Source source2;
+ private SourceVersion sourceVersion;
+ private SourceVersion sourceVersion2;
+ List<Source> sources;
+ private DeleteRequestHandler deleteRequestHandler;
+
+ @Before
+ public void setUp() throws Exception {
+ initModel();
+ createMocketdeleteRequestHandler();
+ }
+
+ private void initModel() {
+ source = new Source( "test", "test source", "http://foo/test" );
+ source2 = new Source( "test2", "test source2", "http://foo/test2" );
+ sourceVersion = new SourceVersion( "1.0.0", "http://foo/source", "test mock", "http://foo/info" );
+ source.addVersion( sourceVersion );
+ sourceVersion2 = new SourceVersion( "1.1.0",
+ "http://foo/source",
+ "test mock",
+ "http://foo/info" );
+ source2.addVersion( sourceVersion2 );
+ sources = Arrays.asList( new Source[]{
+ source, source2
+ } );
+ }
+
+ private void createMocketdeleteRequestHandler() {
+ deleteRequestHandler = new DeleteRequestHandler() {
+
+ @Override
+ protected List<Source> getSources() {
+ return sources;
+ }
+ };
+ }
+
+ @Test
+ public void testHandleRequestInstallStatusOK() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/test/1.0.0" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ List<SourceVersion> sourceVersionsToDelete = Arrays.asList( new SourceVersion[]{
+ sourceVersion
+ } );
+ when( provisioningServiceMock.remove( sourceVersionsToDelete ) ).thenReturn( Status.OK_STATUS );
+ IStatus status = deleteRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, atLeastOnce() ).remove( sourceVersionsToDelete );
+ assertEquals( Status.OK_STATUS, status );
+ }
+
+ @Test
+ public void testHandleRequestInstallNoVersionProvided() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/test/" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ IStatus status = deleteRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, never() ).install( sourceVersion );
+ assertEquals( Status.CANCEL_STATUS, status );
+ }
+
+ @Test
+ public void testHandleRequestInstallNoNameProvided() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/1.0.0/" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ IStatus status = deleteRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, never() ).install( sourceVersion );
+ assertEquals( Status.CANCEL_STATUS, status );
+ }
+
+ @Test
+ public void testHandleRequestInstallSourceNotExists() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "test3/1.0.0/" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ IStatus status = deleteRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, never() ).install( sourceVersion );
+ assertEquals( Status.CANCEL_STATUS, status );
+ }
+}
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/GetRequestHandlerTest.java b/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/GetRequestHandlerTest.java
new file mode 100644
index 0000000..e6d0d40
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/GetRequestHandlerTest.java
@@ -0,0 +1,229 @@
+package org.eclipse.rtp.configurator.rest.provider.internal;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.mockito.Matchers.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.rtp.configurator.service.provider.internal.util.P2Util;
+import org.eclipse.rtp.core.model.Source;
+import org.eclipse.rtp.core.model.SourceUnMarshaller;
+import org.eclipse.rtp.core.model.SourceVersion;
+import org.eclipse.rtp.core.util.ModelUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings( "restriction" )
+public class GetRequestHandlerTest {
+
+ private Source source;
+ private Source source2;
+ ModelUtil modelUtilMock;
+ SourceUnMarshaller marshalService;
+ private GetRequestHandler requestHandler;
+ private P2Util p2UtilMock;
+
+ @Before
+ public void setUp() {
+ source = new Source( "test", "test source", "http://foo/test" );
+ source.addVersion( new SourceVersion( "1.0",
+ "http://foo/repository",
+ "test version 1",
+ "http://foo/info/url" ) );
+ source.addVersion( new SourceVersion( "2.0",
+ "http://foo/repository",
+ "test version 2",
+ "http://foo/info/url" ) );
+ source2 = new Source( "test2", "test source2", "http://foo/test2" );
+ source2.addVersion( new SourceVersion( "1.0.",
+ "http://foo/repository2",
+ "test version",
+ "http://foo/info/url2" ) );
+ modelUtilMock = mock( ModelUtil.class );
+ marshalService = mock( SourceUnMarshaller.class );
+ p2UtilMock = mock( P2Util.class );
+ requestHandler = new GetRequestHandler() {
+
+ @Override
+ protected ModelUtil getModelUtil() {
+ return modelUtilMock;
+ }
+
+ @Override
+ protected SourceUnMarshaller getMarshalService() {
+ return marshalService;
+ }
+
+ @Override
+ protected P2Util getP2Util() {
+ return p2UtilMock;
+ }
+ };
+ }
+
+ @Test
+ public void testHandleRequestList() throws CoreException {
+ List<Source> expectedSources = new ArrayList<Source>();
+ expectedSources.add( source );
+ expectedSources.add( source2 );
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/list" );
+ when( modelUtilMock.list() ).thenReturn( expectedSources );
+ String expectedResult = "unmarshalling sources";
+ when( marshalService.unmarshal( expectedSources ) ).thenReturn( expectedResult );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( modelUtilMock, atLeastOnce() ).list();
+ verify( marshalService, atLeastOnce() ).unmarshal( expectedSources );
+ assertEquals( expectedResult, result );
+ }
+
+ @Test
+ public void testHandleRequestListInstalled() throws CoreException {
+ List<Source> sources = Arrays.asList( new Source[]{
+ source, source2
+ } );
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/list/installed" );
+ when( modelUtilMock.list() ).thenReturn( sources );
+ String expectedResult = "unmarshalling sources";
+ when( marshalService.unmarshal( anyList() ) ).thenReturn( expectedResult );
+ when( p2UtilMock.isSourceVersionInstalled( source.getVersions().get( 0 ) ) ).thenReturn( true );
+ when( p2UtilMock.isSourceVersionInstalled( source.getVersions().get( 1 ) ) ).thenReturn( false );
+ when( p2UtilMock.isSourceVersionInstalled( source2.getVersions().get( 0 ) ) ).thenReturn( true );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( modelUtilMock, atLeastOnce() ).list();
+ verify( marshalService, atLeastOnce() ).unmarshal( anyList() );
+ verify( p2UtilMock, atLeastOnce() ).isSourceVersionInstalled( source.getVersions().get( 0 ) );
+ verify( p2UtilMock, atLeastOnce() ).isSourceVersionInstalled( source.getVersions().get( 1 ) );
+ verify( p2UtilMock, atLeastOnce() ).isSourceVersionInstalled( source2.getVersions().get( 0 ) );
+ assertEquals( expectedResult, result );
+ }
+
+ @Test
+ public void testHandleRequestListUninstalled() throws CoreException {
+ List<Source> sources = Arrays.asList( new Source[]{
+ source, source2
+ } );
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/list/uninstalled" );
+ when( modelUtilMock.list() ).thenReturn( sources );
+ String expectedResult = "unmarshalling sources";
+ when( marshalService.unmarshal( anyList() ) ).thenReturn( expectedResult );
+ when( p2UtilMock.isSourceVersionInstalled( source.getVersions().get( 0 ) ) ).thenReturn( false );
+ when( p2UtilMock.isSourceVersionInstalled( source.getVersions().get( 1 ) ) ).thenReturn( true );
+ when( p2UtilMock.isSourceVersionInstalled( source2.getVersions().get( 0 ) ) ).thenReturn( false );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( modelUtilMock, atLeastOnce() ).list();
+ verify( marshalService, atLeastOnce() ).unmarshal( anyList() );
+ verify( p2UtilMock, atLeastOnce() ).isSourceVersionInstalled( source.getVersions().get( 0 ) );
+ verify( p2UtilMock, atLeastOnce() ).isSourceVersionInstalled( source.getVersions().get( 1 ) );
+ verify( p2UtilMock, atLeastOnce() ).isSourceVersionInstalled( source2.getVersions().get( 0 ) );
+ assertEquals( expectedResult, result );
+ }
+
+ @Test
+ public void testHandleRequestShow() throws CoreException {
+ List<Source> expectedSources = new ArrayList<Source>();
+ expectedSources.add( source );
+ List<String> queryList = new ArrayList<String>();
+ queryList.add( "test" );
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/show" );
+ when( requestMock.getParameter( "query" ) ).thenReturn( "test" );
+ when( modelUtilMock.search( queryList ) ).thenReturn( expectedSources );
+ when( marshalService.unmarshal( expectedSources ) ).thenReturn( "show result" );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( requestMock, atLeastOnce() ).getParameter( "query" );
+ verify( modelUtilMock, atLeastOnce() ).search( queryList );
+ assertEquals( "show result", result );
+ }
+
+ @Test
+ public void testHandleRequestShowEmptyQueryParameter() throws CoreException {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/show" );
+ when( requestMock.getParameter( "query" ) ).thenReturn( "" );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( requestMock, atLeastOnce() ).getParameter( "query" );
+ verify( modelUtilMock, never() ).search( Arrays.asList( new String[]{
+ ""
+ } ) );
+ assertEquals( "", result );
+ }
+
+ @Test
+ public void testHandleRequestShowNullQueryParameter() throws CoreException {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/show" );
+ when( requestMock.getParameter( "query" ) ).thenReturn( null );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( requestMock, atLeastOnce() ).getParameter( "query" );
+ verify( modelUtilMock, never() ).search( Arrays.asList( new String[]{
+ null
+ } ) );
+ assertEquals( "", result );
+ }
+
+ @Test
+ public void testHandleRequestSearch() throws CoreException {
+ List<Source> expectedSources = new ArrayList<Source>();
+ expectedSources.add( source );
+ List<String> queryList = new ArrayList<String>();
+ queryList.add( "te" );
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/search" );
+ when( requestMock.getParameter( "query" ) ).thenReturn( "te" );
+ when( modelUtilMock.search( queryList ) ).thenReturn( expectedSources );
+ when( marshalService.unmarshal( expectedSources ) ).thenReturn( "search result unmarshalled" );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( requestMock, atLeastOnce() ).getParameter( "query" );
+ verify( modelUtilMock, atLeastOnce() ).search( queryList );
+ verify( marshalService, atLeastOnce() ).unmarshal( expectedSources );
+ assertEquals( "search result unmarshalled", result );
+ }
+
+ @Test
+ public void testHandleRequestSearchNullQueryParameter() throws CoreException {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/search" );
+ when( requestMock.getParameter( "query" ) ).thenReturn( null );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( requestMock, atLeastOnce() ).getParameter( "query" );
+ verify( modelUtilMock, never() ).search( Arrays.asList( new String[]{
+ ""
+ } ) );
+ assertEquals( "", result );
+ }
+
+ @Test
+ public void testHandleRequestSearchEmptyQueryParameter() throws CoreException {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/search" );
+ when( requestMock.getParameter( "query" ) ).thenReturn( "" );
+ String result = requestHandler.handleRequest( requestMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( requestMock, atLeastOnce() ).getParameter( "query" );
+ verify( modelUtilMock, never() ).search( Arrays.asList( new String[]{
+ ""
+ } ) );
+ assertEquals( "", result );
+ }
+}
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/PutRequestHandlerTest.java b/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/PutRequestHandlerTest.java
new file mode 100644
index 0000000..0a39363
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/PutRequestHandlerTest.java
@@ -0,0 +1,131 @@
+package org.eclipse.rtp.configurator.rest.provider.internal;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.rtp.core.RuntimeProvisioningService;
+import org.eclipse.rtp.core.model.Source;
+import org.eclipse.rtp.core.model.SourceVersion;
+import org.junit.Before;
+import org.junit.Test;
+
+public class PutRequestHandlerTest {
+
+ private PutRequestHandler putRequestHandler;
+ private Source source;
+ private Source source2;
+ List<Source> sources;
+ private SourceVersion sourceVersion;
+ private SourceVersion sourceVersion2;
+
+ @Before
+ public void setUp() throws Exception {
+ initModel();
+ createMocketPutRequestHandler();
+ }
+
+ private void initModel() {
+ source = new Source( "test", "test source", "http://foo/test" );
+ source2 = new Source( "test2", "test source2", "http://foo/test2" );
+ sourceVersion = new SourceVersion( "1.0.0", "http://foo/source", "test mock", "http://foo/info" );
+ source.addVersion( sourceVersion );
+ sourceVersion2 = new SourceVersion( "1.1.0",
+ "http://foo/source",
+ "test mock",
+ "http://foo/info" );
+ source2.addVersion( sourceVersion2 );
+ sources = Arrays.asList( new Source[]{
+ source, source2
+ } );
+ }
+
+ private void createMocketPutRequestHandler() {
+ putRequestHandler = new PutRequestHandler() {
+
+ @Override
+ protected List<Source> getSources() {
+ return sources;
+ }
+ };
+ }
+
+ @Test
+ public void testHandleRequestUpdateWorldStatusOk() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/updateworld" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ when( provisioningServiceMock.updateWorld() ).thenReturn( Status.OK_STATUS );
+ IStatus status = putRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, atLeastOnce() ).updateWorld();
+ assertEquals( Status.OK_STATUS, status );
+ }
+
+ @Test
+ public void testHandleRequestUpdateWorldStatusCancel() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/updateworld" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ when( provisioningServiceMock.updateWorld() ).thenReturn( Status.CANCEL_STATUS );
+ IStatus status = putRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, atLeastOnce() ).updateWorld();
+ assertEquals( Status.CANCEL_STATUS, status );
+ }
+
+ @Test
+ public void testHandleRequestInstallStatusOK() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/test/1.0.0" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ when( provisioningServiceMock.install( sourceVersion ) ).thenReturn( Status.OK_STATUS );
+ IStatus status = putRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, atLeastOnce() ).install( sourceVersion );
+ assertEquals( Status.OK_STATUS, status );
+ }
+
+ @Test
+ public void testHandleRequestInstallNoVersionProvided() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/test/" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ IStatus status = putRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, never() ).install( sourceVersion );
+ assertEquals( Status.CANCEL_STATUS, status );
+ }
+
+ @Test
+ public void testHandleRequestInstallNoNameProvided() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "/1.0.0/" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ IStatus status = putRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, never() ).install( sourceVersion );
+ assertEquals( Status.CANCEL_STATUS, status );
+ }
+
+ @Test
+ public void testHandleRequestInstallSourceNotExists() {
+ HttpServletRequest requestMock = mock( HttpServletRequest.class );
+ when( requestMock.getPathInfo() ).thenReturn( "test3/1.0.0/" );
+ RuntimeProvisioningService provisioningServiceMock = mock( RuntimeProvisioningService.class );
+ IStatus status = putRequestHandler.handleRequest( requestMock, provisioningServiceMock );
+ verify( requestMock, atLeastOnce() ).getPathInfo();
+ verify( provisioningServiceMock, never() ).install( sourceVersion );
+ assertEquals( Status.CANCEL_STATUS, status );
+ }
+}
diff --git a/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/util/PathInfoUtilTest.java b/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/util/PathInfoUtilTest.java
new file mode 100644
index 0000000..57575cb
--- /dev/null
+++ b/tests/org.eclipse.rtp.configurator.rest.provider.test/src/org/eclipse/rtp/configurator/rest/provider/internal/util/PathInfoUtilTest.java
@@ -0,0 +1,145 @@
+package org.eclipse.rtp.configurator.rest.provider.internal.util;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.rtp.core.model.Source;
+import org.eclipse.rtp.core.model.SourceVersion;
+import org.eclipse.rtp.core.util.ModelUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+public class PathInfoUtilTest {
+
+ private Source source;
+ private Source source2;
+ private SourceVersion sourceVersion;
+ private SourceVersion sourceVersion2;
+ private List<Source> sources;
+
+ @Before
+ public void setUp() throws Exception {
+ initModel();
+ }
+
+ private void initModel() {
+ source = new Source( "test", "test source", "http://foo/test" );
+ source2 = new Source( "test2", "test source2", "http://foo/test2" );
+ sourceVersion = new SourceVersion( "1.0.0", "http://foo/source", "test mock", "http://foo/info" );
+ source.addVersion( sourceVersion );
+ sourceVersion2 = new SourceVersion( "1.1.0",
+ "http://foo/source",
+ "test mock",
+ "http://foo/info" );
+ source2.addVersion( sourceVersion2 );
+ sources = Arrays.asList( new Source[]{
+ source, source2
+ } );
+ }
+
+ @Test
+ public void testsearchSourceVersionTest() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ SourceVersion result = pathInfoUtil.getSourceVersion( "/test/1.0.0/", new ModelUtil(), sources );
+ assertEquals( sourceVersion, result );
+ }
+
+ @Test
+ public void testsearchSourceVersionTest2() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ SourceVersion result = pathInfoUtil.getSourceVersion( "/test2/1.1.0/", new ModelUtil(), sources );
+ assertEquals( sourceVersion2, result );
+ }
+
+ @Test
+ public void testsearchSourceVersionTestNotExits() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ SourceVersion result = pathInfoUtil.getSourceVersion( "/test3/1.1.0/", new ModelUtil(), sources );
+ assertNull( result );
+ }
+
+ @Test
+ public void testGetSourceVersionString() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ String result = pathInfoUtil.getSourceVersion( "foo/1.0.0" );
+ assertEquals( "1.0.0", result );
+ }
+
+ @Test
+ public void testGetSourceName() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ String result = pathInfoUtil.getSourceName( "foo/1.0.0" );
+ assertEquals( "foo", result );
+ }
+
+ @Test
+ public void testIsProvisioningNullPathInfo() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ boolean result = pathInfoUtil.isProvisioning( null, new ModelUtil(), sources );
+ assertFalse( result );
+ }
+
+ @Test
+ public void testIsProvisioningEmtpyPathInfo() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ boolean result = pathInfoUtil.isProvisioning( "", new ModelUtil(), sources );
+ assertFalse( result );
+ }
+
+ @Test
+ public void testIsProvisioningPathInfoStartsAndEndsWithSlash() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ boolean result = pathInfoUtil.isProvisioning( "/test/1.0.0/", new ModelUtil(), sources );
+ assertTrue( result );
+ }
+
+ @Test
+ public void testIsProvisioningPathInfoStartsWithSlash() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ boolean result = pathInfoUtil.isProvisioning( "/test/1.0.0", new ModelUtil(), sources );
+ assertTrue( result );
+ }
+
+ @Test
+ public void testIsProvisioningPathInfoEndsWithSlash() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ boolean result = pathInfoUtil.isProvisioning( "test/1.0.0/", new ModelUtil(), sources );
+ assertTrue( result );
+ }
+
+ @Test
+ public void testIsProvisioningPathInfoWithoutEndAnsStartSlash() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ boolean result = pathInfoUtil.isProvisioning( "test/1.0.0", new ModelUtil(), sources );
+ assertTrue( result );
+ }
+
+ @Test
+ public void testIsProvisioningPathInfoSourceNotExists() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ boolean result = pathInfoUtil.isProvisioning( "test3/1.0.0", new ModelUtil(), sources );
+ assertFalse( result );
+ }
+
+ @Test
+ public void testIsProvisioningPathInfoSourceVersionNotExists() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ boolean result = pathInfoUtil.isProvisioning( "test3/1.2.0", new ModelUtil(), sources );
+ assertFalse( result );
+ }
+
+ @Test
+ public void testGetProvisioningInfo() {
+ PathInfoUtil pathInfoUtil = new PathInfoUtil();
+ String[] result = pathInfoUtil.getProvisioningInfo( "/foo/1.0.0/" );
+ assertArrayEquals( new String[]{
+ "foo", "1.0.0"
+ }, result );
+ }
+}
diff --git a/tests/org.eclipse.rtp.core.model.test/src/org/eclipse/rtp/core/model/SourceUnMarshallerTest.java b/tests/org.eclipse.rtp.core.model.test/src/org/eclipse/rtp/core/model/SourceUnMarshallerTest.java
index 42c7d11..4e07ac2 100644
--- a/tests/org.eclipse.rtp.core.model.test/src/org/eclipse/rtp/core/model/SourceUnMarshallerTest.java
+++ b/tests/org.eclipse.rtp.core.model.test/src/org/eclipse/rtp/core/model/SourceUnMarshallerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 EclipseSource and others. All rights reserved. This program and the
+ * Copyright (c) 2012 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
@@ -12,20 +12,16 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Arrays;
import java.util.List;
-import org.eclipse.rtp.core.model.Feature;
-import org.eclipse.rtp.core.model.Source;
-import org.eclipse.rtp.core.model.SourceProvider;
-import org.eclipse.rtp.core.model.SourceUnMarshaller;
-import org.eclipse.rtp.core.model.SourceVersion;
import org.eclipse.rtp.core.model.internal.SourceUnMarshallerImpl;
import org.junit.Test;
public class SourceUnMarshallerTest {
@Test
- public void testUnmarshal() throws IOException {
+ public void testMarshal() throws IOException {
InputStream stream = readExampleSources();
SourceUnMarshaller marshaller = new SourceUnMarshallerImpl();
SourceProvider provider = marshaller.marshal( stream );
@@ -86,6 +82,29 @@ public class SourceUnMarshallerTest {
checkFeature( "org.eclipse.rap.feature.group", "2.5.0", features.get( 0 ) );
checkFeature( "org.eclipse.rap.feature.group.ext", "1.5.0", features.get( 1 ) );
}
+
+ @Test
+ public void testUnmarshal() throws IOException {
+ String expectedUnmarshalledString = "{\"sources\":[{\"name\":\"test\",\"description\":\"test description\"," +
+ "\"infoUrl\":\"http://foo/test\",\"versions\":[{\"version\":\"1.0.0\",\"repositoryUrl\":\"http://foo/test/repository\"," +
+ "\"features\":[]},{\"version\":\"2.0.0\",\"repositoryUrl\":\"http://foo/test2/repository\",\"features\":[]}]}," +
+ "{\"name\":\"test2\",\"description\":\"test2 description\",\"infoUrl\":\"http://foo/test2\",\"versions\":[]}]}";
+ SourceUnMarshaller marshaller = new SourceUnMarshallerImpl();
+ List<Source> sources = createTestModel();
+ String unmarshalledSources = marshaller.unmarshal( sources );
+ assertEquals( expectedUnmarshalledString, unmarshalledSources );
+ }
+
+ private List<Source> createTestModel() {
+ Source source = new Source( "test", "test description", "http://foo/test" );
+ SourceVersion version = new SourceVersion( "1.0.0", "http://foo/test/repository", "test version", "htt://foo/version/info" );
+ source.addVersion( version );
+ Source source2 = new Source( "test2", "test2 description", "http://foo/test2" );
+ SourceVersion version2 = new SourceVersion( "2.0.0", "http://foo/test2/repository", "test2 version", "htt://foo/version/info2" );
+ source.addVersion( version2 );
+ List<Source> sources = Arrays.asList( new Source[]{source, source2} );
+ return sources;
+ }
private InputStream readExampleSources() throws IOException {
return this.getClass().getResourceAsStream( "example-sources.json" );
diff --git a/tests/org.eclipse.rtp.core.model.test/tmp.txt b/tests/org.eclipse.rtp.core.model.test/tmp.txt
new file mode 100644
index 0000000..bcff09c
--- /dev/null
+++ b/tests/org.eclipse.rtp.core.model.test/tmp.txt
@@ -0,0 +1 @@
+"{\"sources\":[{\"name\":\"test\",\"description\":\"test description\",\"infoUrl\":\"http://foo/test\",\"versions\":[{\"version\":\"1.0.0\",\"repositoryUrl\":\"http://foo/test/repository\",\"features\":[]},{\"version\":\"2.0.0\",\"repositoryUrl\":\"http://foo/test2/repository\",\"features\":[]}]},{\"name\":\"test2\",\"description\":\"test2 description\",\"infoUrl\":\"http://foo/test2\",\"versions\":[]}]}" \ No newline at end of file