CAMEL-12430: Disable camel-consul test on karaf as it does not work

--- tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelConsulTest.java
+++ tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelConsulTest.java
@@ -16,11 +16,14 @@
  */
 package org.apache.camel.itest.karaf;

+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.PaxExam;

+// TODO: camel-consul does not work in OSGi
 @RunWith(PaxExam.class)
+@Ignore("camel-consul does not work in OSGi")
 public class CamelConsulTest extends BaseKarafTest {

     public static final String COMPONENT = extractName(CamelConsulTest.class);

<|original_code|>
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.apache.camel.itest.karaf;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.junit.PaxExam;

@RunWith(PaxExam.class)
public class CamelConsulTest extends BaseKarafTest {

    public static final String COMPONENT = extractName(CamelConsulTest.class);

    @Test
    public void test() throws Exception {
        testComponent(COMPONENT);
    }

}

<|edits_diff|>
--- tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelConsulTest.java
+++ tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelConsulTest.java
@@ -16,10 +16,12 @@
  */
 package org.apache.camel.itest.karaf;

+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.PaxExam;

+// TODO: camel-consul does not work in OSGi
 @RunWith(PaxExam.class)
 public class CamelConsulTest extends BaseKarafTest {

<|current_version|>
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.apache.camel.itest.karaf;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.junit.PaxExam;

// TODO: camel-consul does not work in OSGi
@RunWith(PaxExam.class)
public class CamelConsulTest extends BaseKarafTest {

    public static final String COMPONENT = extractName(CamelConsulTest.class);

    @Test
    public void test() throws Exception {
        testComponent(COMPONENT);
    }

}

<|next_version|>
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.apache.camel.itest.karaf;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.junit.PaxExam;

// TODO: camel-consul does not work in OSGi
@RunWith(PaxExam.class)
@Ignore("camel-consul does not work in OSGi")
public class CamelConsulTest extends BaseKarafTest {

    public static final String COMPONENT = extractName(CamelConsulTest.class);

    @Test
    public void test() throws Exception {
        testComponent(COMPONENT);
    }

}


Add Constant for config: SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY

--- src/org/yeastrc/xlink/base/config_system_table_common_access/ConfigSystemsKeysSharedConstants.java
+++ src/org/yeastrc/xlink/base/config_system_table_common_access/ConfigSystemsKeysSharedConstants.java
@@ -14,6 +14,8 @@

 	public static final String PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY = "proxl_xml_file_import_temp_dir";

+	public static final String SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY = "scan_file_import_allowed_via_web_submit";
+

 	//   Lists of config keys for validation on save

@@ -21,6 +23,7 @@

 	static {
 		textConfigKeys.add( PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY );
+		textConfigKeys.add( SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY );

 	}
 }

<|original_code|>
package org.yeastrc.xlink.base.config_system_table_common_access;

import java.util.HashSet;
import java.util.Set;

public class ConfigSystemsKeysSharedConstants {

	//////   Any plain text inputs need to be added to textConfigKeys in the "static {}" at the bottom

	////  Proxl XML File Import Set Up keys

	public static final String PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY = "proxl_xml_file_import_temp_dir";

	//   Lists of config keys for validation on save

	public static final Set<String> textConfigKeys = new HashSet<>();

	static {
		textConfigKeys.add( PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY );

	}
}

<|edits_diff|>
--- src/org/yeastrc/xlink/base/config_system_table_common_access/ConfigSystemsKeysSharedConstants.java
+++ src/org/yeastrc/xlink/base/config_system_table_common_access/ConfigSystemsKeysSharedConstants.java
@@ -14,6 +14,8 @@

 	public static final String PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY = "proxl_xml_file_import_temp_dir";

+	public static final String SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY = "scan_file_import_allowed_via_web_submit";
+

 	//   Lists of config keys for validation on save

<|current_version|>
package org.yeastrc.xlink.base.config_system_table_common_access;

import java.util.HashSet;
import java.util.Set;

public class ConfigSystemsKeysSharedConstants {

	//////   Any plain text inputs need to be added to textConfigKeys in the "static {}" at the bottom

	////  Proxl XML File Import Set Up keys

	public static final String PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY = "proxl_xml_file_import_temp_dir";

	public static final String SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY = "scan_file_import_allowed_via_web_submit";

	//   Lists of config keys for validation on save

	public static final Set<String> textConfigKeys = new HashSet<>();

	static {
		textConfigKeys.add( PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY );

	}
}

<|next_version|>
package org.yeastrc.xlink.base.config_system_table_common_access;

import java.util.HashSet;
import java.util.Set;

public class ConfigSystemsKeysSharedConstants {

	//////   Any plain text inputs need to be added to textConfigKeys in the "static {}" at the bottom

	////  Proxl XML File Import Set Up keys

	public static final String PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY = "proxl_xml_file_import_temp_dir";

	public static final String SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY = "scan_file_import_allowed_via_web_submit";

	//   Lists of config keys for validation on save

	public static final Set<String> textConfigKeys = new HashSet<>();

	static {
		textConfigKeys.add( PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY );
		textConfigKeys.add( SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY );

	}
}


Fix galleries crashing due to missing injection declaration.

--- src/pro/java/com/antew/redditinpictures/ApplicationModulePro.java
+++ src/pro/java/com/antew/redditinpictures/ApplicationModulePro.java
@@ -6,6 +6,7 @@
 import com.antew.redditinpictures.library.ui.ImageGridFragment;
 import com.antew.redditinpictures.library.ui.ImageListFragment;
 import com.antew.redditinpictures.library.ui.ImgurAlbumActivity;
+import com.antew.redditinpictures.library.ui.ImgurAlbumFragment;
 import com.antew.redditinpictures.library.ui.RedditFragmentActivity;
 import com.antew.redditinpictures.library.ui.RedditImageGridFragment;
 import com.antew.redditinpictures.library.ui.RedditImageListFragment;
@@ -18,6 +19,7 @@
         ImageGridFragment.class, ImageListFragment.class, ImageGridActivity.class,
         ImageDetailActivity.class, ImageDetailFragment.class, ImgurAlbumActivity.class,
         RedditFragmentActivity.class, RedditImageListFragment.class, RedditImageGridFragment.class,
+        ImgurAlbumFragment.class,
     }, library = true
 )
 public class ApplicationModulePro {

<|original_code|>
package com.antew.redditinpictures;

import com.antew.redditinpictures.library.ui.ImageDetailActivity;
import com.antew.redditinpictures.library.ui.ImageDetailFragment;
import com.antew.redditinpictures.library.ui.ImageGridActivity;
import com.antew.redditinpictures.library.ui.ImageGridFragment;
import com.antew.redditinpictures.library.ui.ImageListFragment;
import com.antew.redditinpictures.library.ui.ImgurAlbumActivity;
import com.antew.redditinpictures.library.ui.RedditFragmentActivity;
import com.antew.redditinpictures.library.ui.RedditImageGridFragment;
import com.antew.redditinpictures.library.ui.RedditImageListFragment;
import dagger.Module;

@Module(
    complete = false,
    overrides = true,
    injects = {
        ImageGridFragment.class, ImageListFragment.class, ImageGridActivity.class,
        ImageDetailActivity.class, ImageDetailFragment.class, ImgurAlbumActivity.class,
        RedditFragmentActivity.class, RedditImageListFragment.class, RedditImageGridFragment.class,
    }, library = true
)
public class ApplicationModulePro {

}
<|edits_diff|>
--- src/pro/java/com/antew/redditinpictures/ApplicationModulePro.java
+++ src/pro/java/com/antew/redditinpictures/ApplicationModulePro.java
@@ -6,6 +6,7 @@
 import com.antew.redditinpictures.library.ui.ImageGridFragment;
 import com.antew.redditinpictures.library.ui.ImageListFragment;
 import com.antew.redditinpictures.library.ui.ImgurAlbumActivity;
+import com.antew.redditinpictures.library.ui.ImgurAlbumFragment;
 import com.antew.redditinpictures.library.ui.RedditFragmentActivity;
 import com.antew.redditinpictures.library.ui.RedditImageGridFragment;
 import com.antew.redditinpictures.library.ui.RedditImageListFragment;
<|current_version|>
package com.antew.redditinpictures;

import com.antew.redditinpictures.library.ui.ImageDetailActivity;
import com.antew.redditinpictures.library.ui.ImageDetailFragment;
import com.antew.redditinpictures.library.ui.ImageGridActivity;
import com.antew.redditinpictures.library.ui.ImageGridFragment;
import com.antew.redditinpictures.library.ui.ImageListFragment;
import com.antew.redditinpictures.library.ui.ImgurAlbumActivity;
import com.antew.redditinpictures.library.ui.ImgurAlbumFragment;
import com.antew.redditinpictures.library.ui.RedditFragmentActivity;
import com.antew.redditinpictures.library.ui.RedditImageGridFragment;
import com.antew.redditinpictures.library.ui.RedditImageListFragment;
import dagger.Module;

@Module(
    complete = false,
    overrides = true,
    injects = {
        ImageGridFragment.class, ImageListFragment.class, ImageGridActivity.class,
        ImageDetailActivity.class, ImageDetailFragment.class, ImgurAlbumActivity.class,
        RedditFragmentActivity.class, RedditImageListFragment.class, RedditImageGridFragment.class,
    }, library = true
)
public class ApplicationModulePro {

}
<|next_version|>
package com.antew.redditinpictures;

import com.antew.redditinpictures.library.ui.ImageDetailActivity;
import com.antew.redditinpictures.library.ui.ImageDetailFragment;
import com.antew.redditinpictures.library.ui.ImageGridActivity;
import com.antew.redditinpictures.library.ui.ImageGridFragment;
import com.antew.redditinpictures.library.ui.ImageListFragment;
import com.antew.redditinpictures.library.ui.ImgurAlbumActivity;
import com.antew.redditinpictures.library.ui.ImgurAlbumFragment;
import com.antew.redditinpictures.library.ui.RedditFragmentActivity;
import com.antew.redditinpictures.library.ui.RedditImageGridFragment;
import com.antew.redditinpictures.library.ui.RedditImageListFragment;
import dagger.Module;

@Module(
    complete = false,
    overrides = true,
    injects = {
        ImageGridFragment.class, ImageListFragment.class, ImageGridActivity.class,
        ImageDetailActivity.class, ImageDetailFragment.class, ImgurAlbumActivity.class,
        RedditFragmentActivity.class, RedditImageListFragment.class, RedditImageGridFragment.class,
        ImgurAlbumFragment.class,
    }, library = true
)
public class ApplicationModulePro {

}


Add NonNullApi annotation on org.gradle.api.model

Everything created from ObjectFactory will be non-null.

--- subprojects/core-api/src/main/java/org/gradle/api/model/package-info.java
+++ subprojects/core-api/src/main/java/org/gradle/api/model/package-info.java
@@ -17,4 +17,7 @@
 /**
  * Classes that operate on the Gradle model.
  */
+@NonNullApi
 package org.gradle.api.model;
+
+import org.gradle.api.NonNullApi;

<|original_code|>
/*
 * Copyright 2017 the original author or 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.
 */

/**
 * Classes that operate on the Gradle model.
 */
package org.gradle.api.model;

<|edits_diff|>
--- subprojects/core-api/src/main/java/org/gradle/api/model/package-info.java
+++ subprojects/core-api/src/main/java/org/gradle/api/model/package-info.java
@@ -17,4 +17,5 @@
 /**
  * Classes that operate on the Gradle model.
  */
+@NonNullApi
 package org.gradle.api.model;
<|current_version|>
/*
 * Copyright 2017 the original author or 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.
 */

/**
 * Classes that operate on the Gradle model.
 */
@NonNullApi
package org.gradle.api.model;

<|next_version|>
/*
 * Copyright 2017 the original author or 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.
 */

/**
 * Classes that operate on the Gradle model.
 */
@NonNullApi
package org.gradle.api.model;

import org.gradle.api.NonNullApi;


Add support for accessing the response exception

--- examples/strict/src/test/java/org/jboss/shamrock/example/testutils/URLResponse.java
+++ examples/strict/src/test/java/org/jboss/shamrock/example/testutils/URLResponse.java
@@ -1,5 +1,6 @@
 package org.jboss.shamrock.example.testutils;

+import java.io.IOException;
 import java.io.InputStream;

 import javax.json.JsonReader;
@@ -8,6 +9,8 @@

     int statusCode();

+    IOException exception();
+
     String asString();

     InputStream asInputStream();

<|original_code|>
package org.jboss.shamrock.example.testutils;

import java.io.InputStream;

import javax.json.JsonReader;

public interface URLResponse {

    int statusCode();

    String asString();

    InputStream asInputStream();

    JsonReader asJsonReader();
}

<|edits_diff|>
--- examples/strict/src/test/java/org/jboss/shamrock/example/testutils/URLResponse.java
+++ examples/strict/src/test/java/org/jboss/shamrock/example/testutils/URLResponse.java
@@ -1,5 +1,6 @@
 package org.jboss.shamrock.example.testutils;

+import java.io.IOException;
 import java.io.InputStream;

 import javax.json.JsonReader;
<|current_version|>
package org.jboss.shamrock.example.testutils;

import java.io.IOException;
import java.io.InputStream;

import javax.json.JsonReader;

public interface URLResponse {

    int statusCode();

    String asString();

    InputStream asInputStream();

    JsonReader asJsonReader();
}

<|next_version|>
package org.jboss.shamrock.example.testutils;

import java.io.IOException;
import java.io.InputStream;

import javax.json.JsonReader;

public interface URLResponse {

    int statusCode();

    IOException exception();

    String asString();

    InputStream asInputStream();

    JsonReader asJsonReader();
}


Add debug method to Retrofit process service

--- src/main/java/util/FilestackService.java
+++ src/main/java/util/FilestackService.java
@@ -1,5 +1,6 @@
 package util;

+import com.google.gson.JsonObject;
 import okhttp3.RequestBody;
 import okhttp3.ResponseBody;
 import retrofit2.Call;
@@ -37,5 +38,8 @@
         @Streaming
         @GET("{tasks}/{handle}")
         Call<ResponseBody> get(@Path("tasks") String tasks, @Path("handle") String handle);
+
+        @GET("debug/{tasks}/{handle}")
+        Call<JsonObject> debug(@Path("tasks") String tasks, @Path("handle") String handle);
     }
 }

<|original_code|>
package util;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;

/**
 * Retrofit interfaces wrapping Filestack API.
 */
public class FilestackService {

    public interface Api {
        String URL = "https://www.filestackapi.com/api/file/";

        @POST("{handle}")
        Call<ResponseBody> overwrite(@Path("handle") String handle, @Query("policy") String policy,
                                     @Query("signature") String signature, @Body RequestBody body);

        @DELETE("{handle}")
        Call<ResponseBody> delete(@Path("handle") String handle, @Query("key") String key,
                                  @Query("policy") String policy, @Query("signature") String signature);
    }

    public interface Cdn {
        String URL = "https://cdn.filestackcontent.com/";

        @GET("{handle}")
        @Streaming
        Call<ResponseBody> get(@Path("handle") String handle, @Query("policy") String policy,
                               @Query("signature") String signature);
    }

    public interface Process {
        String URL = "https://process.filestackapi.com/";

        @Streaming
        @GET("{tasks}/{handle}")
        Call<ResponseBody> get(@Path("tasks") String tasks, @Path("handle") String handle);
    }
}

<|edits_diff|>
--- src/main/java/util/FilestackService.java
+++ src/main/java/util/FilestackService.java
@@ -1,5 +1,6 @@
 package util;

+import com.google.gson.JsonObject;
 import okhttp3.RequestBody;
 import okhttp3.ResponseBody;
 import retrofit2.Call;
<|current_version|>
package util;

import com.google.gson.JsonObject;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;

/**
 * Retrofit interfaces wrapping Filestack API.
 */
public class FilestackService {

    public interface Api {
        String URL = "https://www.filestackapi.com/api/file/";

        @POST("{handle}")
        Call<ResponseBody> overwrite(@Path("handle") String handle, @Query("policy") String policy,
                                     @Query("signature") String signature, @Body RequestBody body);

        @DELETE("{handle}")
        Call<ResponseBody> delete(@Path("handle") String handle, @Query("key") String key,
                                  @Query("policy") String policy, @Query("signature") String signature);
    }

    public interface Cdn {
        String URL = "https://cdn.filestackcontent.com/";

        @GET("{handle}")
        @Streaming
        Call<ResponseBody> get(@Path("handle") String handle, @Query("policy") String policy,
                               @Query("signature") String signature);
    }

    public interface Process {
        String URL = "https://process.filestackapi.com/";

        @Streaming
        @GET("{tasks}/{handle}")
        Call<ResponseBody> get(@Path("tasks") String tasks, @Path("handle") String handle);
    }
}

<|next_version|>
package util;

import com.google.gson.JsonObject;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;

/**
 * Retrofit interfaces wrapping Filestack API.
 */
public class FilestackService {

    public interface Api {
        String URL = "https://www.filestackapi.com/api/file/";

        @POST("{handle}")
        Call<ResponseBody> overwrite(@Path("handle") String handle, @Query("policy") String policy,
                                     @Query("signature") String signature, @Body RequestBody body);

        @DELETE("{handle}")
        Call<ResponseBody> delete(@Path("handle") String handle, @Query("key") String key,
                                  @Query("policy") String policy, @Query("signature") String signature);
    }

    public interface Cdn {
        String URL = "https://cdn.filestackcontent.com/";

        @GET("{handle}")
        @Streaming
        Call<ResponseBody> get(@Path("handle") String handle, @Query("policy") String policy,
                               @Query("signature") String signature);
    }

    public interface Process {
        String URL = "https://process.filestackapi.com/";

        @Streaming
        @GET("{tasks}/{handle}")
        Call<ResponseBody> get(@Path("tasks") String tasks, @Path("handle") String handle);

        @GET("debug/{tasks}/{handle}")
        Call<JsonObject> debug(@Path("tasks") String tasks, @Path("handle") String handle);
    }
}


Make test command clean up asynchornously

--- src/main/java/ru/vyarus/dropwizard/guice/test/TestCommand.java
+++ src/main/java/ru/vyarus/dropwizard/guice/test/TestCommand.java
@@ -22,6 +22,7 @@

     public TestCommand(final Application<C> application) {
         super(application, "guicey-test", "Specific command to run guice context without jetty server");
+        cleanupAsynchronously();
         configurationClass = application.getConfigurationClass();
     }

@@ -41,6 +42,7 @@
             throw new IllegalStateException("Failed to stop managed objects container", e);
         }
         container.destroy();
+        cleanup();
     }

     @Override

<|original_code|>
package ru.vyarus.dropwizard.guice.test;

import io.dropwizard.Application;
import io.dropwizard.Configuration;
import io.dropwizard.cli.EnvironmentCommand;
import io.dropwizard.setup.Environment;
import net.sourceforge.argparse4j.inf.Namespace;
import org.eclipse.jetty.util.component.ContainerLifeCycle;

/**
 * Lightweight variation of server command for testing purposes.
 * Handles managed objects lifecycle.
 *
 * @param <C> configuration type
 * @author Vyacheslav Rusakov
 * @since 23.10.2014
 */
public class TestCommand<C extends Configuration> extends EnvironmentCommand<C> {

    private final Class<C> configurationClass;
    private ContainerLifeCycle container;

    public TestCommand(final Application<C> application) {
        super(application, "guicey-test", "Specific command to run guice context without jetty server");
        configurationClass = application.getConfigurationClass();
    }

    @Override
    protected void run(final Environment environment, final Namespace namespace,
                       final C configuration) throws Exception {
        // simulating managed objects lifecycle support
        container = new ContainerLifeCycle();
        environment.lifecycle().attach(container);
        container.start();
    }

    public void stop() {
        try {
            container.stop();
        } catch (Exception e) {
            throw new IllegalStateException("Failed to stop managed objects container", e);
        }
        container.destroy();
    }

    @Override
    protected Class<C> getConfigurationClass() {
        return configurationClass;
    }
}

<|edits_diff|>
--- src/main/java/ru/vyarus/dropwizard/guice/test/TestCommand.java
+++ src/main/java/ru/vyarus/dropwizard/guice/test/TestCommand.java
@@ -22,6 +22,7 @@

     public TestCommand(final Application<C> application) {
         super(application, "guicey-test", "Specific command to run guice context without jetty server");
+        cleanupAsynchronously();
         configurationClass = application.getConfigurationClass();
     }

<|current_version|>
package ru.vyarus.dropwizard.guice.test;

import io.dropwizard.Application;
import io.dropwizard.Configuration;
import io.dropwizard.cli.EnvironmentCommand;
import io.dropwizard.setup.Environment;
import net.sourceforge.argparse4j.inf.Namespace;
import org.eclipse.jetty.util.component.ContainerLifeCycle;

/**
 * Lightweight variation of server command for testing purposes.
 * Handles managed objects lifecycle.
 *
 * @param <C> configuration type
 * @author Vyacheslav Rusakov
 * @since 23.10.2014
 */
public class TestCommand<C extends Configuration> extends EnvironmentCommand<C> {

    private final Class<C> configurationClass;
    private ContainerLifeCycle container;

    public TestCommand(final Application<C> application) {
        super(application, "guicey-test", "Specific command to run guice context without jetty server");
        cleanupAsynchronously();
        configurationClass = application.getConfigurationClass();
    }

    @Override
    protected void run(final Environment environment, final Namespace namespace,
                       final C configuration) throws Exception {
        // simulating managed objects lifecycle support
        container = new ContainerLifeCycle();
        environment.lifecycle().attach(container);
        container.start();
    }

    public void stop() {
        try {
            container.stop();
        } catch (Exception e) {
            throw new IllegalStateException("Failed to stop managed objects container", e);
        }
        container.destroy();
    }

    @Override
    protected Class<C> getConfigurationClass() {
        return configurationClass;
    }
}

<|next_version|>
package ru.vyarus.dropwizard.guice.test;

import io.dropwizard.Application;
import io.dropwizard.Configuration;
import io.dropwizard.cli.EnvironmentCommand;
import io.dropwizard.setup.Environment;
import net.sourceforge.argparse4j.inf.Namespace;
import org.eclipse.jetty.util.component.ContainerLifeCycle;

/**
 * Lightweight variation of server command for testing purposes.
 * Handles managed objects lifecycle.
 *
 * @param <C> configuration type
 * @author Vyacheslav Rusakov
 * @since 23.10.2014
 */
public class TestCommand<C extends Configuration> extends EnvironmentCommand<C> {

    private final Class<C> configurationClass;
    private ContainerLifeCycle container;

    public TestCommand(final Application<C> application) {
        super(application, "guicey-test", "Specific command to run guice context without jetty server");
        cleanupAsynchronously();
        configurationClass = application.getConfigurationClass();
    }

    @Override
    protected void run(final Environment environment, final Namespace namespace,
                       final C configuration) throws Exception {
        // simulating managed objects lifecycle support
        container = new ContainerLifeCycle();
        environment.lifecycle().attach(container);
        container.start();
    }

    public void stop() {
        try {
            container.stop();
        } catch (Exception e) {
            throw new IllegalStateException("Failed to stop managed objects container", e);
        }
        container.destroy();
        cleanup();
    }

    @Override
    protected Class<C> getConfigurationClass() {
        return configurationClass;
    }
}


engine: Make test connectivity non transactional

No reason for this command to be transactional as it doesn't alter the
DB.

Change-Id: I7423f4089d937f3094bf6054818390c3f26b1d9a
Signed-off-by: Mike Kolesnik <c6947eedc1b0e500810c3b3db45e5f4633b0ea7d@redhat.com>

--- backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/TestProviderConnectivityCommand.java
+++ backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/TestProviderConnectivityCommand.java
@@ -4,6 +4,7 @@
 import java.util.List;

 import org.ovirt.engine.core.bll.CommandBase;
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.ProviderParameters;
@@ -17,6 +18,7 @@
  * @param <P>
  *            Parameter type.
  */
+@NonTransactiveCommandAttribute
 public class TestProviderConnectivityCommand<P extends ProviderParameters> extends CommandBase<P> {

     public TestProviderConnectivityCommand(Guid commandId) {

<|original_code|>
package org.ovirt.engine.core.bll.provider;

import java.util.Collections;
import java.util.List;

import org.ovirt.engine.core.bll.CommandBase;
import org.ovirt.engine.core.bll.utils.PermissionSubject;
import org.ovirt.engine.core.common.VdcObjectType;
import org.ovirt.engine.core.common.action.ProviderParameters;
import org.ovirt.engine.core.common.businessentities.ActionGroup;
import org.ovirt.engine.core.compat.Guid;

/**
 * Allows to test that the provider definition allows connecting to the provider and accessing it's API.

 * In case of connection failure, an exception will be thrown.
 *
 * @param

 *            Parameter type.
 */
public class TestProviderConnectivityCommand
 extends CommandBase
 {

    public TestProviderConnectivityCommand(Guid commandId) {
        super(commandId);
    }

    public TestProviderConnectivityCommand(P parameters) {
        super(parameters);
    }

    @Override
    protected void executeCommand() {
        ProviderProxy proxy = ProviderProxyFactory.getInstance().create(getParameters().getProvider());

        proxy.testConnection();
        setSucceeded(true);
    }

    @Override
    public List<PermissionSubject> getPermissionCheckSubjects() {
        return Collections.singletonList(new PermissionSubject(Guid.SYSTEM,
                VdcObjectType.System,
                ActionGroup.CREATE_STORAGE_POOL));
    }

}

<|edits_diff|>
--- backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/TestProviderConnectivityCommand.java
+++ backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/TestProviderConnectivityCommand.java
@@ -4,6 +4,7 @@
 import java.util.List;

 import org.ovirt.engine.core.bll.CommandBase;
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.ProviderParameters;
<|current_version|>
package org.ovirt.engine.core.bll.provider;

import java.util.Collections;
import java.util.List;

import org.ovirt.engine.core.bll.CommandBase;
import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
import org.ovirt.engine.core.bll.utils.PermissionSubject;
import org.ovirt.engine.core.common.VdcObjectType;
import org.ovirt.engine.core.common.action.ProviderParameters;
import org.ovirt.engine.core.common.businessentities.ActionGroup;
import org.ovirt.engine.core.compat.Guid;

/**
 * Allows to test that the provider definition allows connecting to the provider and accessing it's API.

 * In case of connection failure, an exception will be thrown.
 *
 * @param

 *            Parameter type.
 */
public class TestProviderConnectivityCommand
 extends CommandBase
 {

    public TestProviderConnectivityCommand(Guid commandId) {
        super(commandId);
    }

    public TestProviderConnectivityCommand(P parameters) {
        super(parameters);
    }

    @Override
    protected void executeCommand() {
        ProviderProxy proxy = ProviderProxyFactory.getInstance().create(getParameters().getProvider());

        proxy.testConnection();
        setSucceeded(true);
    }

    @Override
    public List<PermissionSubject> getPermissionCheckSubjects() {
        return Collections.singletonList(new PermissionSubject(Guid.SYSTEM,
                VdcObjectType.System,
                ActionGroup.CREATE_STORAGE_POOL));
    }

}

<|next_version|>
package org.ovirt.engine.core.bll.provider;

import java.util.Collections;
import java.util.List;

import org.ovirt.engine.core.bll.CommandBase;
import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
import org.ovirt.engine.core.bll.utils.PermissionSubject;
import org.ovirt.engine.core.common.VdcObjectType;
import org.ovirt.engine.core.common.action.ProviderParameters;
import org.ovirt.engine.core.common.businessentities.ActionGroup;
import org.ovirt.engine.core.compat.Guid;

/**
 * Allows to test that the provider definition allows connecting to the provider and accessing it's API.

 * In case of connection failure, an exception will be thrown.
 *
 * @param

 *            Parameter type.
 */
@NonTransactiveCommandAttribute
public class TestProviderConnectivityCommand
 extends CommandBase
 {

    public TestProviderConnectivityCommand(Guid commandId) {
        super(commandId);
    }

    public TestProviderConnectivityCommand(P parameters) {
        super(parameters);
    }

    @Override
    protected void executeCommand() {
        ProviderProxy proxy = ProviderProxyFactory.getInstance().create(getParameters().getProvider());

        proxy.testConnection();
        setSucceeded(true);
    }

    @Override
    public List<PermissionSubject> getPermissionCheckSubjects() {
        return Collections.singletonList(new PermissionSubject(Guid.SYSTEM,
                VdcObjectType.System,
                ActionGroup.CREATE_STORAGE_POOL));
    }

}


Set up the view to use the ImageView created in the getView

--- app/src/main/java/com/andela/webservice/FlowerAdapter.java
+++ app/src/main/java/com/andela/webservice/FlowerAdapter.java
@@ -6,6 +6,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
+import android.widget.ImageView;
 import android.widget.TextView;

 import com.andela.webservice.model.Flower;
@@ -37,6 +38,9 @@
         Flower flower = flowerList.get(position);
         TextView tv = (TextView) view.findViewById(R.id.textView1);
         tv.setText(flower.getName());
+
+        ImageView img = (ImageView) view.findViewById(R.id.imageView1);
+        img.setImageBitmap(flower.getBitmap());
         return view;
     }
 }

<|original_code|>
package com.andela.webservice;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.andela.webservice.model.Flower;

import java.util.List;

/**
 * Created by Spykins on 11/06/16.
 */
public class FlowerAdapter extends ArrayAdapter<Flower> {
    private Context context;
    @SuppressWarnings("unused")
    private List<Flower> flowerList;

    public FlowerAdapter(Context context, int resource, List<Flower> objects) {
        super(context, resource, objects);
        this.context = context;
        this.flowerList = objects;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        LayoutInflater inflater =
                (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
        View view = inflater.inflate(R.layout.item_flower, parent, false);

        //Display flower name in the TextView widget
        Flower flower = flowerList.get(position);
        TextView tv = (TextView) view.findViewById(R.id.textView1);
        tv.setText(flower.getName());
        return view;
    }
}

<|edits_diff|>
--- app/src/main/java/com/andela/webservice/FlowerAdapter.java
+++ app/src/main/java/com/andela/webservice/FlowerAdapter.java
@@ -6,6 +6,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
+import android.widget.ImageView;
 import android.widget.TextView;

 import com.andela.webservice.model.Flower;
<|current_version|>
package com.andela.webservice;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.andela.webservice.model.Flower;

import java.util.List;

/**
 * Created by Spykins on 11/06/16.
 */
public class FlowerAdapter extends ArrayAdapter<Flower> {
    private Context context;
    @SuppressWarnings("unused")
    private List<Flower> flowerList;

    public FlowerAdapter(Context context, int resource, List<Flower> objects) {
        super(context, resource, objects);
        this.context = context;
        this.flowerList = objects;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        LayoutInflater inflater =
                (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
        View view = inflater.inflate(R.layout.item_flower, parent, false);

        //Display flower name in the TextView widget
        Flower flower = flowerList.get(position);
        TextView tv = (TextView) view.findViewById(R.id.textView1);
        tv.setText(flower.getName());
        return view;
    }
}

<|next_version|>
package com.andela.webservice;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.andela.webservice.model.Flower;

import java.util.List;

/**
 * Created by Spykins on 11/06/16.
 */
public class FlowerAdapter extends ArrayAdapter<Flower> {
    private Context context;
    @SuppressWarnings("unused")
    private List<Flower> flowerList;

    public FlowerAdapter(Context context, int resource, List<Flower> objects) {
        super(context, resource, objects);
        this.context = context;
        this.flowerList = objects;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        LayoutInflater inflater =
                (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
        View view = inflater.inflate(R.layout.item_flower, parent, false);

        //Display flower name in the TextView widget
        Flower flower = flowerList.get(position);
        TextView tv = (TextView) view.findViewById(R.id.textView1);
        tv.setText(flower.getName());

        ImageView img = (ImageView) view.findViewById(R.id.imageView1);
        img.setImageBitmap(flower.getBitmap());
        return view;
    }
}


Add test annotation again, ignore overrides this.

--- src/test/java/com/crawljax/util/PrettyHTMLTest.java
+++ src/test/java/com/crawljax/util/PrettyHTMLTest.java
@@ -6,6 +6,7 @@
 import java.io.File;

 import org.junit.Ignore;
+import org.junit.Test;

 public class PrettyHTMLTest {

@@ -14,6 +15,7 @@
 	        "src/test/java/com/crawljax/util/tuduDombefore.html.tidy";

 	@Ignore
+	@Test
 	public void prettifyHTML() {
 		String testdom = Helper.getContent(new File(TESTFILE));
 		String controldom = Helper.getContent(new File(CONTROLFILE));

<|original_code|>
package com.crawljax.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.io.File;

import org.junit.Ignore;

public class PrettyHTMLTest {

	private static final String TESTFILE = "src/test/java/com/crawljax/util/tuduDombefore.html";
	private static final String CONTROLFILE =
	        "src/test/java/com/crawljax/util/tuduDombefore.html.tidy";

	@Ignore
	public void prettifyHTML() {
		String testdom = Helper.getContent(new File(TESTFILE));
		String controldom = Helper.getContent(new File(CONTROLFILE));

		assertNotNull("File should be read", testdom);
		assertNotNull("File should be read", controldom);

		testdom = PrettyHTML.prettyHTML(testdom);

		assertEquals(controldom, testdom);
	}
}

<|edits_diff|>
--- src/test/java/com/crawljax/util/PrettyHTMLTest.java
+++ src/test/java/com/crawljax/util/PrettyHTMLTest.java
@@ -6,6 +6,7 @@
 import java.io.File;

 import org.junit.Ignore;
+import org.junit.Test;

 public class PrettyHTMLTest {

<|current_version|>
package com.crawljax.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.io.File;

import org.junit.Ignore;
import org.junit.Test;

public class PrettyHTMLTest {

	private static final String TESTFILE = "src/test/java/com/crawljax/util/tuduDombefore.html";
	private static final String CONTROLFILE =
	        "src/test/java/com/crawljax/util/tuduDombefore.html.tidy";

	@Ignore
	public void prettifyHTML() {
		String testdom = Helper.getContent(new File(TESTFILE));
		String controldom = Helper.getContent(new File(CONTROLFILE));

		assertNotNull("File should be read", testdom);
		assertNotNull("File should be read", controldom);

		testdom = PrettyHTML.prettyHTML(testdom);

		assertEquals(controldom, testdom);
	}
}

<|next_version|>
package com.crawljax.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.io.File;

import org.junit.Ignore;
import org.junit.Test;

public class PrettyHTMLTest {

	private static final String TESTFILE = "src/test/java/com/crawljax/util/tuduDombefore.html";
	private static final String CONTROLFILE =
	        "src/test/java/com/crawljax/util/tuduDombefore.html.tidy";

	@Ignore
	@Test
	public void prettifyHTML() {
		String testdom = Helper.getContent(new File(TESTFILE));
		String controldom = Helper.getContent(new File(CONTROLFILE));

		assertNotNull("File should be read", testdom);
		assertNotNull("File should be read", controldom);

		testdom = PrettyHTML.prettyHTML(testdom);

		assertEquals(controldom, testdom);
	}
}


Fix java client to accept new parameters

--- clients/java/src/main/java/io/aigar/game/models/GameState.java
+++ clients/java/src/main/java/io/aigar/game/models/GameState.java
@@ -8,6 +8,7 @@
     private int id;
     private int tick;
     private boolean paused;
+    private boolean disabledLeaderboard;
     private int multiplier;
     private float timeLeft;
     private List<Player> players;
@@ -30,6 +31,8 @@
     public boolean isPaused() {
         return paused;
     }
+
+    public boolean isDisabledLeaderboard() { return disabledLeaderboard; }

     public int getMultiplier() {
         return multiplier;

<|original_code|>
package io.aigar.game.models;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;

public class GameState {
    private int id;
    private int tick;
    private boolean paused;
    private int multiplier;
    private float timeLeft;
    private List<Player> players;
    private Resources resources;
    private Size map;
    private List<Virus> viruses;
    @JsonIgnore
    private Player me;
    @JsonIgnore
    private List<Player> enemies;

    public int getId() {
        return id;
    }

    public int getTick() {
        return tick;
    }

    public boolean isPaused() {
        return paused;
    }

    public int getMultiplier() {
        return multiplier;
    }

    public float getTimeLeft() {
        return timeLeft;
    }

    public List<Player> getPlayers() {
        return players;
    }

    public Resources getResources() {
        return resources;
    }

    public Size getMap() {
        return map;
    }

    public List<Virus> getViruses() {
        return viruses;
    }

    public Player getMe() {
        return me;
    }

    public void setMe(Player me) {
        this.me = me;
    }

    public List<Player> getEnemies() {
        return enemies;
    }

    public void setEnemies(List<Player> enemies) {
        this.enemies = enemies;
    }
}

<|edits_diff|>
--- clients/java/src/main/java/io/aigar/game/models/GameState.java
+++ clients/java/src/main/java/io/aigar/game/models/GameState.java
@@ -8,6 +8,7 @@
     private int id;
     private int tick;
     private boolean paused;
+    private boolean disabledLeaderboard;
     private int multiplier;
     private float timeLeft;
     private List<Player> players;
<|current_version|>
package io.aigar.game.models;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;

public class GameState {
    private int id;
    private int tick;
    private boolean paused;
    private boolean disabledLeaderboard;
    private int multiplier;
    private float timeLeft;
    private List<Player> players;
    private Resources resources;
    private Size map;
    private List<Virus> viruses;
    @JsonIgnore
    private Player me;
    @JsonIgnore
    private List<Player> enemies;

    public int getId() {
        return id;
    }

    public int getTick() {
        return tick;
    }

    public boolean isPaused() {
        return paused;
    }

    public int getMultiplier() {
        return multiplier;
    }

    public float getTimeLeft() {
        return timeLeft;
    }

    public List<Player> getPlayers() {
        return players;
    }

    public Resources getResources() {
        return resources;
    }

    public Size getMap() {
        return map;
    }

    public List<Virus> getViruses() {
        return viruses;
    }

    public Player getMe() {
        return me;
    }

    public void setMe(Player me) {
        this.me = me;
    }

    public List<Player> getEnemies() {
        return enemies;
    }

    public void setEnemies(List<Player> enemies) {
        this.enemies = enemies;
    }
}

<|next_version|>
package io.aigar.game.models;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;

public class GameState {
    private int id;
    private int tick;
    private boolean paused;
    private boolean disabledLeaderboard;
    private int multiplier;
    private float timeLeft;
    private List<Player> players;
    private Resources resources;
    private Size map;
    private List<Virus> viruses;
    @JsonIgnore
    private Player me;
    @JsonIgnore
    private List<Player> enemies;

    public int getId() {
        return id;
    }

    public int getTick() {
        return tick;
    }

    public boolean isPaused() {
        return paused;
    }

    public boolean isDisabledLeaderboard() { return disabledLeaderboard; }

    public int getMultiplier() {
        return multiplier;
    }

    public float getTimeLeft() {
        return timeLeft;
    }

    public List<Player> getPlayers() {
        return players;
    }

    public Resources getResources() {
        return resources;
    }

    public Size getMap() {
        return map;
    }

    public List<Virus> getViruses() {
        return viruses;
    }

    public Player getMe() {
        return me;
    }

    public void setMe(Player me) {
        this.me = me;
    }

    public List<Player> getEnemies() {
        return enemies;
    }

    public void setEnemies(List<Player> enemies) {
        this.enemies = enemies;
    }
}


Add method with ConnectionFactory as an argument

--- falchion-jetty9-connector/src/main/java/net/unit8/falchion/jetty9/ReusePortConnector.java
+++ falchion-jetty9-connector/src/main/java/net/unit8/falchion/jetty9/ReusePortConnector.java
@@ -1,5 +1,6 @@
 package net.unit8.falchion.jetty9;

+import org.eclipse.jetty.server.ConnectionFactory;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.util.annotation.Name;
@@ -16,6 +17,10 @@
 public class ReusePortConnector extends ServerConnector {
     public ReusePortConnector(@Name("server") Server server) {
         super(server);
+    }
+
+    public ReusePortConnector(@Name("server") Server server, @Name("factories") ConnectionFactory... factories) {
+        super(server, factories);
     }

     @Override

<|original_code|>
package net.unit8.falchion.jetty9;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.util.annotation.Name;

import java.io.IOException;
import java.lang.reflect.Field;
import java.net.InetSocketAddress;
import java.net.StandardSocketOptions;
import java.nio.channels.ServerSocketChannel;

/**
 * @author kawasima
 */
public class ReusePortConnector extends ServerConnector {
    public ReusePortConnector(@Name("server") Server server) {
        super(server);
    }

    @Override
    public void open() throws IOException {
        ServerSocketChannel serverChannel = ServerSocketChannel.open();
        serverChannel.setOption(StandardSocketOptions.SO_REUSEPORT, true);

        InetSocketAddress bindAddress = getHost() == null ? new InetSocketAddress(getPort()) : new InetSocketAddress(getHost(), getPort());
        serverChannel.socket().setReuseAddress(getReuseAddress());
        serverChannel.socket().bind(bindAddress, getAcceptQueueSize());
        serverChannel.configureBlocking(true);
        addBean(serverChannel);
        try {
            Field acceptChannel = ServerConnector.class.getDeclaredField("_acceptChannel");
            acceptChannel.setAccessible(true);
            acceptChannel.set(this, serverChannel);
        } catch (Exception ex) {
            throw new IOException(ex);
        }
    }
}

<|edits_diff|>
--- falchion-jetty9-connector/src/main/java/net/unit8/falchion/jetty9/ReusePortConnector.java
+++ falchion-jetty9-connector/src/main/java/net/unit8/falchion/jetty9/ReusePortConnector.java
@@ -1,5 +1,6 @@
 package net.unit8.falchion.jetty9;

+import org.eclipse.jetty.server.ConnectionFactory;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.util.annotation.Name;
<|current_version|>
package net.unit8.falchion.jetty9;

import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.util.annotation.Name;

import java.io.IOException;
import java.lang.reflect.Field;
import java.net.InetSocketAddress;
import java.net.StandardSocketOptions;
import java.nio.channels.ServerSocketChannel;

/**
 * @author kawasima
 */
public class ReusePortConnector extends ServerConnector {
    public ReusePortConnector(@Name("server") Server server) {
        super(server);
    }

    @Override
    public void open() throws IOException {
        ServerSocketChannel serverChannel = ServerSocketChannel.open();
        serverChannel.setOption(StandardSocketOptions.SO_REUSEPORT, true);

        InetSocketAddress bindAddress = getHost() == null ? new InetSocketAddress(getPort()) : new InetSocketAddress(getHost(), getPort());
        serverChannel.socket().setReuseAddress(getReuseAddress());
        serverChannel.socket().bind(bindAddress, getAcceptQueueSize());
        serverChannel.configureBlocking(true);
        addBean(serverChannel);
        try {
            Field acceptChannel = ServerConnector.class.getDeclaredField("_acceptChannel");
            acceptChannel.setAccessible(true);
            acceptChannel.set(this, serverChannel);
        } catch (Exception ex) {
            throw new IOException(ex);
        }
    }
}

<|next_version|>
package net.unit8.falchion.jetty9;

import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.util.annotation.Name;

import java.io.IOException;
import java.lang.reflect.Field;
import java.net.InetSocketAddress;
import java.net.StandardSocketOptions;
import java.nio.channels.ServerSocketChannel;

/**
 * @author kawasima
 */
public class ReusePortConnector extends ServerConnector {
    public ReusePortConnector(@Name("server") Server server) {
        super(server);
    }

    public ReusePortConnector(@Name("server") Server server, @Name("factories") ConnectionFactory... factories) {
        super(server, factories);
    }

    @Override
    public void open() throws IOException {
        ServerSocketChannel serverChannel = ServerSocketChannel.open();
        serverChannel.setOption(StandardSocketOptions.SO_REUSEPORT, true);

        InetSocketAddress bindAddress = getHost() == null ? new InetSocketAddress(getPort()) : new InetSocketAddress(getHost(), getPort());
        serverChannel.socket().setReuseAddress(getReuseAddress());
        serverChannel.socket().bind(bindAddress, getAcceptQueueSize());
        serverChannel.configureBlocking(true);
        addBean(serverChannel);
        try {
            Field acceptChannel = ServerConnector.class.getDeclaredField("_acceptChannel");
            acceptChannel.setAccessible(true);
            acceptChannel.set(this, serverChannel);
        } catch (Exception ex) {
            throw new IOException(ex);
        }
    }
}


Fix adaptation service Bean issue

Fix adaptation service Bean issue

--- src/main/java/jp/ac/nii/prl/mape/plan/service/AdaptationServiceImpl.java
+++ src/main/java/jp/ac/nii/prl/mape/plan/service/AdaptationServiceImpl.java
@@ -3,10 +3,12 @@
 import java.util.Optional;

 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;

 import jp.ac.nii.prl.mape.plan.model.Adaptation;
 import jp.ac.nii.prl.mape.plan.repository.AdaptationRepository;

+@Service("adaptationService")
 public class AdaptationServiceImpl implements AdaptationService {

 	@Autowired

<|original_code|>
package jp.ac.nii.prl.mape.plan.service;

import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;

import jp.ac.nii.prl.mape.plan.model.Adaptation;
import jp.ac.nii.prl.mape.plan.repository.AdaptationRepository;

public class AdaptationServiceImpl implements AdaptationService {

	@Autowired
	private AdaptationRepository adaptationRepository;

	@Override
	public Adaptation save(Adaptation adaptation) {
		return adaptationRepository.save(adaptation);
	}

	@Override
	public Optional<Adaptation> findByDeploymentId(Integer deploymentId) {
		return adaptationRepository.findByDeploymentId(deploymentId);
	}

}

<|edits_diff|>
--- src/main/java/jp/ac/nii/prl/mape/plan/service/AdaptationServiceImpl.java
+++ src/main/java/jp/ac/nii/prl/mape/plan/service/AdaptationServiceImpl.java
@@ -3,6 +3,7 @@
 import java.util.Optional;

 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;

 import jp.ac.nii.prl.mape.plan.model.Adaptation;
 import jp.ac.nii.prl.mape.plan.repository.AdaptationRepository;
<|current_version|>
package jp.ac.nii.prl.mape.plan.service;

import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import jp.ac.nii.prl.mape.plan.model.Adaptation;
import jp.ac.nii.prl.mape.plan.repository.AdaptationRepository;

public class AdaptationServiceImpl implements AdaptationService {

	@Autowired
	private AdaptationRepository adaptationRepository;

	@Override
	public Adaptation save(Adaptation adaptation) {
		return adaptationRepository.save(adaptation);
	}

	@Override
	public Optional<Adaptation> findByDeploymentId(Integer deploymentId) {
		return adaptationRepository.findByDeploymentId(deploymentId);
	}

}

<|next_version|>
package jp.ac.nii.prl.mape.plan.service;

import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import jp.ac.nii.prl.mape.plan.model.Adaptation;
import jp.ac.nii.prl.mape.plan.repository.AdaptationRepository;

@Service("adaptationService")
public class AdaptationServiceImpl implements AdaptationService {

	@Autowired
	private AdaptationRepository adaptationRepository;

	@Override
	public Adaptation save(Adaptation adaptation) {
		return adaptationRepository.save(adaptation);
	}

	@Override
	public Optional<Adaptation> findByDeploymentId(Integer deploymentId) {
		return adaptationRepository.findByDeploymentId(deploymentId);
	}

}


Define __DEV__ for frontend tests

Define __DEV__ for frontend tests

--- frontend/webpack.config-test.babel.js
+++ frontend/webpack.config-test.babel.js
@@ -1,3 +1,4 @@
+import webpack from 'webpack'
 import nodeExternals from 'webpack-node-externals';
 var path = require('path')

@@ -59,4 +60,9 @@
       lang : path.resolve("./lang")
     }
   },
+  plugins: [
+    new webpack.DefinePlugin({
+      __DEV__: JSON.stringify(false),
+    })
+  ]
 };

<|original_code|>
import nodeExternals from 'webpack-node-externals';
var path = require('path')

export default {
  target: 'node',
  externals: [nodeExternals()],
  module: {
      rules: [
          //{ test: /\.jsx$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/ },
          {
            test: /\.js$/,
            exclude: /node_modules/,
            use: ["react-hot-loader", "babel-loader"]
          },
          { test: /\.css$/, use: ["style-loader","css"] },
          {
            test: /\.sass$/,
            use: [{
              loader: "style-loader"
            }, {
              loader: "css-loader"
            }, {
              loader: "sass-loader",
              options : {
                includePaths: ["./"]
              }
            }]
          },
          { test: /\.(jpe?g|png|gif|svg)$/i,
            loaders: [
              'file-loader',
              {
                loader: 'image-webpack-loader',
                query: {
                  mozjpeg: {
                    progressive: true,
                  },
                  gifslice: {
                    interlaced: false,
                  },
                  optipng: {
                    optimizationLevel: 7,
                  },
                  pngquant: {
                    quality: '65-90',
                    speed: 4
                  }
                }
              }
            ]
          }
      ]
  },
  devtool: "cheap-module-source-map",
  resolve: {
    alias:{
      app : path.resolve("./app/js"),
      sass : path.resolve("./app/sass"),
      lang : path.resolve("./lang")
    }
  },
};

<|edits_diff|>
--- frontend/webpack.config-test.babel.js
+++ frontend/webpack.config-test.babel.js
@@ -1,3 +1,4 @@
+import webpack from 'webpack'
 import nodeExternals from 'webpack-node-externals';
 var path = require('path')

<|current_version|>
import webpack from 'webpack'
import nodeExternals from 'webpack-node-externals';
var path = require('path')

export default {
  target: 'node',
  externals: [nodeExternals()],
  module: {
      rules: [
          //{ test: /\.jsx$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/ },
          {
            test: /\.js$/,
            exclude: /node_modules/,
            use: ["react-hot-loader", "babel-loader"]
          },
          { test: /\.css$/, use: ["style-loader","css"] },
          {
            test: /\.sass$/,
            use: [{
              loader: "style-loader"
            }, {
              loader: "css-loader"
            }, {
              loader: "sass-loader",
              options : {
                includePaths: ["./"]
              }
            }]
          },
          { test: /\.(jpe?g|png|gif|svg)$/i,
            loaders: [
              'file-loader',
              {
                loader: 'image-webpack-loader',
                query: {
                  mozjpeg: {
                    progressive: true,
                  },
                  gifslice: {
                    interlaced: false,
                  },
                  optipng: {
                    optimizationLevel: 7,
                  },
                  pngquant: {
                    quality: '65-90',
                    speed: 4
                  }
                }
              }
            ]
          }
      ]
  },
  devtool: "cheap-module-source-map",
  resolve: {
    alias:{
      app : path.resolve("./app/js"),
      sass : path.resolve("./app/sass"),
      lang : path.resolve("./lang")
    }
  },
};

<|next_version|>
import webpack from 'webpack'
import nodeExternals from 'webpack-node-externals';
var path = require('path')

export default {
  target: 'node',
  externals: [nodeExternals()],
  module: {
      rules: [
          //{ test: /\.jsx$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/ },
          {
            test: /\.js$/,
            exclude: /node_modules/,
            use: ["react-hot-loader", "babel-loader"]
          },
          { test: /\.css$/, use: ["style-loader","css"] },
          {
            test: /\.sass$/,
            use: [{
              loader: "style-loader"
            }, {
              loader: "css-loader"
            }, {
              loader: "sass-loader",
              options : {
                includePaths: ["./"]
              }
            }]
          },
          { test: /\.(jpe?g|png|gif|svg)$/i,
            loaders: [
              'file-loader',
              {
                loader: 'image-webpack-loader',
                query: {
                  mozjpeg: {
                    progressive: true,
                  },
                  gifslice: {
                    interlaced: false,
                  },
                  optipng: {
                    optimizationLevel: 7,
                  },
                  pngquant: {
                    quality: '65-90',
                    speed: 4
                  }
                }
              }
            ]
          }
      ]
  },
  devtool: "cheap-module-source-map",
  resolve: {
    alias:{
      app : path.resolve("./app/js"),
      sass : path.resolve("./app/sass"),
      lang : path.resolve("./lang")
    }
  },
  plugins: [
    new webpack.DefinePlugin({
      __DEV__: JSON.stringify(false),
    })
  ]
};


Add recipient param to ls and agent to scope

--- app/scripts/controllers/account.js
+++ app/scripts/controllers/account.js
@@ -5,13 +5,17 @@

     $scope.friends = [];

+    $scope.agent = Token.data();
+
     /**
      * init
      */
     $scope.init = function() {
+        console.log('AccountCtrl init');
         Token.request({
                 action: 'ls',
                 resource: 'friends',
+                recipient: $scope.agent.email,
                 fields: ['name', '_id', 'email'],
           }).
         then(function(friends) {

<|original_code|>
'use strict';

angular.module('geboRegistrantHaiApp')
  .controller('AccountCtrl', function ($scope, Token) {

    $scope.friends = [];

    /**
     * init
     */
    $scope.init = function() {
        Token.request({
                action: 'ls',
                resource: 'friends',
                fields: ['name', '_id', 'email'],
          }).
        then(function(friends) {
            $scope.friends = friends;
          }).
        catch(function(err) {
          });
      };
  });

<|edits_diff|>
--- app/scripts/controllers/account.js
+++ app/scripts/controllers/account.js
@@ -5,10 +5,13 @@

     $scope.friends = [];

+    $scope.agent = Token.data();
+
     /**
      * init
      */
     $scope.init = function() {
+        console.log('AccountCtrl init');
         Token.request({
                 action: 'ls',
                 resource: 'friends',
<|current_version|>
'use strict';

angular.module('geboRegistrantHaiApp')
  .controller('AccountCtrl', function ($scope, Token) {

    $scope.friends = [];

    $scope.agent = Token.data();

    /**
     * init
     */
    $scope.init = function() {
        console.log('AccountCtrl init');
        Token.request({
                action: 'ls',
                resource: 'friends',
                fields: ['name', '_id', 'email'],
          }).
        then(function(friends) {
            $scope.friends = friends;
          }).
        catch(function(err) {
          });
      };
  });

<|next_version|>
'use strict';

angular.module('geboRegistrantHaiApp')
  .controller('AccountCtrl', function ($scope, Token) {

    $scope.friends = [];

    $scope.agent = Token.data();

    /**
     * init
     */
    $scope.init = function() {
        console.log('AccountCtrl init');
        Token.request({
                action: 'ls',
                resource: 'friends',
                recipient: $scope.agent.email,
                fields: ['name', '_id', 'email'],
          }).
        then(function(friends) {
            $scope.friends = friends;
          }).
        catch(function(err) {
          });
      };
  });


Create containers to hold music data

Create containers to hold music data

I.e. empty arrays for songs, artists, albums, and favorites

--- app/js/controllers.js
+++ app/js/controllers.js
@@ -6,10 +6,14 @@
   .controller('HomeController', ['$scope', function($scope) {
   }])
   .controller('AlbumsController', ['$scope', function($scope) {
+    $scope.albums = [];
   }])
   .controller('ArtistsController', ['$scope', function($scope) {
+    $scope.artists = [];
   }])
   .controller('SongsController', ['$scope', function($scope) {
+    $scope.songs = [];
   }])
   .controller('FavoritesController', ['$scope', function($scope) {
+    $scope.favorites = [];
   }]);

<|original_code|>
'use strict';

/* Controllers */

angular.module('myApp.controllers', [])
  .controller('HomeController', ['$scope', function($scope) {
  }])
  .controller('AlbumsController', ['$scope', function($scope) {
  }])
  .controller('ArtistsController', ['$scope', function($scope) {
  }])
  .controller('SongsController', ['$scope', function($scope) {
  }])
  .controller('FavoritesController', ['$scope', function($scope) {
  }]);

<|edits_diff|>
--- app/js/controllers.js
+++ app/js/controllers.js
@@ -6,10 +6,13 @@
   .controller('HomeController', ['$scope', function($scope) {
   }])
   .controller('AlbumsController', ['$scope', function($scope) {
+    $scope.albums = [];
   }])
   .controller('ArtistsController', ['$scope', function($scope) {
+    $scope.artists = [];
   }])
   .controller('SongsController', ['$scope', function($scope) {
+    $scope.songs = [];
   }])
   .controller('FavoritesController', ['$scope', function($scope) {
   }]);
<|current_version|>
'use strict';

/* Controllers */

angular.module('myApp.controllers', [])
  .controller('HomeController', ['$scope', function($scope) {
  }])
  .controller('AlbumsController', ['$scope', function($scope) {
    $scope.albums = [];
  }])
  .controller('ArtistsController', ['$scope', function($scope) {
    $scope.artists = [];
  }])
  .controller('SongsController', ['$scope', function($scope) {
    $scope.songs = [];
  }])
  .controller('FavoritesController', ['$scope', function($scope) {
  }]);

<|next_version|>
'use strict';

/* Controllers */

angular.module('myApp.controllers', [])
  .controller('HomeController', ['$scope', function($scope) {
  }])
  .controller('AlbumsController', ['$scope', function($scope) {
    $scope.albums = [];
  }])
  .controller('ArtistsController', ['$scope', function($scope) {
    $scope.artists = [];
  }])
  .controller('SongsController', ['$scope', function($scope) {
    $scope.songs = [];
  }])
  .controller('FavoritesController', ['$scope', function($scope) {
    $scope.favorites = [];
  }]);


Disable keyboard shortcut if target element is an input element.

--- source/javascript/keyboardShortcuts.js
+++ source/javascript/keyboardShortcuts.js
@@ -1,4 +1,5 @@
 define(function (require) {
+	var $ = require("jquery");
 	var documentKeyboardHandler = require("utilities/documentKeyboardHandler");

 	var keyboardShortcuts = function (eventBus) {
@@ -24,6 +25,9 @@

 			// number keys 1 to 9
 			if (isDown && event.which >= 49 && event.which <= 57) {
+				if ($(event.target).is("input"))
+					return;
+
 				if (!isRepeated)
 					eventBus.trigger("selectTrack", {
 						trackIndex: event.which - 49

<|original_code|>
define(function (require) {
	var documentKeyboardHandler = require("utilities/documentKeyboardHandler");

	var keyboardShortcuts = function (eventBus) {
		documentKeyboardHandler(function (event, isDown, isRepeated) {
			// spacebar
			if (isDown && event.which === 32) {
				if (!isRepeated)
					eventBus.trigger("togglePlayback");

				return false;
			}

			// shift
			if (event.which === 16) {
				if (!isRepeated) {
					eventBus.trigger("setGridViewState", {
						state: isDown ? "play" : "addOrRemove"
					});
				}

				return false;
			}

			// number keys 1 to 9
			if (isDown && event.which >= 49 && event.which <= 57) {
				if (!isRepeated)
					eventBus.trigger("selectTrack", {
						trackIndex: event.which - 49
					});

				return false;
			}
		});
	};

	return keyboardShortcuts;
});

<|edits_diff|>
--- source/javascript/keyboardShortcuts.js
+++ source/javascript/keyboardShortcuts.js
@@ -1,4 +1,5 @@
 define(function (require) {
+	var $ = require("jquery");
 	var documentKeyboardHandler = require("utilities/documentKeyboardHandler");

 	var keyboardShortcuts = function (eventBus) {
<|current_version|>
define(function (require) {
	var $ = require("jquery");
	var documentKeyboardHandler = require("utilities/documentKeyboardHandler");

	var keyboardShortcuts = function (eventBus) {
		documentKeyboardHandler(function (event, isDown, isRepeated) {
			// spacebar
			if (isDown && event.which === 32) {
				if (!isRepeated)
					eventBus.trigger("togglePlayback");

				return false;
			}

			// shift
			if (event.which === 16) {
				if (!isRepeated) {
					eventBus.trigger("setGridViewState", {
						state: isDown ? "play" : "addOrRemove"
					});
				}

				return false;
			}

			// number keys 1 to 9
			if (isDown && event.which >= 49 && event.which <= 57) {
				if (!isRepeated)
					eventBus.trigger("selectTrack", {
						trackIndex: event.which - 49
					});

				return false;
			}
		});
	};

	return keyboardShortcuts;
});

<|next_version|>
define(function (require) {
	var $ = require("jquery");
	var documentKeyboardHandler = require("utilities/documentKeyboardHandler");

	var keyboardShortcuts = function (eventBus) {
		documentKeyboardHandler(function (event, isDown, isRepeated) {
			// spacebar
			if (isDown && event.which === 32) {
				if (!isRepeated)
					eventBus.trigger("togglePlayback");

				return false;
			}

			// shift
			if (event.which === 16) {
				if (!isRepeated) {
					eventBus.trigger("setGridViewState", {
						state: isDown ? "play" : "addOrRemove"
					});
				}

				return false;
			}

			// number keys 1 to 9
			if (isDown && event.which >= 49 && event.which <= 57) {
				if ($(event.target).is("input"))
					return;

				if (!isRepeated)
					eventBus.trigger("selectTrack", {
						trackIndex: event.which - 49
					});

				return false;
			}
		});
	};

	return keyboardShortcuts;
});


Add wait cursor when loading folder create menu

--- webapp/scripts/folder-create-menu.js
+++ webapp/scripts/folder-create-menu.js
@@ -2,6 +2,7 @@

 jQuery(function($) {
     $('#create-menu').one('click', function() {
+        var wait = calli.wait();
         $.ajax({
             type: 'GET',
             url: $('#create-menu-json')[0].href + encodeURIComponent(calli.getUserIri()),
@@ -36,6 +37,7 @@
                     li.append(a);
                     ul.append(li);
                 });
+                wait.over();
             }
         });
         return true;

<|original_code|>
// folder-create-menu.js

jQuery(function($) {
    $('#create-menu').one('click', function() {
        $.ajax({
            type: 'GET',
            url: $('#create-menu-json')[0].href + encodeURIComponent(calli.getUserIri()),
            xhrFields: calli.withCredentials,
            dataType: 'json',
            success: function(data) {
                var ul = $('#create-menu-more');
                var section;
                $(data.rows).each(function(){
                    if (section != this[4]) {
                        if (section) {
                            ul.append('

');
                        }
                        section = this[4];
                        var header = $('

');
                        header.text(section);
                        ul.append(header);
                    }
                    var li = $('

');
                    var a = $('');
                    a.attr('href', this[0]);
                    a.text(this[1]);
                    if (this[2]) {
                        a.attr('title', this[2]);
                    }
                    if (this[3]) {
                        var img = $('');
                        img.attr('src', this[3]);
                        a.prepend(' ');
                        a.prepend(img);
                    }
                    li.append(a);
                    ul.append(li);
                });
            }
        });
        return true;
    });
});

<|edits_diff|>
--- webapp/scripts/folder-create-menu.js
+++ webapp/scripts/folder-create-menu.js
@@ -2,6 +2,7 @@

 jQuery(function($) {
     $('#create-menu').one('click', function() {
+        var wait = calli.wait();
         $.ajax({
             type: 'GET',
             url: $('#create-menu-json')[0].href + encodeURIComponent(calli.getUserIri()),
<|current_version|>
// folder-create-menu.js

jQuery(function($) {
    $('#create-menu').one('click', function() {
        var wait = calli.wait();
        $.ajax({
            type: 'GET',
            url: $('#create-menu-json')[0].href + encodeURIComponent(calli.getUserIri()),
            xhrFields: calli.withCredentials,
            dataType: 'json',
            success: function(data) {
                var ul = $('#create-menu-more');
                var section;
                $(data.rows).each(function(){
                    if (section != this[4]) {
                        if (section) {
                            ul.append('

');
                        }
                        section = this[4];
                        var header = $('

');
                        header.text(section);
                        ul.append(header);
                    }
                    var li = $('

');
                    var a = $('');
                    a.attr('href', this[0]);
                    a.text(this[1]);
                    if (this[2]) {
                        a.attr('title', this[2]);
                    }
                    if (this[3]) {
                        var img = $('');
                        img.attr('src', this[3]);
                        a.prepend(' ');
                        a.prepend(img);
                    }
                    li.append(a);
                    ul.append(li);
                });
            }
        });
        return true;
    });
});

<|next_version|>
// folder-create-menu.js

jQuery(function($) {
    $('#create-menu').one('click', function() {
        var wait = calli.wait();
        $.ajax({
            type: 'GET',
            url: $('#create-menu-json')[0].href + encodeURIComponent(calli.getUserIri()),
            xhrFields: calli.withCredentials,
            dataType: 'json',
            success: function(data) {
                var ul = $('#create-menu-more');
                var section;
                $(data.rows).each(function(){
                    if (section != this[4]) {
                        if (section) {
                            ul.append('

');
                        }
                        section = this[4];
                        var header = $('

');
                        header.text(section);
                        ul.append(header);
                    }
                    var li = $('

');
                    var a = $('');
                    a.attr('href', this[0]);
                    a.text(this[1]);
                    if (this[2]) {
                        a.attr('title', this[2]);
                    }
                    if (this[3]) {
                        var img = $('');
                        img.attr('src', this[3]);
                        a.prepend(' ');
                        a.prepend(img);
                    }
                    li.append(a);
                    ul.append(li);
                });
                wait.over();
            }
        });
        return true;
    });
});


Destroy language registry and workspace on package deactivation

--- lib/main.js
+++ lib/main.js
@@ -1,7 +1,9 @@
 'use babel';

+import languageRegistry from './language-registry';
 import levelsConfig     from './levels-config';
 import levelsServices   from './levels-services';
+import workspace        from './workspace';
 import workspaceManager from './workspace-manager';

 export default {
@@ -15,6 +17,8 @@
     workspaceManager.cleanUpWorkspace();
     workspaceManager.deactivateEventHandlers();
     workspaceManager.deactivateCommandHandlers();
+    workspace.destroy();
+    languageRegistry.destroy();
   },

   config: levelsConfig,

<|original_code|>
'use babel';

import levelsConfig     from './levels-config';
import levelsServices   from './levels-services';
import workspaceManager from './workspace-manager';

export default {
  activate() {
    workspaceManager.setUpWorkspace();
    workspaceManager.activateEventHandlers();
    workspaceManager.activateCommandHandlers();
  },

  deactivate() {
    workspaceManager.cleanUpWorkspace();
    workspaceManager.deactivateEventHandlers();
    workspaceManager.deactivateCommandHandlers();
  },

  config: levelsConfig,

  provideLevels() {
    return levelsServices;
  },

  consumeStatusBar(statusBar) {
    workspaceManager.consumeStatusBar(statusBar);
  }
};
<|edits_diff|>
--- lib/main.js
+++ lib/main.js
@@ -1,7 +1,9 @@
 'use babel';

+import languageRegistry from './language-registry';
 import levelsConfig     from './levels-config';
 import levelsServices   from './levels-services';
+import workspace        from './workspace';
 import workspaceManager from './workspace-manager';

 export default {
<|current_version|>
'use babel';

import languageRegistry from './language-registry';
import levelsConfig     from './levels-config';
import levelsServices   from './levels-services';
import workspace        from './workspace';
import workspaceManager from './workspace-manager';

export default {
  activate() {
    workspaceManager.setUpWorkspace();
    workspaceManager.activateEventHandlers();
    workspaceManager.activateCommandHandlers();
  },

  deactivate() {
    workspaceManager.cleanUpWorkspace();
    workspaceManager.deactivateEventHandlers();
    workspaceManager.deactivateCommandHandlers();
  },

  config: levelsConfig,

  provideLevels() {
    return levelsServices;
  },

  consumeStatusBar(statusBar) {
    workspaceManager.consumeStatusBar(statusBar);
  }
};
<|next_version|>
'use babel';

import languageRegistry from './language-registry';
import levelsConfig     from './levels-config';
import levelsServices   from './levels-services';
import workspace        from './workspace';
import workspaceManager from './workspace-manager';

export default {
  activate() {
    workspaceManager.setUpWorkspace();
    workspaceManager.activateEventHandlers();
    workspaceManager.activateCommandHandlers();
  },

  deactivate() {
    workspaceManager.cleanUpWorkspace();
    workspaceManager.deactivateEventHandlers();
    workspaceManager.deactivateCommandHandlers();
    workspace.destroy();
    languageRegistry.destroy();
  },

  config: levelsConfig,

  provideLevels() {
    return levelsServices;
  },

  consumeStatusBar(statusBar) {
    workspaceManager.consumeStatusBar(statusBar);
  }
};


Allow the use of arrow functions in Node

--- configurations/node.js
+++ configurations/node.js
@@ -3,9 +3,16 @@
   "env": {
     "node": true
   },
+  "ecmaFeatures": {
+    "arrowFunctions": true
+  },
   "rules": {
+    "arrow-body-style": [2, "as-needed"],
+    "arrow-parens": [2, "as-needed"],
+    "arrow-spacing": [2, {"after": true, "before": true}],
     "callback-return": 2,
     "handle-callback-err": 2,
+    "no-arrow-condition": 2,
     "no-mixed-requires": 2,
     "no-new-require": 2,
     "no-path-concat": 2

<|original_code|>
module.exports = {
  "extends": "chiton/configurations/default",
  "env": {
    "node": true
  },
  "rules": {
    "callback-return": 2,
    "handle-callback-err": 2,
    "no-mixed-requires": 2,
    "no-new-require": 2,
    "no-path-concat": 2
  }
};

<|edits_diff|>
--- configurations/node.js
+++ configurations/node.js
@@ -3,7 +3,13 @@
   "env": {
     "node": true
   },
+  "ecmaFeatures": {
+    "arrowFunctions": true
+  },
   "rules": {
+    "arrow-body-style": [2, "as-needed"],
+    "arrow-parens": [2, "as-needed"],
+    "arrow-spacing": [2, {"after": true, "before": true}],
     "callback-return": 2,
     "handle-callback-err": 2,
     "no-mixed-requires": 2,
<|current_version|>
module.exports = {
  "extends": "chiton/configurations/default",
  "env": {
    "node": true
  },
  "ecmaFeatures": {
    "arrowFunctions": true
  },
  "rules": {
    "arrow-body-style": [2, "as-needed"],
    "arrow-parens": [2, "as-needed"],
    "arrow-spacing": [2, {"after": true, "before": true}],
    "callback-return": 2,
    "handle-callback-err": 2,
    "no-mixed-requires": 2,
    "no-new-require": 2,
    "no-path-concat": 2
  }
};

<|next_version|>
module.exports = {
  "extends": "chiton/configurations/default",
  "env": {
    "node": true
  },
  "ecmaFeatures": {
    "arrowFunctions": true
  },
  "rules": {
    "arrow-body-style": [2, "as-needed"],
    "arrow-parens": [2, "as-needed"],
    "arrow-spacing": [2, {"after": true, "before": true}],
    "callback-return": 2,
    "handle-callback-err": 2,
    "no-arrow-condition": 2,
    "no-mixed-requires": 2,
    "no-new-require": 2,
    "no-path-concat": 2
  }
};


Modify player teams upon clan add/remove

--- src/entities/Clan.js
+++ src/entities/Clan.js
@@ -2,6 +2,7 @@
     removePlayer(player) {
         for (var i = 0; i < this.members.length; ++i) {
             if (this.members[i].player.sid === player.player.sid) {
+                this.members[i].player.team = null;
                 this.members.splice(i, 1);
                 return true;
             }
@@ -9,6 +10,7 @@
         return false;
     }
     addPlayer(player) {
+        player.player.team = this.name;
         this.members.push(player);
     }
     constructor(name) {

<|original_code|>
class Clan {
    removePlayer(player) {
        for (var i = 0; i < this.members.length; ++i) {
            if (this.members[i].player.sid === player.player.sid) {
                this.members.splice(i, 1);
                return true;
            }
        }
        return false;
    }
    addPlayer(player) {
        this.members.push(player);
    }
    constructor(name) {
        if (name) {
            this.name = name;
        } else {
            this.name = null;
        }
        this.members = [];
    }
}
module.exports = Clan;
<|edits_diff|>
--- src/entities/Clan.js
+++ src/entities/Clan.js
@@ -2,6 +2,7 @@
     removePlayer(player) {
         for (var i = 0; i < this.members.length; ++i) {
             if (this.members[i].player.sid === player.player.sid) {
+                this.members[i].player.team = null;
                 this.members.splice(i, 1);
                 return true;
             }
<|current_version|>
class Clan {
    removePlayer(player) {
        for (var i = 0; i < this.members.length; ++i) {
            if (this.members[i].player.sid === player.player.sid) {
                this.members[i].player.team = null;
                this.members.splice(i, 1);
                return true;
            }
        }
        return false;
    }
    addPlayer(player) {
        this.members.push(player);
    }
    constructor(name) {
        if (name) {
            this.name = name;
        } else {
            this.name = null;
        }
        this.members = [];
    }
}
module.exports = Clan;
<|next_version|>
class Clan {
    removePlayer(player) {
        for (var i = 0; i < this.members.length; ++i) {
            if (this.members[i].player.sid === player.player.sid) {
                this.members[i].player.team = null;
                this.members.splice(i, 1);
                return true;
            }
        }
        return false;
    }
    addPlayer(player) {
        player.player.team = this.name;
        this.members.push(player);
    }
    constructor(name) {
        if (name) {
            this.name = name;
        } else {
            this.name = null;
        }
        this.members = [];
    }
}
module.exports = Clan;


Check when session is null

Check when session is null

--- js/twee-fi.js
+++ js/twee-fi.js
@@ -29,12 +29,16 @@
     },
     updateLoginInfo() {
         SolidAuthClient.currentSession().then(function (session) {
+            if (session) {
             var user = $rdf.sym(session.webId);
             SolidUtils.rdfFetch(session.webId).then(function (response) {
                 var name = response.graph.any(user, SolidUtils.vocab.foaf('name'));
                 $("#loginInfo").html("Logged in as:");
                 $("#loginName").html("" + name + "");
             });
+        } else {
+            $("#loginInfo").html("Not logged in");
+        }
         });
     }

<|original_code|>
/* global SolidAuthClient, SolidUtils, $rdf */

TweeFiUtils = {

    TweetUri: class {
        constructor(value) {
            // Regex-pattern to check URLs against:
            // https://twitter.com/<twitteruser>/status/<long number>
            var urlRegex = /^https:\/\/twitter.com\/([a-zA-Z _.,!"'/$]+)\/status\/([0-9]*$)/;
            this.match = urlRegex.exec(value);
            this.value = value;
        }

        isValid() {
            return this.match !== null;
        }

        getUser() {
            return this.match[1];
        }

        getStatus() {
            return this.match[2];
        }

        toString() {
            return this.value;
        }
    },
    updateLoginInfo() {
        SolidAuthClient.currentSession().then(function (session) {
            var user = $rdf.sym(session.webId);
            SolidUtils.rdfFetch(session.webId).then(function (response) {
                var name = response.graph.any(user, SolidUtils.vocab.foaf('name'));
                $("#loginInfo").html("Logged in as:");
                $("#loginName").html("" + name + "");
            });
        });
    }

}
<|edits_diff|>
--- js/twee-fi.js
+++ js/twee-fi.js
@@ -29,6 +29,7 @@
     },
     updateLoginInfo() {
         SolidAuthClient.currentSession().then(function (session) {
+            if (session) {
             var user = $rdf.sym(session.webId);
             SolidUtils.rdfFetch(session.webId).then(function (response) {
                 var name = response.graph.any(user, SolidUtils.vocab.foaf('name'));
<|current_version|>
/* global SolidAuthClient, SolidUtils, $rdf */

TweeFiUtils = {

    TweetUri: class {
        constructor(value) {
            // Regex-pattern to check URLs against:
            // https://twitter.com/<twitteruser>/status/<long number>
            var urlRegex = /^https:\/\/twitter.com\/([a-zA-Z _.,!"'/$]+)\/status\/([0-9]*$)/;
            this.match = urlRegex.exec(value);
            this.value = value;
        }

        isValid() {
            return this.match !== null;
        }

        getUser() {
            return this.match[1];
        }

        getStatus() {
            return this.match[2];
        }

        toString() {
            return this.value;
        }
    },
    updateLoginInfo() {
        SolidAuthClient.currentSession().then(function (session) {
            if (session) {
            var user = $rdf.sym(session.webId);
            SolidUtils.rdfFetch(session.webId).then(function (response) {
                var name = response.graph.any(user, SolidUtils.vocab.foaf('name'));
                $("#loginInfo").html("Logged in as:");
                $("#loginName").html("" + name + "");
            });
        });
    }

}
<|next_version|>
/* global SolidAuthClient, SolidUtils, $rdf */

TweeFiUtils = {

    TweetUri: class {
        constructor(value) {
            // Regex-pattern to check URLs against:
            // https://twitter.com/<twitteruser>/status/<long number>
            var urlRegex = /^https:\/\/twitter.com\/([a-zA-Z _.,!"'/$]+)\/status\/([0-9]*$)/;
            this.match = urlRegex.exec(value);
            this.value = value;
        }

        isValid() {
            return this.match !== null;
        }

        getUser() {
            return this.match[1];
        }

        getStatus() {
            return this.match[2];
        }

        toString() {
            return this.value;
        }
    },
    updateLoginInfo() {
        SolidAuthClient.currentSession().then(function (session) {
            if (session) {
            var user = $rdf.sym(session.webId);
            SolidUtils.rdfFetch(session.webId).then(function (response) {
                var name = response.graph.any(user, SolidUtils.vocab.foaf('name'));
                $("#loginInfo").html("Logged in as:");
                $("#loginName").html("" + name + "");
            });
        } else {
            $("#loginInfo").html("Not logged in");
        }
        });
    }

}


Update expects for home page

Update expects for home page

--- test/e2e/home-page.js
+++ test/e2e/home-page.js
@@ -10,6 +10,7 @@
     it('should display the home page', function() {
       homePage.get();
       expect($('.welcome').getText()).toBe('Welcome to Lean Coffee! ');
+      expect(ptor.getCurrentUrl()).toContain('#/home');
     });

     it('should present the user with a default room in the inactive meeting list', function() {
@@ -30,6 +31,7 @@
     it('should navigate to submit phase when user clicks Create a Meeting! button', function() {
       homePage.createMeeting();
       expect(global.getPhaseText()).toMatch(/PHASE: SUBMIT/);
+      expect(ptor.getCurrentUrl()).toContain('#/meeting');
     });
   });
 });

<|original_code|>
var po = require('./page-objects');
var ptor = protractor.getInstance();

describe('lean coffee', function() {
  var global = new po.GlobalFunction();

  describe('home page', function(){
    var homePage = new po.HomePage();

    it('should display the home page', function() {
      homePage.get();
      expect($('.welcome').getText()).toBe('Welcome to Lean Coffee! ');
    });

    it('should present the user with a default room in the inactive meeting list', function() {
      expect($('.meeting-list').getText()).toContain('default');
    });

    it('should allow user to enter a meeting name', function() {
      expect(element(by.model('meetingName')).getAttribute('value')).toBe('');
      homePage.setMeetingNameInput('Testing Meeting Name');
      expect(element(by.model('meetingName')).getAttribute('value')).toBe('Testing Meeting Name');
      homePage.setMeetingNameInput('');
    });

    it('should display a Create a Meeting! button', function() {
      expect(element(by.buttonText('Create a Meeting!')).isPresent()).toBe(true);
    });

    it('should navigate to submit phase when user clicks Create a Meeting! button', function() {
      homePage.createMeeting();
      expect(global.getPhaseText()).toMatch(/PHASE: SUBMIT/);
    });
  });
});

<|edits_diff|>
--- test/e2e/home-page.js
+++ test/e2e/home-page.js
@@ -10,6 +10,7 @@
     it('should display the home page', function() {
       homePage.get();
       expect($('.welcome').getText()).toBe('Welcome to Lean Coffee! ');
+      expect(ptor.getCurrentUrl()).toContain('#/home');
     });

     it('should present the user with a default room in the inactive meeting list', function() {
<|current_version|>
var po = require('./page-objects');
var ptor = protractor.getInstance();

describe('lean coffee', function() {
  var global = new po.GlobalFunction();

  describe('home page', function(){
    var homePage = new po.HomePage();

    it('should display the home page', function() {
      homePage.get();
      expect($('.welcome').getText()).toBe('Welcome to Lean Coffee! ');
      expect(ptor.getCurrentUrl()).toContain('#/home');
    });

    it('should present the user with a default room in the inactive meeting list', function() {
      expect($('.meeting-list').getText()).toContain('default');
    });

    it('should allow user to enter a meeting name', function() {
      expect(element(by.model('meetingName')).getAttribute('value')).toBe('');
      homePage.setMeetingNameInput('Testing Meeting Name');
      expect(element(by.model('meetingName')).getAttribute('value')).toBe('Testing Meeting Name');
      homePage.setMeetingNameInput('');
    });

    it('should display a Create a Meeting! button', function() {
      expect(element(by.buttonText('Create a Meeting!')).isPresent()).toBe(true);
    });

    it('should navigate to submit phase when user clicks Create a Meeting! button', function() {
      homePage.createMeeting();
      expect(global.getPhaseText()).toMatch(/PHASE: SUBMIT/);
    });
  });
});

<|next_version|>
var po = require('./page-objects');
var ptor = protractor.getInstance();

describe('lean coffee', function() {
  var global = new po.GlobalFunction();

  describe('home page', function(){
    var homePage = new po.HomePage();

    it('should display the home page', function() {
      homePage.get();
      expect($('.welcome').getText()).toBe('Welcome to Lean Coffee! ');
      expect(ptor.getCurrentUrl()).toContain('#/home');
    });

    it('should present the user with a default room in the inactive meeting list', function() {
      expect($('.meeting-list').getText()).toContain('default');
    });

    it('should allow user to enter a meeting name', function() {
      expect(element(by.model('meetingName')).getAttribute('value')).toBe('');
      homePage.setMeetingNameInput('Testing Meeting Name');
      expect(element(by.model('meetingName')).getAttribute('value')).toBe('Testing Meeting Name');
      homePage.setMeetingNameInput('');
    });

    it('should display a Create a Meeting! button', function() {
      expect(element(by.buttonText('Create a Meeting!')).isPresent()).toBe(true);
    });

    it('should navigate to submit phase when user clicks Create a Meeting! button', function() {
      homePage.createMeeting();
      expect(global.getPhaseText()).toMatch(/PHASE: SUBMIT/);
      expect(ptor.getCurrentUrl()).toContain('#/meeting');
    });
  });
});