// Path: src/main/java/org/calrissian/flowmix/core/support/Utils.java
// public static String buildKeyIndexForEvent(Event event, List<String> groupBy) {
//   StringBuffer stringBuffer = new StringBuffer();
// 
//   if(groupBy == null || groupBy.size() == 0)
//     return stringBuffer.toString();  // default partition when no groupBy fields are specified.
// 
//   for(String groupField : groupBy) {
//     Collection<Tuple> tuples = event.getAll(groupField);
//     SortedSet<String> values = new TreeSet<String>();
// 
//     if(tuples == null) {
//       values.add("");
//     } else {
//       for(Tuple tuple : tuples)
//         values.add(registry.encode(tuple.getValue()));
//     }
//     stringBuffer.append(groupField + join(values, "") + "|");
//   }
//   try {
//     return stringBuffer.toString();
//   } catch (Exception e) {
//     return null;
//   }
// }


import java.util.Arrays;
import java.util.Collections;
import org.calrissian.mango.domain.Tuple;
import org.calrissian.mango.domain.event.BaseEvent;
import org.calrissian.mango.domain.event.Event;
import org.junit.Test;
import static java.lang.System.currentTimeMillis;
import static java.util.Collections.EMPTY_LIST;
import static java.util.UUID.randomUUID;
import static org.calrissian.flowmix.core.support.Utils.buildKeyIndexForEvent;
import static org.junit.Assert.assertEquals;
/*
 * Copyright (C) 2014 The Calrissian Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.calrissian.flowmix.core.support;





public class UtilsTest {

  @Test
  public void test_buildKeyIndexForEvent_noGroupBy() {
// Path: src/main/java/org/calrissian/flowmix/core/support/Utils.java
// public static String buildKeyIndexForEvent(Event event, List<String> groupBy) {
//   StringBuffer stringBuffer = new StringBuffer();
// 
//   if(groupBy == null || groupBy.size() == 0)
//     return stringBuffer.toString();  // default partition when no groupBy fields are specified.
// 
//   for(String groupField : groupBy) {
//     Collection<Tuple> tuples = event.getAll(groupField);
//     SortedSet<String> values = new TreeSet<String>();
// 
//     if(tuples == null) {
//       values.add("");
//     } else {
//       for(Tuple tuple : tuples)
//         values.add(registry.encode(tuple.getValue()));
//     }
//     stringBuffer.append(groupField + join(values, "") + "|");
//   }
//   try {
//     return stringBuffer.toString();
//   } catch (Exception e) {
//     return null;
//   }
// }


// Path: src/test/java/org/calrissian/flowmix/core/support/UtilsTest.java
import java.util.Arrays;
import java.util.Collections;
import org.calrissian.mango.domain.Tuple;
import org.calrissian.mango.domain.event.BaseEvent;
import org.calrissian.mango.domain.event.Event;
import org.junit.Test;
import static java.lang.System.currentTimeMillis;
import static java.util.Collections.EMPTY_LIST;
import static java.util.UUID.randomUUID;
import static org.calrissian.flowmix.core.support.Utils.buildKeyIndexForEvent;
import static org.junit.Assert.assertEquals;

/*
 * Copyright (C) 2014 The Calrissian Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.calrissian.flowmix.core.support;





public class UtilsTest {

  @Test
  public void test_buildKeyIndexForEvent_noGroupBy() {
    String hash = buildKeyIndexForEvent("one", buildTestEvent(), EMPTY_LIST);