geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstew...@apache.org
Subject [geode] branch develop updated: Update javadoc for JarBuilder
Date Wed, 13 Sep 2017 20:21:07 GMT
This is an automated email from the ASF dual-hosted git repository.

jstewart pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new e61847c  Update javadoc for JarBuilder
e61847c is described below

commit e61847c2b2bd4e279d292c1257131d1ae1b32cd4
Author: Jared Stewart <jstewart@pivotal.io>
AuthorDate: Wed Sep 13 13:20:00 2017 -0700

    Update javadoc for JarBuilder
---
 .../org/apache/geode/test/compiler/JarBuilder.java | 59 +++++++++++-----------
 1 file changed, 29 insertions(+), 30 deletions(-)

diff --git a/geode-junit/src/main/java/org/apache/geode/test/compiler/JarBuilder.java b/geode-junit/src/main/java/org/apache/geode/test/compiler/JarBuilder.java
index db1eb58..c3d4d19 100644
--- a/geode-junit/src/main/java/org/apache/geode/test/compiler/JarBuilder.java
+++ b/geode-junit/src/main/java/org/apache/geode/test/compiler/JarBuilder.java
@@ -34,41 +34,37 @@ import java.util.jar.JarOutputStream;
  * Example of usage:
  *
  * <pre>
- *  &#064;Rule
- *  public TemporaryFolder temporaryFolder= new TemporaryFolder();
+`` *
+ * &#064;Test
+ * public void buildJarUsingStrings() {
+ *   JarBuilder jarBuilder = new JarBuilder();
+ *   File outputJar = new File("output.jar");
  *
- *  &#064;Test
- *  public void buildJarUsingStrings() {
- *  File tempDir = temporaryFolder.getRoot()
- *  JarBuilder jarBuilder = new JarBuilder(tempDir);
- *  File outputJar = new File("output.jar");
+ *   String classInFooBarPackage = &quot;package foo.bar; public class ClassA {int n
= 10;}&quot;;
+ *   String classInDefaultPackage = &quot;public class ClassB {}&quot;;
+ *   jarBuilder.buildJar(outputJar, classInFooBarPackage, classInDefaultPackage);
+ * }
  *
- *  String classInFooBarPackage = &quot;package foo.bar; public class ClassA {int n =
10;}&quot;;
- *  String classInDefaultPackage = &quot;public class ClassB {}&quot;;
- *  jarBuilder.buildJar(outputJar, classInFooBarPackage, classInDefaultPackage);
- *     }
+ * &#064;Test
+ * public void buildJarUsingFiles() {
+ *   JarBuilder jarBuilder = new JarBuilder();
+ *   File outputJar = new File("output.jar");
  *
- *  &#064;Test
- *  public void buildJarUsingFiles() {
- *  File tempDir = temporaryFolder.getRoot()
- *  JarBuilder jarBuilder = new JarBuilder(tempDir);
- *  File outputJar = new File("output.jar");
+ *   // The following two files are expected to contain valid Java source code
+ *   File sourceFileOne = new File("ClassA.java");
+ *   File sourceFileTwo = new File("ClassB.java");
+ *   jarBuilder.buildJar(outputJar, sourceFileOne, sourceFileTwo);
+ * }
  *
- *  File sourceFileOne = new File("ClassA.java");
- *  File sourceFileTwo = new File("ClassB.java");
- *  jarBuilder.buildJar(outputJar, sourceFileOne, sourceFileTwo);
- *     }
+ * &#064;Test
+ * public void buildJarUsingClassNames() {
+ *   JarBuilder jarBuilder = new JarBuilder();
+ *   File outputJar = new File("output.jar");
  *
- *  &#064;Test
- *  public void buildJarUsingClassNames() {
- *  File tempDir = temporaryFolder.getRoot()
- *  JarBuilder jarBuilder = new JarBuilder(tempDir);
- *  File outputJar = new File("output.jar");
- *
- *  String classInFooBarPackage = "foo.bar.ClassInFooBarPackage";
- *  String classInDefaultPackage = "ClassInDefaultPackage";
- *  jarBuilder.buildJar(outputJar, classInFooBarPackage, classInDefaultPackage);
- *     }
+ *   String classInFooBarPackage = "foo.bar.ClassInFooBarPackage";
+ *   String classInDefaultPackage = "ClassInDefaultPackage";
+ *   jarBuilder.buildJar(outputJar, classInFooBarPackage, classInDefaultPackage);
+ * }
  * </pre>
  **/
 public class JarBuilder {
@@ -82,6 +78,9 @@ public class JarBuilder {
     javaCompiler.addToClasspath(jarFile);
   }
 
+  /**
+   * Builds a jar file containing empty classes with the given classNames.
+   */
   public void buildJarFromClassNames(File outputJarFile, String... classNames) throws IOException
{
     UncompiledSourceCode[] uncompiledSourceCodes = Arrays.stream(classNames)
         .map(UncompiledSourceCode::fromClassName).toArray(UncompiledSourceCode[]::new);

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message