This is an automated email from the ASF dual-hosted git repository. sseifert pushed a commit to branch feature/SLING-12730-parent-62 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing-content.git
commit 01b1dfb341b04e9e58ce49941e7ce964190ebabf Author: Stefan Seifert <[email protected]> AuthorDate: Fri Mar 28 18:10:38 2025 +0100 SLING-12730 apply spotless formatting --- pom.xml | 128 ++++++++++----------- .../adaptable/AbstractRequestAdapterUseObject.java | 8 +- .../testing/adaptable/NonImplementedInterface.java | 34 +++--- .../testing/adaptable/RequestAdapterUseObject.java | 5 +- .../adaptable/ResourceAdapterUseObject.java | 5 +- .../ResourceResolverAdapterUseObject.java | 5 +- .../adaptable/impl/RequestAdapterFactory.java | 12 +- .../impl/RequestAdapterUseObjectImpl.java | 4 +- .../adaptable/impl/ResourceAdapterFactory.java | 12 +- .../impl/ResourceAdapterUseObjectImpl.java | 4 +- .../impl/ResourceResolverAdapterFactory.java | 12 +- .../impl/ResourceResolverAdapterUseObjectImpl.java | 4 +- .../sightly/testing/adaptable/package-info.java | 1 - .../scripting/sightly/testing/models/FaqModel.java | 32 +++--- .../sightly/testing/models/RequestModel.java | 13 ++- .../sightly/testing/models/ResourceModel.java | 4 +- .../testing/models/ResourceResolverModel.java | 40 +++---- .../scripting/sightly/testing/models/TestEnum.java | 7 +- .../sightly/testing/models/TestModel.java | 40 ++++--- .../sightly/testing/models/package-info.java | 1 - .../sling/scripting/sightly/testing/use/Test.java | 39 ++++--- .../scripting/sightly/testing/use/TestService.java | 31 ++--- .../sightly/testing/use/impl/TestServiceImpl.java | 30 ++--- .../sightly/testing/use/package-info.java | 1 - 24 files changed, 237 insertions(+), 235 deletions(-) diff --git a/pom.xml b/pom.xml index a068e0c..2afbc46 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more contributor license agreements. See the NOTICE file @@ -41,24 +41,76 @@ <name>Apache Sling Scripting HTL Testing Content</name> - <description> - This bundle contains: + <description>This bundle contains: - Content adapted from the Adobe HTL TCK meant to test the org.apache.sling.scripting.HTL implementations. - - Content meant to test performance of the org.apache.sling.scripting.HTL implementation. - </description> + - Content meant to test performance of the org.apache.sling.scripting.HTL implementation.</description> <scm> <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing-content.git</connection> <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing-content.git</developerConnection> + <tag>HEAD</tag> <url>https://github.com/apache/sling-org-apache-sling-scripting-sightly-testing-content.git</url> - <tag>HEAD</tag> - </scm> + </scm> <properties> <project.build.outputTimestamp>2024-07-17T13:22:23Z</project.build.outputTimestamp> <sling.java.version>8</sling.java.version> </properties> + <dependencies> + <!-- Test bundle dependencies --> + <dependency> + <groupId>io.sightly</groupId> + <artifactId>io.sightly.tck</artifactId> + <version>1.4.5</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.annotation.versioning</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.service.component.annotations</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>javax.servlet-api</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.inject</groupId> + <artifactId>javax.inject</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.models.api</artifactId> + <version>1.2.2</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.api</artifactId> + <version>2.1.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.scripting.sightly.runtime</artifactId> + <version>1.1.0-1.4.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.commons.osgi</artifactId> + <version>2.4.0</version> + <scope>provided</scope> + </dependency> + </dependencies> + <!-- ======================================================================= --> <!-- B U I L D --> <!-- ======================================================================= --> @@ -68,8 +120,8 @@ <directory>${basedir}/src/main/resources</directory> </resource> <resource> - <directory>${project.build.outputDirectory}/SLING-INF/sightlytck</directory> <targetPath>SLING-INF/sightlytck</targetPath> + <directory>${project.build.outputDirectory}/SLING-INF/sightlytck</directory> </resource> </resources> <pluginManagement> @@ -99,10 +151,10 @@ <executions> <execution> <id>unpack</id> - <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> + <phase>generate-resources</phase> <configuration> <artifactItems> <artifactItem> @@ -122,10 +174,10 @@ <executions> <execution> <id>copy-resources</id> - <phase>generate-resources</phase> <goals> <goal>copy-resources</goal> </goals> + <phase>generate-resources</phase> <configuration> <outputDirectory>${project.build.outputDirectory}/SLING-INF/sightlytck/scripts</outputDirectory> <resources> @@ -172,62 +224,8 @@ </configuration> </execution> </executions> - </plugin> + </plugin> </plugins> </build> - <dependencies> - <!-- Test bundle dependencies --> - <dependency> - <groupId>io.sightly</groupId> - <artifactId>io.sightly.tck</artifactId> - <version>1.4.5</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.annotation.versioning</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.service.component.annotations</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.inject</groupId> - <artifactId>javax.inject</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.models.api</artifactId> - <version>1.2.2</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.api</artifactId> - <version>2.1.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.scripting.sightly.runtime</artifactId> - <version>1.1.0-1.4.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.commons.osgi</artifactId> - <version>2.4.0</version> - <scope>provided</scope> - </dependency> - </dependencies> - </project> diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/AbstractRequestAdapterUseObject.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/AbstractRequestAdapterUseObject.java index 6c4b6cd..2de7b2f 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/AbstractRequestAdapterUseObject.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/AbstractRequestAdapterUseObject.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,9 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable; -public abstract class AbstractRequestAdapterUseObject implements RequestAdapterUseObject { - -} +public abstract class AbstractRequestAdapterUseObject implements RequestAdapterUseObject {} diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/NonImplementedInterface.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/NonImplementedInterface.java index b381390..3bb5d13 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/NonImplementedInterface.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/NonImplementedInterface.java @@ -1,21 +1,21 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.sling.scripting.sightly.testing.adaptable; -public interface NonImplementedInterface { - -} +public interface NonImplementedInterface {} diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/RequestAdapterUseObject.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/RequestAdapterUseObject.java index 24733ff..56a5374 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/RequestAdapterUseObject.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/RequestAdapterUseObject.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,11 +15,10 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable; public interface RequestAdapterUseObject { public String getTitle(); - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/ResourceAdapterUseObject.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/ResourceAdapterUseObject.java index dc8b88b..659a9e3 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/ResourceAdapterUseObject.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/ResourceAdapterUseObject.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,11 +15,10 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable; public interface ResourceAdapterUseObject { public String getTitle(); - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/ResourceResolverAdapterUseObject.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/ResourceResolverAdapterUseObject.java index 1926081..595b83b 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/ResourceResolverAdapterUseObject.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/ResourceResolverAdapterUseObject.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,11 +15,10 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable; public interface ResourceResolverAdapterUseObject { String getTitle(); - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/RequestAdapterFactory.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/RequestAdapterFactory.java index 03151cc..d1914df 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/RequestAdapterFactory.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/RequestAdapterFactory.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable.impl; import org.apache.sling.api.SlingHttpServletRequest; @@ -27,10 +27,10 @@ import org.osgi.service.component.annotations.Component; @Component( property = { - AdapterFactory.ADAPTABLE_CLASSES + "=org.apache.sling.api.SlingHttpServletRequest", - AdapterFactory.ADAPTER_CLASSES + "=org.apache.sling.scripting.sightly.testing.adaptable.RequestAdapterUseObject" - } -) + AdapterFactory.ADAPTABLE_CLASSES + "=org.apache.sling.api.SlingHttpServletRequest", + AdapterFactory.ADAPTER_CLASSES + + "=org.apache.sling.scripting.sightly.testing.adaptable.RequestAdapterUseObject" + }) public class RequestAdapterFactory implements AdapterFactory { @Override diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/RequestAdapterUseObjectImpl.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/RequestAdapterUseObjectImpl.java index c7997e2..ecee29b 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/RequestAdapterUseObjectImpl.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/RequestAdapterUseObjectImpl.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable.impl; import org.apache.sling.scripting.sightly.testing.adaptable.RequestAdapterUseObject; diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceAdapterFactory.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceAdapterFactory.java index cbecf49..e29f491 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceAdapterFactory.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceAdapterFactory.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable.impl; import org.apache.sling.api.adapter.AdapterFactory; @@ -26,10 +26,10 @@ import org.osgi.service.component.annotations.Component; @Component( property = { - AdapterFactory.ADAPTABLE_CLASSES + "=org.apache.sling.api.resource.Resource", - AdapterFactory.ADAPTER_CLASSES + "=org.apache.sling.scripting.sightly.testing.adaptable.ResourceAdapterUseObject" - } -) + AdapterFactory.ADAPTABLE_CLASSES + "=org.apache.sling.api.resource.Resource", + AdapterFactory.ADAPTER_CLASSES + + "=org.apache.sling.scripting.sightly.testing.adaptable.ResourceAdapterUseObject" + }) public class ResourceAdapterFactory implements AdapterFactory { @Override diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceAdapterUseObjectImpl.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceAdapterUseObjectImpl.java index 2c3a8ad..e2fce73 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceAdapterUseObjectImpl.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceAdapterUseObjectImpl.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable.impl; import org.apache.sling.scripting.sightly.testing.adaptable.ResourceAdapterUseObject; diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceResolverAdapterFactory.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceResolverAdapterFactory.java index 6b6531d..1d4e198 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceResolverAdapterFactory.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceResolverAdapterFactory.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable.impl; import org.apache.sling.api.adapter.AdapterFactory; @@ -25,10 +25,10 @@ import org.osgi.service.component.annotations.Component; @Component( property = { - AdapterFactory.ADAPTABLE_CLASSES + "=org.apache.sling.api.resource.ResourceResolver", - AdapterFactory.ADAPTER_CLASSES + "=org.apache.sling.scripting.sightly.testing.adaptable.ResourceResolverAdapterUseObject" - } -) + AdapterFactory.ADAPTABLE_CLASSES + "=org.apache.sling.api.resource.ResourceResolver", + AdapterFactory.ADAPTER_CLASSES + + "=org.apache.sling.scripting.sightly.testing.adaptable.ResourceResolverAdapterUseObject" + }) public class ResourceResolverAdapterFactory implements AdapterFactory { @Override diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceResolverAdapterUseObjectImpl.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceResolverAdapterUseObjectImpl.java index cdc6170..3f8b144 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceResolverAdapterUseObjectImpl.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/impl/ResourceResolverAdapterUseObjectImpl.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.adaptable.impl; import org.apache.sling.scripting.sightly.testing.adaptable.ResourceResolverAdapterUseObject; diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/package-info.java b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/package-info.java index 97510c8..4c05d3c 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/package-info.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/adaptable/package-info.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ - @Version("1.2.0") package org.apache.sling.scripting.sightly.testing.adaptable; diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/models/FaqModel.java b/src/main/java/org/apache/sling/scripting/sightly/testing/models/FaqModel.java index f146194..23c7d45 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/models/FaqModel.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/models/FaqModel.java @@ -1,19 +1,21 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.sling.scripting.sightly.testing.models; import org.apache.sling.api.resource.Resource; @@ -22,7 +24,6 @@ import org.apache.sling.models.annotations.Model; @Model(adaptables = Resource.class) public class FaqModel { - public String getQuestion() { return "Some question with special character \"\':\t"; // some invalid characters in JSON } @@ -30,5 +31,4 @@ public class FaqModel { public String getAnswer() { return "42"; } - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/models/RequestModel.java b/src/main/java/org/apache/sling/scripting/sightly/testing/models/RequestModel.java index ba4d4e6..8d978bb 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/models/RequestModel.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/models/RequestModel.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.models; import javax.inject.Inject; @@ -31,15 +31,19 @@ import org.apache.sling.models.annotations.injectorspecific.ScriptVariable; @Model(adaptables = SlingHttpServletRequest.class) public class RequestModel { - @Inject @Via("resource") @Named("jcr:title") + @Inject + @Via("resource") + @Named("jcr:title") private String title; - @Inject @Named("argument") + @Inject + @Named("argument") // get it from request attributes private String requestArgument; @ScriptVariable private ValueMap properties; + private String jcrType; public String getTitle() { @@ -53,5 +57,4 @@ public class RequestModel { public String getJCRType() { return PropertiesUtil.toString(properties.get("jcr:primaryType"), "FAILED"); } - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/models/ResourceModel.java b/src/main/java/org/apache/sling/scripting/sightly/testing/models/ResourceModel.java index bb5ff94..1694a24 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/models/ResourceModel.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/models/ResourceModel.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.models; import javax.inject.Inject; diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/models/ResourceResolverModel.java b/src/main/java/org/apache/sling/scripting/sightly/testing/models/ResourceResolverModel.java index b05799d..2a84bff 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/models/ResourceResolverModel.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/models/ResourceResolverModel.java @@ -1,21 +1,21 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.sling.scripting.sightly.testing.models; import org.apache.sling.api.resource.ResourceResolver; @@ -26,11 +26,11 @@ import org.apache.sling.models.annotations.injectorspecific.Self; @Model(adaptables = ResourceResolver.class) public class ResourceResolverModel { - @Self @Via("user") + @Self + @Via("user") private String userID; public String getUserID() { return userID; } - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/models/TestEnum.java b/src/main/java/org/apache/sling/scripting/sightly/testing/models/TestEnum.java index 1549b9e..483a881 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/models/TestEnum.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/models/TestEnum.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -15,20 +15,19 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - ******************************************************************************/ + */ package org.apache.sling.scripting.sightly.testing.models; /** * For testing SLING-10677 */ public enum TestEnum { - ENUM_CONSTANT, ENUM_CONSTANT2; public static final String STATIC_FIELD1 = "static field1"; + public static String something() { return "something"; } - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/models/TestModel.java b/src/main/java/org/apache/sling/scripting/sightly/testing/models/TestModel.java index 92d3d85..273bcb7 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/models/TestModel.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/models/TestModel.java @@ -1,24 +1,27 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.sling.scripting.sightly.testing.models; +import javax.inject.Inject; + import java.util.Date; import java.util.Iterator; -import javax.inject.Inject; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Default; @@ -31,10 +34,12 @@ public class TestModel { @Inject private String text; - @Inject @Optional + @Inject + @Optional private String tag; - @Inject @Default(booleanValues = false) + @Inject + @Default(booleanValues = false) private boolean includeChildren; private Resource resource; @@ -76,5 +81,4 @@ public class TestModel { public Date getDate() { return new Date(); } - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/models/package-info.java b/src/main/java/org/apache/sling/scripting/sightly/testing/models/package-info.java index 53661e9..889e0b8 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/models/package-info.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/models/package-info.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ - @Version("1.5.0") package org.apache.sling.scripting.sightly.testing.models; diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/use/Test.java b/src/main/java/org/apache/sling/scripting/sightly/testing/use/Test.java index f93443a..47d370e 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/use/Test.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/use/Test.java @@ -1,24 +1,27 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.sling.scripting.sightly.testing.use; +import javax.script.Bindings; + import java.util.Date; import java.util.Iterator; -import javax.script.Bindings; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ValueMap; @@ -41,8 +44,8 @@ public class Test implements Use { private Iterator<Resource> children = null; public void init(Bindings bindings) { - Resource resource = (Resource)bindings.get(SlingBindings.RESOURCE); - ValueMap properties = (ValueMap)bindings.get(PROPERTIES); + Resource resource = (Resource) bindings.get(SlingBindings.RESOURCE); + ValueMap properties = (ValueMap) bindings.get(PROPERTIES); if (properties != null) { text = properties.get(TEXT, resource.getPath()); @@ -87,4 +90,4 @@ public class Test implements Use { public Date getDate() { return new Date(); } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/use/TestService.java b/src/main/java/org/apache/sling/scripting/sightly/testing/use/TestService.java index 5f6a6e2..3975a5d 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/use/TestService.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/use/TestService.java @@ -1,23 +1,24 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.sling.scripting.sightly.testing.use; public interface TestService { String sayHello(); - } diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/use/impl/TestServiceImpl.java b/src/main/java/org/apache/sling/scripting/sightly/testing/use/impl/TestServiceImpl.java index 82385bd..12bbbe8 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/use/impl/TestServiceImpl.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/use/impl/TestServiceImpl.java @@ -1,19 +1,21 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ******************************************************************************/ + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.sling.scripting.sightly.testing.use.impl; import org.apache.sling.scripting.sightly.testing.use.TestService; diff --git a/src/main/java/org/apache/sling/scripting/sightly/testing/use/package-info.java b/src/main/java/org/apache/sling/scripting/sightly/testing/use/package-info.java index aad68c4..237c560 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/testing/use/package-info.java +++ b/src/main/java/org/apache/sling/scripting/sightly/testing/use/package-info.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ - @Version("1.1.0") package org.apache.sling.scripting.sightly.testing.use;
