repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/forge/ClientProxy.java | // Path: src/com/mcf/davidee/msc/network/ClientPacketHandler.java
// public class ClientPacketHandler extends MSCPacketHandler {
//
//
// //TODO Verify that the GUIs are open for the correct mod?
//
// private Minecraft mc;
//
// public ClientPacketHandler() {
// this.mc = Minecraft.getMinecraft();
// }
//... | import java.io.File;
import com.mcf.davidee.msc.network.ClientPacketHandler;
import com.mcf.davidee.msc.network.MSCPacketHandler;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler; | package com.mcf.davidee.msc.forge;
public class ClientProxy extends CommonProxy {
protected final MSCPacketHandler client;
public ClientProxy() {
FMLCommonHandler.instance().bus().register(new KeyListener()); | // Path: src/com/mcf/davidee/msc/network/ClientPacketHandler.java
// public class ClientPacketHandler extends MSCPacketHandler {
//
//
// //TODO Verify that the GUIs are open for the correct mod?
//
// private Minecraft mc;
//
// public ClientPacketHandler() {
// this.mc = Minecraft.getMinecraft();
// }
//... | client = new ClientPacketHandler(); |
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/spawning/SpawnCapHelper.java | // Path: src/com/mcf/davidee/msc/MobSpawnControls.java
// @Mod(modid = "MSC2", name="Mob Spawn Controls 2", dependencies = "after:*", version=MobSpawnControls.VERSION)
// public class MobSpawnControls{
//
// public static final String VERSION = "1.2.1";
// public static final PacketPipeline DISPATCHER = new PacketPi... | import net.minecraft.entity.EnumCreatureType;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import com.mcf.davidee.msc.MobSpawnControls; | package com.mcf.davidee.msc.spawning;
public final class SpawnCapHelper {
public static boolean setSpawnCap(EnumCreatureType type, int value) { | // Path: src/com/mcf/davidee/msc/MobSpawnControls.java
// @Mod(modid = "MSC2", name="Mob Spawn Controls 2", dependencies = "after:*", version=MobSpawnControls.VERSION)
// public class MobSpawnControls{
//
// public static final String VERSION = "1.2.1";
// public static final PacketPipeline DISPATCHER = new PacketPi... | MobSpawnControls.getLogger().info("Attempting to set spawn cap to " + value + " for " + type ); |
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/packet/DebugPacket.java | // Path: src/com/mcf/davidee/msc/network/MSCPacketHandler.java
// public abstract class MSCPacketHandler {
//
// public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// public abstract void handleAccessDenied(EntityPlayer player);
// public abstract void handleHandShake(EntityPlayer player)... | import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import com.mcf.davidee.msc.network.MSCPacketHandler; | package com.mcf.davidee.msc.packet;
public class DebugPacket extends MSCPacket {
public String[] log;
@Override
public MSCPacket readData(Object... data) {
log = (String[]) data[0];
return this;
}
@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf to) throws IOException {
writeSt... | // Path: src/com/mcf/davidee/msc/network/MSCPacketHandler.java
// public abstract class MSCPacketHandler {
//
// public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// public abstract void handleAccessDenied(EntityPlayer player);
// public abstract void handleHandShake(EntityPlayer player)... | public void execute(MSCPacketHandler handler, EntityPlayer player) { |
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/packet/RequestPacket.java | // Path: src/com/mcf/davidee/msc/network/MSCPacketHandler.java
// public abstract class MSCPacketHandler {
//
// public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// public abstract void handleAccessDenied(EntityPlayer player);
// public abstract void handleHandShake(EntityPlayer player)... | import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import com.google.common.primitives.UnsignedBytes;
import com.mcf.davidee.msc.network.MSCPacketHandler; | package com.mcf.davidee.msc.packet;
public class RequestPacket extends MSCPacket {
private byte request;
private String mod;
@Override
public MSCPacket readData(Object... data) {
request = (Byte) data[0];
if (data.length > 1)
mod = (String) data[1];
return this;
}
@Override
public void encodeIn... | // Path: src/com/mcf/davidee/msc/network/MSCPacketHandler.java
// public abstract class MSCPacketHandler {
//
// public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// public abstract void handleAccessDenied(EntityPlayer player);
// public abstract void handleHandShake(EntityPlayer player)... | public void execute(MSCPacketHandler handler, EntityPlayer player) { |
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/grouping/BiomeOperand.java | // Path: src/com/mcf/davidee/msc/BiomeNameHelper.java
// public class BiomeNameHelper {
//
// public static final int MAX_REG_ID = 39;
// public static final List<Integer> VANILLA_MUT = Arrays.asList(129, 130, 131, 132, 133, 134, 140, 149, 151, 155, 156, 157, 158, 160, 162, 163, 164, 165, 166, 167);
//
//
//
/... | import java.util.Set;
import net.minecraft.world.biome.BiomeGenBase;
import com.mcf.davidee.msc.BiomeNameHelper;
import com.mcf.davidee.msc.Utils; | package com.mcf.davidee.msc.grouping;
public class BiomeOperand {
public final BiomeOperator operator;
private BiomeGroup group;
private BiomeGenBase biome;
private boolean isGroup, isAll;
public BiomeOperand() {
this.operator = BiomeOperator.ALL;
isAll = true;
}
public BiomeOperand(BiomeOperator op,... | // Path: src/com/mcf/davidee/msc/BiomeNameHelper.java
// public class BiomeNameHelper {
//
// public static final int MAX_REG_ID = 39;
// public static final List<Integer> VANILLA_MUT = Arrays.asList(129, 130, 131, 132, 133, 134, 140, 149, 151, 155, 156, 157, 158, 160, 162, 163, 164, 165, 166, 167);
//
//
//
/... | return BiomeNameHelper.getAllBiomes(); |
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/grouping/BiomeOperand.java | // Path: src/com/mcf/davidee/msc/BiomeNameHelper.java
// public class BiomeNameHelper {
//
// public static final int MAX_REG_ID = 39;
// public static final List<Integer> VANILLA_MUT = Arrays.asList(129, 130, 131, 132, 133, 134, 140, 149, 151, 155, 156, 157, 158, 160, 162, 163, 164, 165, 166, 167);
//
//
//
/... | import java.util.Set;
import net.minecraft.world.biome.BiomeGenBase;
import com.mcf.davidee.msc.BiomeNameHelper;
import com.mcf.davidee.msc.Utils; | package com.mcf.davidee.msc.grouping;
public class BiomeOperand {
public final BiomeOperator operator;
private BiomeGroup group;
private BiomeGenBase biome;
private boolean isGroup, isAll;
public BiomeOperand() {
this.operator = BiomeOperator.ALL;
isAll = true;
}
public BiomeOperand(BiomeOperator op,... | // Path: src/com/mcf/davidee/msc/BiomeNameHelper.java
// public class BiomeNameHelper {
//
// public static final int MAX_REG_ID = 39;
// public static final List<Integer> VANILLA_MUT = Arrays.asList(129, 130, 131, 132, 133, 134, 140, 149, 151, 155, 156, 157, 158, 160, 162, 163, 164, 165, 166, 167);
//
//
//
/... | return Utils.asSet(biome); |
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/packet/CreatureTypePacket.java | // Path: src/com/mcf/davidee/msc/network/MSCPacketHandler.java
// public abstract class MSCPacketHandler {
//
// public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// public abstract void handleAccessDenied(EntityPlayer player);
// public abstract void handleHandShake(EntityPlayer player)... | import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import com.mcf.davidee.msc.network.MSCPacketHandler; | package com.mcf.davidee.msc.packet;
public class CreatureTypePacket extends MSCPacket {
public String mod;
public String creatureType;
public String[] mobs;
@Override
public MSCPacket readData(Object... data) {
mod = (String) data[0];
creatureType = (String) data[1];
mobs = (String[]) data[2];
retur... | // Path: src/com/mcf/davidee/msc/network/MSCPacketHandler.java
// public abstract class MSCPacketHandler {
//
// public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// public abstract void handleAccessDenied(EntityPlayer player);
// public abstract void handleHandShake(EntityPlayer player)... | public void execute(MSCPacketHandler handler, EntityPlayer player) { |
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/packet/GroupsPacket.java | // Path: src/com/mcf/davidee/msc/network/MSCPacketHandler.java
// public abstract class MSCPacketHandler {
//
// public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// public abstract void handleAccessDenied(EntityPlayer player);
// public abstract void handleHandShake(EntityPlayer player)... | import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import com.mcf.davidee.msc.network.MSCPacketHandler; | package com.mcf.davidee.msc.packet;
public class GroupsPacket extends MSCPacket {
public String mod;
public String[] groups;
public String[] biomeNames;
@Override
public MSCPacket readData(Object... data) {
mod = (String) data[0];
groups = (String[]) data[1];
biomeNames = (String[]) data[2];
return ... | // Path: src/com/mcf/davidee/msc/network/MSCPacketHandler.java
// public abstract class MSCPacketHandler {
//
// public abstract void handleSettings(SettingsPacket pkt, EntityPlayer player);
// public abstract void handleAccessDenied(EntityPlayer player);
// public abstract void handleHandShake(EntityPlayer player)... | public void execute(MSCPacketHandler handler, EntityPlayer player) { |
elibom/jogger | src/main/java/com/elibom/jogger/http/Response.java | // Path: src/main/java/com/elibom/jogger/asset/Asset.java
// public class Asset {
//
// /**
// * The input stream of the asset.
// */
// private final InputStream inputStream;
//
// /**
// * The name of the asset.
// */
// private final String name;
//
// /**
// * The content length of the asset.
// ... | import java.util.Map;
import com.elibom.jogger.asset.Asset;
import com.elibom.jogger.template.TemplateException; |
/**
* Removes a cookie.
*
* @param cookie the name of the cookie to be removed.
*
* @return itself for method chaining.
*/
Response removeCookie(Cookie cookie);
Map<String,Object> getAttributes();
Response setAttribute(String name, Object object);
/**
* Writes an HTML string into the response.
... | // Path: src/main/java/com/elibom/jogger/asset/Asset.java
// public class Asset {
//
// /**
// * The input stream of the asset.
// */
// private final InputStream inputStream;
//
// /**
// * The name of the asset.
// */
// private final String name;
//
// /**
// * The content length of the asset.
// ... | Response write(Asset asset); |
elibom/jogger | src/main/java/com/elibom/jogger/http/Response.java | // Path: src/main/java/com/elibom/jogger/asset/Asset.java
// public class Asset {
//
// /**
// * The input stream of the asset.
// */
// private final InputStream inputStream;
//
// /**
// * The name of the asset.
// */
// private final String name;
//
// /**
// * The content length of the asset.
// ... | import java.util.Map;
import com.elibom.jogger.asset.Asset;
import com.elibom.jogger.template.TemplateException; | Map<String,Object> getAttributes();
Response setAttribute(String name, Object object);
/**
* Writes an HTML string into the response.
*
* @param output the output code to write in the response.
*
* @return itself for method chaining.
*/
Response write(String output);
/**
* Writes an InputStream in... | // Path: src/main/java/com/elibom/jogger/asset/Asset.java
// public class Asset {
//
// /**
// * The input stream of the asset.
// */
// private final InputStream inputStream;
//
// /**
// * The name of the asset.
// */
// private final String name;
//
// /**
// * The content length of the asset.
// ... | Response render(String templateName) throws TemplateException; |
elibom/jogger | src/main/java/com/elibom/jogger/http/Request.java | // Path: src/main/java/com/elibom/jogger/middleware/router/Route.java
// public class Route {
//
// public enum HttpMethod {
// GET,
// POST,
// PUT,
// DELETE,
// OPTIONS,
// HEAD,
// PATCH
// }
//
// private final HttpMethod httpMethod;
//
// private final String path;
//
// private final Objec... | import java.io.InputStream;
import java.util.Map;
import com.elibom.jogger.middleware.router.Route; | package com.elibom.jogger.http;
/**
* Represents an HTTP Request.
*
* @author German Escobar
*/
public interface Request {
String getHost();
/**
* Returns the full URL including scheme, host, port, path and query string.
*
* @return a String object with the URL.
*/
String getUrl();
/**
* Retriev... | // Path: src/main/java/com/elibom/jogger/middleware/router/Route.java
// public class Route {
//
// public enum HttpMethod {
// GET,
// POST,
// PUT,
// DELETE,
// OPTIONS,
// HEAD,
// PATCH
// }
//
// private final HttpMethod httpMethod;
//
// private final String path;
//
// private final Objec... | void setRoute(Route route); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/ConflictExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/ConflictException.java
// public class ConflictException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 409;
// private static final String NAME = "Conflict";
//
// public Confli... | import com.elibom.jogger.exception.ConflictException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class ConflictExceptionTest {
@Test
public void shouldCreateConflictException() throws Exception {
try { | // Path: src/main/java/com/elibom/jogger/exception/ConflictException.java
// public class ConflictException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 409;
// private static final String NAME = "Conflict";
//
// public Confli... | throw new ConflictException(); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/ConflictExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/ConflictException.java
// public class ConflictException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 409;
// private static final String NAME = "Conflict";
//
// public Confli... | import com.elibom.jogger.exception.ConflictException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class ConflictExceptionTest {
@Test
public void shouldCreateConflictException() throws Exception {
try {
throw new ConflictException(); | // Path: src/main/java/com/elibom/jogger/exception/ConflictException.java
// public class ConflictException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 409;
// private static final String NAME = "Conflict";
//
// public Confli... | } catch (WebApplicationException e) { |
elibom/jogger | src/main/java/com/elibom/jogger/http/FileItem.java | // Path: src/main/java/com/elibom/jogger/util/Preconditions.java
// public final class Preconditions {
//
// /**
// * Hide constructor.
// */
// private Preconditions() {}
//
// /**
// * Checks that an object is not null.
// *
// * @param object the object to be tested
// * @param message the message f... | import java.io.File;
import java.util.HashMap;
import java.util.Map;
import com.elibom.jogger.util.Preconditions; | package com.elibom.jogger.http;
/**
* Represents a file from an HTTP multipart/form-data request.
*
* @author German Escobar
*/
public class FileItem {
/**
* The name of the field to which this file was associated in the HTTP request
*/
private String name;
/**
* The name of the file taken from the HT... | // Path: src/main/java/com/elibom/jogger/util/Preconditions.java
// public final class Preconditions {
//
// /**
// * Hide constructor.
// */
// private Preconditions() {}
//
// /**
// * Checks that an object is not null.
// *
// * @param object the object to be tested
// * @param message the message f... | Preconditions.notNull(fieldName, "no fieldName provided."); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/BadRequestExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/BadRequestException.java
// public class BadRequestException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 400;
// private static final String NAME = "Bad Request";
//
// public... | import com.elibom.jogger.exception.BadRequestException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class BadRequestExceptionTest {
@Test
public void shouldCreateBadRequestException() throws Exception {
try { | // Path: src/main/java/com/elibom/jogger/exception/BadRequestException.java
// public class BadRequestException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 400;
// private static final String NAME = "Bad Request";
//
// public... | throw new BadRequestException(); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/BadRequestExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/BadRequestException.java
// public class BadRequestException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 400;
// private static final String NAME = "Bad Request";
//
// public... | import com.elibom.jogger.exception.BadRequestException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class BadRequestExceptionTest {
@Test
public void shouldCreateBadRequestException() throws Exception {
try {
throw new BadRequestException(); | // Path: src/main/java/com/elibom/jogger/exception/BadRequestException.java
// public class BadRequestException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 400;
// private static final String NAME = "Bad Request";
//
// public... | } catch (WebApplicationException e) { |
elibom/jogger | src/main/java/com/elibom/jogger/middleware/router/loader/SpringControllerLoader.java | // Path: src/main/java/com/elibom/jogger/middleware/router/RoutesException.java
// public class RoutesException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public RoutesException(String message) {
// super(message);
// }
//
// public RoutesException(String message, T... | import com.elibom.jogger.middleware.router.RoutesException;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware; | package com.elibom.jogger.middleware.router.loader;
/**
* A concrete implementation of {@link ControllerLoader} that loads controllers from a Spring context using an
* <code>ApplicationContext</code>. Notice that this class implements <code>ApplicationContextAware</code>, so if you
* configure this class as a Spri... | // Path: src/main/java/com/elibom/jogger/middleware/router/RoutesException.java
// public class RoutesException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public RoutesException(String message) {
// super(message);
// }
//
// public RoutesException(String message, T... | public Object load(String controllerName) throws RoutesException { |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/ForbiddenExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/ForbiddenException.java
// public class ForbiddenException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 403;
// private static final String NAME = "Forbidden";
//
// public For... | import com.elibom.jogger.exception.ForbiddenException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class ForbiddenExceptionTest {
@Test
public void shouldCreateForbiddenException() throws Exception {
try { | // Path: src/main/java/com/elibom/jogger/exception/ForbiddenException.java
// public class ForbiddenException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 403;
// private static final String NAME = "Forbidden";
//
// public For... | throw new ForbiddenException(); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/ForbiddenExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/ForbiddenException.java
// public class ForbiddenException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 403;
// private static final String NAME = "Forbidden";
//
// public For... | import com.elibom.jogger.exception.ForbiddenException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class ForbiddenExceptionTest {
@Test
public void shouldCreateForbiddenException() throws Exception {
try {
throw new ForbiddenException(); | // Path: src/main/java/com/elibom/jogger/exception/ForbiddenException.java
// public class ForbiddenException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 403;
// private static final String NAME = "Forbidden";
//
// public For... | } catch (WebApplicationException e) { |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/UnprocessableEntityExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/UnprocessableEntityException.java
// public class UnprocessableEntityException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 422;
// private static final String NAME = "Unprocessab... | import com.elibom.jogger.exception.UnprocessableEntityException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class UnprocessableEntityExceptionTest {
@Test
public void shouldCreateUnprocessableEntityException() throws Exception {
try { | // Path: src/main/java/com/elibom/jogger/exception/UnprocessableEntityException.java
// public class UnprocessableEntityException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 422;
// private static final String NAME = "Unprocessab... | throw new UnprocessableEntityException(); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/UnprocessableEntityExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/UnprocessableEntityException.java
// public class UnprocessableEntityException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 422;
// private static final String NAME = "Unprocessab... | import com.elibom.jogger.exception.UnprocessableEntityException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class UnprocessableEntityExceptionTest {
@Test
public void shouldCreateUnprocessableEntityException() throws Exception {
try {
throw new UnprocessableEntityException(); | // Path: src/main/java/com/elibom/jogger/exception/UnprocessableEntityException.java
// public class UnprocessableEntityException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 422;
// private static final String NAME = "Unprocessab... | } catch (WebApplicationException e) { |
elibom/jogger | src/test/java/com/elibom/jogger/template/FreemarkerTemplateEngineTest.java | // Path: src/main/java/com/elibom/jogger/template/TemplateException.java
// public class TemplateException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public TemplateException() {
// super();
// }
//
// public TemplateException(String message, Throwable cause) {
// ... | import com.elibom.jogger.template.TemplateException;
import com.elibom.jogger.template.FreemarkerTemplateEngine;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.template;
public class FreemarkerTemplateEngineTest {
@Test
public void shouldRenderExistingTemplate() throws Exception { | // Path: src/main/java/com/elibom/jogger/template/TemplateException.java
// public class TemplateException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public TemplateException() {
// super();
// }
//
// public TemplateException(String message, Throwable cause) {
// ... | FreemarkerTemplateEngine templateEngine = new FreemarkerTemplateEngine(); |
elibom/jogger | src/test/java/com/elibom/jogger/template/FreemarkerTemplateEngineTest.java | // Path: src/main/java/com/elibom/jogger/template/TemplateException.java
// public class TemplateException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public TemplateException() {
// super();
// }
//
// public TemplateException(String message, Throwable cause) {
// ... | import com.elibom.jogger.template.TemplateException;
import com.elibom.jogger.template.FreemarkerTemplateEngine;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.template;
public class FreemarkerTemplateEngineTest {
@Test
public void shouldRenderExistingTemplate() throws Exception {
FreemarkerTemplateEngine templateEngine = new FreemarkerTemplateEngine();
Map<String,Object> root = new HashMap<String,Object>();
root.put("title", "This is a ... | // Path: src/main/java/com/elibom/jogger/template/TemplateException.java
// public class TemplateException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public TemplateException() {
// super();
// }
//
// public TemplateException(String message, Throwable cause) {
// ... | @Test(expectedExceptions=TemplateException.class) |
elibom/jogger | src/test/java/com/elibom/jogger/router/FileSystemRoutesLoaderTest.java | // Path: src/main/java/com/elibom/jogger/middleware/router/Route.java
// public class Route {
//
// public enum HttpMethod {
// GET,
// POST,
// PUT,
// DELETE,
// OPTIONS,
// HEAD,
// PATCH
// }
//
// private final HttpMethod httpMethod;
//
// private final String path;
//
// private final Objec... | import java.text.ParseException;
import java.util.List;
import com.elibom.jogger.middleware.router.Route;
import com.elibom.jogger.middleware.router.loader.FileSystemRoutesLoader;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.router;
public class FileSystemRoutesLoaderTest {
@Test
public void shouldParseInput() throws Exception {
// prepare | // Path: src/main/java/com/elibom/jogger/middleware/router/Route.java
// public class Route {
//
// public enum HttpMethod {
// GET,
// POST,
// PUT,
// DELETE,
// OPTIONS,
// HEAD,
// PATCH
// }
//
// private final HttpMethod httpMethod;
//
// private final String path;
//
// private final Objec... | FileSystemRoutesLoader routesLoader = new FileSystemRoutesLoader("src/test/resources/routes/routes-1.config"); |
elibom/jogger | src/test/java/com/elibom/jogger/router/FileSystemRoutesLoaderTest.java | // Path: src/main/java/com/elibom/jogger/middleware/router/Route.java
// public class Route {
//
// public enum HttpMethod {
// GET,
// POST,
// PUT,
// DELETE,
// OPTIONS,
// HEAD,
// PATCH
// }
//
// private final HttpMethod httpMethod;
//
// private final String path;
//
// private final Objec... | import java.text.ParseException;
import java.util.List;
import com.elibom.jogger.middleware.router.Route;
import com.elibom.jogger.middleware.router.loader.FileSystemRoutesLoader;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.router;
public class FileSystemRoutesLoaderTest {
@Test
public void shouldParseInput() throws Exception {
// prepare
FileSystemRoutesLoader routesLoader = new FileSystemRoutesLoader("src/test/resources/routes/routes-1.config");
routesLoader.setBasePackage("com.elibom.jogger");
/... | // Path: src/main/java/com/elibom/jogger/middleware/router/Route.java
// public class Route {
//
// public enum HttpMethod {
// GET,
// POST,
// PUT,
// DELETE,
// OPTIONS,
// HEAD,
// PATCH
// }
//
// private final HttpMethod httpMethod;
//
// private final String path;
//
// private final Objec... | List<Route> routes = routesLoader.load(); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/UnAuthorizedExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/UnAuthorizedException.java
// public class UnAuthorizedException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 401;
// private static final String NAME = "Unauthorized";
//
// p... | import com.elibom.jogger.exception.UnAuthorizedException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class UnAuthorizedExceptionTest {
@Test
public void shouldCreateUnAuthorizedException() throws Exception {
try { | // Path: src/main/java/com/elibom/jogger/exception/UnAuthorizedException.java
// public class UnAuthorizedException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 401;
// private static final String NAME = "Unauthorized";
//
// p... | throw new UnAuthorizedException(); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/UnAuthorizedExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/UnAuthorizedException.java
// public class UnAuthorizedException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 401;
// private static final String NAME = "Unauthorized";
//
// p... | import com.elibom.jogger.exception.UnAuthorizedException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class UnAuthorizedExceptionTest {
@Test
public void shouldCreateUnAuthorizedException() throws Exception {
try {
throw new UnAuthorizedException(); | // Path: src/main/java/com/elibom/jogger/exception/UnAuthorizedException.java
// public class UnAuthorizedException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 401;
// private static final String NAME = "Unauthorized";
//
// p... | } catch (WebApplicationException e) { |
elibom/jogger | src/test/java/com/elibom/jogger/template/JadeTemplateEngineTest.java | // Path: src/main/java/com/elibom/jogger/template/TemplateException.java
// public class TemplateException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public TemplateException() {
// super();
// }
//
// public TemplateException(String message, Throwable cause) {
// ... | import com.elibom.jogger.template.TemplateException;
import com.elibom.jogger.template.JadeTemplateEngine;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.template;
public class JadeTemplateEngineTest {
@Test
public void shouldRenderExistingTemplate() throws Exception { | // Path: src/main/java/com/elibom/jogger/template/TemplateException.java
// public class TemplateException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public TemplateException() {
// super();
// }
//
// public TemplateException(String message, Throwable cause) {
// ... | JadeTemplateEngine templateEngine = new JadeTemplateEngine(); |
elibom/jogger | src/test/java/com/elibom/jogger/template/JadeTemplateEngineTest.java | // Path: src/main/java/com/elibom/jogger/template/TemplateException.java
// public class TemplateException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public TemplateException() {
// super();
// }
//
// public TemplateException(String message, Throwable cause) {
// ... | import com.elibom.jogger.template.TemplateException;
import com.elibom.jogger.template.JadeTemplateEngine;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.template;
public class JadeTemplateEngineTest {
@Test
public void shouldRenderExistingTemplate() throws Exception {
JadeTemplateEngine templateEngine = new JadeTemplateEngine();
Map<String,Object> root = new HashMap<String,Object>();
root.put("title", "This is a test");
StringW... | // Path: src/main/java/com/elibom/jogger/template/TemplateException.java
// public class TemplateException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public TemplateException() {
// super();
// }
//
// public TemplateException(String message, Throwable cause) {
// ... | @Test(expectedExceptions=TemplateException.class) |
elibom/jogger | src/main/java/com/elibom/jogger/middleware/router/loader/ClassPathControllerLoader.java | // Path: src/main/java/com/elibom/jogger/middleware/router/RoutesException.java
// public class RoutesException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public RoutesException(String message) {
// super(message);
// }
//
// public RoutesException(String message, T... | import com.elibom.jogger.middleware.router.RoutesException; | package com.elibom.jogger.middleware.router.loader;
/**
* A concrete implementation of {@link ControllerLoader} that loads controllers from the classpath using a
* <code>ClassLoader</code>. You can specified a <code>basePackage</code> to avoid repeating the package in the routes
* file.
*
* @author German Escoba... | // Path: src/main/java/com/elibom/jogger/middleware/router/RoutesException.java
// public class RoutesException extends RuntimeException {
//
// private static final long serialVersionUID = 1L;
//
// public RoutesException(String message) {
// super(message);
// }
//
// public RoutesException(String message, T... | public Object load(String controllerName) throws RoutesException { |
elibom/jogger | src/main/java/com/elibom/jogger/http/servlet/multipart/PartHandler.java | // Path: src/main/java/com/elibom/jogger/http/FileItem.java
// public class FileItem {
//
// /**
// * The name of the field to which this file was associated in the HTTP request
// */
// private String name;
//
// /**
// * The name of the file taken from the HTTP part (in the filename attribute of the Conten... | import com.elibom.jogger.http.FileItem; | package com.elibom.jogger.http.servlet.multipart;
/**
* Implementations of this interface are passed to the
* {@link Multipart#parse(javax.servlet.http.HttpServletRequest, PartHandler)} method and handle the request parts.
*
* @author German Escobar
*/
public interface PartHandler {
/**
* Called when a form ... | // Path: src/main/java/com/elibom/jogger/http/FileItem.java
// public class FileItem {
//
// /**
// * The name of the field to which this file was associated in the HTTP request
// */
// private String name;
//
// /**
// * The name of the file taken from the HTTP part (in the filename attribute of the Conten... | void handleFileItem(String name, FileItem fileItem); |
elibom/jogger | src/main/java/com/elibom/jogger/http/servlet/multipart/Multipart.java | // Path: src/main/java/com/elibom/jogger/http/FileItem.java
// public class FileItem {
//
// /**
// * The name of the field to which this file was associated in the HTTP request
// */
// private String name;
//
// /**
// * The name of the file taken from the HTTP part (in the filename attribute of the Conten... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.elibom.jogger.http.FileItem; | Map<String,String> headers = getHeadersMap(headersString);
if (currentFieldName == null) {
// we're parsing the outer multipart
String fieldName = getFieldName( headers.get(CONTENT_DISPOSITION) );
if (fieldName != null) {
String partContentType = headers.get(CONTENT_TYPE);
if (partContent... | // Path: src/main/java/com/elibom/jogger/http/FileItem.java
// public class FileItem {
//
// /**
// * The name of the field to which this file was associated in the HTTP request
// */
// private String name;
//
// /**
// * The name of the file taken from the HTTP part (in the filename attribute of the Conten... | FileItem fileItem = new FileItem(fieldName, fileName, partContentType, tempFile.length(), tempFile, headers); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/NotFoundExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/NotFoundException.java
// public class NotFoundException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 404;
// private static final String NAME = "Not Found";
//
// public NotFo... | import com.elibom.jogger.exception.NotFoundException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class NotFoundExceptionTest {
@Test
public void shouldCreateNotFoundException() throws Exception {
try { | // Path: src/main/java/com/elibom/jogger/exception/NotFoundException.java
// public class NotFoundException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 404;
// private static final String NAME = "Not Found";
//
// public NotFo... | throw new NotFoundException(); |
elibom/jogger | src/test/java/com/elibom/jogger/exceptions/NotFoundExceptionTest.java | // Path: src/main/java/com/elibom/jogger/exception/NotFoundException.java
// public class NotFoundException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 404;
// private static final String NAME = "Not Found";
//
// public NotFo... | import com.elibom.jogger.exception.NotFoundException;
import com.elibom.jogger.exception.WebApplicationException;
import org.testng.Assert;
import org.testng.annotations.Test; | package com.elibom.jogger.exceptions;
public class NotFoundExceptionTest {
@Test
public void shouldCreateNotFoundException() throws Exception {
try {
throw new NotFoundException(); | // Path: src/main/java/com/elibom/jogger/exception/NotFoundException.java
// public class NotFoundException extends WebApplicationException {
//
// private static final long serialVersionUID = 1L;
//
// private static final int STATUS = 404;
// private static final String NAME = "Not Found";
//
// public NotFo... | } catch (WebApplicationException e) { |
elibom/jogger | src/main/java/com/elibom/jogger/asset/FileAssetLoader.java | // Path: src/main/java/com/elibom/jogger/util/Preconditions.java
// public final class Preconditions {
//
// /**
// * Hide constructor.
// */
// private Preconditions() {}
//
// /**
// * Checks that an object is not null.
// *
// * @param object the object to be tested
// * @param message the message f... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.io.Buffer;
import com.elibom.jogger.util.Preconditions; | package com.elibom.jogger.asset;
/**
* An {@link AssetLoader} implementation that uses the file system to retrieve assets.
*
* @author German Escobar
*/
public class FileAssetLoader implements AssetLoader {
private static final String DEFAULT_BASE_DIRECTORY = "assets";
private File parent;
/**
* Construc... | // Path: src/main/java/com/elibom/jogger/util/Preconditions.java
// public final class Preconditions {
//
// /**
// * Hide constructor.
// */
// private Preconditions() {}
//
// /**
// * Checks that an object is not null.
// *
// * @param object the object to be tested
// * @param message the message f... | Preconditions.notEmpty(directory, "no directory provided"); |
elibom/jogger | src/main/java/com/elibom/jogger/middleware/router/Route.java | // Path: src/main/java/com/elibom/jogger/http/Path.java
// public class Path {
//
// /**
// * The regular expression to find holders in a path (e.g. {userId}).
// */
// public static final String VAR_REGEXP = "\\{([^{}]+)\\}";
//
// public static final String VAR_REPLACE = "([^#/?]+)";
//
// public static St... | import java.lang.reflect.Method;
import com.elibom.jogger.http.Path;
import com.elibom.jogger.util.Preconditions; | package com.elibom.jogger.middleware.router;
/**
* Holds the information of a route.
*
* @author German Escobar
*/
public class Route {
public enum HttpMethod {
GET,
POST,
PUT,
DELETE,
OPTIONS,
HEAD,
PATCH
}
private final HttpMethod httpMethod;
private final String path;
private final Obje... | // Path: src/main/java/com/elibom/jogger/http/Path.java
// public class Path {
//
// /**
// * The regular expression to find holders in a path (e.g. {userId}).
// */
// public static final String VAR_REGEXP = "\\{([^{}]+)\\}";
//
// public static final String VAR_REPLACE = "([^#/?]+)";
//
// public static St... | Preconditions.notNull(httpMethod, "no httpMethod provided"); |
elibom/jogger | src/main/java/com/elibom/jogger/middleware/router/Route.java | // Path: src/main/java/com/elibom/jogger/http/Path.java
// public class Path {
//
// /**
// * The regular expression to find holders in a path (e.g. {userId}).
// */
// public static final String VAR_REGEXP = "\\{([^{}]+)\\}";
//
// public static final String VAR_REPLACE = "([^#/?]+)";
//
// public static St... | import java.lang.reflect.Method;
import com.elibom.jogger.http.Path;
import com.elibom.jogger.util.Preconditions; | package com.elibom.jogger.middleware.router;
/**
* Holds the information of a route.
*
* @author German Escobar
*/
public class Route {
public enum HttpMethod {
GET,
POST,
PUT,
DELETE,
OPTIONS,
HEAD,
PATCH
}
private final HttpMethod httpMethod;
private final String path;
private final Obje... | // Path: src/main/java/com/elibom/jogger/http/Path.java
// public class Path {
//
// /**
// * The regular expression to find holders in a path (e.g. {userId}).
// */
// public static final String VAR_REGEXP = "\\{([^{}]+)\\}";
//
// public static final String VAR_REPLACE = "([^#/?]+)";
//
// public static St... | this.path = Path.fixPath(path); |
houkx/nettythrift | client.json/src/io/client/thrift/ClientInterfaceFactory.java | // Path: client.json/src/io/client/thrift/Json.java
// public static class Strategy {
// int excludeModifiers = Modifier.TRANSIENT | Modifier.STATIC;
//
// /**
// * 返回字段名,如果返回null,则表示忽略这个字段
// *
// * @param field
// * @return
// */
// public String fieldName(Field field) {
// if (excludeClass(field.get... | import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import... | /**
*
*/
package io.client.thrift;
/**
* 使用 HTTP + JSON 协议
* <p>
* 只有这一个文件,适合轻量级通信,如单一接口。由于依赖的 org.json 包 在 android.jar中 已存在,代码整体尺寸很小。
*
* @author HouKangxi
*
*/
public class ClientInterfaceFactory {
private ClientInterfaceFactory() {
}
private static ConcurrentHashMap<Long, Object> ifaceCache = ne... | // Path: client.json/src/io/client/thrift/Json.java
// public static class Strategy {
// int excludeModifiers = Modifier.TRANSIENT | Modifier.STATIC;
//
// /**
// * 返回字段名,如果返回null,则表示忽略这个字段
// *
// * @param field
// * @return
// */
// public String fieldName(Field field) {
// if (excludeClass(field.get... | private static class Handler extends Json.Strategy implements InvocationHandler { |
houkx/nettythrift | io.nettythrift/src/main/java/io/nettythrift/core/ThriftServerDefBuilderBase.java | // Path: io.nettythrift/src/main/java/io/nettythrift/protocol/DefaultProtocolFactorySelectorFactory.java
// public class DefaultProtocolFactorySelectorFactory implements ProtocolFactorySelectorFactory {
//
// /*
// * (non-Javadoc)
// *
// * @see io.netty5thrift.protocol.ProtocolFactorySelectorFactory#
//... | import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.thrift.TBaseProcessor;
import io.netty.channel.ChannelHandler;
import io.netty.util.concurrent.DefaultExecutorServiceFactory;
import io.nettythrift.protocol.DefaultProtocolFactorySelectorFactory;
import io.n... | /*
* Copyright (C) 2012-2013 Facebook, Inc.
*
* 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 ag... | // Path: io.nettythrift/src/main/java/io/nettythrift/protocol/DefaultProtocolFactorySelectorFactory.java
// public class DefaultProtocolFactorySelectorFactory implements ProtocolFactorySelectorFactory {
//
// /*
// * (non-Javadoc)
// *
// * @see io.netty5thrift.protocol.ProtocolFactorySelectorFactory#
//... | private ProtocolFactorySelectorFactory protocolFactorySelectorFactory;// hasDefault |
houkx/nettythrift | io.nettythrift/src/main/java/io/nettythrift/core/ThriftServerDefBuilderBase.java | // Path: io.nettythrift/src/main/java/io/nettythrift/protocol/DefaultProtocolFactorySelectorFactory.java
// public class DefaultProtocolFactorySelectorFactory implements ProtocolFactorySelectorFactory {
//
// /*
// * (non-Javadoc)
// *
// * @see io.netty5thrift.protocol.ProtocolFactorySelectorFactory#
//... | import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.thrift.TBaseProcessor;
import io.netty.channel.ChannelHandler;
import io.netty.util.concurrent.DefaultExecutorServiceFactory;
import io.nettythrift.protocol.DefaultProtocolFactorySelectorFactory;
import io.n... | @SuppressWarnings("unchecked")
public T httpHandlerFactory(HttpHandlerFactory httpHandlerFactory) {
this.httpHandlerFactory = httpHandlerFactory;
return (T) this;
}
@SuppressWarnings("unchecked")
public T trafficForecastFactory(TrafficForecastFactory trafficForecast) {
this.trafficForecastFactory = trafficF... | // Path: io.nettythrift/src/main/java/io/nettythrift/protocol/DefaultProtocolFactorySelectorFactory.java
// public class DefaultProtocolFactorySelectorFactory implements ProtocolFactorySelectorFactory {
//
// /*
// * (non-Javadoc)
// *
// * @see io.netty5thrift.protocol.ProtocolFactorySelectorFactory#
//... | protocolFactorySelectorFactory = new DefaultProtocolFactorySelectorFactory(); |
houkx/nettythrift | io.nettythrift/src/main/java/io/nettythrift/core/ThriftServerDef.java | // Path: io.nettythrift/src/main/java/io/nettythrift/protocol/ProtocolFactorySelector.java
// public class ProtocolFactorySelector {
// private static Logger logger = LoggerFactory.getLogger(ProtocolFactorySelector.class);
// private final HashMap<Short, TProtocolFactory> protocolFactoryMap = new HashMap<Short, TPr... | import io.nettythrift.protocol.ProtocolFactorySelectorFactory;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import org.apache.thrift.ProcessFunction;
im... | /*
* Copyright (C) 2012-2013 Facebook, Inc.
*
* 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 ag... | // Path: io.nettythrift/src/main/java/io/nettythrift/protocol/ProtocolFactorySelector.java
// public class ProtocolFactorySelector {
// private static Logger logger = LoggerFactory.getLogger(ProtocolFactorySelector.class);
// private final HashMap<Short, TProtocolFactory> protocolFactoryMap = new HashMap<Short, TPr... | public final ProtocolFactorySelector protocolFactorySelector; |
houkx/nettythrift | io.nettythrift/src/main/java/io/nettythrift/core/ThriftServerDef.java | // Path: io.nettythrift/src/main/java/io/nettythrift/protocol/ProtocolFactorySelector.java
// public class ProtocolFactorySelector {
// private static Logger logger = LoggerFactory.getLogger(ProtocolFactorySelector.class);
// private final HashMap<Short, TProtocolFactory> protocolFactoryMap = new HashMap<Short, TPr... | import io.nettythrift.protocol.ProtocolFactorySelectorFactory;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import org.apache.thrift.ProcessFunction;
im... | /*
* Copyright (C) 2012-2013 Facebook, Inc.
*
* 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 ag... | // Path: io.nettythrift/src/main/java/io/nettythrift/protocol/ProtocolFactorySelector.java
// public class ProtocolFactorySelector {
// private static Logger logger = LoggerFactory.getLogger(ProtocolFactorySelector.class);
// private final HashMap<Short, TProtocolFactory> protocolFactoryMap = new HashMap<Short, TPr... | ProtocolFactorySelectorFactory protocolFactorySelectorFactory, HttpResourceHandler httpResourceHandler, |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/workflow/AddGitLabMergeRequestCommentStep.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | import static com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.getClient;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ws.rs.ProcessingException;
import javax.ws.rs.WebApplicationException;
imp... |
@Override
public StepExecution start(StepContext context) throws Exception {
return new AddGitLabMergeRequestCommentStepExecution(context, this);
}
public String getComment() {
return comment;
}
@DataBoundSetter
public void setComment(String comment) {
this.comment = StringUtils... | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | GitLabWebHookCause cause = run.getCause(GitLabWebHookCause.class); |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/workflow/AddGitLabMergeRequestCommentStep.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | import static com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.getClient;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ws.rs.ProcessingException;
import javax.ws.rs.WebApplicationException;
imp... | }
public String getComment() {
return comment;
}
@DataBoundSetter
public void setComment(String comment) {
this.comment = StringUtils.isEmpty(comment) ? null : comment;
}
public static class AddGitLabMergeRequestCommentStepExecution extends AbstractSynchronousStepExecution<V... | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | GitLabClient client = getClient(run); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClientTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.API_TOKEN;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.addGitLabApiToken;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.Tes... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class AutodetectingGitLabClientTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
private MockServerClient mockServerClient;
private String gitLabUrl; | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | private GitLabClientBuilder clientBuilder; |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClientTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.API_TOKEN;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.addGitLabApiToken;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.Tes... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class AutodetectingGitLabClientTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
private MockServerClient mockServerClient;
private String gitLabUrl;
... | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | addGitLabApiToken(); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClientTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.API_TOKEN;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.addGitLabApiToken;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.Tes... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class AutodetectingGitLabClientTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
private MockServerClient mockServerClient;
private String gitLabUrl;
... | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | api = new AutodetectingGitLabClient(builders, gitLabUrl, API_TOKEN, true, 10, 10); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClientTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.API_TOKEN;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.addGitLabApiToken;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.Tes... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class AutodetectingGitLabClientTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
private MockServerClient mockServerClient;
private String gitLabUrl;
... | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | v3Request = versionRequest(V3GitLabApiProxy.ID); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClientTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.API_TOKEN;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.addGitLabApiToken;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.Tes... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class AutodetectingGitLabClientTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
private MockServerClient mockServerClient;
private String gitLabUrl;
... | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | mockServerClient.when(v3Request).respond(responseOk()); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClientTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.API_TOKEN;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.addGitLabApiToken;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.Tes... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class AutodetectingGitLabClientTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
private MockServerClient mockServerClient;
private String gitLabUrl;
... | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | assertApiImpl(api, V3GitLabApiProxy.class); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClientTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.API_TOKEN;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.addGitLabApiToken;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.Tes... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class AutodetectingGitLabClientTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
private MockServerClient mockServerClient;
private String gitLabUrl;
... | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static final String API_TOKEN = "secret";
//
// Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void addGitLabApiToken() throws IOException {
// for (CredentialsStore credentialsStore... | mockServerClient.when(v3Request).respond(responseNotFound()); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilderTest.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java
// @Extension
// @Restricted(NoExternalUse.class)
// public final class AutodetectGitLabClientBuilder extends GitLabClientBuilder {
// public AutodetectGitLabClientBuilder() {
// super("autodetect", 0);
//... | import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectGitLabClientBuilder;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.V3GitLabClientBuilder;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.... | package com.dabsquared.gitlabjenkins.gitlab.api;
public class GitLabClientBuilderTest {
@Rule
public JenkinsRule jenkins = new JenkinsRule();
@Test
public void getAllGitLabClientBuilders_list_is_sorted_by_ordinal() {
List<GitLabClientBuilder> builders = GitLabClientBuilder.getAllGitLabClient... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java
// @Extension
// @Restricted(NoExternalUse.class)
// public final class AutodetectGitLabClientBuilder extends GitLabClientBuilder {
// public AutodetectGitLabClientBuilder() {
// super("autodetect", 0);
//... | assertThat(builders.get(0), instanceOf(AutodetectGitLabClientBuilder.class)); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilderTest.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java
// @Extension
// @Restricted(NoExternalUse.class)
// public final class AutodetectGitLabClientBuilder extends GitLabClientBuilder {
// public AutodetectGitLabClientBuilder() {
// super("autodetect", 0);
//... | import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectGitLabClientBuilder;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.V3GitLabClientBuilder;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.... | package com.dabsquared.gitlabjenkins.gitlab.api;
public class GitLabClientBuilderTest {
@Rule
public JenkinsRule jenkins = new JenkinsRule();
@Test
public void getAllGitLabClientBuilders_list_is_sorted_by_ordinal() {
List<GitLabClientBuilder> builders = GitLabClientBuilder.getAllGitLabClient... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java
// @Extension
// @Restricted(NoExternalUse.class)
// public final class AutodetectGitLabClientBuilder extends GitLabClientBuilder {
// public AutodetectGitLabClientBuilder() {
// super("autodetect", 0);
//... | assertThat(builders.get(1), instanceOf(V4GitLabClientBuilder.class)); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilderTest.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java
// @Extension
// @Restricted(NoExternalUse.class)
// public final class AutodetectGitLabClientBuilder extends GitLabClientBuilder {
// public AutodetectGitLabClientBuilder() {
// super("autodetect", 0);
//... | import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectGitLabClientBuilder;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.V3GitLabClientBuilder;
import com.dabsquared.gitlabjenkins.gitlab.api.impl.... | package com.dabsquared.gitlabjenkins.gitlab.api;
public class GitLabClientBuilderTest {
@Rule
public JenkinsRule jenkins = new JenkinsRule();
@Test
public void getAllGitLabClientBuilders_list_is_sorted_by_ordinal() {
List<GitLabClientBuilder> builders = GitLabClientBuilder.getAllGitLabClient... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java
// @Extension
// @Restricted(NoExternalUse.class)
// public final class AutodetectGitLabClientBuilder extends GitLabClientBuilder {
// public AutodetectGitLabClientBuilder() {
// super("autodetect", 0);
//... | assertThat(builders.get(2), instanceOf(V3GitLabClientBuilder.class)); |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/workflow/AcceptGitLabMergeRequestStep.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | import static com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.getClient;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ws.rs.ProcessingException;
import javax.ws.rs.WebApplicationException;
imp... | @DataBoundSetter
public void setMergeCommitMessage(String mergeCommitMessage) {
this.mergeCommitMessage = StringUtils.isEmpty(mergeCommitMessage) ? null : mergeCommitMessage;
}
@DataBoundSetter
public void setUseMRDescription(boolean useMRDescription) {
this.useMRDescription = useM... | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | GitLabWebHookCause cause = run.getCause(GitLabWebHookCause.class); |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/workflow/AcceptGitLabMergeRequestStep.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | import static com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.getClient;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ws.rs.ProcessingException;
import javax.ws.rs.WebApplicationException;
imp... |
@DataBoundSetter
public void setUseMRDescription(boolean useMRDescription) {
this.useMRDescription = useMRDescription;
}
@DataBoundSetter
public void setRemoveSourceBranch(boolean removeSourceBranch) {
this.removeSourceBranch = removeSourceBranch;
}
public static class A... | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | GitLabClient client = getClient(run); |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/publisher/GitLabAcceptMergeRequestPublisher.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import com.dabsquared.gitlabjenkins.gitlab.api.model.MergeRequest;
import hudson.Extension;
import hudson.model.AbstractProject;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.tasks.BuildStepDescriptor;
im... | package com.dabsquared.gitlabjenkins.publisher;
/**
* @author Robin Müller
*/
public class GitLabAcceptMergeRequestPublisher extends MergeRequestNotifier {
private static final Logger LOGGER = Logger.getLogger(GitLabAcceptMergeRequestPublisher.class.getName());
private Boolean deleteSourceBranch;
@D... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | protected void perform(Run<?, ?> build, TaskListener listener, GitLabClient client, MergeRequest mergeRequest) { |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/testhelpers/GitLabPushRequestSamples_8_1_2_8c8af7b.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/hook/model/PushHook.java
// @GeneratePojoBuilder(intoPackage = "*.builder.generated", withFactoryMethod = "*")
// public class PushHook extends WebHook {
//
// private String before;
// private String after;
// private String ref;
// private In... | import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.CommitBuilder.commit;
import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.PushHookBuilder.pushHook;
import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.RepositoryBuilder.repository;
impor... | package com.dabsquared.gitlabjenkins.testhelpers;
public class GitLabPushRequestSamples_8_1_2_8c8af7b implements GitLabPushRequestSamples {
private static final String ZERO_SHA = "0000000000000000000000000000000000000000";
private static final String COMMIT_25 = "258d6f6e21e6dda343f6e9f8e78c38f12bb81c87";
... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/hook/model/PushHook.java
// @GeneratePojoBuilder(intoPackage = "*.builder.generated", withFactoryMethod = "*")
// public class PushHook extends WebHook {
//
// private String before;
// private String after;
// private String ref;
// private In... | public PushHook pushBrandNewMasterBranchRequest() { |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder;
import hudson.Extension;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.ArrayList... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
@Extension
@Restricted(NoExternalUse.class) | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | public final class AutodetectGitLabClientBuilder extends GitLabClientBuilder { |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectGitLabClientBuilder.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder;
import hudson.Extension;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.ArrayList... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
@Extension
@Restricted(NoExternalUse.class)
public final class AutodetectGitLabClientBuilder extends GitLabClientBuilder {
public AutodetectGitLabClientBuilder() {
super("autodetect", 0);
}
@Override
@NonNull | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | public GitLabClient buildClient(String url, String token, boolean ignoreCertificateErrors, int connectionTimeout, int readTimeout) { |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.Cr... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
class TestUtility {
static final String API_TOKEN = "secret";
private static final String API_TOKEN_ID = "apiTokenId";
private static final boolean IGNORE_CERTIFICATE_ERRORS = true;
private static final int CONNECTION_TIMEOUT = 10;
private sta... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | static GitLabClient buildClientWithDefaults(GitLabClientBuilder clientBuilder, String url) { |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.Cr... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
class TestUtility {
static final String API_TOKEN = "secret";
private static final String API_TOKEN_ID = "apiTokenId";
private static final boolean IGNORE_CERTIFICATE_ERRORS = true;
private static final int CONNECTION_TIMEOUT = 10;
private sta... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | static GitLabClient buildClientWithDefaults(GitLabClientBuilder clientBuilder, String url) { |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/util/ProjectIdUtilTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/util/ProjectIdUtilTest.java
// static TestData forRemoteUrl(String baseUrl, String remoteUrl) {
// return new TestData(baseUrl, remoteUrl);
// }
//
// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {... | import static com.dabsquared.gitlabjenkins.util.ProjectIdUtilTest.TestData.forRemoteUrl;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import org.junit.experimental.theories.DataPoints;
import org.junit.exper... | package com.dabsquared.gitlabjenkins.util;
/**
* @author Robin Müller
*/
@RunWith(Theories.class)
public class ProjectIdUtilTest {
@DataPoints
public static TestData[] testData = { | // Path: src/test/java/com/dabsquared/gitlabjenkins/util/ProjectIdUtilTest.java
// static TestData forRemoteUrl(String baseUrl, String remoteUrl) {
// return new TestData(baseUrl, remoteUrl);
// }
//
// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {... | forRemoteUrl("git@gitlab.com", "git@gitlab.com:test/project.git").expectProjectId("test/project"), |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/util/ProjectIdUtilTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/util/ProjectIdUtilTest.java
// static TestData forRemoteUrl(String baseUrl, String remoteUrl) {
// return new TestData(baseUrl, remoteUrl);
// }
//
// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {... | import static com.dabsquared.gitlabjenkins.util.ProjectIdUtilTest.TestData.forRemoteUrl;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import org.junit.experimental.theories.DataPoints;
import org.junit.exper... | package com.dabsquared.gitlabjenkins.util;
/**
* @author Robin Müller
*/
@RunWith(Theories.class)
public class ProjectIdUtilTest {
@DataPoints
public static TestData[] testData = {
forRemoteUrl("git@gitlab.com", "git@gitlab.com:test/project.git").expectProjectId("test/project"),
forRemoteU... | // Path: src/test/java/com/dabsquared/gitlabjenkins/util/ProjectIdUtilTest.java
// static TestData forRemoteUrl(String baseUrl, String remoteUrl) {
// return new TestData(baseUrl, remoteUrl);
// }
//
// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {... | GitLabClient client = new GitLabClientStub(testData.hostUrl); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/testhelpers/GitLabPushRequestSamples_7_5_1_36679b5.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/hook/model/PushHook.java
// @GeneratePojoBuilder(intoPackage = "*.builder.generated", withFactoryMethod = "*")
// public class PushHook extends WebHook {
//
// private String before;
// private String after;
// private String ref;
// private In... | import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.CommitBuilder.commit;
import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.PushHookBuilder.pushHook;
import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.RepositoryBuilder.repository;
impor... | package com.dabsquared.gitlabjenkins.testhelpers;
public class GitLabPushRequestSamples_7_5_1_36679b5 implements GitLabPushRequestSamples {
private static final String ZERO_SHA = "0000000000000000000000000000000000000000";
| // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/hook/model/PushHook.java
// @GeneratePojoBuilder(intoPackage = "*.builder.generated", withFactoryMethod = "*")
// public class PushHook extends WebHook {
//
// private String before;
// private String after;
// private String ref;
// private In... | public PushHook pushBrandNewMasterBranchRequest() { |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/testhelpers/GitLabPushRequestSamples_7_10_5_489b413.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/hook/model/PushHook.java
// @GeneratePojoBuilder(intoPackage = "*.builder.generated", withFactoryMethod = "*")
// public class PushHook extends WebHook {
//
// private String before;
// private String after;
// private String ref;
// private In... | import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.CommitBuilder.commit;
import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.PushHookBuilder.pushHook;
import static com.dabsquared.gitlabjenkins.gitlab.hook.model.builder.generated.RepositoryBuilder.repository;
impor... | package com.dabsquared.gitlabjenkins.testhelpers;
public class GitLabPushRequestSamples_7_10_5_489b413 implements GitLabPushRequestSamples {
private static final String ZERO_SHA = "0000000000000000000000000000000000000000";
private static final String COMMIT_7A = "7a5db3baf5d42b4218a2a501c88f745559b1d24c";
... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/hook/model/PushHook.java
// @GeneratePojoBuilder(intoPackage = "*.builder.generated", withFactoryMethod = "*")
// public class PushHook extends WebHook {
//
// private String before;
// private String after;
// private String ref;
// private In... | public PushHook pushBrandNewMasterBranchRequest() { |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionConfig.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import hudson.Extension;
import hudson.ExtensionList;
import hudson.model.Item;
import jenkins.model.GlobalConfiguration;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import java.util.ArrayList;
import java.util... |
public boolean isUseAuthenticatedEndpoint() {
return useAuthenticatedEndpoint;
}
@DataBoundSetter
public void setUseAuthenticatedEndpoint(boolean useAuthenticatedEndpoint) {
this.useAuthenticatedEndpoint = useAuthenticatedEndpoint;
save();
}
public List<GitLabConnectio... | // Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
// String getHostUrl();
//
// Project createProject(String projectName);
//
// MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// ... | public GitLabClient getClient(String connectionName, Item item, String jobCredentialId) { |
jenkinsci/gitlab-plugin | src/main/java/com/dabsquared/gitlabjenkins/environment/GitLabEnvironmentContributor.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | import com.dabsquared.gitlabjenkins.cause.GitLabWebHookCause;
import hudson.EnvVars;
import hudson.Extension;
import hudson.matrix.MatrixRun;
import hudson.matrix.MatrixBuild;
import hudson.model.EnvironmentContributor;
import hudson.model.Run;
import hudson.model.TaskListener;
import edu.umd.cs.findbugs.annotations.No... | package com.dabsquared.gitlabjenkins.environment;
/**
* @author Robin Müller
*/
@Extension
public class GitLabEnvironmentContributor extends EnvironmentContributor {
@Override
public void buildEnvironmentFor(@NonNull Run r, @NonNull EnvVars envs, @NonNull TaskListener listener) throws IOException, Interrup... | // Path: src/main/java/com/dabsquared/gitlabjenkins/cause/GitLabWebHookCause.java
// @ExportedBean
// public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {
//
// private final CauseData data;
//
// public GitLabWebHookCause(CauseData data) {
// super("");
// this.data = Objects.... | GitLabWebHookCause cause = null; |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/ResteasyGitLabClientBuilderTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void assertApiImpl(GitLabClient client, Class<? extends GitLabApiProxy> apiImplClass) throws Exception {
// Field apiField = ((ResteasyGitLabClient) client).getClass().getDeclaredField("api");
// apiField.setAccessibl... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.buildClientWithDefaults;
import static org.junit.Assert.assertNotNull;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder;
import hudson.ProxyConfi... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class ResteasyGitLabClientBuilderTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
@Test
public void buildClient() throws Exception { | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void assertApiImpl(GitLabClient client, Class<? extends GitLabApiProxy> apiImplClass) throws Exception {
// Field apiField = ((ResteasyGitLabClient) client).getClass().getDeclaredField("api");
// apiField.setAccessibl... | GitLabClientBuilder clientBuilder = new ResteasyGitLabClientBuilder("test", 0, V3GitLabApiProxy.class, null); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/ResteasyGitLabClientBuilderTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void assertApiImpl(GitLabClient client, Class<? extends GitLabApiProxy> apiImplClass) throws Exception {
// Field apiField = ((ResteasyGitLabClient) client).getClass().getDeclaredField("api");
// apiField.setAccessibl... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.buildClientWithDefaults;
import static org.junit.Assert.assertNotNull;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder;
import hudson.ProxyConfi... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class ResteasyGitLabClientBuilderTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
@Test
public void buildClient() throws Exception {
GitLabClien... | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void assertApiImpl(GitLabClient client, Class<? extends GitLabApiProxy> apiImplClass) throws Exception {
// Field apiField = ((ResteasyGitLabClient) client).getClass().getDeclaredField("api");
// apiField.setAccessibl... | assertApiImpl(buildClientWithDefaults(clientBuilder, "http://localhost/"), V3GitLabApiProxy.class); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/ResteasyGitLabClientBuilderTest.java | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void assertApiImpl(GitLabClient client, Class<? extends GitLabApiProxy> apiImplClass) throws Exception {
// Field apiField = ((ResteasyGitLabClient) client).getClass().getDeclaredField("api");
// apiField.setAccessibl... | import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.assertApiImpl;
import static com.dabsquared.gitlabjenkins.gitlab.api.impl.TestUtility.buildClientWithDefaults;
import static org.junit.Assert.assertNotNull;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder;
import hudson.ProxyConfi... | package com.dabsquared.gitlabjenkins.gitlab.api.impl;
public class ResteasyGitLabClientBuilderTest {
@Rule
public MockServerRule mockServer = new MockServerRule(this);
@Rule
public JenkinsRule jenkins = new JenkinsRule();
@Test
public void buildClient() throws Exception {
GitLabClien... | // Path: src/test/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/TestUtility.java
// static void assertApiImpl(GitLabClient client, Class<? extends GitLabApiProxy> apiImplClass) throws Exception {
// Field apiField = ((ResteasyGitLabClient) client).getClass().getDeclaredField("api");
// apiField.setAccessibl... | assertApiImpl(buildClientWithDefaults(clientBuilder, "http://localhost/"), V3GitLabApiProxy.class); |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionConfigSSLTest.java | // Path: src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnection.java
// @Extension
// public static class DescriptorImpl extends Descriptor<GitLabConnection> {
// public FormValidation doCheckName(@QueryParameter String id, @QueryParameter String value) {
// if (StringUtils.isEmptyOrNull(val... | import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.CredentialsScope;
import com.cloudbees.plugins.credentials.Crede... | public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
response.setStatus(HttpServletResponse.SC_OK);
baseRequest.setHandled(true);
}
}
... | // Path: src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnection.java
// @Extension
// public static class DescriptorImpl extends Descriptor<GitLabConnection> {
// public FormValidation doCheckName(@QueryParameter String id, @QueryParameter String value) {
// if (StringUtils.isEmptyOrNull(val... | GitLabConnection.DescriptorImpl descriptor = (DescriptorImpl) jenkins.jenkins.getDescriptor(GitLabConnection.class); |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/VariableTable.java | // Path: src/java/net/rkoubou/kspparser/analyzer/Variable.java
// public class Variable extends SymbolDefinition
// {
// /** 元となるASTノード */
// public final ASTVariableDeclaration astNode;
//
// /** 配列型の場合の要素数 */
// public int arraySize = 0;
//
// /**
// * UI型変数の場合に値がセットされる(シンボル収集フェーズ)
// ... | import net.rkoubou.kspparser.analyzer.Variable;
import net.rkoubou.kspparser.analyzer.SymbolDefinition.SymbolType;
import net.rkoubou.kspparser.javacc.generated.ASTVariableDeclaration; | * 変数テーブルへの追加
*/
@Override
public boolean add( ASTVariableDeclaration decl )
{
Variable v = new Variable( decl );
return add( v );
}
/**
* 変数テーブルへの追加
*/
public boolean add( Variable v )
{
final String name = v.getName();
if( table.containsK... | // Path: src/java/net/rkoubou/kspparser/analyzer/Variable.java
// public class Variable extends SymbolDefinition
// {
// /** 元となるASTノード */
// public final ASTVariableDeclaration astNode;
//
// /** 配列型の場合の要素数 */
// public int arraySize = 0;
//
// /**
// * UI型変数の場合に値がセットされる(シンボル収集フェーズ)
// ... | v.symbolType = SymbolType.Variable; |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/Argument.java | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTVariableDeclaration.java
// public
// class ASTVariableDeclaration extends SimpleNode {
// public ASTVariableDeclaration(int id) {
// super(id);
// }
//
// public ASTVariableDeclaration(KSPParser p, int id) {
// super(p, id);
// }
//
//
// ... | import net.rkoubou.kspparser.javacc.generated.ASTVariableDeclaration; | /* =========================================================================
Argument.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* 引数の変数の中間表現を示す
*/
public class Argument extends Variable
{
/** ... | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTVariableDeclaration.java
// public
// class ASTVariableDeclaration extends SimpleNode {
// public ASTVariableDeclaration(int id) {
// super(id);
// }
//
// public ASTVariableDeclaration(KSPParser p, int id) {
// super(p, id);
// }
//
//
// ... | public Argument( ASTVariableDeclaration node ) |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/UserFunction.java | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTUserFunctionDeclaration.java
// public
// class ASTUserFunctionDeclaration extends SimpleNode {
// public ASTUserFunctionDeclaration(int id) {
// super(id);
// }
//
// public ASTUserFunctionDeclaration(KSPParser p, int id) {
// super(p, id);
// ... | import net.rkoubou.kspparser.javacc.generated.ASTUserFunctionDeclaration; | /* =========================================================================
UserFunction.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* ユーザー定義関数の中間表現を示す
*/
public class UserFunction extends SymbolDe... | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTUserFunctionDeclaration.java
// public
// class ASTUserFunctionDeclaration extends SimpleNode {
// public ASTUserFunctionDeclaration(int id) {
// super(id);
// }
//
// public ASTUserFunctionDeclaration(KSPParser p, int id) {
// super(p, id);
// ... | public final ASTUserFunctionDeclaration astNode; |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/CommandTable.java | // Path: src/java/net/rkoubou/kspparser/analyzer/SymbolDefinition.java
// public enum SymbolType
// {
// Unknown,
// Callback,
// Command,
// UserFunction,
// Variable,
// Literal,
// Expression,
// PreprocessorSymbol,
// };
//
// Path: src/java/net/rkoubou/kspparser/javacc/generated/AS... | import net.rkoubou.kspparser.analyzer.SymbolDefinition.SymbolType;
import net.rkoubou.kspparser.javacc.generated.ASTCallCommand; | /* =========================================================================
CommandTable.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* KSPコマンド定義テーブル
*/
public class CommandTable extends SymbolTable... | // Path: src/java/net/rkoubou/kspparser/analyzer/SymbolDefinition.java
// public enum SymbolType
// {
// Unknown,
// Callback,
// Command,
// UserFunction,
// Variable,
// Literal,
// Expression,
// PreprocessorSymbol,
// };
//
// Path: src/java/net/rkoubou/kspparser/javacc/generated/AS... | c.symbolType = SymbolType.Command; |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/util/KSPParserProperties.java | // Path: src/java/net/rkoubou/kspparser/ApplicationConstants.java
// public class ApplicationConstants
// {
// /** VM引数 -D dataフォルダの明示的指定時のプロパティ名 */
// static public final String SYSTEM_PROPERTY_DATADIR = "kspparser.datadir";
//
// /** VM引数 -Dkspparser.datadir がなかった時のデフォルトの dataフォルダの相対パス */
// static p... | import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import net.rkoubou.kspparser.ApplicationConstants; | /* =========================================================================
KSPParserProperties.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.util;
public class KSPParserProperties
{
/** プロパティ格納先 */
protect... | // Path: src/java/net/rkoubou/kspparser/ApplicationConstants.java
// public class ApplicationConstants
// {
// /** VM引数 -D dataフォルダの明示的指定時のプロパティ名 */
// static public final String SYSTEM_PROPERTY_DATADIR = "kspparser.datadir";
//
// /** VM引数 -Dkspparser.datadir がなかった時のデフォルトの dataフォルダの相対パス */
// static p... | this( path, ApplicationConstants.DATA_DIR ); |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/PreProcessorSymbol.java | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTPreProcessorDefine.java
// public
// class ASTPreProcessorDefine extends SimpleNode {
// public ASTPreProcessorDefine(int id) {
// super(id);
// }
//
// public ASTPreProcessorDefine(KSPParser p, int id) {
// super(p, id);
// }
//
//
// /**... | import net.rkoubou.kspparser.javacc.generated.ASTPreProcessorDefine; | /* =========================================================================
PreProcessorSymbol.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* プリプロセッサで定義したシンボルの中間表現を示す
*/
public class PreProcessorSym... | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTPreProcessorDefine.java
// public
// class ASTPreProcessorDefine extends SimpleNode {
// public ASTPreProcessorDefine(int id) {
// super(id);
// }
//
// public ASTPreProcessorDefine(KSPParser p, int id) {
// super(p, id);
// }
//
//
// /**... | public final ASTPreProcessorDefine astNode; |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/KSPLanguageLimitations.java | // Path: src/java/net/rkoubou/kspparser/util/KSPParserProperties.java
// public class KSPParserProperties
// {
// /** プロパティ格納先 */
// protected Properties properties = new Properties();
//
// /**
// * ctor.
// */
// public KSPParserProperties( String path ) throws IOException
// {
// ... | import net.rkoubou.kspparser.util.KSPParserProperties; | /* =========================================================================
KSPLanguageLimitations.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* KSPの言語仕様、バグなどに起因するパラメータ類の限界値の定義
*/
public class KSPL... | // Path: src/java/net/rkoubou/kspparser/util/KSPParserProperties.java
// public class KSPParserProperties
// {
// /** プロパティ格納先 */
// protected Properties properties = new Properties();
//
// /**
// * ctor.
// */
// public KSPParserProperties( String path ) throws IOException
// {
// ... | KSPParserProperties p = new KSPParserProperties( PROPERTIES_PATH ); |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/Position.java | // Path: src/java/net/rkoubou/kspparser/javacc/generated/Token.java
// public class Token implements java.io.Serializable {
//
// /**
// * The version identifier for this Serializable class.
// * Increment only if the <i>serialized</i> form of the
// * class changes.
// */
// private static final long ... | import net.rkoubou.kspparser.javacc.generated.Token; | /* =========================================================================
Position.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* シンボル等の行番号、列を格納する
*/
public class Position
{
public int beginLi... | // Path: src/java/net/rkoubou/kspparser/javacc/generated/Token.java
// public class Token implements java.io.Serializable {
//
// /**
// * The version identifier for this Serializable class.
// * Increment only if the <i>serialized</i> form of the
// * class changes.
// */
// private static final long ... | static public void copy( Token src, Position dest ) |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/CallbackTable.java | // Path: src/java/net/rkoubou/kspparser/analyzer/SymbolDefinition.java
// public enum SymbolType
// {
// Unknown,
// Callback,
// Command,
// UserFunction,
// Variable,
// Literal,
// Expression,
// PreprocessorSymbol,
// };
//
// Path: src/java/net/rkoubou/kspparser/javacc/generated/AS... | import net.rkoubou.kspparser.analyzer.SymbolDefinition.SymbolType;
import net.rkoubou.kspparser.javacc.generated.ASTCallbackDeclaration;
import net.rkoubou.kspparser.javacc.generated.KSPParserTreeConstants; | */
public boolean add( Callback c, String name )
{
if( table.containsKey( name ) )
{
//--------------------------------------------------------------------------
// 宣言済み
//--------------------------------------------------------------------------
... | // Path: src/java/net/rkoubou/kspparser/analyzer/SymbolDefinition.java
// public enum SymbolType
// {
// Unknown,
// Callback,
// Command,
// UserFunction,
// Variable,
// Literal,
// Expression,
// PreprocessorSymbol,
// };
//
// Path: src/java/net/rkoubou/kspparser/javacc/generated/AS... | c.symbolType = SymbolType.Callback; |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/UserFunctionTable.java | // Path: src/java/net/rkoubou/kspparser/analyzer/SymbolDefinition.java
// public enum SymbolType
// {
// Unknown,
// Callback,
// Command,
// UserFunction,
// Variable,
// Literal,
// Expression,
// PreprocessorSymbol,
// };
//
// Path: src/java/net/rkoubou/kspparser/javacc/generated/AS... | import net.rkoubou.kspparser.analyzer.SymbolDefinition.SymbolType;
import net.rkoubou.kspparser.javacc.generated.ASTUserFunctionDeclaration; | /* =========================================================================
UserFunctionTable.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* ユーザー定義関数テーブル
*/
public class UserFunctionTable extends Sy... | // Path: src/java/net/rkoubou/kspparser/analyzer/SymbolDefinition.java
// public enum SymbolType
// {
// Unknown,
// Callback,
// Command,
// UserFunction,
// Variable,
// Literal,
// Expression,
// PreprocessorSymbol,
// };
//
// Path: src/java/net/rkoubou/kspparser/javacc/generated/AS... | c.symbolType = SymbolType.UserFunction; |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/util/table/SeparatedTextParser.java | // Path: src/java/net/rkoubou/kspparser/util/StreamCloser.java
// public class StreamCloser
// {
// /**
// * ctor.
// */
// private StreamCloser(){}
//
// /**
// * 指定されたストリームのクローズ
// */
// static public void close( InputStream in )
// {
// try{ in.close(); } catch( Throw... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.regex.Pattern;
import net.rkoubou.kspparser.util.StreamCloser; | }
/**
* 指定された入力ストリームからパースを実行する
*/
public void parse( InputStream in ) throws IOException
{
BufferedReader br = null;
try
{
String line;
br = new BufferedReader( new InputStreamReader( in, encoding ) );
while( ( line = br.readLine() )... | // Path: src/java/net/rkoubou/kspparser/util/StreamCloser.java
// public class StreamCloser
// {
// /**
// * ctor.
// */
// private StreamCloser(){}
//
// /**
// * 指定されたストリームのクローズ
// */
// static public void close( InputStream in )
// {
// try{ in.close(); } catch( Throw... | StreamCloser.close( br ); |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/Variable.java | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTVariableDeclaration.java
// public
// class ASTVariableDeclaration extends SimpleNode {
// public ASTVariableDeclaration(int id) {
// super(id);
// }
//
// public ASTVariableDeclaration(KSPParser p, int id) {
// super(p, id);
// }
//
//
// ... | import net.rkoubou.kspparser.javacc.generated.ASTVariableDeclaration; | /* =========================================================================
Variable.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* KSPの値、変数の中間表現を示す
*/
public class Variable extends SymbolDefinition... | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTVariableDeclaration.java
// public
// class ASTVariableDeclaration extends SimpleNode {
// public ASTVariableDeclaration(int id) {
// super(id);
// }
//
// public ASTVariableDeclaration(KSPParser p, int id) {
// super(p, id);
// }
//
//
// ... | public final ASTVariableDeclaration astNode; |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/PreProcessorSymbolTable.java | // Path: src/java/net/rkoubou/kspparser/analyzer/SymbolDefinition.java
// public enum SymbolType
// {
// Unknown,
// Callback,
// Command,
// UserFunction,
// Variable,
// Literal,
// Expression,
// PreprocessorSymbol,
// };
//
// Path: src/java/net/rkoubou/kspparser/javacc/generated/AS... | import net.rkoubou.kspparser.analyzer.SymbolDefinition.SymbolType;
import net.rkoubou.kspparser.javacc.generated.ASTPreProcessorDefine;
import net.rkoubou.kspparser.javacc.generated.ASTPreProcessorUnDefine;
import net.rkoubou.kspparser.javacc.generated.KSPParserTreeConstants; | /**
* プリプロセッサシンボルテーブルへの追加
*/
@Override
public boolean add( ASTPreProcessorDefine decl )
{
return add( new PreProcessorSymbol( decl ) );
}
/**
* プリプロセッサシンボルテーブルへの追加
*/
public boolean add( PreProcessorSymbol c )
{
final String name = c.getName();
... | // Path: src/java/net/rkoubou/kspparser/analyzer/SymbolDefinition.java
// public enum SymbolType
// {
// Unknown,
// Callback,
// Command,
// UserFunction,
// Variable,
// Literal,
// Expression,
// PreprocessorSymbol,
// };
//
// Path: src/java/net/rkoubou/kspparser/javacc/generated/AS... | public boolean remove( ASTPreProcessorUnDefine undef ) |
r-koubou/KSPSyntaxParser | src/java/net/rkoubou/kspparser/analyzer/Command.java | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTCallCommand.java
// public
// class ASTCallCommand extends SimpleNode {
// public ASTCallCommand(int id) {
// super(id);
// }
//
// public ASTCallCommand(KSPParser p, int id) {
// super(p, id);
// }
//
//
// /** Accept the visitor. **/
// ... | import java.util.ArrayList;
import java.util.HashMap;
import net.rkoubou.kspparser.javacc.generated.ASTCallCommand;
import net.rkoubou.kspparser.javacc.generated.KSPParserTreeConstants; | /* =========================================================================
Command.java
Copyright (c) R-Koubou
======================================================================== */
package net.rkoubou.kspparser.analyzer;
/**
* コマンドの中間表現を示す
*/
public class Command extends SymbolDefinition impl... | // Path: src/java/net/rkoubou/kspparser/javacc/generated/ASTCallCommand.java
// public
// class ASTCallCommand extends SimpleNode {
// public ASTCallCommand(int id) {
// super(id);
// }
//
// public ASTCallCommand(KSPParser p, int id) {
// super(p, id);
// }
//
//
// /** Accept the visitor. **/
// ... | public final ASTCallCommand astNode; |
xbacinsk/White-box_cipher_java | src/main/java/cz/muni/fi/xklinec/whiteboxAES/generator/GTBox8to32.java | // Path: src/main/java/cz/muni/fi/xklinec/whiteboxAES/generator/Generator.java
// public static class W08x32Coding extends W08xZZCODING{
// public W08x32Coding() {
// super(4);
// }
// }
//
// Path: src/main/java/cz/muni/fi/xklinec/whiteboxAES/generator/Generator.java
// public static class XORCODING {... | import cz.muni.fi.xklinec.whiteboxAES.generator.Generator.W08x32Coding;
import cz.muni.fi.xklinec.whiteboxAES.generator.Generator.XORCODING; | /*
* Copyright (c) 2014, Dusan (Ph4r05) Klinec, Petr Svenda
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this... | // Path: src/main/java/cz/muni/fi/xklinec/whiteboxAES/generator/Generator.java
// public static class W08x32Coding extends W08xZZCODING{
// public W08x32Coding() {
// super(4);
// }
// }
//
// Path: src/main/java/cz/muni/fi/xklinec/whiteboxAES/generator/Generator.java
// public static class XORCODING {... | XORCODING[] xcod = c.getCod(); |
leelit/STUer-client | app/src/androidTest/java/com/leelit/stuer/dao/SellDaoTest.java | // Path: app/src/main/java/com/leelit/stuer/bean/SellInfo.java
// public class SellInfo {
// int id;
// String name;
// String tel;
// String shortTel;
// String wechat;
// String datetime;
// String imei;
// String picAddress;
// String state;
// String uniquecode; // attention ... | import android.util.Log;
import com.leelit.stuer.bean.SellInfo;
import junit.framework.TestCase;
import java.util.ArrayList;
import java.util.List; | package com.leelit.stuer.dao;
/**
* Created by Leelit on 2016/3/16.
*/
public class SellDaoTest extends TestCase {
private static final String[] keys = {"name", "tel", "shorttel", "wechat", "dt", "imei", "picaddress", "state", "flag", "status"};
public void testSave() throws Exception {
SellDa... | // Path: app/src/main/java/com/leelit/stuer/bean/SellInfo.java
// public class SellInfo {
// int id;
// String name;
// String tel;
// String shortTel;
// String wechat;
// String datetime;
// String imei;
// String picAddress;
// String state;
// String uniquecode; // attention ... | List<SellInfo> list = new ArrayList<>(); |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_baseinfo/carpool/model/CarpoolService.java | // Path: app/src/main/java/com/leelit/stuer/bean/CarpoolingInfo.java
// public class CarpoolingInfo extends BaseInfo {
//
// String route;
//
// @Override
// public String toString() {
// return "CarpoolingInfo{" +
// "id=" + id +
// ", name='" + name + '\'' +
// ... | import com.leelit.stuer.bean.CarpoolingInfo;
import java.util.List;
import java.util.Map;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable; | package com.leelit.stuer.module_baseinfo.carpool.model;
/**
* Created by Leelit on 2016/3/8.
*/
public interface CarpoolService {
@GET("query") | // Path: app/src/main/java/com/leelit/stuer/bean/CarpoolingInfo.java
// public class CarpoolingInfo extends BaseInfo {
//
// String route;
//
// @Override
// public String toString() {
// return "CarpoolingInfo{" +
// "id=" + id +
// ", name='" + name + '\'' +
// ... | Observable<List<CarpoolingInfo>> getGroupRecords(); |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_stu/StuWebViewActivity.java | // Path: app/src/main/java/com/leelit/stuer/utils/UiUtils.java
// public class UiUtils {
//
// @TargetApi(19)
// public static void setTranslucentStatusBar(Activity activity, NavigationView navigationView) {
// if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT && navigationView != null) {
// ... | import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.webkit.DownloadListener;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import a... | package com.leelit.stuer.module_stu;
public class StuWebViewActivity extends AppCompatActivity {
@InjectView(R.id.webView)
WebView mWebView;
@InjectView(R.id.btn_back)
ImageView mBtnBack;
@InjectView(R.id.btn_forward)
ImageView mBtnForward;
@InjectView(R.id.toolbar)
Toolbar mToolbar... | // Path: app/src/main/java/com/leelit/stuer/utils/UiUtils.java
// public class UiUtils {
//
// @TargetApi(19)
// public static void setTranslucentStatusBar(Activity activity, NavigationView navigationView) {
// if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT && navigationView != null) {
// ... | UiUtils.setTranslucentStatusBar(this); |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/dao/SellDao.java | // Path: app/src/main/java/com/leelit/stuer/bean/SellInfo.java
// public class SellInfo {
// int id;
// String name;
// String tel;
// String shortTel;
// String wechat;
// String datetime;
// String imei;
// String picAddress;
// String state;
// String uniquecode; // attention ... | import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.leelit.stuer.bean.SellInfo;
import java.util.ArrayList;
import java.util.List; | package com.leelit.stuer.dao;
/**
* Created by Leelit on 2016/3/16.
*/
public class SellDao {
public static final String[] TABLES = {"sell", "sell_collector"};
| // Path: app/src/main/java/com/leelit/stuer/bean/SellInfo.java
// public class SellInfo {
// int id;
// String name;
// String tel;
// String shortTel;
// String wechat;
// String datetime;
// String imei;
// String picAddress;
// String state;
// String uniquecode; // attention ... | public void save(String whichTable, SellInfo info) { |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_baseinfo/date/model/DateModel.java | // Path: app/src/main/java/com/leelit/stuer/bean/DatingInfo.java
// public class DatingInfo extends BaseInfo {
//
// String type;
// String description = "";
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }... | import com.leelit.stuer.bean.DatingInfo;
import com.leelit.stuer.utils.SupportModelUtils;
import java.util.List;
import java.util.Map;
import okhttp3.ResponseBody;
import retrofit2.GsonConverterFactory;
import retrofit2.Retrofit;
import retrofit2.RxJavaCallAdapterFactory;
import rx.Subscriber; | package com.leelit.stuer.module_baseinfo.date.model;
/**
* Created by Leelit on 2016/3/8.
*/
public class DateModel {
private static final String BASE_URL = SupportModelUtils.HOST + "date/";
private DateService mService = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFa... | // Path: app/src/main/java/com/leelit/stuer/bean/DatingInfo.java
// public class DatingInfo extends BaseInfo {
//
// String type;
// String description = "";
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }... | public void getGroupRecords(String type, Subscriber<List<DatingInfo>> subscriber) { |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_baseinfo/date/presenter/DatePresenter.java | // Path: app/src/main/java/com/leelit/stuer/bean/DatingInfo.java
// public class DatingInfo extends BaseInfo {
//
// String type;
// String description = "";
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }... | import com.leelit.stuer.bean.DatingInfo;
import com.leelit.stuer.constant.NetConstant;
import com.leelit.stuer.base_presenter.IPresenter;
import com.leelit.stuer.base_view.viewinterface.IBaseInfoView;
import com.leelit.stuer.module_baseinfo.date.model.DateModel;
import java.util.List;
import okhttp3.ResponseBody;
impor... | package com.leelit.stuer.module_baseinfo.date.presenter;
/**
* Created by Leelit on 2016/3/8.
*/
public class DatePresenter implements IPresenter {
private DateModel mModel = new DateModel();
| // Path: app/src/main/java/com/leelit/stuer/bean/DatingInfo.java
// public class DatingInfo extends BaseInfo {
//
// String type;
// String description = "";
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }... | private IBaseInfoView mView; |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_baseinfo/date/presenter/DatePresenter.java | // Path: app/src/main/java/com/leelit/stuer/bean/DatingInfo.java
// public class DatingInfo extends BaseInfo {
//
// String type;
// String description = "";
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }... | import com.leelit.stuer.bean.DatingInfo;
import com.leelit.stuer.constant.NetConstant;
import com.leelit.stuer.base_presenter.IPresenter;
import com.leelit.stuer.base_view.viewinterface.IBaseInfoView;
import com.leelit.stuer.module_baseinfo.date.model.DateModel;
import java.util.List;
import okhttp3.ResponseBody;
impor... | package com.leelit.stuer.module_baseinfo.date.presenter;
/**
* Created by Leelit on 2016/3/8.
*/
public class DatePresenter implements IPresenter {
private DateModel mModel = new DateModel();
private IBaseInfoView mView; | // Path: app/src/main/java/com/leelit/stuer/bean/DatingInfo.java
// public class DatingInfo extends BaseInfo {
//
// String type;
// String description = "";
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }... | private Subscriber<List<DatingInfo>> mSubscriber1; |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_baseinfo/date/presenter/DatePresenter.java | // Path: app/src/main/java/com/leelit/stuer/bean/DatingInfo.java
// public class DatingInfo extends BaseInfo {
//
// String type;
// String description = "";
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }... | import com.leelit.stuer.bean.DatingInfo;
import com.leelit.stuer.constant.NetConstant;
import com.leelit.stuer.base_presenter.IPresenter;
import com.leelit.stuer.base_view.viewinterface.IBaseInfoView;
import com.leelit.stuer.module_baseinfo.date.model.DateModel;
import java.util.List;
import okhttp3.ResponseBody;
impor... | public void onError(Throwable e) {
if (mView != null) {
mView.stopRefreshing();
mView.netError();
}
}
@Override
public void onNext(List<DatingInfo> datingInfos) {
mView.stopRefreshing... | // Path: app/src/main/java/com/leelit/stuer/bean/DatingInfo.java
// public class DatingInfo extends BaseInfo {
//
// String type;
// String description = "";
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }... | if (e.toString().split(" ")[2].equals(String.valueOf(NetConstant.NET_ERROR_RECORD_EXISTED))) { |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_baseinfo/carpool/model/CarpoolModel.java | // Path: app/src/main/java/com/leelit/stuer/bean/CarpoolingInfo.java
// public class CarpoolingInfo extends BaseInfo {
//
// String route;
//
// @Override
// public String toString() {
// return "CarpoolingInfo{" +
// "id=" + id +
// ", name='" + name + '\'' +
// ... | import com.leelit.stuer.bean.CarpoolingInfo;
import com.leelit.stuer.utils.SupportModelUtils;
import java.util.List;
import java.util.Map;
import okhttp3.ResponseBody;
import retrofit2.GsonConverterFactory;
import retrofit2.Retrofit;
import retrofit2.RxJavaCallAdapterFactory;
import rx.Subscriber; | package com.leelit.stuer.module_baseinfo.carpool.model;
/**
* Created by Leelit on 2016/3/8.
*/
public class CarpoolModel {
// model此处无法抽象,因为接口不同;
// Retrofit使用Gson进行字符串解析,并且RxJava#Observable<T>不能使用通配符,所以Gson从String-Object时必须指定确切类型,如果指定父类,则会丢失信息。
// 使用Retrofit配合Gson不管是post还是get,解析的类型都是特定的,父类会丢失子类信息。
... | // Path: app/src/main/java/com/leelit/stuer/bean/CarpoolingInfo.java
// public class CarpoolingInfo extends BaseInfo {
//
// String route;
//
// @Override
// public String toString() {
// return "CarpoolingInfo{" +
// "id=" + id +
// ", name='" + name + '\'' +
// ... | public void getGroupRecords(Subscriber<List<CarpoolingInfo>> subscriber) { |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/utils/AppInfoUtils.java | // Path: app/src/main/java/com/leelit/stuer/MyApplication.java
// public class MyApplication extends Application {
//
// public static final String VERSION = "1.1.0";
//
// public static Context context;
//
// @Override
// public void onCreate() {
// super.onCreate();
// context = get... | import android.app.Activity;
import android.telephony.TelephonyManager;
import com.leelit.stuer.MyApplication;
import com.leelit.stuer.R;
import java.util.Date; | package com.leelit.stuer.utils;
/**
* Created by Leelit on 2016/1/6.
*/
public class AppInfoUtils {
public static String getAppName() { | // Path: app/src/main/java/com/leelit/stuer/MyApplication.java
// public class MyApplication extends Application {
//
// public static final String VERSION = "1.1.0";
//
// public static Context context;
//
// @Override
// public void onCreate() {
// super.onCreate();
// context = get... | return MyApplication.context.getString(R.string.app_name); |
leelit/STUer-client | app/src/androidTest/java/com/leelit/stuer/dao/TreeholeDaoTest.java | // Path: app/src/main/java/com/leelit/stuer/bean/TreeholeInfo.java
// public class TreeholeInfo {
// String datetime;
//
// String state;
//
// String picAddress;
//
// String uniquecode;
//
// @Override
// public String toString() {
// return "TreeholeInfo{" +
// "da... | import android.util.Log;
import com.leelit.stuer.bean.TreeholeInfo;
import com.leelit.stuer.utils.AppInfoUtils;
import com.leelit.stuer.utils.TimeUtils;
import junit.framework.TestCase;
import java.util.ArrayList;
import java.util.List; | package com.leelit.stuer.dao;
/**
* Created by Leelit on 2016/3/25.
*/
public class TreeholeDaoTest extends TestCase {
public void testSave() throws Exception { | // Path: app/src/main/java/com/leelit/stuer/bean/TreeholeInfo.java
// public class TreeholeInfo {
// String datetime;
//
// String state;
//
// String picAddress;
//
// String uniquecode;
//
// @Override
// public String toString() {
// return "TreeholeInfo{" +
// "da... | List<TreeholeInfo> treeholeInfos = new ArrayList<>(); |
leelit/STUer-client | app/src/androidTest/java/com/leelit/stuer/dao/TreeholeDaoTest.java | // Path: app/src/main/java/com/leelit/stuer/bean/TreeholeInfo.java
// public class TreeholeInfo {
// String datetime;
//
// String state;
//
// String picAddress;
//
// String uniquecode;
//
// @Override
// public String toString() {
// return "TreeholeInfo{" +
// "da... | import android.util.Log;
import com.leelit.stuer.bean.TreeholeInfo;
import com.leelit.stuer.utils.AppInfoUtils;
import com.leelit.stuer.utils.TimeUtils;
import junit.framework.TestCase;
import java.util.ArrayList;
import java.util.List; | package com.leelit.stuer.dao;
/**
* Created by Leelit on 2016/3/25.
*/
public class TreeholeDaoTest extends TestCase {
public void testSave() throws Exception {
List<TreeholeInfo> treeholeInfos = new ArrayList<>();
for (int i = 0; i < 3; i++) {
TreeholeInfo info = new TreeholeInf... | // Path: app/src/main/java/com/leelit/stuer/bean/TreeholeInfo.java
// public class TreeholeInfo {
// String datetime;
//
// String state;
//
// String picAddress;
//
// String uniquecode;
//
// @Override
// public String toString() {
// return "TreeholeInfo{" +
// "da... | info.setDatetime(TimeUtils.getCurrentTime()); |
leelit/STUer-client | app/src/androidTest/java/com/leelit/stuer/dao/TreeholeDaoTest.java | // Path: app/src/main/java/com/leelit/stuer/bean/TreeholeInfo.java
// public class TreeholeInfo {
// String datetime;
//
// String state;
//
// String picAddress;
//
// String uniquecode;
//
// @Override
// public String toString() {
// return "TreeholeInfo{" +
// "da... | import android.util.Log;
import com.leelit.stuer.bean.TreeholeInfo;
import com.leelit.stuer.utils.AppInfoUtils;
import com.leelit.stuer.utils.TimeUtils;
import junit.framework.TestCase;
import java.util.ArrayList;
import java.util.List; | package com.leelit.stuer.dao;
/**
* Created by Leelit on 2016/3/25.
*/
public class TreeholeDaoTest extends TestCase {
public void testSave() throws Exception {
List<TreeholeInfo> treeholeInfos = new ArrayList<>();
for (int i = 0; i < 3; i++) {
TreeholeInfo info = new TreeholeInf... | // Path: app/src/main/java/com/leelit/stuer/bean/TreeholeInfo.java
// public class TreeholeInfo {
// String datetime;
//
// String state;
//
// String picAddress;
//
// String uniquecode;
//
// @Override
// public String toString() {
// return "TreeholeInfo{" +
// "da... | info.setUniquecode(AppInfoUtils.getUniqueCode()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.