From b9421dc80af485591a9c50cc8921f912e0def11e Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 23 Oct 2015 10:05:40 -0700 Subject: Removing sources to replace with download links instead. Change-Id: Ie28789a725051aec0d1b04dd291b7690a7898668 Signed-off-by: Ashlee Young --- .../maven-builder-support/pom.xml | 49 ------- .../org/apache/maven/building/DefaultProblem.java | 161 --------------------- .../maven/building/DefaultProblemCollector.java | 64 -------- .../java/org/apache/maven/building/FileSource.java | 79 ---------- .../java/org/apache/maven/building/Problem.java | 101 ------------- .../apache/maven/building/ProblemCollector.java | 59 -------- .../maven/building/ProblemCollectorFactory.java | 43 ------ .../java/org/apache/maven/building/Source.java | 49 ------- .../org/apache/maven/building/StringSource.java | 90 ------------ .../java/org/apache/maven/building/UrlSource.java | 80 ---------- .../maven-builder-support/src/site/site.xml | 36 ----- .../building/DefaultProblemCollectorTest.java | 76 ---------- .../apache/maven/building/DefaultProblemTest.java | 136 ----------------- .../org/apache/maven/building/FileSourceTest.java | 93 ------------ .../building/ProblemCollectorFactoryTest.java | 45 ------ .../apache/maven/building/StringSourceTest.java | 79 ---------- .../org/apache/maven/building/UrlSourceTest.java | 87 ----------- .../src/test/resources/source.txt | 1 - 18 files changed, 1328 deletions(-) delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/pom.xml delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblem.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblemCollector.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/FileSource.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/Problem.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollector.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollectorFactory.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/Source.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/StringSource.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/UrlSource.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/site/site.xml delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/FileSourceTest.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/StringSourceTest.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java delete mode 100644 framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/resources/source.txt (limited to 'framework/src/maven/apache-maven-3.3.3/maven-builder-support') diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/pom.xml deleted file mode 100644 index 791b5e4e..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - 4.0.0 - - - org.apache.maven - maven - 3.3.3 - - - maven-builder-support - - Maven Builder Support - Support for descriptor builders (model, setting, toolchains) - - - scm:git:https://git-wip-us.apache.org/repos/asf/maven.git - scm:git:https://git-wip-us.apache.org/repos/asf/maven.git - maven-3.3.3 - - - - - org.codehaus.plexus - plexus-utils - - - - diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblem.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblem.java deleted file mode 100644 index ad1fc40f..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblem.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -/** - * Describes a problem that was encountered during settings building. A problem can either be an exception that was - * thrown or a simple string message. In addition, a problem carries a hint about its source, e.g. the settings file - * that exhibits the problem. - * - * @author Benjamin Bentmann - * @author Robert Scholte - */ -class DefaultProblem - implements Problem -{ - - private final String source; - - private final int lineNumber; - - private final int columnNumber; - - private final String message; - - private final Exception exception; - - private final Severity severity; - - /** - * Creates a new problem with the specified message and exception. - * Either {@code message} or {@code exception} is required - * - * @param message The message describing the problem, may be {@code null}. - * @param severity The severity level of the problem, may be {@code null} to default to - * {@link SettingsProblem.Severity#ERROR}. - * @param source A hint about the source of the problem like a file path, may be {@code null}. - * @param lineNumber The one-based index of the line containing the problem or {@code -1} if unknown. - * @param columnNumber The one-based index of the column containing the problem or {@code -1} if unknown. - * @param exception The exception that caused this problem, may be {@code null}. - */ - public DefaultProblem( String message, Severity severity, String source, int lineNumber, int columnNumber, - Exception exception ) - { - this.message = message; - this.severity = ( severity != null ) ? severity : Severity.ERROR; - this.source = ( source != null ) ? source : ""; - this.lineNumber = lineNumber; - this.columnNumber = columnNumber; - this.exception = exception; - } - - public String getSource() - { - return source; - } - - public int getLineNumber() - { - return lineNumber; - } - - public int getColumnNumber() - { - return columnNumber; - } - - public String getLocation() - { - StringBuilder buffer = new StringBuilder( 256 ); - - if ( getSource().length() > 0 ) - { - if ( buffer.length() > 0 ) - { - buffer.append( ", " ); - } - buffer.append( getSource() ); - } - - if ( getLineNumber() > 0 ) - { - if ( buffer.length() > 0 ) - { - buffer.append( ", " ); - } - buffer.append( "line " ).append( getLineNumber() ); - } - - if ( getColumnNumber() > 0 ) - { - if ( buffer.length() > 0 ) - { - buffer.append( ", " ); - } - buffer.append( "column " ).append( getColumnNumber() ); - } - - return buffer.toString(); - } - - public Exception getException() - { - return exception; - } - - public String getMessage() - { - String msg; - - if ( message != null && message.length() > 0 ) - { - msg = message; - } - else - { - msg = exception.getMessage(); - - if ( msg == null ) - { - msg = ""; - } - } - - return msg; - } - - public Severity getSeverity() - { - return severity; - } - - @Override - public String toString() - { - StringBuilder buffer = new StringBuilder( 128 ); - - buffer.append( "[" ).append( getSeverity() ).append( "] " ); - buffer.append( getMessage() ); - buffer.append( " @ " ).append( getLocation() ); - - return buffer.toString(); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblemCollector.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblemCollector.java deleted file mode 100644 index 567f620e..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblemCollector.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import java.util.ArrayList; -import java.util.List; - -/** - * Collects problems that are encountered during settings building. - * - * @author Benjamin Bentmann - * @author Robert Scholte - */ -class DefaultProblemCollector - implements ProblemCollector -{ - - private List problems; - - private String source; - - public DefaultProblemCollector( List problems ) - { - this.problems = ( problems != null ) ? problems : new ArrayList(); - } - - @Override - public List getProblems() - { - return problems; - } - - @Override - public void setSource( String source ) - { - this.source = source; - } - - @Override - public void add( Problem.Severity severity, String message, int line, int column, Exception cause ) - { - Problem problem = new DefaultProblem( message, severity, source, line, column, cause ); - - problems.add( problem ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/FileSource.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/FileSource.java deleted file mode 100644 index 1a6fc2f4..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/FileSource.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * Wraps an ordinary {@link File} as a source. - * - * @author Benjamin Bentmann - */ -public class FileSource - implements Source -{ - private final File file; - - /** - * Creates a new source backed by the specified file. - * - * @param file The file, must not be {@code null}. - */ - public FileSource( File file ) - { - if ( file == null ) - { - throw new IllegalArgumentException( "no file specified" ); - } - this.file = file.getAbsoluteFile(); - } - - @Override - public InputStream getInputStream() - throws IOException - { - return new FileInputStream( file ); - } - - @Override - public String getLocation() - { - return file.getPath(); - } - - /** - * Gets the file of this source. - * - * @return The underlying file, never {@code null}. - */ - public File getFile() - { - return file; - } - - @Override - public String toString() - { - return getLocation(); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/Problem.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/Problem.java deleted file mode 100644 index 9ab9b3a8..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/Problem.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -/** - * Describes a problem that was encountered during settings building. A problem can either be an exception that was - * thrown or a simple string message. In addition, a problem carries a hint about its source, e.g. the settings file - * that exhibits the problem. - * - * @author Benjamin Bentmann - * @author Robert Scholte - */ -public interface Problem -{ - - /** - * The different severity levels for a problem, in decreasing order. - */ - enum Severity - { - - FATAL, // - ERROR, // - WARNING // - - } - - /** - * Gets the hint about the source of the problem. While the syntax of this hint is unspecified and depends on the - * creator of the problem, the general expectation is that the hint provides sufficient information to the user to - * track the problem back to its origin. A concrete example for such a source hint can be the file path or URL from - * which the settings were read. - * - * @return The hint about the source of the problem or an empty string if unknown, never {@code null}. - */ - String getSource(); - - /** - * Gets the one-based index of the line containing the problem. The line number should refer to some text file that - * is given by {@link #getSource()}. - * - * @return The one-based index of the line containing the problem or a non-positive value if unknown. - */ - int getLineNumber(); - - /** - * Gets the one-based index of the column containing the problem. The column number should refer to some text file - * that is given by {@link #getSource()}. - * - * @return The one-based index of the column containing the problem or non-positive value if unknown. - */ - int getColumnNumber(); - - /** - * Gets the location of the problem. The location is a user-friendly combination of the values from - * {@link #getSource()}, {@link #getLineNumber()} and {@link #getColumnNumber()}. The exact syntax of the returned - * value is undefined. - * - * @return The location of the problem, never {@code null}. - */ - String getLocation(); - - /** - * Gets the exception that caused this problem (if any). - * - * @return The exception that caused this problem or {@code null} if not applicable. - */ - Exception getException(); - - /** - * Gets the message that describes this problem. - * - * @return The message describing this problem, never {@code null}. - */ - String getMessage(); - - /** - * Gets the severity level of this problem. - * - * @return The severity level of this problem, never {@code null}. - */ - Severity getSeverity(); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollector.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollector.java deleted file mode 100644 index e7015676..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollector.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import java.util.List; - -/** - * Collects problems that are encountered during settings building. - * - * @author Benjamin Bentmann - * @author Robert Scholte - */ -public interface ProblemCollector -{ - - /** - * Adds the specified problem. - * Either message or exception is required - * - * @param severity The severity of the problem, must not be {@code null}. - * @param message The detail message of the problem, may be {@code null}. - * @param line The one-based index of the line containing the problem or {@code -1} if unknown. - * @param column The one-based index of the column containing the problem or {@code -1} if unknown. - * @param cause The cause of the problem, may be {@code null}. - */ - void add( Problem.Severity severity, String message, int line, int column, Exception cause ); - - /** - * The next messages will be bound to this source. When calling this method again, previous messages keep - * their source, but the next messages will use the new source. - * - * @param source - */ - void setSource( String source ); - - /** - * - * @return the collected Problems, never {@code null} - */ - List getProblems(); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollectorFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollectorFactory.java deleted file mode 100644 index c1c23737..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/ProblemCollectorFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import java.util.List; - -/** - * - * @author Robert Scholte - * @since 3.3.0 - */ -public class ProblemCollectorFactory -{ - - /** - * The default implementation is not visible, create it with this factory - * - * @param problems starting set of problems, may be {@code null} - * @return a new instance of a ProblemCollector - */ - public static ProblemCollector newInstance( List problems ) - { - return new DefaultProblemCollector( problems ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/Source.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/Source.java deleted file mode 100644 index 1f7510ba..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/Source.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import java.io.IOException; -import java.io.InputStream; - -/** - * Provides access to the contents of a source independently of the backing store (e.g. file system, database, memory). - * - * @author Benjamin Bentmann - */ -public interface Source -{ - - /** - * Gets a byte stream to the source contents. Closing the returned stream is the responsibility of the caller. - * - * @return A byte stream to the source contents, never {@code null}. - */ - InputStream getInputStream() - throws IOException; - - /** - * Provides a user-friendly hint about the location of the source. This could be a local file path, a URI or just an - * empty string. The intention is to assist users during error reporting. - * - * @return A user-friendly hint about the location of the source, never {@code null}. - */ - String getLocation(); - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/StringSource.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/StringSource.java deleted file mode 100644 index f9d87c0b..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/StringSource.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * Wraps an ordinary {@link CharSequence} as a source. - * - * @author Benjamin Bentmann - */ -public class StringSource - implements Source -{ - - private String content; - - private String location; - - /** - * Creates a new source backed by the specified string. - * - * @param content The String representation, may be empty or {@code null}. - */ - public StringSource( CharSequence content ) - { - this( content, null ); - } - - /** - * Creates a new source backed by the specified string. - * - * @param content The String representation, may be empty or {@code null}. - * @param location The location to report for this use, may be {@code null}. - */ - public StringSource( CharSequence content, String location ) - { - this.content = ( content != null ) ? content.toString() : ""; - this.location = ( location != null ) ? location : "(memory)"; - } - - @Override - public InputStream getInputStream() - throws IOException - { - return new ByteArrayInputStream( content.getBytes( "UTF-8" ) ); - } - - @Override - public String getLocation() - { - return location; - } - - /** - * Gets the content of this source. - * - * @return The underlying character stream, never {@code null}. - */ - public String getContent() - { - return content; - } - - @Override - public String toString() - { - return getLocation(); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/UrlSource.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/UrlSource.java deleted file mode 100644 index 7bd3e3c3..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/main/java/org/apache/maven/building/UrlSource.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -/** - * Wraps an ordinary {@link URL} as a source. - * - * @author Benjamin Bentmann - */ -public class UrlSource - implements Source -{ - - private URL url; - - /** - * Creates a new source backed by the specified URL. - * - * @param url The file, must not be {@code null}. - */ - public UrlSource( URL url ) - { - if ( url == null ) - { - throw new IllegalArgumentException( "no url specified" ); - } - this.url = url; - } - - @Override - public InputStream getInputStream() - throws IOException - { - return url.openStream(); - } - - @Override - public String getLocation() - { - return url.toString(); - } - - /** - * Gets the URL of this source. - * - * @return The underlying URL, never {@code null}. - */ - public URL getUrl() - { - return url; - } - - @Override - public String toString() - { - return getLocation(); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/site/site.xml b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/site/site.xml deleted file mode 100644 index 3a16bf98..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/site/site.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java deleted file mode 100644 index bf0f8477..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemCollectorTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import static org.junit.Assert.*; - -import org.apache.maven.building.Problem.Severity; -import org.junit.Test; - -public class DefaultProblemCollectorTest -{ - - @Test - public void testGetProblems() - { - DefaultProblemCollector collector = new DefaultProblemCollector( null ); - assertNotNull( collector.getProblems() ); - assertEquals( 0, collector.getProblems().size() ); - - collector.add( null, "MESSAGE1", -1, -1, null ); - - Exception e2 = new Exception(); - collector.add( Severity.WARNING, null, 42, 127, e2 ); - - assertEquals( 2, collector.getProblems().size() ); - - Problem p1 = collector.getProblems().get(0); - assertEquals( Severity.ERROR, p1.getSeverity() ); - assertEquals( "MESSAGE1",p1.getMessage() ); - assertEquals( -1, p1.getLineNumber() ); - assertEquals( -1, p1.getColumnNumber() ); - assertEquals( null, p1.getException() ); - - Problem p2 = collector.getProblems().get(1); - assertEquals( Severity.WARNING, p2.getSeverity() ); - assertEquals( "",p2.getMessage() ); - assertEquals( 42, p2.getLineNumber() ); - assertEquals( 127, p2.getColumnNumber() ); - assertEquals( e2, p2.getException() ); - } - - @Test - public void testSetSource() - { - DefaultProblemCollector collector = new DefaultProblemCollector( null ); - - collector.add( null, "PROBLEM1", -1, -1, null ); - - collector.setSource( "SOURCE_PROBLEM2" ); - collector.add( null, "PROBLEM2", -1, -1, null ); - - collector.setSource( "SOURCE_PROBLEM3" ); - collector.add( null, "PROBLEM3", -1, -1, null ); - - assertEquals( "", collector.getProblems().get( 0 ).getSource() ); - assertEquals( "SOURCE_PROBLEM2", collector.getProblems().get( 1 ).getSource() ); - assertEquals( "SOURCE_PROBLEM3", collector.getProblems().get( 2 ).getSource() ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java deleted file mode 100644 index 80a20da9..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/DefaultProblemTest.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; - -import org.apache.maven.building.Problem.Severity; -import org.junit.Test; - -public class DefaultProblemTest -{ - - @Test - public void testGetSeverity() - { - DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); - assertEquals( Severity.ERROR, problem.getSeverity() ); - - problem = new DefaultProblem( null, Severity.FATAL, null, -1, -1, null ); - assertEquals( Severity.FATAL, problem.getSeverity() ); - - problem = new DefaultProblem( null, Severity.ERROR, null, -1, -1, null ); - assertEquals( Severity.ERROR, problem.getSeverity() ); - - problem = new DefaultProblem( null, Severity.WARNING, null, -1, -1, null ); - assertEquals( Severity.WARNING, problem.getSeverity() ); - } - - @Test - public void testGetLineNumber() - { - DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); - assertEquals( -1, problem.getLineNumber() ); - - problem = new DefaultProblem( null, null, null, 42, -1, null ); - assertEquals( 42, problem.getLineNumber() ); - - problem = new DefaultProblem( null, null, null, Integer.MAX_VALUE, -1, null ); - assertEquals( Integer.MAX_VALUE, problem.getLineNumber() ); - - // this case is not specified, might also return -1 - problem = new DefaultProblem( null, null, null, Integer.MIN_VALUE, -1, null ); - assertEquals( Integer.MIN_VALUE, problem.getLineNumber() ); - } - - @Test - public void testGetColumnNumber() - { - DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); - assertEquals( -1, problem.getColumnNumber() ); - - problem = new DefaultProblem( null, null, null, -1, 42, null ); - assertEquals( 42, problem.getColumnNumber() ); - - problem = new DefaultProblem( null, null, null, -1, Integer.MAX_VALUE, null ); - assertEquals( Integer.MAX_VALUE, problem.getColumnNumber() ); - - // this case is not specified, might also return -1 - problem = new DefaultProblem( null, null, null, -1, Integer.MIN_VALUE, null ); - assertEquals( Integer.MIN_VALUE, problem.getColumnNumber() ); - } - - @Test - public void testGetException() - { - DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); - assertEquals( null, problem.getException() ); - - Exception e = new Exception(); - problem = new DefaultProblem( null, null, null, -1, -1, e ); - assertSame( e, problem.getException() ); - } - - @Test - public void testGetSource() - { - DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); - assertEquals( "", problem.getSource() ); - - problem = new DefaultProblem( null, null, "", -1, -1, null ); - assertEquals( "", problem.getSource() ); - - problem = new DefaultProblem( null, null, "SOURCE", -1, -1, null ); - assertEquals( "SOURCE", problem.getSource() ); - } - - @Test - public void testGetLocation() - { - DefaultProblem problem = new DefaultProblem( null, null, null, -1, -1, null ); - assertEquals( "", problem.getLocation() ); - - problem = new DefaultProblem( null, null, "SOURCE", -1, -1, null ); - assertEquals( "SOURCE", problem.getLocation() ); - - problem = new DefaultProblem( null, null, null, 42, -1, null ); - assertEquals( "line 42", problem.getLocation() ); - - problem = new DefaultProblem( null, null, null, -1, 127, null ); - assertEquals( "column 127", problem.getLocation() ); - - problem = new DefaultProblem( null, null, "SOURCE", 42, 127, null ); - assertEquals( "SOURCE, line 42, column 127", problem.getLocation() ); - } - - @Test - public void testGetMessage() - { - DefaultProblem problem = new DefaultProblem( "MESSAGE", null, null, -1, -1, null ); - assertEquals( "MESSAGE", problem.getMessage() ); - - problem = new DefaultProblem( null, null, null, -1, -1, new Exception() ); - assertEquals( "", problem.getMessage() ); - - problem = new DefaultProblem( null, null, null, -1, -1, new Exception( "EXCEPTION MESSAGE" ) ); - assertEquals( "EXCEPTION MESSAGE", problem.getMessage() ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/FileSourceTest.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/FileSourceTest.java deleted file mode 100644 index 086adda8..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/FileSourceTest.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.File; -import java.io.InputStream; -import java.util.Scanner; - -import org.junit.Test; - -public class FileSourceTest -{ - - @Test - public void testFileSource() - { - try - { - new FileSource( null ); - fail( "Should fail, since you must specify a file" ); - } - catch ( IllegalArgumentException e ) - { - assertEquals( "no file specified", e.getMessage() ); - } - } - - @Test - public void testGetInputStream() - throws Exception - { - File txtFile = new File( "target/test-classes/source.txt" ); - FileSource source = new FileSource( txtFile ); - - Scanner scanner = null; - InputStream is = null; - try - { - is = source.getInputStream(); - - scanner = new Scanner( is ); - assertEquals( "Hello World!", scanner.nextLine() ); - } - finally - { - if ( scanner != null ) - { - scanner.close(); - } - if ( is != null ) - { - is.close(); - } - } - } - - @Test - public void testGetLocation() - { - File txtFile = new File( "target/test-classes/source.txt" ); - FileSource source = new FileSource( txtFile ); - assertEquals( txtFile.getAbsolutePath(), source.getLocation() ); - } - - @Test - public void testGetFile() - { - File txtFile = new File( "target/test-classes/source.txt" ); - FileSource source = new FileSource( txtFile ); - assertEquals( txtFile.getAbsoluteFile(), source.getFile() ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java deleted file mode 100644 index 44c7906c..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/ProblemCollectorFactoryTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; - -import java.util.Collections; - -import org.junit.Test; - -public class ProblemCollectorFactoryTest -{ - - @Test - public void testNewInstance() - { - ProblemCollector collector1 = ProblemCollectorFactory.newInstance( null ); - - Problem problem = new DefaultProblem( "MESSAGE1", null, null, -1, -1, null ); - ProblemCollector collector2 = ProblemCollectorFactory.newInstance( Collections.singletonList( problem ) ); - - assertNotSame( collector1, collector2 ); - assertEquals( 0, collector1.getProblems().size() ); - assertEquals( 1, collector2.getProblems().size() ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/StringSourceTest.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/StringSourceTest.java deleted file mode 100644 index 013b8a4d..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/StringSourceTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import static org.junit.Assert.assertEquals; - -import java.io.InputStream; -import java.util.Scanner; - -import org.junit.Test; - -public class StringSourceTest -{ - @Test - public void testGetInputStream() - throws Exception - { - StringSource source = new StringSource( "Hello World!" ); - - Scanner scanner = null; - InputStream is = null; - try - { - is = source.getInputStream(); - - scanner = new Scanner( is ); - assertEquals( "Hello World!", scanner.nextLine() ); - } - finally - { - if ( scanner != null ) - { - scanner.close(); - } - if ( is != null ) - { - is.close(); - } - } - } - - @Test - public void testGetLocation() - { - StringSource source = new StringSource( "Hello World!" ); - assertEquals( "(memory)", source.getLocation() ); - - source = new StringSource( "Hello World!", "LOCATION" ); - assertEquals( "LOCATION", source.getLocation() ); - } - - @Test - public void testGetContent() - { - StringSource source = new StringSource( null ); - assertEquals( "", source.getContent() ); - - source = new StringSource( "Hello World!", "LOCATION" ); - assertEquals( "Hello World!", source.getContent() ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java deleted file mode 100644 index 5524c9b3..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.apache.maven.building; - -/* - * 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. - */ - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.File; -import java.io.InputStream; -import java.net.URL; -import java.util.Scanner; - -import org.junit.Test; - -public class UrlSourceTest -{ - - @Test - public void testUrlSource() - { - try - { - new UrlSource( null ); - fail( "Should fail, since you must specify a url" ); - } - catch ( IllegalArgumentException e ) - { - assertEquals( "no url specified", e.getMessage() ); - } - } - - @Test - public void testGetInputStream() - throws Exception - { - URL txtFile = new File( "target/test-classes/source.txt" ).toURI().toURL(); - UrlSource source = new UrlSource( txtFile ); - - Scanner scanner = null; - InputStream is = null; - try - { - is = source.getInputStream(); - - scanner = new Scanner( is ); - assertEquals( "Hello World!", scanner.nextLine() ); - } - finally - { - if ( scanner != null ) - { - scanner.close(); - } - if ( is != null ) - { - is.close(); - } - } - } - - @Test - public void testGetLocation() - throws Exception - { - URL txtFile = new File( "target/test-classes/source.txt" ).toURI().toURL(); - UrlSource source = new UrlSource( txtFile ); - assertEquals( txtFile.toExternalForm(), source.getLocation() ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/resources/source.txt b/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/resources/source.txt deleted file mode 100644 index c57eff55..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-builder-support/src/test/resources/source.txt +++ /dev/null @@ -1 +0,0 @@ -Hello World! \ No newline at end of file -- cgit 1.2.3-korg