@@ -0,0 +1,2296 @@
+/*%0ACopyright 2014 Twitter, Inc.%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0Ahttp://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A */%0A%0Apackage com.twitter.ambrose.model;%0A%0Aimport static org.junit.Assert.assertArrayEquals;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.Properties;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport com.twitter.ambrose.model.Job;%0Aimport com.twitter.ambrose.cascading.CascadingJob;%0A%0Apublic class CascadingJobTest %7B%0A  CascadingJob cascadingJob;%0A%0A  @Before%0A  public void setUp() throws Exception %7B%0A    Properties properties = new Properties();%0A    properties.setProperty(%22someprop%22, %22propvalue%22);%0A    String%5B%5D features = new String%5B%5D %7B %22feature1%22 %7D;%0A    Map%3CString, Number%3E m = new HashMap%3CString, Number%3E();%0A    m.put(%22somemetric%22, 45);%0A%0A    cascadingJob = new CascadingJob();%0A    cascadingJob.setFeatures(features);%0A    cascadingJob.setConfiguration(properties);%0A    cascadingJob.setMetrics(m);%0A  %7D%0A  %0A  @Test%0A  public void testPigJobRoundTrip() throws IOException %7B%0A    doTestRoundTrip(cascadingJob);%0A  %7D%0A  %0A  private void doTestRoundTrip(CascadingJob expected) throws IOException %7B%0A    String asJson = expected.toJson();%0A    Job asJobAgain = Job.fromJson(asJson);%0A%0A    // assert that if we get a PigJob without having to ask for it explicitly%0A    assertTrue(asJobAgain instanceof CascadingJob);%0A    assertJobEquals(expected, (CascadingJob) asJobAgain);%0A  %7D%0A%0A  public static void assertJobEquals(CascadingJob expected, CascadingJob found) %7B%0A    assertEquals(expected.getId(), found.getId());%0A    assertArrayEquals(expected.getFeatures(), found.getFeatures());%0A    assertEquals(expected.getMetrics(), found.getMetrics());%0A    assertEquals(expected.getConfiguration(), found.getConfiguration());%0A  %7D%0A%7D%0A

add missing test file for cascading