diff --git a/javav2/README.rst b/javav2/README.rst index 211fdd2377a..213ffd3892e 100644 --- a/javav2/README.rst +++ b/javav2/README.rst @@ -9,7 +9,7 @@ limitations under the License. ########################################### -AWS SDK for Java 2.0 Documentation Examples +AWS SDK for Java 2.0 documentation examples ########################################### These are examples for the `AWS SDK for Java public documentation `_. @@ -17,114 +17,112 @@ These are examples for the `AWS SDK for Java public documentation `_ (>3.0) * `AWS SDK for Java `_ (downloaded and extracted somewhere on your machine) -* AWS credentials, either configured in a local AWS credentials file or by setting the +* AWS credentials, either configured in a local AWS credentials file or set by using the ``AWS_ACCESS_KEY_ID`` and ``AWS_SECRET_ACCESS_KEY`` environment variables. -* You should also set the *AWS region* within which the operations will be performed. If a region is - not set, the default region used will be ``us-east-1``. +* You should also set the *AWS Region* within which the operations will be performed. If a Region is + not set, the default Region used is ``us-east-1``. -For information about how to set AWS credentials and the region for use with the AWS SDK for Java, -see `Set up AWS Credentials and Region for Development +For information about how to set AWS credentials and the Region for use with the AWS SDK for Java, +see `Set up AWS credentials and Region for development `_ in the *AWS -Java Developer Guide*. +SDK for Java Developer Guide*. AWS Java code examples ====================== -The javav2 folder in this repository contains examples of complete use cases, as well as AWS service-based code examples. +The **javav2** folder in this repository contains examples of complete use cases, and AWS service-based code examples. Use cases --------- -Under the **use_cases** folder, you will locate step by step development tutorials that use multiple AWS services. By following these tutorials, you will gain a deeper understanding on how to create Java based applications that use the AWS Java SDK. You will find these tutorials: +In the **use_cases** folder, find step-by-step development tutorials that use multiple AWS services. By following these tutorials, you will gain a deeper understanding of how to create Java-based applications that use the AWS SDK for Java. These tutorials include: -+ **Creating your first AWS Java Web Application** - A tutorial that discusses using Amazon DynamoDB, Amazon Simple Notification Service (Amazon SNS) and AWS Elastic Beanstalk. -+ **Creating a Secure Spring Application using AWS Services** - A tutorial that discusses using Amazon Relational Database Service (RDS), Amazon Simple Email Service (SES), and AWS Elastic Beanstalk. -+ **Creating AWS Serverless workflows using the Java SDK** - A tutorial that discusses using the AWS Java SDK and AWS Step Functions to create a workflow that invokes AWS services. Each workflow step is implemented by using a Lambda function. - -+ **Creating a Sample AWS Photo Analyzer application using the AWS SDK for Java** - A tutorial that discusses using the AWS Java SDK and various AWS Services, such as the Amazon Rekognition service, to analyze images. The application can analyze many images and generate a report that breaks down each image into a series of labels. ++ **Creating your first AWS Java web application** - A tutorial that discusses using Amazon DynamoDB, Amazon Simple Notification Service (Amazon SNS), and AWS Elastic Beanstalk. ++ **Creating a secure Spring application using AWS services** - A tutorial that discusses using Amazon Relational Database Service (Amazon RDS), Amazon Simple Email Service (Amazon SES), and AWS Elastic Beanstalk. ++ **Creating AWS serverless workflows using the AWS SDK for Java** - A tutorial that discusses using the AWS SDK for Java and AWS Step Functions to create a workflow that invokes AWS services. Each workflow step is implemented by using an AWS Lambda function. ++ **Creating a sample AWS photo analyzer application using the AWS SDK for Java** - A tutorial that discusses using the AWS SDK for Java and various AWS services, such as the Amazon Rekognition service, to analyze images. The application can analyze many images and generate a report that breaks down each image into a series of labels. AWS service examples -------------------- -The AWS service specific Java examples are located under the **example_code** folder. The examples are divided into directories by AWS service (``s3``, ``sqs``, and so on). Within +The AWS service-specific Java examples are located in the **example_code** folder. The examples are divided into directories by AWS service (``s3``, ``sqs``, and so on). Within each, you'll find a ``pom.xml`` file used for building the examples with Maven, and a ``Makefile`` that wraps the Maven commands for those of you who also have ``make`` installed. - - - Build and run the service examples ================================== -Build the examples from a Java IDE +Build the examples from a Java IDE ---------------------------------- -You can build the examples in a Java IDE such as IntelliJ. Create a Maven project and be sure to include the POM file you locate in a service directory in your project. This is the easiest way to start building and running the AWS Java examples. The POM file ensures you have access to the Java dependencies. To create an IntelliJ project. +You can build the examples in a Java IDE such as IntelliJ. Create a Maven project and be sure to include the POM file you locate in a service directory in your project. This is the easiest way to start building and running the AWS SDK for Java examples. The POM file ensures you have access to the Java dependencies. + +**To create an IntelliJ project** -1. In the IntelliJ IDE, choose **File**, **New**, **Project**. -2. In the **New Project** dialog box, choose **Maven**. +1. In the IntelliJ IDE, choose **File**, **New**, **Project**. +2. In the **New Project** dialog box, choose **Maven**. 3. Choose **Next**. -4. In **GroupId**, enter **aws-project**. -5. In **ArtifactId**, enter **aws-project**. +4. In **GroupId**, enter **aws-project**. +5. In **ArtifactId**, enter **aws-project**. 6. Choose **Next**. -7. Choose **Finish**. +7. Choose **Finish**. -**Note**: Add the POM file you find in a service specific folder to the POM file in the project. Then create a package that you find in the examples and you can start adding the Java classes to your project. +**Note:** Add the POM file you find in a service-specific folder to the POM file in the project. Then create a package that you find in the examples and you can start adding the Java classes to your project. -Build the examples from the command line +Build the examples from the command line ----------------------------------------- -To build any of the service examples, open a command-line (terminal) window and change to the directory containing the examples -you want to build/run. Then type:: +To build any of the service examples, open a command-prompt (terminal) window and change to the directory containing the examples +you want to build or run. Then type:: mvn package -You can use the Apache Maven Shade Plugin to package your JAR with the artifacts in an uber-jar, which consists of all dependencies required to run the project. Ensure that the POM file has the required plugin to build the JAR with the dependencies. +You can use the Apache Maven Shade Plugin to package your JAR file with the artifacts in an uber JAR, which consists of all dependencies required to run the project. Ensure that the POM file has the required plugin to build the JAR with the dependencies. + - org.apache.maven.plugins - + maven-shade-plugin - + 3.0.0 - + - + - + package - + - + shade - + - + - + - + - - - -For example, if you execute this command from the S3 directory, you will find a JAR file named **S3J2Project-1.0-SNAPSHOT.jar** in the **target** folder. -or, if you have ``make``, you can simply type:: + + +For example, if you execute this command from the ``s3`` directory, you will find a JAR file named **S3J2Project-1.0-SNAPSHOT.jar** in the **target** folder. + +Or, if you have ``make``, you can begin the build process by typing:: make -to begin the build process. Maven will download any dependencies (such as components of the AWS SDK +Maven will download any dependencies (such as components of the AWS SDK for Java) that it needs for building. -Once the examples have been built, you can run them to see them in action. +Once the examples are built, you can run them to see them in action. .. note:: If you are running on a platform with ``make``, you can also use the provided Makefiles to build the examples, by running ``make`` in any directory with a ``Makefile`` present. You must @@ -136,8 +134,8 @@ Run the service examples **IMPORTANT** - The examples perform AWS operations for the account and region for which you've specified - credentials, and you may incur AWS service charges by running them. Please visit the `AWS Pricing + The examples perform AWS operations for the account and AWS Region for which you've specified + credentials, and you may incur AWS service charges by running them. See the `AWS Pricing `_ page for details about the charges you can expect for a given service and operation. @@ -146,15 +144,15 @@ Run the service examples may delete or modify AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -Because you built the JAR that contains the depedencies, you can run an example using the following command. For example, you can run a S3 Java V2 example using this command: +Because you built the JAR file that contains the dependencies, you can run an example using the following command. For example, you can run an S3 Java V2 example using this command: java -cp target/S3J2Project-1.0-SNAPSHOT.jar com.example.s3.ListObjects mybucket -For systems with bash support +For systems with Bash support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As an alternative to setting the ``CLASSPATH`` and specifying the full namespace of the class to -run, we've included a ``bash`` script, ``run_example.sh``, that you can use on Linux, Unix or OS X +run, we've included a ``bash`` script, ``run_example.sh``, that you can use on Linux, Unix, or OS X (or on Windows by using `Cygwin `_, `MingW `_, or `Bash on Ubuntu on Windows `_). @@ -162,10 +160,10 @@ You can execute ``run_example.sh`` as shown:: ./run_example.sh S3BucketOps -This will run the `S3BucketOps `_ -example (assuming that you've built the examples first!). +This runs the `S3BucketOps `_ +example (assuming that you've built the examples first). -If the example requires arguments, pass the argument list in quotes:: +If the example requires arguments, pass the argument list in quotation marks:: ./run_example.sh S3BucketOps " " diff --git a/javav2/example_code/athena/Readme.md b/javav2/example_code/athena/Readme.md index 02cc5e5a1a4..202d4787805 100644 --- a/javav2/example_code/athena/Readme.md +++ b/javav2/example_code/athena/Readme.md @@ -1,51 +1,51 @@ -# Amazon Athena Java Readme +# Amazon Athena Java code examples -A README that discusses how to run and test the Java Amazon Athena code examples. +This README discusses how to run and test the Java code examples for Amazon Athena. -## Running the Amazon Athena Java files +## Running the Athena Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java code examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources, such as deleting a named query example. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java aws.example.athena.ListNamedQueryExample -For systems with bash support. -**Note**: These code examples depend upon values defined in the **ExampleConstants** Java file. Besure to set values that are applicable to your environment. For example, specify the database that you created by following https://docs.aws.amazon.com/athena/latest/ug/work-with-data.html. +**Note:** These code examples depend on values defined in the **ExampleConstants** Java file. Be sure to set values that are applicable to your environment. For example, specify the database that you created by following https://docs.aws.amazon.com/athena/latest/ug/work-with-data.html. - ## Testing the Amazon Athena files + ## Testing the Athena Java files -You can test the Amazon Athena Java code examples by running a test file named **AWSAthenaServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Athena by running a test file named **AWSAthenaServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test runs, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and may incur charges on your account._ ### Properties file -Before running the Amazon Athena JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define a named query to use in the tests. If you do not define all values, the JUnit tests fail. +Before running the Amazon Athena JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define a named query to use in the tests. If you do not define all values, the JUnit tests fail. -Define these values to successfully run the JUnit tests: +Define this value to successfully run the JUnit tests: -- **nameQuery** - a named query. +- **nameQuery** - A named query. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -68,7 +68,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/cloudwatch/Readme.md b/javav2/example_code/cloudwatch/Readme.md index 09669297452..05465f59ccb 100644 --- a/javav2/example_code/cloudwatch/Readme.md +++ b/javav2/example_code/cloudwatch/Readme.md @@ -1,64 +1,65 @@ -# Amazon CloudWatch Java Readme +# Amazon CloudWatch Java code examples -A README that discusses how to run and test the Java Amazon CloudWatch code examples. +This README discusses how to run and test the Java code examples for Amazon CloudWatch. ## Running the Amazon CloudWatch Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java code examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources, such as deleting a CloudWatch alarm. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.cloudwatch.DeleteAlarm -For systems with bash support. ## Testing the Amazon CloudWatch Java files -You can test the Amazon CloudWatch Java code examples by running a test file named **CloudWatchServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon CloudWatch by running a test file named **CloudWatchServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon CloudWatch resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon CloudWatch resources and may incur charges on your account._ ### Properties file -Before running the Amazon CloudWatch JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an alarm name for various tests. If you do not define all values, the JUnit tests fail. +Before running the Amazon CloudWatch JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define an alarm name for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **logGroup** - the name of the log group to use. For example, **testgroup**. +- **logGroup** - The name of the log group to use. For example, **testgroup**. -- **alarmName** – the name of the alarm to use. For example, **AlarmFeb**. +- **alarmName** – The name of the alarm to use. For example, **AlarmFeb**. -- **instanceId** – the id of the instance to use. You can obtain this value from the AWS Console. For example, **ami-04300000000**. +- **instanceId** – The ID of the instance to use. You can obtain this value from the AWS Management Console. For example, **ami-04300000000**. -- **streamName** - the name of the stream to use. This value is used to retrieve log events. +- **streamName** - The name of the stream to use. This value is used to retrieve log events. -- **ruleResource** – the ARN of the user whom owns the rule. You can obtain this value from the AWS Console. -- **filterName** - the name of the filter to use. +- **ruleResource** – The Amazon Resource Name (ARN) of the user who owns the rule. You can obtain this value from the AWS Management Console. +- **filterName** - The name of the filter to use. -- **destinationArn** - the ARN of the destination. This value is used to create subscription filters. -- **roleArn** - the ARN of the user. This value is used to create subscription filters. +- **destinationArn** - The ARN of the destination. This value is used to create subscription filters. -- **filterPattern** - the filter pattern. For example, **Error**. +- **roleArn** - The ARN of the user. This value is used to create subscription filters. + +- **filterPattern** - The filter pattern. For example, **Error**. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -81,7 +82,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/cognito/Readme.md b/javav2/example_code/cognito/Readme.md index ae2dbd7c6e7..b9517f3abf1 100644 --- a/javav2/example_code/cognito/Readme.md +++ b/javav2/example_code/cognito/Readme.md @@ -1,53 +1,53 @@ -# Amazon Cognito Java Readme +# Amazon Cognito Java code examples -A README that discusses how to run and test the Java Amazon Cognito code examples. +This README discusses how to run and test the Java code examples for Amazon Cognito. ## Running the Amazon Cognito Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources, such as deleting a user pool. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.cognito.ListUsers -For systems with bash support. ## Testing the Amazon Cognito files -You can test the Amazon Cognito Java code examples by running a test file named **CognitoServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon Cognito by running a test file named **CognitoServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and may incur charges on your account._ ### Properties file Before running the Amazon Cognito JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **userPoolName** - the name of the user pool that is created. -- **username** – the user name that is used in the **CreateAdminUser** test. -- **email** - the user email that is used in the **CreateAdminUser** test. -- **clientName** - the client name that is used in the **CreateUserPoolClient** test. -- **identityPoolName** - the pool name used in the **CreateIdentityPool** test. +- **userPoolName** - The name of the user pool that is created. +- **username** – The user name that is used in the **CreateAdminUser** test. +- **email** - The user email that is used in the **CreateAdminUser** test. +- **clientName** - The client name that is used in the **CreateUserPoolClient** test. +- **identityPoolName** - The pool name used in the **CreateIdentityPool** test. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To execute the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -70,7 +70,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/comprehend/Readme.md b/javav2/example_code/comprehend/Readme.md index f7a2e738176..832775f6440 100644 --- a/javav2/example_code/comprehend/Readme.md +++ b/javav2/example_code/comprehend/Readme.md @@ -1,51 +1,51 @@ -# Amazon Comprehend Java Readme +# Amazon Comprehend Java code examples -A README that discusses how to run and test the Java Amazon Comprehend code examples. +This README discusses how to run and test the Java code examples for Amazon Comprehend. ## Running the Amazon Comprehend Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java SDK JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.comprehend.DetectSyntax -For systems with bash support. ## Testing the Amazon Comprehend files -You can test the Amazon Comprehend Java code examples by running a test file named **AmazonComprehendServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon Comprehend by running a test file named **AmazonComprehendServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and may incur charges on your account._ ### Properties file -Before running the Amazon Comprehend JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. +Before running the Amazon Comprehend JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **dataAccessRoleArn** - the ARN value of the role used for the **DocumentClassifierDemo** test. -- **s3Uri** – the S3 bucket that contains the CSV file for the **DocumentClassifierDemo** test. -- **documentClassifier** - the name of the document classifier for the **DocumentClassifierDemo** test. +- **dataAccessRoleArn** - The Amazon Resource Name (ARN) value of the role used for the **DocumentClassifierDemo** test. +- **s3Uri** – The Amazon S3 bucket that contains the CSV file for the **DocumentClassifierDemo** test. +- **documentClassifier** - The name of the document classifier for the **DocumentClassifierDemo** test. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -68,7 +68,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- @@ -79,4 +79,3 @@ If you do not define the correct values in the properties file, your JUnit tests [INFO] --------------------------------------- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project S3J2Project: There are test failures. [ERROR]; - diff --git a/javav2/example_code/dynamodb/Readme.md b/javav2/example_code/dynamodb/Readme.md index c0a259ea8c9..c762d86c7f6 100644 --- a/javav2/example_code/dynamodb/Readme.md +++ b/javav2/example_code/dynamodb/Readme.md @@ -1,59 +1,59 @@ -# Amazon DynamoDB Java Readme +# Amazon DynamoDB Java code examples -A README that discusses how to run and test the Java Amazon DynamoDB code examples. +This README discusses how to run and test the Java code examples for Amazon DynamoDB. -## Running the Amazon DynamoDB Java files +## Running the Amazon DynamoDB Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you might incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources, such as deleting a table. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.dynamodb.ListTables -For systems with bash support. - ## Testing the Amazon DynamoDB Java files + ## Testing the DynamoDB Java files -You can test the Amazon DynamoDB Java code examples by running a test file named **AWSDynamoServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon DynamoDB by running a test file named **AWSDynamoServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon DynamoDB resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon DynamoDB resources and might incur charges on your account._ ### Properties file -Before running the Amazon DynamoDB JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define a table name used for various tests. If you do not define all values, the JUnit tests fail. +Before running the DynamoDB JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define a table name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **tableName** - the name of a table. For example, **Music3**. +- **tableName** - The name of a table. For example, **Music3**. -- **key** – the name of a key to use. For example, **Artist**. +- **key** – The name of a key to use. For example, **Artist**. -- **keyValue** – the key value. For example, **Famous Band**. -- **albumTitle** – an album title to use. For example, **AlbumTitle**. -- **AlbumTitleValue** – an album title value. For example, **Songs About Life**. -- **Awards** – a value for a column. For example, **Awards**. -- **AwardVal** – the value for the Awards column. For example, **10**. -- **SongTitle** – a value for another column. For example, **SongTitle**. -- **SongTitleVal** – the value for the SongTitle column. For example, **Happy Summer Day**. +- **keyValue** – The key value. For example, **Famous Band**. +- **albumTitle** – An album title to use. For example, **AlbumTitle**. +- **AlbumTitleValue** – An album title value. For example, **Songs About Life**. +- **Awards** – A value for a column. For example, **Awards**. +- **AwardVal** – The value for the Awards column. For example, **10**. +- **SongTitle** – A value for another column. For example, **SongTitle**. +- **SongTitleVal** – The value for the SongTitle column. For example, **Happy Summer Day**. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -76,7 +76,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/ec2/Readme.md b/javav2/example_code/ec2/Readme.md index e4889668c44..e5fc22de1d3 100644 --- a/javav2/example_code/ec2/Readme.md +++ b/javav2/example_code/ec2/Readme.md @@ -1,55 +1,55 @@ -# Amazon Elastic Compute Cloud (Amazon EC2) Java Readme +# Amazon EC2 Java code examples -A README that discusses how to run and test the Java Elastic Compute Cloud (Amazon EC2) code examples. +This README discusses how to run and test the Java code examples for Amazon Elastic Compute Cloud (Amazon EC2). -## Running the Amazon EC2 Java files +## Running the Amazon EC2 Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. -Some of these examples perform *destructive* operations on AWS resources, such as deleting a security group. **Be very careful** when running an operation that +Some of these examples perform *destructive* operations on AWS resources, such as deleting a security group. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.ec2.FindRunningInstances -For systems with bash support. ## Testing the Amazon EC2 Java files -You can test the Amazon EC2 Java code examples by running a test file named **AWSEC2ServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon EC2 by running a test file named **AWSEC2ServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon EC2 resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon EC2 resources and may incur charges on your account._ ### Properties file -Before running the Amazon EC2 JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. +Before running the Amazon EC2 JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **ami** – an ami value. -- **instanceName** – an instance name. You can obtain this value from the AWS Console. -- **keyPair** – a key pair to use. For example, **TestKeyPair**. -- **groupName** – ta group name to use. For example, **TestSecGroup**. -- **groupDesc** – a description of the group. For example, **Test Group**. -- **vpcId** – a VCP ID. You can obtain this value from the AWS Console. +- **ami** – An Amazon Machine Image (AMI) value. +- **instanceName** – An instance name. You can obtain this value from the AWS Management Console. +- **keyPair** – A key pair to use. For example, **TestKeyPair**. +- **groupName** – A group name to use. For example, **TestSecGroup**. +- **groupDesc** – A description of the group. For example, **Test Group**. +- **vpcId** – A VPC ID. You can obtain this value from the AWS Management Console. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -72,7 +72,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/forecast/Readme.md b/javav2/example_code/forecast/Readme.md index 7ad6ded593e..b15b7c6b5b9 100644 --- a/javav2/example_code/forecast/Readme.md +++ b/javav2/example_code/forecast/Readme.md @@ -1,52 +1,52 @@ -# Amazon Forecast Java Readme +# Amazon Forecast Java code examples -A README that discusses how to run and test the Java Amazon Forecast code examples. +This README discusses how to run and test the Java code examples for Amazon Forecast. ## Running the Amazon Forecast Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources, such as deleting a named query example. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.forecast.ListDataSets -For systems with bash support. ## Testing the Amazon Forecast files You can test the Amazon Forecast Java code examples by running a test file named **AmazonForecastServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and may incur charges on your account._ ### Properties file -Before running the Amazon Forecast JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define a forecast name used in the tests. If you do not define all values, the JUnit tests fail. +Before running the Amazon Forecast JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define a forecast name used in the tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **forecastName** - the name of a forecast used in the tests. -- **predictorARN** - a ARN of an existing predictor. -- **dataSet** - the name of a data set to create. -- **forecastARNToDelete** - an ARN of an existing forecast to delete (you cannot delete the forecast that is created because there is a time delay). +- **forecastName** - The name of a forecast used in the tests. +- **predictorARN** - An Amazon Resource Name (ARN) of an existing predictor. +- **dataSet** - The name of a dataset to create. +- **forecastARNToDelete** - An ARN of an existing forecast to delete (you cannot delete the forecast that is created because there is a time delay). ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -69,7 +69,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/glacier/Readme.md b/javav2/example_code/glacier/Readme.md index 48405804cb6..bc5b3a1f794 100644 --- a/javav2/example_code/glacier/Readme.md +++ b/javav2/example_code/glacier/Readme.md @@ -1,53 +1,52 @@ -# Amazon Glacier Java Readme +# Amazon Glacier Java code examples -A README that discusses how to run and test the Java Amazon Glacier code examples. +This README discusses how to run and test the Java code examples for Amazon Glacier. ## Running the Amazon Glacier Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java code examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources, such as deleting a Glacier vault. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.glacier.ListVaults -For systems with bash support. - ## Testing the Amazon Glacier files -You can test the Amazon Glacier Java code examples by running a test file named **AWSGlacierServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon Glacier by running a test file named **AWSGlacierServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and might incur charges on your account._ ### Properties file -Before running the Amazon Glacier JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define a vault name used for various tests. If you do not define all values, the JUnit tests fail. +Before running the Amazon Glacier JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define a vault name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **vaultName** - the name of the vault. -- **strPath** – the path to a file to use as an archive. For example, C:\\AWS\\test.pdf. -- **downloadVault** - a vault that contains an archive to download. -- **emptyVault** - an emtpy vault to delete. -- **accountId** - your account ID. You can obtain this value from the AWS Console. +- **vaultName** - The name of the vault. +- **strPath** – The path to a file to use as an archive. For example, C:\\AWS\\test.pdf. +- **downloadVault** - A vault that contains an archive to download. +- **emptyVault** - An empty vault to delete. +- **accountId** - Your account ID. You can obtain this value from the AWS Management Console. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -70,7 +69,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/iam/Readme.md b/javav2/example_code/iam/Readme.md index c66250fb51a..7de5fb70e5a 100644 --- a/javav2/example_code/iam/Readme.md +++ b/javav2/example_code/iam/Readme.md @@ -1,53 +1,53 @@ -# AWS Identity and Access Management (IAM) Java Readme +# IAM Java code examples -A README that discusses how to run and test the Java AWS IAM code examples. +This README discusses how to run and test the Java code examples for AWS Identity and Access Management (IAM). -## Running the Java AWS IAM Java files +## Running the IAM Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you might incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. -Some of these examples perform *destructive* operations on AWS resources, such as deleting a user. **Be very careful** when running an operation that +Some of these examples perform *destructive* operations on AWS resources, such as deleting a user. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.ec2.FindRunningInstances -For systems with bash support. - ## Testing the AWS IAM Java files + ## Testing the IAM Java files -You can test the AWS IAM Java code examples by running a test file named **IAMServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for IAM by running a test file named **IAMServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon EC2 resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and might incur charges on your account._ ### Properties file -Before running the AWS IAM JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. +Before running the IAM JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **userName** - a user name that is used to create a user. -- **policyName** – a policy name that is used to create a policy. -- **roleName** – a role name. You can obtain this value from the AWS Console. -- **accountAlias** – a value that is used to create an account alias. For example, **myawsaccount10**.- +- **userName** - A user name that is used to create a user. +- **policyName** – A policy name that is used to create a policy. +- **roleName** – A role name. You can obtain this value from the AWS Management Console. +- **accountAlias** – A value that is used to create an account alias. For example, **myawsaccount10**.- ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -70,7 +70,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you don't define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/kinesis/Readme.md b/javav2/example_code/kinesis/Readme.md index b07abe00d67..a880bb47936 100644 --- a/javav2/example_code/kinesis/Readme.md +++ b/javav2/example_code/kinesis/Readme.md @@ -1,51 +1,51 @@ -# Amazon Kinesis Java Readme +# Amazon Kinesis Java code examples -A README that discusses how to run and test the Java Amazon Kinesis code examples. +This README discusses how to run and test the Java code examples for Amazon Kinesis. ## Running the Amazon Kinesis Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. -Some of these examples perform *destructive* operations on AWS resources, such as deleting a data stream. **Be very careful** when running an operation that +Some of these examples perform *destructive* operations on AWS resources, such as deleting a data stream. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.kinesis.DescribeLimits -For systems with bash support. ## Testing the Amazon Kinesis files -You can test the Amazon Kinesis Java code examples by running a test file named **KinesisServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon Kinesis by running a test file named **KinesisServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and may incur charges on your account._ ### Properties file -Before running the Amazon Kinesis JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. +Before running the Amazon Kinesis JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **streamName** - a data stream name used in the tests. -- **existingDataStream** – an existing data stream that is used in the tests. Ensure that this is a different value from **streamName**. +- **streamName** - A data stream name used in the tests. +- **existingDataStream** – An existing data stream that is used in the tests. Ensure that this is a different value from **streamName**. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -68,7 +68,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/migrationhub/Readme.md b/javav2/example_code/migrationhub/Readme.md index af7600d0b2c..986220d3b2d 100644 --- a/javav2/example_code/migrationhub/Readme.md +++ b/javav2/example_code/migrationhub/Readme.md @@ -1,47 +1,51 @@ -## Running the Amazon Migration Hub Java files +# AWS Migration Hub Java code examples + +This README discusses how to run and test the Java code examples for AWS Migration Hub. + +## Running the AWS Migration Hub Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.migrationhub.ListApplications -For systems with bash support. - ## Testing the Migration Hub files + ## Testing the AWS Migration Hub files -You can test the Amazon Migration Hub Java code examples by running a test file named **MigrationHubServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for AWS Migration Hub by running a test file named **MigrationHubServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and may incur charges on your account._ ### Properties file -Before running the Amazon Migration Hub JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define the migration task named used for various tests. If you do not define all values, the JUnit tests fail. +Before running the AWS Migration Hub JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to run the JUnit tests. For example, you define the migration task named used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **appId** - the id value of an application. -- **migrationtask** – a String value that defines the migration task name. -- **progress** - a String value that defines the progress stream name. +- **appId** - The ID value of an application. +- **migrationtask** – A String value that defines the migration task name. +- **progress** - A String value that defines the progress stream name. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -64,7 +68,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- @@ -75,4 +79,3 @@ If you do not define the correct values in the properties file, your JUnit tests [INFO] --------------------------------------- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project S3J2Project: There are test failures. [ERROR]; - diff --git a/javav2/example_code/pinpoint/Readme.md b/javav2/example_code/pinpoint/Readme.md index efe0881ffc1..3f9c9246fb9 100644 --- a/javav2/example_code/pinpoint/Readme.md +++ b/javav2/example_code/pinpoint/Readme.md @@ -1,54 +1,53 @@ -# Amazon Pinpoint Java Readme +# Amazon Pinpoint Java code examples -A README that discusses how to run and test the Java (v2) Amazon Pinpoint code examples. +This README discusses how to run and test the Java (v2) code examples for Amazon Pinpoint. ## Running the Amazon Pinpoint Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources, such as deleting an Amazon Pinpoint application. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-pinpoint-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.pinpoint.CreateApp -For systems with bash support. ## Testing the Amazon Pinpoint Java files -You can test the Amazon Pinpoint Java code examples by running a test file named **AmazonPinpointServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon Pinpoint by running a test file named **AmazonPinpointServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can run the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is run, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed **WARNING**: _Running these JUnit tests manipulate real AWS resources and may incur charges on your account._ ### Properties file -Before running the JUnit tests, you must define values in the **config.properties** file located in the **src/main/resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an application name required for various tests. If you do not define all values, the JUnit tests fail. +Before running the JUnit tests, you must define values in the **config.properties** file located in the **src/main/resources** folder. This file contains values that are required to run the JUnit tests. For example, you define an application name required for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **appName** - the name of the Pinpoint application. For example, **TestApp2**. +- **appName** - The name of the Amazon Pinpoint application. For example, **TestApp2**. -- **bucket** – the name of a S3 bucket to use for the ImportSegments test. +- **bucket** – The name of an Amazon S3 bucket to use for the **ImportSegments** test. -- **path** – the path where the JSON is located in the bucket for the ImportSegments test. For example, **imports/myjson.json**. +- **path** – The path where the JSON file is located in the bucket for the **ImportSegments** test. For example, **imports/myjson.json**. -- **roleArn** - the ARN of the role for the ImportSegments test. +- **roleArn** - The Amazon Resource Name (ARN) of the role for the **ImportSegments** test. ### Sample policy text -For the purpose of the JUnit tests, the **ImportSegments** test uses JSON to import segments. You must place this JSON in the S3 bucket specified in the **bucket** value. Also, this JSON must be located in the **path** location. The following represents an example myjson.json file that you can use for the **ImportSegments** test. +For the purpose of the JUnit tests, the **ImportSegments** test uses a JSON file to import segments. You must place this JSON file in the S3 bucket specified in the **bucket** value. Also, this JSON file must be located in the **path** location. The following represents an example myjson.json file that you can use for the **ImportSegments** test. { "ChannelType":"SMS", @@ -92,11 +91,11 @@ For the purpose of the JUnit tests, the **ImportSegments** test uses JSON to imp } ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To run the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -119,7 +118,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. Also, ensure that you placed the JSON file in the correct S3 bucket location. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. Also, ensure that you placed the JSON file in the correct S3 bucket location. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/polly/Readme.md b/javav2/example_code/polly/Readme.md index e1386dae22b..428b82782bb 100644 --- a/javav2/example_code/polly/Readme.md +++ b/javav2/example_code/polly/Readme.md @@ -1,38 +1,38 @@ -# Amazon Polly Service Java Readme +# Amazon Polly Java code examples -A README that discusses how to run and test the Java Amazon Polly Service code examples. +This README discusses how to run and test the Java code examples for Amazon Polly. ## Running the Amazon Polly Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. - java com.example.polly.PollyDemo + java com.example.polly.PollyDemo -For systems with bash support. ## Testing the Amazon Polly Java files -You can test the Amazon Polly Java code examples by running a test file named **AWSPollyServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon Polly by running a test file named **AWSPollyServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can execute the tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To execute the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S diff --git a/javav2/example_code/rekognition/Readme.md b/javav2/example_code/rekognition/Readme.md index cfd94ad0a6d..8f7aae74652 100644 --- a/javav2/example_code/rekognition/Readme.md +++ b/javav2/example_code/rekognition/Readme.md @@ -1,54 +1,54 @@ -# Amazon Rekognition Java Readme +# Amazon Rekognition Java code examples -A README that discusses how to run and test the Java Amazon Rekognition code examples. +This README discusses how to run and test the Java code examples for Amazon Rekognition. ## Running the Amazon Rekognition Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.rekognition.ListCollections -For systems with bash support. ## Testing the Amazon Rekognition files -You can test the Amazon Rekognition Java code examples by running a test file named **RekognitionServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon Rekognition by running a test file named **RekognitionServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and may incur charges on your account._ ### Properties file Before running the Amazon Rekognition JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an instance name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **facesImage** - the path to an image that contains faces. -- **faceImage2** – the path to an image that contains faces. -- **celebritiesImage** - the path to an image that contains famous people. -- **celId** - the id value of the celebrity. You can use the RecognizeCelebrities example to get the ID value. -- **moutainImage** - the path to an image that contains mountains. -- **collectionName** - a string value that represents the collection name. +- **facesImage** - The path to an image that contains faces. +- **faceImage2** – The path to an image that contains faces. +- **celebritiesImage** - The path to an image that contains famous people. +- **celId** - The ID value of the celebrity. You can use the **RecognizeCelebrities** example to get the ID value. +- **moutainImage** - The path to an image that contains mountains. +- **collectionName** - A string value that represents the collection name. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To execute the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -71,7 +71,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- @@ -82,5 +82,3 @@ If you do not define the correct values in the properties file, your JUnit tests [INFO] --------------------------------------- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project S3J2Project: There are test failures. [ERROR]; - - diff --git a/javav2/example_code/s3/README.md b/javav2/example_code/s3/README.md index 8163f4300c6..ff04aae00d3 100644 --- a/javav2/example_code/s3/README.md +++ b/javav2/example_code/s3/README.md @@ -1,59 +1,58 @@ -# Amazon S3 Java Readme +# Amazon S3 Java code examples -A README that discusses how to run and test the Java Amazon Simple Storage Service (Amazon S3) code examples. +This README discusses how to run and test the Java code examples for Amazon Simple Storage Service (Amazon S3). ## Running the Amazon S3 Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources, such as deleting an Amazon S3 bucket. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-s3-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.s3.S3BucketOps -For systems with bash support. ## Testing the Amazon S3 Java files -You can test the Amazon S3 Java code examples by running a test file named **AmazonS3ServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Amazon S3 Java code examples by running a test file named **AmazonS3ServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon S3 resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon S3 resources and may incur charges on your account._ ### Properties file -Before running the Amazon S3 JUnit tests, you must define values in the **config.properties** file located in the **src/main/resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an object key required for various tests. If you do not define all values, the JUnit tests fail. +Before running the Amazon S3 JUnit tests, you must define values in the **config.properties** file located in the **src/main/resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define an object key required for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **bucketName** - the name of the bucket to use. For example, **buckettestfeb7**. +- **bucketName** - The name of the bucket to use. For example, **buckettestfeb7**. -- **objectKey** – the name of the object to use. For example, **book.pdf**. +- **objectKey** – The name of the object to use. For example, **book.pdf**. -- **objectPath** – the path where the object is located. For example, **/AWS/book2.pdf**. +- **objectPath** – The path where the object is located. For example, **/AWS/book2.pdf**. -- **toBucket** - the name of another bucket in your account. For example, **febbucket101**. +- **toBucket** - The name of another bucket in your account. For example, **febbucket101**. -- **policyText** – the location where a text file is located that defines a policy. For example, **/AWS/bucketpolicy.txt** (an example of this file is shown below). +- **policyText** – The location of a text file that defines a policy. For example, **/AWS/bucketpolicy.txt** (an example of this file is shown below). -- **id** - the ID of the user whom owns the bucket. You can get this value from the AWS Console. This value appears as a GUID value (under *Permissions* tab, and then the *Access Control List* tab). +- **id** - The ID of the user who owns the bucket. You can get this value from the AWS Management Console. This value appears as a GUID value (choose the *Permissions* tab, and then the *Access Control List* tab). -- **access** - the access level to test an ACL with. You can specify one of these values: **FULL_CONTROL** , **READ** , **WRITE** , **READ_ACP** , **WRITE_ACP**. +- **access** - The access level to test an ACL with. You can specify one of these values: **FULL_CONTROL**, **READ**, **WRITE**, **READ_ACP**, **WRITE_ACP**. ### Sample policy text -For the purpose of the JUnit tests, you can use the following example content for the policy text. Be sure to specify the correct ARN bucket name in the **Resource** section; otherwise, your test is not successful. +For the purpose of the JUnit tests, you can use the following example content for the policy text. Be sure to specify the correct Amazon Resource Name (ARN) bucket name in the **Resource** section; otherwise, your test is not successful. { "Version": "2012-10-17", @@ -74,10 +73,11 @@ For the purpose of the JUnit tests, you can use the following example content fo ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To execute the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -100,7 +100,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. Also, ensure that you specify the correct resource name in the **Sample policy** text file as well as the correct owner ID value (you can retrieve this value from the AWS Console). +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. Also, ensure that you specify the correct resource name in the **Sample policy** text file, and the correct owner ID value (you can retrieve this value from the AWS Management Console). [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/sns/Readme.md b/javav2/example_code/sns/Readme.md index 5d98c4be9f5..946024e5af6 100644 --- a/javav2/example_code/sns/Readme.md +++ b/javav2/example_code/sns/Readme.md @@ -1,60 +1,60 @@ -# Amazon Simple Notification Service Java Readme +# Amazon SNS Java code examples -A README that discusses how to run and test the Java Amazon Simple Notification Service (SNS) code examples. +This README discusses how to run and test the Java code examples for Amazon Simple Notification Service (Amazon SNS). ## Running the Amazon SNS Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. -Some of these examples perform *destructive* operations on AWS resources, such as deleting a SNS topic. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. +Some of these examples perform *destructive* operations on AWS resources, such as deleting an SNS topic. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.sns.ListTopics -For systems with bash support. ## Testing the Amazon SNS Java files -You can test the Amazon SNS Java code examples by running a test file named **AWSSNSServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Amazon SNS Java code examples by running a test file named **AWSSNSServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon SNS resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon SNS resources and may incur charges on your account._ ### Properties file Before running the Amazon SNS JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define a topic name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **topicName** - the name of the topic to use. For example, **SNSTopic101**. +- **topicName** - The name of the topic to use. For example, **SNSTopic101**. -- **attributeName** – the name of an attribute. For example, **DisplayName**. +- **attributeName** – The name of an attribute. For example, **DisplayName**. -- **attributeValue** – the value to assign to the attribute. For example, **DisplayName1**. +- **attributeValue** – The value to assign to the attribute. For example, **DisplayName1**. -- **email** - an email address to use. +- **email** - An email address to use. -- **lambdaarn** – the ARN of a lambda function. You can obtain this value from the AWS Console. -- **phone** - the number of a mobile phone. A text message is sent as part of unit test. +- **lambdaarn** – The Amazon Resource Name (ARN) of an AWS Lambda function. You can obtain this value from the AWS Management Console. +- **phone** - The number of a mobile phone. A text message is sent as part of the unit test. -- **message** - the message to use. For example, **Hello from AWS**. - +- **message** - The message to use. For example, **Hello from AWS**. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To execute the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -77,7 +77,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/sqs/Readme.md b/javav2/example_code/sqs/Readme.md index 23a9007b1c6..84c941e0056 100644 --- a/javav2/example_code/sqs/Readme.md +++ b/javav2/example_code/sqs/Readme.md @@ -1,54 +1,54 @@ -# Amazon Simple Queue Service Java Readme +# Amazon SQS Java code examples -A README that discusses how to run and test the Java Amazon Simple Queue Service (SQS) code examples. +This README discusses how to run and test the Java code examples for Amazon Simple Queue Service (Amazon SQS). ## Running the Amazon SQS Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. -Some of these examples perform *destructive* operations on AWS resources, such as deleting a message. **Be very careful** when running an operation that +Some of these examples perform *destructive* operations on AWS resources, such as deleting a message. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with Bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.sqs.SendReceiveMessages -For systems with bash support. ## Testing the Amazon SQS Java files -You can test the Amazon SQS Java code examples by running a test file named **SQSServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Amazon SQS Java code examples by running a test file named **SQSServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon SQS resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon SQS resources and may incur charges on your account._ ### Properties file Before running the Amazon SQS JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. For example, you define a topic name used for various tests. If you do not define all values, the JUnit tests fail. Define these values to successfully run the JUnit tests: -- **QueueName** - the name of the queue to use. For example, **MyTestQueue**. +- **QueueName** - The name of the queue to use. For example, **MyTestQueue**. -- **DLQueueName** – the name of the dead letter queue. For example, **MyDLQueue**. +- **DLQueueName** – The name of the dead-letter queue. For example, **MyDLQueue**. -- **Message** – the message to use. For example, **Test message sent by the SQS Service**. +- **Message** – The message to use. For example, **Test message sent by the Amazon SQS service**. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To execute the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -71,7 +71,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- diff --git a/javav2/example_code/workdocs/Readme.md b/javav2/example_code/workdocs/Readme.md index a676c890242..67e21bc3cd7 100644 --- a/javav2/example_code/workdocs/Readme.md +++ b/javav2/example_code/workdocs/Readme.md @@ -1,54 +1,54 @@ -# Amazon WorkDocs Java Readme +# Amazon WorkDocs Java code examples -A README that discusses how to run and test the Java Amazon WorkDocs code examples. +This README discusses how to run and test the Java code examples for Amazon WorkDocs. ## Running the Amazon WorkDocs Java files **IMPORTANT** -The Java examples perform AWS operations for the account and region for which you've specified credentials, and you may incur AWS service charges by running them. Visit the AWS Pricing page for details about the charges you can expect for a given service and operation. For details, see https://aws.amazon.com/pricing/. +The Java code examples perform AWS operations for the account and AWS Region for which you've specified credentials, and you may incur AWS service charges by running them. See the [AWS Pricing page](https://aws.amazon.com/pricing/) for details about the charges you can expect for a given service and operation. Some of these examples perform *destructive* operations on AWS resources. **Be very careful** when running an operation that deletes or modifies AWS resources in your account. It's best to create separate test-only resources when experimenting with these examples. -To run these examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**: +To run the examples, you'll need the AWS SDK for Java libraries in your **CLASSPATH**. export CLASSPATH=target/sdk-examples-1.0.jar:/path/to/aws-java-sdk/.jar -Where **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS Java SDK jar. +Here **/path/to/aws-java-sdk/.jar** is the path to where you extracted or built the AWS SDK for Java JAR file. -Once you set the **CLASSPATH**, you can run a particular example like this: +For systems with bash support, once you set the **CLASSPATH**, you can run a particular example as follows. java com.example.workdocs.ListUserDocs -For systems with bash support. -## Testing the Amazon WorkDocs files +## Testing the Amazon WorkDocs Java files -You can test the Amazon WorkDocs Java code examples by running a test file named **WorkdocsServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/) . +You can test the Java code examples for Amazon WorkDocs by running a test file named **WorkdocsServiceIntegrationTest**. This file uses JUnit 5 to run the JUnit tests and is located in the **src/test/java** folder. For more information, see [https://junit.org/junit5/](https://junit.org/junit5/). -You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that test 3 passed: +You can execute the JUnit tests from a Java IDE, such as IntelliJ, or from the command line by using Maven. As each test is executed, you can view messages that inform you if the various tests succeed or fail. For example, the following message informs you that Test 3 passed. Test 3 passed -**WARNING**: _Running these JUnit tests manipulate real Amazon resources and may incur charges on your account._ +**WARNING**: _Running these JUnit tests manipulates real Amazon resources and may incur charges on your account._ ### Properties file -Before running the Amazon Workdocs JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. +Before running the Amazon WorkDocs JUnit tests, you must define values in the **config.properties** file located in the **resources** folder. This file contains values that are required to execute the JUnit tests. -Define these values to successfully run the JUnit tests: +Define the following values to successfully run the JUnit tests: -- **orgId** - your organization ID value. -- **userEmail** – the user email that you configured. -- **workdocsName** - the name of the document to download. -- **saveDocFullName** - the path where a document is saved after it's downloaded. -- **docName** - the name of the document after its uploaded. -- **docPath** - the path of the document to upload. +- **orgId** - Your organization ID value. +- **userEmail** – The user email that you configured. +- **workdocsName** - The name of the document to download. +- **saveDocFullName** - The path where a document is saved after it's downloaded. +- **docName** - The name of the document after it's uploaded. +- **docPath** - The path of the document to upload. ### Command line -To execute the JUnit tests from the command line, you can use the following command: +To execute the JUnit tests from the command line, you can use the following command. mvn test -You will see output from the JUnit tests, as shown here: + +You will see output from the JUnit tests, as shown here. [INFO] ------------------------------------------------------- [INFO] T E S T S @@ -71,7 +71,7 @@ You will see output from the JUnit tests, as shown here: ### Unsuccessful tests -If you do not define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as below. You need to double check the values that you set in the properties file and run the tests again. +If you don't define the correct values in the properties file, your JUnit tests are not successful. You will see an error message such as the following. You need to double-check the values that you set in the properties file and run the tests again. [INFO] [INFO] -------------------------------------- @@ -82,4 +82,3 @@ If you do not define the correct values in the properties file, your JUnit tests [INFO] --------------------------------------- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project S3J2Project: There are test failures. [ERROR]; - diff --git a/javav2/example_code/workdocs/src/main/java/com/example/workdocs/DownloadUserDoc.java b/javav2/example_code/workdocs/src/main/java/com/example/workdocs/DownloadUserDoc.java index de4ba78d686..a02457045cd 100644 --- a/javav2/example_code/workdocs/src/main/java/com/example/workdocs/DownloadUserDoc.java +++ b/javav2/example_code/workdocs/src/main/java/com/example/workdocs/DownloadUserDoc.java @@ -41,7 +41,7 @@ public class DownloadUserDoc { public static void main(String[] args) throws Exception { final String USAGE = "\n" + - "To run this example, supply your organization ID, a user email, name of the document, and path to save document\n" + + "To run this example, supply your organization ID, a user email, the document name, and path to save the document to\n" + "\n" + "Ex: download_user_doc \n"; @@ -72,7 +72,7 @@ public static void downloadDoc(WorkDocsClient workDocs, String orgId, String use Map map = getDocInfo(workDocs, orgId, userEmail, workdocsName); if (map.isEmpty()) { - System.out.println("Could not get info about workdoc " + workdocsName); + System.out.println("Could not get information about the document " + workdocsName); return; } @@ -80,7 +80,7 @@ public static void downloadDoc(WorkDocsClient workDocs, String orgId, String use String versionId = map.get("version_id"); if (docId.isEmpty() || versionId.isEmpty()) { - System.out.println("Could not get info about workdoc " + workdocsName); + System.out.println("Could not get information about the document " + workdocsName); return; } @@ -133,7 +133,7 @@ private static String getUserFolder(WorkDocsClient workDocs, String orgId, Strin } for (User wdUser : wdUsers) { - //DescribeFolderContentsRequest dfc_request = new DescribeFolderContentsRequest(); + // DescribeFolderContentsRequest dfc_request = new DescribeFolderContentsRequest(); userFolder = wdUser.rootFolderId(); } @@ -194,7 +194,7 @@ private static String getDownloadDocUrl(WorkDocsClient workDocs, String docId, S Map sourceDoc = response.metadata().source(); Map.Entry entry = sourceDoc.entrySet().iterator().next(); DocumentSourceType key = entry.getKey(); - String docUrl = entry.getValue(); // stores the URL of this document + String docUrl = entry.getValue(); // Stores the URL of this document return docUrl; diff --git a/javav2/example_code/workdocs/src/main/java/com/example/workdocs/ListUserDocs.java b/javav2/example_code/workdocs/src/main/java/com/example/workdocs/ListUserDocs.java index c5db17920d0..46685b1679e 100644 --- a/javav2/example_code/workdocs/src/main/java/com/example/workdocs/ListUserDocs.java +++ b/javav2/example_code/workdocs/src/main/java/com/example/workdocs/ListUserDocs.java @@ -1,4 +1,4 @@ -//snippet-sourcedescription:[ListUserDocs.java demonstrates how to list user docs for the current user.] +//snippet-sourcedescription:[ListUserDocs.java demonstrates how to list user documents for the current user.] //snippet-keyword:[SDK for Java 2.0] //snippet-keyword:[Code Sample] //snippet-service:[Amazon WorkDocs] @@ -27,7 +27,7 @@ public class ListUserDocs { public static void main(String[] args) throws Exception { - // Based on WorkDocs dev guide code at http://docs.aws.amazon.com/workdocs/latest/developerguide/connect-workdocs-role.html + // Based on Amazon WorkDocs Developer Guide code at http://docs.aws.amazon.com/workdocs/latest/developerguide/connect-workdocs-role.html final String USAGE = "\n" + "To run this example, supply your organization ID and a user email\n" + @@ -75,7 +75,7 @@ public static void listDocs(WorkDocsClient workDocs, String orgId, String userEm System.out.println("Name: " + md.name()); System.out.println("Size (bytes): " + md.size()); System.out.println("Last modified: " + md.modifiedTimestamp()); - System.out.println("Doc ID: " + doc.id()); + System.out.println("Document ID: " + doc.id()); System.out.println(""); } diff --git a/javav2/example_code/workdocs/src/main/java/com/example/workdocs/ListUsers.java b/javav2/example_code/workdocs/src/main/java/com/example/workdocs/ListUsers.java index 01ad61aa0ef..4b7ab7ce35e 100644 --- a/javav2/example_code/workdocs/src/main/java/com/example/workdocs/ListUsers.java +++ b/javav2/example_code/workdocs/src/main/java/com/example/workdocs/ListUsers.java @@ -23,7 +23,7 @@ public class ListUsers { public static void main(String[] args) { - // Based on WorkDocs dev guide code at http://docs.aws.amazon.com/workdocs/latest/developerguide/connect-workdocs-iam.html + // Based on Amazon WorkDocs Developer Guide code at http://docs.aws.amazon.com/workdocs/latest/developerguide/connect-workdocs-iam.html final String USAGE = "\n" + "To run this example, supply your organization ID\n" + diff --git a/javav2/example_code/workdocs/src/main/java/com/example/workdocs/UploadUserDocs.java b/javav2/example_code/workdocs/src/main/java/com/example/workdocs/UploadUserDocs.java index 56600a5c843..f612ffa7cbc 100644 --- a/javav2/example_code/workdocs/src/main/java/com/example/workdocs/UploadUserDocs.java +++ b/javav2/example_code/workdocs/src/main/java/com/example/workdocs/UploadUserDocs.java @@ -1,4 +1,4 @@ -//snippet-sourcedescription:[UploadUserDocs.java demonstrates how to upload a document to AWS Workdocs.] +//snippet-sourcedescription:[UploadUserDocs.java demonstrates how to upload a document to Amazon WorkDocs.] //snippet-keyword:[SDK for Java 2.0] //snippet-keyword:[Code Sample] //snippet-service:[Amazon WorkDocs] @@ -41,7 +41,7 @@ public class UploadUserDocs { public static void main(String[] args) { - // Based on WorkDocs dev guide code at http://docs.aws.amazon.com/workdocs/latest/developerguide/upload-documents.html + // Based on Amazon WorkDocs Developer Guide code at http://docs.aws.amazon.com/workdocs/latest/developerguide/upload-documents.html final String USAGE = "\n" + " To run this example, supply your organization ID, a user email, the document name, and the path where the document is located \n" + @@ -83,7 +83,7 @@ public static void uploadDoc(WorkDocsClient workDocs, String orgId, String userE if (statusValue != 200) { System.out.println("Error code uploading: " + statusValue); } else { - System.out.println("Success uploading doc " + docName); + System.out.println("Success uploading document " + docName); } completeUpload(workDocs, docId, versionId);