@@ -0,0 +1,3064 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage storm.mesos;%0A%0Aimport org.apache.mesos.Protos.CommandInfo;%0Aimport org.apache.mesos.Protos.ExecutorID;%0Aimport org.apache.mesos.Protos.ExecutorInfo;%0Aimport org.apache.mesos.Protos.FrameworkID;%0Aimport org.apache.mesos.Protos.Offer;%0Aimport org.apache.mesos.Protos.OfferID;%0Aimport org.apache.mesos.Protos.SlaveID;%0Aimport org.apache.mesos.Protos.TaskID;%0Aimport org.apache.mesos.Protos.TaskInfo;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertSame;%0A%0Apublic final class LaunchTaskTest%0A%7B%0A%0A  /**%0A   * Testing target.%0A   */%0A  private final LaunchTask target;%0A%0A  private final TaskInfo sampleTaskInfo;%0A%0A  private final Offer sampleOffer;%0A%0A  /**%0A   * Setup testing target & sample data.%0A   */%0A  public LaunchTaskTest()%0A  %7B%0A    SlaveID slaveID = SlaveID.newBuilder().setValue(%22s1%22).build();%0A    this.sampleTaskInfo =%0A        TaskInfo.newBuilder()%0A                .setName(%22t1%22).setSlaveId(slaveID)%0A                .setTaskId(TaskID.newBuilder().setValue(%22id2%22))%0A                .setExecutor(%0A                    ExecutorInfo.newBuilder()%0A                                .setExecutorId(ExecutorID.newBuilder().setValue(%22e1%22))%0A                                .setCommand(CommandInfo.getDefaultInstance()))%0A                .build();%0A    this.sampleOffer =%0A        Offer.newBuilder()%0A             .setHostname(%22h1%22).setSlaveId(slaveID)%0A             .setId(OfferID.newBuilder().setValue(%22id1%22))%0A             .setFrameworkId(FrameworkID.newBuilder().setValue(%22f1%22).build())%0A             .build();%0A    this.target = new LaunchTask(sampleTaskInfo, sampleOffer);%0A  %7D%0A%0A  @Test%0A  public void getTask()%0A  %7B%0A    assertSame(%0A        %22The return value should be the same as the value passed in the argument of the constructor%22,%0A        sampleTaskInfo, target.getTask()%0A    );%0A  %7D%0A%0A  @Test%0A  public void getOffer()%0A  %7B%0A    assertSame(%0A        %22The return value should be the same as the value passed in the argument of the constructor%22,%0A        sampleOffer, target.getOffer()%0A    );%0A  %7D%0A%0A  @Test%0A  public void objectToString()%0A  %7B%0A    assertEquals(%0A        %22Offer: %7B%5C%22offer_id%5C%22:%5C%22id1%5C%22,%5C%22hostname%5C%22:%5C%22h1%5C%22%7D TaskInfo: %7B%5C%22task_id%5C%22:%5C%22id2%5C%22,%5C%22slave_id%5C%22:%5C%22s1%5C%22,%5C%22executor_id%5C%22:%5C%22e1%5C%22%7D%22,%0A        target.toString()%0A    );%0A  %7D%0A%0A%7D%0A

Add test cases for LaunchTask