SLING-12730 apply spotless formatting
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,141 +41,22 @@ <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> - <!-- ======================================================================= --> - <!-- B U I L D --> - <!-- ======================================================================= --> - <build> - <resources> - <resource> - <directory>${basedir}/src/main/resources</directory> - </resource> - <resource> - <directory>${project.build.outputDirectory}/SLING-INF/sightlytck</directory> - <targetPath>SLING-INF/sightlytck</targetPath> - </resource> - </resources> - <pluginManagement> - <plugins> - <plugin> - <!-- Extend RAT configuration from parent pom --> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <configuration> - <excludes combine.children="append"> - <exclude>src/main/resources/SLING-INF/**/*.json</exclude> - <exclude>src/main/resources/SLING-INF/**/*.ecma</exclude> - <!-- Ignore files generated bei IDE plugins e.g. maven-eclipse-plugin --> - <exclude>maven-eclipse.xml</exclude> - <exclude>.*</exclude> - <exclude>.*/**</exclude> - </excludes> - </configuration> - </plugin> - </plugins> - </pluginManagement> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>unpack</id> - <phase>generate-resources</phase> - <goals> - <goal>unpack</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>io.sightly</groupId> - <artifactId>io.sightly.tck</artifactId> - <type>jar</type> - <outputDirectory>${project.build.directory}/sightlytck/</outputDirectory> - <includes>**/*.html,**/*.js,**/*.java</includes> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <executions> - <execution> - <id>copy-resources</id> - <phase>generate-resources</phase> - <goals> - <goal>copy-resources</goal> - </goals> - <configuration> - <outputDirectory>${project.build.outputDirectory}/SLING-INF/sightlytck/scripts</outputDirectory> - <resources> - <resource> - <directory>${project.build.directory}/sightlytck/testfiles/scripts/</directory> - </resource> - </resources> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>jslint-maven-plugin</artifactId> - <version>1.0.1</version> - <configuration> - <sourceJsFolder>${basedir}/src/main/resources/SLING-INF</sourceJsFolder> - <includes> - <include>**/*.json</include> - </includes> - <encoding>UTF-8</encoding> - </configuration> - <executions> - <execution> - <goals> - <goal>jslint</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>biz.aQute.bnd</groupId> - <artifactId>bnd-baseline-maven-plugin</artifactId> - <executions> - <execution> - <id>bnd-baseline</id> - <goals> - <goal>baseline</goal> - </goals> - <configuration> - <diffignores> - <diffignore>Bundle-Version</diffignore> - </diffignores> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - <dependencies> <!-- Test bundle dependencies --> <dependency> @@ -230,4 +111,121 @@ </dependency> </dependencies> + <!-- ======================================================================= --> + <!-- B U I L D --> + <!-- ======================================================================= --> + <build> + <resources> + <resource> + <directory>${basedir}/src/main/resources</directory> + </resource> + <resource> + <targetPath>SLING-INF/sightlytck</targetPath> + <directory>${project.build.outputDirectory}/SLING-INF/sightlytck</directory> + </resource> + </resources> + <pluginManagement> + <plugins> + <plugin> + <!-- Extend RAT configuration from parent pom --> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <configuration> + <excludes combine.children="append"> + <exclude>src/main/resources/SLING-INF/**/*.json</exclude> + <exclude>src/main/resources/SLING-INF/**/*.ecma</exclude> + <!-- Ignore files generated bei IDE plugins e.g. maven-eclipse-plugin --> + <exclude>maven-eclipse.xml</exclude> + <exclude>.*</exclude> + <exclude>.*/**</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack</id> + <goals> + <goal>unpack</goal> + </goals> + <phase>generate-resources</phase> + <configuration> + <artifactItems> + <artifactItem> + <groupId>io.sightly</groupId> + <artifactId>io.sightly.tck</artifactId> + <type>jar</type> + <outputDirectory>${project.build.directory}/sightlytck/</outputDirectory> + <includes>**/*.html,**/*.js,**/*.java</includes> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>copy-resources</id> + <goals> + <goal>copy-resources</goal> + </goals> + <phase>generate-resources</phase> + <configuration> + <outputDirectory>${project.build.outputDirectory}/SLING-INF/sightlytck/scripts</outputDirectory> + <resources> + <resource> + <directory>${project.build.directory}/sightlytck/testfiles/scripts/</directory> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jslint-maven-plugin</artifactId> + <version>1.0.1</version> + <configuration> + <sourceJsFolder>${basedir}/src/main/resources/SLING-INF</sourceJsFolder> + <includes> + <include>**/*.json</include> + </includes> + <encoding>UTF-8</encoding> + </configuration> + <executions> + <execution> + <goals> + <goal>jslint</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>biz.aQute.bnd</groupId> + <artifactId>bnd-baseline-maven-plugin</artifactId> + <executions> + <execution> + <id>bnd-baseline</id> + <goals> + <goal>baseline</goal> + </goals> + <configuration> + <diffignores> + <diffignore>Bundle-Version</diffignore> + </diffignores> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </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 @@ @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 @@ @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 @@ @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 @@ @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 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 @@ @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 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 @@ @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 @@ @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 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 @@ 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 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;