conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
public void testNullTypedef() throws Throwable {
myFixture.configureByFiles("NullTypedef.hx", "std/StdTypes.hx", "std/String.hx");
doTestVariantsInner("NullTypedef.txt");
}
public void testRefTypedef() throws Throwable {
myFixture.configureByFiles("RefTypedef.hx", "std/String.hx");
doTestVariantsInner("RefTypedef.txt");
}
=======
public void testImportGenericSubType() throws Throwable {
myFixture.configureByFiles("ImportGenericSubType.hx", "generic1/ClassWithGenericSubClass.hx", "std/StdTypes.hx");
doTestVariantsInner("ImportGenericSubType.txt");
}
>>>>>>>
public void testImportGenericSubType() throws Throwable {
myFixture.configureByFiles("ImportGenericSubType.hx", "generic1/ClassWithGenericSubClass.hx", "std/StdTypes.hx");
doTestVariantsInner("ImportGenericSubType.txt");
}
public void testNullTypedef() throws Throwable {
myFixture.configureByFiles("NullTypedef.hx", "std/StdTypes.hx", "std/String.hx");
doTestVariantsInner("NullTypedef.txt");
}
public void testRefTypedef() throws Throwable {
myFixture.configureByFiles("RefTypedef.hx", "std/String.hx");
doTestVariantsInner("RefTypedef.txt");
} |
<<<<<<<
else if (root_ == CONSTRUCTOR_NAME) {
result_ = constructorName(builder_, 0);
}
=======
else if (root_ == CONDITIONAL) {
result_ = conditional(builder_, 0);
}
>>>>>>>
else if (root_ == CONDITIONAL) {
result_ = conditional(builder_, 0);
}
else if (root_ == CONSTRUCTOR_NAME) {
result_ = constructorName(builder_, 0);
}
<<<<<<<
else if (root_ == FINAL_META) {
result_ = finalMeta(builder_, 0);
}
=======
else if (root_ == FAT_ARROW_EXPRESSION) {
result_ = fatArrowExpression(builder_, 0);
}
>>>>>>>
else if (root_ == FAT_ARROW_EXPRESSION) {
result_ = fatArrowExpression(builder_, 0);
}
else if (root_ == FINAL_META) {
result_ = finalMeta(builder_, 0);
}
<<<<<<<
// 'new'
public static boolean constructorName(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "constructorName")) return false;
if (!nextTokenIs(builder_, ONEW)) return false;
boolean result_;
Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, ONEW);
exit_section_(builder_, marker_, CONSTRUCTOR_NAME, result_);
return result_;
}
/* ********************************************************** */
=======
// CONDITIONAL_STATEMENT_ID
public static boolean conditional(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "conditional")) return false;
boolean result_;
Marker marker_ = enter_section_(builder_, level_, _NONE_, "<conditional>");
result_ = consumeToken(builder_, CONDITIONAL_STATEMENT_ID);
exit_section_(builder_, level_, marker_, CONDITIONAL, result_, false, conditional_recover_parser_);
return result_;
}
/* ********************************************************** */
// conditional
static boolean conditional_recover(PsiBuilder builder_, int level_) {
return conditional(builder_, level_ + 1);
}
/* ********************************************************** */
>>>>>>>
// CONDITIONAL_STATEMENT_ID
public static boolean conditional(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "conditional")) return false;
boolean result_;
Marker marker_ = enter_section_(builder_, level_, _NONE_, "<conditional>");
result_ = consumeToken(builder_, CONDITIONAL_STATEMENT_ID);
exit_section_(builder_, level_, marker_, CONDITIONAL, result_, false, conditional_recover_parser_);
return result_;
}
/* ********************************************************** */
// conditional
static boolean conditional_recover(PsiBuilder builder_, int level_) {
return conditional(builder_, level_ + 1);
}
/* ********************************************************** */
// 'new'
public static boolean constructorName(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "constructorName")) return false;
if (!nextTokenIs(builder_, ONEW)) return false;
boolean result_;
Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, ONEW);
exit_section_(builder_, marker_, CONSTRUCTOR_NAME, result_);
return result_;
}
/* ********************************************************** */
<<<<<<<
// '@:final'
public static boolean finalMeta(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "finalMeta")) return false;
if (!nextTokenIs(builder_, KFINAL)) return false;
boolean result_;
Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, KFINAL);
exit_section_(builder_, marker_, FINAL_META, result_);
return result_;
}
/* ********************************************************** */
=======
// '=>' assignExpressionWrapper
public static boolean fatArrowExpression(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "fatArrowExpression")) return false;
if (!nextTokenIs(builder_, OFAT_ARROW)) return false;
boolean result_;
boolean pinned_;
Marker marker_ = enter_section_(builder_, level_, _LEFT_, null);
result_ = consumeToken(builder_, OFAT_ARROW);
pinned_ = result_; // pin = 1
result_ = result_ && assignExpressionWrapper(builder_, level_ + 1);
exit_section_(builder_, level_, marker_, FAT_ARROW_EXPRESSION, result_, pinned_, null);
return result_ || pinned_;
}
/* ********************************************************** */
// assignExpressionWrapper fatArrowExpression*
static boolean fatArrowExpressionWrapper(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "fatArrowExpressionWrapper")) return false;
if (!nextTokenIs(builder_, "", ONOT, PLPAREN,
OPLUS_PLUS, OMINUS, OMINUS_MINUS, PLBRACK, KCAST, KFALSE,
KFUNCTION, KIF, ONEW, KNULL, KSUPER, KSWITCH,
KTHIS, KTRUE, KTRY, KUNTYPED, PLCURLY, OCOMPLEMENT,
ID, LITFLOAT, LITHEX, LITINT, LITOCT, OPEN_QUOTE, REG_EXP)) return false;
boolean result_;
Marker marker_ = enter_section_(builder_);
result_ = assignExpressionWrapper(builder_, level_ + 1);
result_ = result_ && fatArrowExpressionWrapper_1(builder_, level_ + 1);
exit_section_(builder_, marker_, null, result_);
return result_;
}
// fatArrowExpression*
private static boolean fatArrowExpressionWrapper_1(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "fatArrowExpressionWrapper_1")) return false;
int pos_ = current_position_(builder_);
while (true) {
if (!fatArrowExpression(builder_, level_ + 1)) break;
if (!empty_element_parsed_guard_(builder_, "fatArrowExpressionWrapper_1", pos_)) break;
pos_ = current_position_(builder_);
}
return true;
}
/* ********************************************************** */
>>>>>>>
// '=>' assignExpressionWrapper
public static boolean fatArrowExpression(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "fatArrowExpression")) return false;
if (!nextTokenIs(builder_, OFAT_ARROW)) return false;
boolean result_;
boolean pinned_;
Marker marker_ = enter_section_(builder_, level_, _LEFT_, null);
result_ = consumeToken(builder_, OFAT_ARROW);
pinned_ = result_; // pin = 1
result_ = result_ && assignExpressionWrapper(builder_, level_ + 1);
exit_section_(builder_, level_, marker_, FAT_ARROW_EXPRESSION, result_, pinned_, null);
return result_ || pinned_;
}
/* ********************************************************** */
// assignExpressionWrapper fatArrowExpression*
static boolean fatArrowExpressionWrapper(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "fatArrowExpressionWrapper")) return false;
if (!nextTokenIs(builder_, "", ONOT, PLPAREN,
OPLUS_PLUS, OMINUS, OMINUS_MINUS, PLBRACK, KCAST, KFALSE,
KFUNCTION, KIF, ONEW, KNULL, KSUPER, KSWITCH,
KTHIS, KTRUE, KTRY, KUNTYPED, PLCURLY, OCOMPLEMENT,
ID, LITFLOAT, LITHEX, LITINT, LITOCT, OPEN_QUOTE, REG_EXP)) return false;
boolean result_;
Marker marker_ = enter_section_(builder_);
result_ = assignExpressionWrapper(builder_, level_ + 1);
result_ = result_ && fatArrowExpressionWrapper_1(builder_, level_ + 1);
exit_section_(builder_, marker_, null, result_);
return result_;
}
// fatArrowExpression*
private static boolean fatArrowExpressionWrapper_1(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "fatArrowExpressionWrapper_1")) return false;
int pos_ = current_position_(builder_);
while (true) {
if (!fatArrowExpression(builder_, level_ + 1)) break;
if (!empty_element_parsed_guard_(builder_, "fatArrowExpressionWrapper_1", pos_)) break;
pos_ = current_position_(builder_);
}
return true;
}
/* ********************************************************** */
// '@:final'
public static boolean finalMeta(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "finalMeta")) return false;
if (!nextTokenIs(builder_, KFINAL)) return false;
boolean result_;
Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, KFINAL);
exit_section_(builder_, marker_, FINAL_META, result_);
return result_;
}
/* ********************************************************** */ |
<<<<<<<
// blockStatement | notBlockStatement
public static boolean statement(PsiBuilder builder_, int level_) {
=======
// blockStatement | notBlockStatement | conditional
static boolean statement(PsiBuilder builder_, int level_) {
>>>>>>>
// blockStatement | notBlockStatement | conditional
public static boolean statement(PsiBuilder builder_, int level_) {
<<<<<<<
exit_section_(builder_, level_, marker_, STATEMENT, result_, false, null);
=======
if (!result_) result_ = conditional(builder_, level_ + 1);
exit_section_(builder_, marker_, null, result_);
>>>>>>>
if (!result_) result_ = conditional(builder_, level_ + 1);
exit_section_(builder_, level_, marker_, STATEMENT, result_, false, null); |
<<<<<<<
public void visitConstructorName(@NotNull HaxeConstructorName o) {
visitPsiCompositeElement(o);
}
=======
public void visitConditional(@NotNull HaxeConditional o) {
visitPsiCompositeElement(o);
}
>>>>>>>
public void visitConditional(@NotNull HaxeConditional o) {
visitPsiCompositeElement(o);
}
public void visitConstructorName(@NotNull HaxeConstructorName o) {
visitPsiCompositeElement(o);
}
<<<<<<<
public void visitFinalMeta(@NotNull HaxeFinalMeta o) {
visitPsiCompositeElement(o);
}
=======
public void visitFatArrowExpression(@NotNull HaxeFatArrowExpression o) {
visitExpression(o);
}
>>>>>>>
public void visitFatArrowExpression(@NotNull HaxeFatArrowExpression o) {
visitExpression(o);
}
public void visitFinalMeta(@NotNull HaxeFinalMeta o) {
visitPsiCompositeElement(o);
} |
<<<<<<<
import com.intellij.plugins.haxe.lang.psi.*;
=======
import com.intellij.plugins.haxe.HaxeComponentType;
import com.intellij.plugins.haxe.lang.psi.*;
>>>>>>>
import com.intellij.plugins.haxe.lang.psi.*;
import com.intellij.plugins.haxe.HaxeComponentType;
<<<<<<<
import com.intellij.psi.*;
import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference;
=======
import com.intellij.plugins.haxe.lang.psi.impl.HaxePsiMethod;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference;
>>>>>>>
import com.intellij.plugins.haxe.lang.psi.impl.HaxePsiMethod;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference;
<<<<<<<
@Nullable
public static PsiElement getReferencedElement(@NotNull DataContext context) {
PsiElement element = null;
final Editor editor = CommonDataKeys.EDITOR.getData(context);
if (editor != null) {
element = TargetElementUtil.findTargetElement(editor,
TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
}
return element;
}
=======
@Nullable
public static PsiElement getReferencedElement(@NotNull DataContext context) {
PsiElement element = null;
final Editor editor = CommonDataKeys.EDITOR.getData(context);
if (editor != null) {
element = TargetElementUtil.findTargetElement(editor,
TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED |
TargetElementUtil.ELEMENT_NAME_ACCEPTED);
}
return element;
}
/**
* Determine if there is a method that is the target of the current
* action, and, if so, return it.
*
* @param context Editor context.
* @return The PSI method if the current context points at a method,
* null otherwise.
*/
@Nullable
public static HaxePsiMethod getTargetMethod(@NotNull DataContext context) {
final PsiElement logicalElement = HaxeHierarchyUtils.getReferencedElement(context);
if (logicalElement == null) {
return null;
}
// Apparently, the tree that referenced element is part of is NOT
// the AST tree from the parsed file, but rather a PSI tree that
// matches the logical structure of the language. The parent of a
// referenced component is always the element we want the type of.
HaxeComponentType ctype = HaxeComponentType.typeOf(logicalElement.getParent());
if (ctype == HaxeComponentType.METHOD) {
// What we need to return is not the element we checked the type of,
// nor the corresponding parsed file element.
// Instead, we need to return the composite HaxePsiMethod class.
HaxeComponentWithDeclarationList psiElement =
(HaxeComponentWithDeclarationList)logicalElement.getParent();
HaxePsiMethod psiMethod = new HaxePsiMethod(psiElement);
return psiMethod;
}
return null;
}
>>>>>>>
@Nullable
public static PsiElement getReferencedElement(@NotNull DataContext context) {
PsiElement element = null;
final Editor editor = CommonDataKeys.EDITOR.getData(context);
if (editor != null) {
element = TargetElementUtil.findTargetElement(editor,
TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED |
TargetElementUtil.ELEMENT_NAME_ACCEPTED);
}
return element;
}
/**
* Determine if there is a method that is the target of the current
* action, and, if so, return it.
*
* @param context Editor context.
* @return The PSI method if the current context points at a method,
* null otherwise.
*/
@Nullable
public static HaxePsiMethod getTargetMethod(@NotNull DataContext context) {
final PsiElement logicalElement = HaxeHierarchyUtils.getReferencedElement(context);
if (logicalElement == null) {
return null;
}
// Apparently, the tree that referenced element is part of is NOT
// the AST tree from the parsed file, but rather a PSI tree that
// matches the logical structure of the language. The parent of a
// referenced component is always the element we want the type of.
HaxeComponentType ctype = HaxeComponentType.typeOf(logicalElement.getParent());
if (ctype == HaxeComponentType.METHOD) {
// What we need to return is not the element we checked the type of,
// nor the corresponding parsed file element.
// Instead, we need to return the composite HaxePsiMethod class.
HaxeComponentWithDeclarationList psiElement =
(HaxeComponentWithDeclarationList)logicalElement.getParent();
HaxePsiMethod psiMethod = new HaxePsiMethod(psiElement);
return psiMethod;
}
return null;
} |
<<<<<<<
=======
// Some other types
default:
if ("VARCHAR2".equals(type.typeName())) {
return TEXT_COLUMN;
} else if ("uuid".equals(type.typeName())) { // PostgreSQL
return TEXT_COLUMN;
} else if ("NVARCHAR2".equals(type.typeName())) {
return TEXT_COLUMN;
} else if ("TIMESTAMP(0)".equals(type.typeName())) {
return TIMESTAMP_COLUMN;
} else if ("TIMESTAMP(6)".equals(type.typeName())) {
return TIMESTAMP_COLUMN;
} else if ("TIMESTAMP(9)".equals(type.typeName())) {
return TIMESTAMP_COLUMN;
} else if ("NVARCHAR".equals(type.typeName())) { // NCHAR not mapped to Type.NCHAR in Java 1.5
return TEXT_COLUMN;
} else if ("NCHAR".equals(type.typeName())) { // NCHAR not mapped to Type.NCHAR in Java 1.5
return TEXT_COLUMN;
} else if ("NCLOB".equals(type.typeName())) { // NCLOB not mapped to Type.NCLOB in Java 1.5
return TEXT_COLUMN;
} else if("BINARY_FLOAT".equals(type.typeName())) {
return NUMERIC_COLUMN;
} else if("BINARY_DOUBLE".equals(type.typeName())) {
return NUMERIC_COLUMN;
} else if("BFILE".equals(type.typeName())) {
// TODO: We could at least support reading from BFILE, although querying for them seems hard
return UNMAPPABLE_COLUMN;
} else {
throw new D2RQException("Unsupported database type code (" +
type.typeId() + ") or type name ('" + type.typeName() +
"') for column " + column.qualifiedName(), D2RQException.DATATYPE_UNKNOWN);
}
>>>>>>> |
<<<<<<<
private final static String DEFAULT_BASE_URI = "http://localhost";
=======
>>>>>>>
<<<<<<<
/** d2rq mapping file */
private String configFile;
=======
/** System loader for access to the GraphD2RQ and configuration */
private final SystemLoader loader;
>>>>>>>
/** System loader for access to the GraphD2RQ and configuration */
private final SystemLoader loader;
<<<<<<<
private ConfigLoader config = null;
/** server port from command line, overrides port in config file */
private int overridePort = -1;
=======
private final ConfigLoader config;
>>>>>>>
private final ConfigLoader config;
<<<<<<<
/** base URI from command line */
private boolean overrideUseAllOptimizations = false;
=======
>>>>>>>
<<<<<<<
public void overridePort(int port) {
log.info("using port " + port);
this.overridePort = port;
}
=======
>>>>>>>
<<<<<<<
public void overrideUseAllOptimizations(boolean overrideAllOptimizations) {
this.overrideUseAllOptimizations = overrideAllOptimizations;
}
public void setConfigFile(String configFileURL) {
configFile = configFileURL;
}
=======
>>>>>>>
<<<<<<<
public String graphURLDescribingResource(String resourceURI) {
if (resourceURI.indexOf(":") == -1) {
resourceURI = resourceBaseURI() + resourceURI;
}
String query = "DESCRIBE <" + resourceURI + ">";
try {
return this.baseURI() + D2RServer.SPARQL_SERVICE_NAME + "?query="
+ URLEncoder.encode(query, "utf-8");
} catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex);
}
}
=======
>>>>>>>
<<<<<<<
log.info("using config file: " + configFile);
this.config = new ConfigLoader(configFile);
this.config.load();
if (config.isLocalMappingFile())
this.dataset = new AutoReloadableDataset(
config.getLocalMappingFilename(), true,
overrideUseAllOptimizations, this);
else
this.dataset = new AutoReloadableDataset(config.getMappingURL(),
false, overrideUseAllOptimizations, this);
this.dataset.forceReload();
if (currentGraph().getConfiguration().getUseAllOptimizations()) {
=======
if (config.isLocalMappingFile()) {
this.dataset = new AutoReloadableDataset(loader, config.getLocalMappingFilename(), config.getAutoReloadMapping());
} else {
this.dataset = new AutoReloadableDataset(loader, null, false);
}
if (loader.getMapping().configuration().getUseAllOptimizations()) {
>>>>>>>
if (config.isLocalMappingFile()) {
this.dataset = new AutoReloadableDataset(loader, config.getLocalMappingFilename(), config.getAutoReloadMapping());
} else {
this.dataset = new AutoReloadableDataset(loader, null, false);
}
if (loader.getMapping().configuration().getUseAllOptimizations()) {
<<<<<<<
=======
// Set up a custom DescribeHandler that calls out to
// {@link ResourceDescriber}
>>>>>>>
this.metadataCreator = new MetadataCreator(this);
// Set up a custom DescribeHandler that calls out to
// {@link ResourceDescriber}
<<<<<<<
private class FindDescribeHandlerFactory implements DescribeHandlerFactory {
public DescribeHandler create() {
return new FindDescribeHandler(D2RServer.this);
}
}
=======
>>>>>>>
<<<<<<<
/**
* Holds a shared {@link MetadataCreator} instance. This instance holds the
* meta data template defined in the configuration, caching this instance
* avoids reading the template on every request to a resource. The instance
* is constructed in the start() method.
*
* @return the cached meta data creator instance
*/
public MetadataCreator getMetadataCreator() {
return metadataCreator;
}
=======
public static void storeSystemLoader(SystemLoader loader, ServletContext context) {
context.setAttribute(SYSTEM_LOADER, loader);
}
public static SystemLoader retrieveSystemLoader(ServletContext context) {
return (SystemLoader) context.getAttribute(SYSTEM_LOADER);
}
>>>>>>>
public static void storeSystemLoader(SystemLoader loader, ServletContext context) {
context.setAttribute(SYSTEM_LOADER, loader);
}
public static SystemLoader retrieveSystemLoader(ServletContext context) {
return (SystemLoader) context.getAttribute(SYSTEM_LOADER);
}
public MetadataCreator getMetadataCreator() {
return metadataCreator;
} |
<<<<<<<
=======
import de.fuberlin.wiwiss.d2rq.expr.Add;
import de.fuberlin.wiwiss.d2rq.expr.Constant;
import de.fuberlin.wiwiss.d2rq.expr.Divide;
import de.fuberlin.wiwiss.d2rq.expr.Equality;
>>>>>>>
import de.fuberlin.wiwiss.d2rq.expr.Add;
import de.fuberlin.wiwiss.d2rq.expr.Constant;
import de.fuberlin.wiwiss.d2rq.expr.Divide;
import de.fuberlin.wiwiss.d2rq.expr.Equality;
<<<<<<<
public final class TransformExprToSQLApplyer implements ExprVisitor
{
private StringBuffer sqlExpression;
private Expression expression = null;
private boolean convertAbleSuccessful; // flag if converting was possible
private NodeRelation nodeRelation;
=======
public final class TransformExprToSQLApplyer implements ExprVisitor {
private static final Log logger = LogFactory.getLog(TransformExprToSQLApplyer.class);
// TODO Expression.FALSE and Expression.TRUE are not constants
private static final Expression CONSTANT_FALSE = new ConstantEx("false", NodeValueBoolean.FALSE.asNode());
private static final Expression CONSTANT_TRUE = new ConstantEx("true", NodeValueBoolean.TRUE.asNode());
private final NodeRelation nodeRelation;
private final Stack expression = new Stack();
private boolean convertable; // flag if converting was possible
private String reason = null; // reason why converting failed
>>>>>>>
public final class TransformExprToSQLApplyer implements ExprVisitor {
private static final Log logger = LogFactory.getLog(TransformExprToSQLApplyer.class);
// TODO Expression.FALSE and Expression.TRUE are not constants
private static final Expression CONSTANT_FALSE = new ConstantEx("false", NodeValueBoolean.FALSE.asNode());
private static final Expression CONSTANT_TRUE = new ConstantEx("true", NodeValueBoolean.TRUE.asNode());
private final NodeRelation nodeRelation;
private final Stack expression = new Stack();
private boolean convertable; // flag if converting was possible
private String reason = null; // reason why converting failed |
<<<<<<<
register(AttributeType.GENERIC_MAX_HEALTH, "generic.max_health");
register(AttributeType.GENERIC_FOLLOW_RANGE, "generic.follow_range");
register(AttributeType.GENERIC_KNOCKBACK_RESISTANCE, "generic.knockback_resistance");
register(AttributeType.GENERIC_MOVEMENT_SPEED, "generic.movement_speed");
register(AttributeType.GENERIC_ATTACK_DAMAGE, "generic.attack_damage");
register(AttributeType.GENERIC_ATTACK_SPEED, "generic.attack_speed");
=======
register(AttributeType.GENERIC_MAX_HEALTH, "generic.maxHealth");
register(AttributeType.GENERIC_FOLLOW_RANGE, "generic.followRange");
register(AttributeType.GENERIC_KNOCKBACK_RESISTANCE, "generic.knockbackResistance");
register(AttributeType.GENERIC_MOVEMENT_SPEED, "generic.movementSpeed");
register(AttributeType.GENERIC_ATTACK_DAMAGE, "generic.attackDamage");
register(AttributeType.GENERIC_ATTACK_SPEED, "generic.attackSpeed");
register(AttributeType.GENERIC_FLYING_SPEED, "generic.flyingSpeed");
>>>>>>>
register(AttributeType.GENERIC_MAX_HEALTH, "generic.max_health");
register(AttributeType.GENERIC_FOLLOW_RANGE, "generic.follow_range");
register(AttributeType.GENERIC_KNOCKBACK_RESISTANCE, "generic.knockback_resistance");
register(AttributeType.GENERIC_MOVEMENT_SPEED, "generic.movement_speed");
register(AttributeType.GENERIC_ATTACK_DAMAGE, "generic.attack_damage");
register(AttributeType.GENERIC_ATTACK_SPEED, "generic.attack_speed");
<<<<<<<
register(AttributeType.GENERIC_ARMOR_TOUGHNESS, "generic.armor_toughness");
=======
register(AttributeType.GENERIC_ARMOR_TOUGHNESS, "generic.armorToughness");
register(AttributeType.GENERIC_ATTACK_KNOCKBACK, "generic.attackKnockback");
>>>>>>>
register(AttributeType.GENERIC_ARMOR_TOUGHNESS, "generic.armor_toughness");
<<<<<<<
register(AttributeType.GENERIC_FLYING_SPEED, "generic.flying_speed");
register(AttributeType.HORSE_JUMP_STRENGTH, "horse.jump_strength");
register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS, "zombie.spawn_reinforcements");
register(AttributeType.SWIM_SPEED, "forge.swim_speed");
register(AttributeType.NAMETAG_DISTANCE, "forge.name_tag_distance");
=======
register(AttributeType.HORSE_JUMP_STRENGTH, "horse.jumpStrength");
register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS, "zombie.spawnReinforcements");
// Forge-only
register(AttributeType.SWIM_SPEED, "forge.swimSpeed");
register(AttributeType.NAMETAG_DISTANCE, "forge.nameTagDistance");
>>>>>>>
register(AttributeType.GENERIC_FLYING_SPEED, "generic.flying_speed");
register(AttributeType.HORSE_JUMP_STRENGTH, "horse.jump_strength");
register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS, "zombie.spawn_reinforcements");
// Forge-only
register(AttributeType.SWIM_SPEED, "forge.swim_speed");
register(AttributeType.NAMETAG_DISTANCE, "forge.name_tag_distance"); |
<<<<<<<
this.primaryDistributedTraceId = distributedTraceIds.get(0);
=======
this.distributedTraceIds = distributedTraceIds;
if (entryServiceId == DictionaryUtil.nullValue()) {
this.entryOperationName = "#" + entryOperationName;
} else {
this.entryOperationName = String.valueOf(entryServiceId);
}
>>>>>>>
this.primaryDistributedTraceId = distributedTraceIds.get(0);
if (entryServiceId == DictionaryUtil.nullValue()) {
this.entryOperationName = "#" + entryOperationName;
} else {
this.entryOperationName = String.valueOf(entryServiceId);
}
<<<<<<<
&& primaryDistributedTraceId != null;
=======
&& distributedTraceIds != null
&& distributedTraceIds.size() > 0
&& !StringUtil.isEmpty(entryOperationName);
}
public String getEntryOperationName() {
return entryOperationName;
>>>>>>>
&& primaryDistributedTraceId != null
&& !StringUtil.isEmpty(entryOperationName);
}
public String getEntryOperationName() {
return entryOperationName; |
<<<<<<<
public static final OfficialComponent SERVICECOMB = new OfficialComponent(27, "ServiceComb");
=======
public static final OfficialComponent KAFKA = new OfficialComponent(27, "Kafka");
>>>>>>>
public static final OfficialComponent KAFKA = new OfficialComponent(27, "Kafka");
public static final OfficialComponent SERVICECOMB = new OfficialComponent(28, "ServiceComb");
<<<<<<<
addComponent(SERVICECOMB);
=======
addComponent(KAFKA);
>>>>>>>
addComponent(KAFKA);
addComponent(SERVICECOMB); |
<<<<<<<
return null;
=======
>>>>>>>
return null; |
<<<<<<<
import akka.actor.ActorPath;
import akka.actor.ActorRef;
import com.a.eye.skywalking.logging.ILog;
import com.a.eye.skywalking.logging.LogManager;
=======
>>>>>>>
<<<<<<<
public class WorkerRef {
private ILog logger = LogManager.getLogger(WorkerRef.class);
final ActorRef actorRef;
=======
public abstract class WorkerRef {
>>>>>>>
public abstract class WorkerRef { |
<<<<<<<
if (operationName.length() == 0 || Config.Plugin.Toolkit.USE_QUALIFIED_NAME_AS_ENDPOINT_NAME) {
operationName = generateOperationName(method);
=======
if (operationName.length() == 0) {
operationName = MethodUtil.generateOperationName(method);
>>>>>>>
if (operationName.length() == 0 || Config.Plugin.Toolkit.USE_QUALIFIED_NAME_AS_ENDPOINT_NAME) {
operationName = MethodUtil.generateOperationName(method); |
<<<<<<<
=======
import com.secuso.privacyFriendlyCodeScanner.GeneralFragments.ScanFragment;
>>>>>>>
import com.secuso.privacyFriendlyCodeScanner.GeneralFragments.ScanFragment; |
<<<<<<<
private MetaDataFactory metaDataFactory;
=======
private CacheKeyFactory cacheKeyFactory;
>>>>>>>
private CacheKeyFactory cacheKeyFactory;
private MetaDataFactory metaDataFactory;
<<<<<<<
if (metaDataFactory == null) {
metaDataFactory = newMetaDataFactory();
}
=======
if (cacheKeyFactory == null) {
cacheKeyFactory = newCacheKeyFactory();
}
>>>>>>>
if (cacheKeyFactory == null) {
cacheKeyFactory = newCacheKeyFactory();
}
if (metaDataFactory == null) {
metaDataFactory = newMetaDataFactory();
}
<<<<<<<
manager.setMetaDataFactory(metaDataFactory);
=======
manager.setCacheKeyFactory(cacheKeyFactory);
// initialize before injection to allow injector do its job properly
>>>>>>>
manager.setCacheKeyFactory(cacheKeyFactory);
manager.setMetaDataFactory(metaDataFactory);
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
/**
* @return the namingStrategy
*/
public NamingStrategy getNamingStrategy() {
return namingStrategy;
}
>>>>>>>
<<<<<<<
=======
/**
* @return default implementation of {@link CacheKeyFactory}.
*/
protected CacheKeyFactory newCacheKeyFactory() {
return new DefaultCacheKeyFactory();
}
>>>>>>>
/**
* @return default implementation of {@link CacheKeyFactory}.
*/
protected CacheKeyFactory newCacheKeyFactory() {
return new DefaultCacheKeyFactory();
}
<<<<<<<
/**
* @return default implementation of {@link MetaDataFactory} used when no {@link MetaDataFactory} is set.
*/
protected MetaDataFactory newMetaDataFactory() {
return new DefaultMetaDataFactory();
}
=======
>>>>>>>
/**
* @return default implementation of {@link MetaDataFactory} used when no {@link MetaDataFactory} is set.
*/
protected MetaDataFactory newMetaDataFactory() {
return new DefaultMetaDataFactory();
}
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
public void setCacheKeyFactory(final CacheKeyFactory cacheKeyFactory) {
this.cacheKeyFactory = cacheKeyFactory;
}
>>>>>>>
public void setCacheKeyFactory(final CacheKeyFactory cacheKeyFactory) {
this.cacheKeyFactory = cacheKeyFactory;
}
<<<<<<<
=======
public WroModelFactory getModelFactory() {
return modelFactory;
}
>>>>>>> |
<<<<<<<
import org.junit.After;
=======
import org.junit.After;
import org.junit.AfterClass;
>>>>>>>
import org.junit.After;
import org.junit.AfterClass;
<<<<<<<
@After
public void tearDown() throws Exception {
victim.destroy();
Context.unset();
}
=======
@After
public void tearDown() {
Context.unset();
}
>>>>>>>
@After
public void tearDown()
throws Exception {
victim.destroy();
Context.unset();
}
<<<<<<<
@Test
public void shouldCheckForChangeAsynchronously() throws Exception {
final AtomicBoolean groupChanged = new AtomicBoolean();
final AtomicBoolean callbackInvoked = new AtomicBoolean();
victim = new ResourceWatcher() {
@Override
void onGroupChanged(final CacheKey cacheEntry) {
super.onGroupChanged(cacheEntry);
groupChanged.set(true);
}
};
final Injector injector = createDefaultInjector();
injector.inject(victim);
victim.checkAsync(cacheEntry, new Runnable() {
public void run() {
callbackInvoked.set(true);
assertTrue(groupChanged.get());
}
});
WroTestUtils.waitUntil(new Function<Void, Boolean>() {
public Boolean apply(final Void input)
throws Exception {
return callbackInvoked.get();
}
}, 500);
}
=======
>>>>>>>
@Test
public void shouldCheckForChangeAsynchronously()
throws Exception {
final AtomicBoolean groupChanged = new AtomicBoolean();
final AtomicBoolean callbackInvoked = new AtomicBoolean();
victim = new ResourceWatcher() {
@Override
void onGroupChanged(final CacheKey cacheEntry) {
super.onGroupChanged(cacheEntry);
groupChanged.set(true);
}
};
final Injector injector = createDefaultInjector();
injector.inject(victim);
victim.checkAsync(cacheEntry, new Runnable() {
public void run() {
callbackInvoked.set(true);
assertTrue(groupChanged.get());
}
});
WroTestUtils.waitUntil(new Function<Void, Boolean>() {
public Boolean apply(final Void input)
throws Exception {
return callbackInvoked.get();
}
}, 500);
} |
<<<<<<<
hash = hashBuilder.getHash(new ByteArrayInputStream(content.getBytes()));
=======
LOG.debug("Content to fingerprint: [" + StringUtils.abbreviate(content, 40) + "]");
hash = fingerprintCreator.create(new ByteArrayInputStream(content.getBytes()));
>>>>>>>
LOG.debug("Content to fingerprint: [" + StringUtils.abbreviate(content, 40) + "]");
hash = hashBuilder.getHash(new ByteArrayInputStream(content.getBytes())); |
<<<<<<<
private long getResourceWatcherUpdatePeriod() {
return context.getConfig().getResourceWatcherUpdatePeriod();
}
/**
* @return {@link TimeUnit} used to run resourceWatcher.
* @VisibleForTesting
*/
TimeUnit getTimeUnitForResourceWatcher() {
return TimeUnit.SECONDS;
}
=======
>>>>>>>
private long getResourceWatcherUpdatePeriod() {
return context.getConfig().getResourceWatcherUpdatePeriod();
}
/**
* @return {@link TimeUnit} used to run resourceWatcher.
* @VisibleForTesting
*/
TimeUnit getTimeUnitForResourceWatcher() {
return TimeUnit.SECONDS;
} |
<<<<<<<
*
* @parameter default-value="${project.build.directory}
=======
*
* @parameter default-value="${project.build.directory}"
>>>>>>>
*
* @parameter default-value="${project.build.directory}"
<<<<<<<
* This parameter is not meant to be used. The only purpose is to hold the final build name of the artifacty
*
* @parameter default-value="${project.build.directory}/${project.build.finalName}
=======
* This parameter is not meant to be used. The only purpose is to hold the final build name of the artifact
*
* @parameter default-value="${project.build.directory}/${project.build.finalName}"
>>>>>>>
* This parameter is not meant to be used. The only purpose is to hold the final build name of the artifact
*
* @parameter default-value="${project.build.directory}/${project.build.finalName}"
<<<<<<<
=======
/**
* {@inheritDoc}
*/
@Override
protected void onBeforeExecute() {
groupNames.clear();
if (groupNameMappingFile != null && isIncrementalBuild()) {
try {
//reuse stored properties for incremental build
groupNames.load(new FileInputStream(groupNameMappingFile));
} catch(final IOException e) {
getLog().debug("Cannot load " + groupNameMappingFile.getPath());
}
}
}
>>>>>>>
/**
* {@inheritDoc}
*/
@Override
protected void onBeforeExecute() {
groupNames.clear();
if (groupNameMappingFile != null && isIncrementalBuild()) {
try {
//reuse stored properties for incremental build
groupNames.load(new FileInputStream(groupNameMappingFile));
} catch(final IOException e) {
getLog().debug("Cannot load " + groupNameMappingFile.getPath());
}
}
}
<<<<<<<
* @param destinationFolder
* the destinationFolder to set
=======
* @param destinationFolder the destinationFolder to set
* @VisibleForTesting
>>>>>>>
* @param destinationFolder
* the destinationFolder to set
* @VisibleForTesting
<<<<<<<
* @param cssDestinationFolder
* the cssDestinationFolder to set
=======
* @param cssDestinationFolder the cssDestinationFolder to set
* @VisibleForTesting
>>>>>>>
* @param cssDestinationFolder
* the cssDestinationFolder to set
* @VisibleForTesting
<<<<<<<
* @param jsDestinationFolder
* the jsDestinationFolder to set
=======
* @param jsDestinationFolder the jsDestinationFolder to set
* @VisibleForTesting
>>>>>>>
* @param jsDestinationFolder
* the jsDestinationFolder to set
* @VisibleForTesting
<<<<<<<
*
* @param buildDirectory
* the buildDirectory to set
=======
*
* @param buildDirectory the buildDirectory to set
* @VisibleForTesting
>>>>>>>
*
* @param buildDirectory
* the buildDirectory to set
* @VisibleForTesting
<<<<<<<
* @param buildFinalName
* the buildFinalName to set
*/
public void setBuildFinalName(final File buildFinalName) {
this.buildFinalName = buildFinalName;
}
/**
* @param groupNameMappingFile
* the groupNameMappingFile to set
=======
* @param groupNameMappingFile the groupNameMappingFile to set
* @VisibleForTesting
>>>>>>>
* @param buildFinalName the buildFinalName to set
*/
public void setBuildFinalName(final File buildFinalName) {
this.buildFinalName = buildFinalName;
}
/**
* @param groupNameMappingFile
* the groupNameMappingFile to set
* @VisibleForTesting |
<<<<<<<
final String fileName = resource == null ? "wro4j-processed-file.js" : resource.getUri();
final JSSourceFile input = JSSourceFile.fromInputStream(fileName, new ByteArrayInputStream(content.getBytes()));
=======
final JSSourceFile input = JSSourceFile.fromInputStream("",
new ByteArrayInputStream(content.getBytes(Context.get().getConfig().getEncoding())));
>>>>>>>
final String fileName = resource == null ? "wro4j-processed-file.js" : resource.getUri();
final JSSourceFile input = JSSourceFile.fromInputStream(fileName, new ByteArrayInputStream(content.getBytes(Context.get().getConfig().getEncoding()))); |
<<<<<<<
final List<Group> groupAsList = new ArrayList<Group>();
//TODO update the context
getCallbackRegistry().onBeforeModelCreated();
=======
>>>>>>>
//TODO update the context
getCallbackRegistry().onBeforeModelCreated();
<<<<<<<
public final void onModelPeriodChanged() {
LOG.info("ModelChange event triggered!");
//trigger model destroy
=======
public final void onModelPeriodChanged(final long period) {
LOG.info("onModelPeriodChanged with value {} has been triggered!", period);
>>>>>>>
public final void onModelPeriodChanged(final long period) {
LOG.info("onModelPeriodChanged with value {} has been triggered!", period);
//trigger model destroy |
<<<<<<<
import ro.isdc.wro.config.metadata.MetaDataFactory;
=======
import ro.isdc.wro.manager.ResourceBundleProcessor;
>>>>>>>
import ro.isdc.wro.config.metadata.MetaDataFactory;
import ro.isdc.wro.manager.ResourceBundleProcessor;
<<<<<<<
assertNotNull(sample.namingStrategy);
assertNotNull(sample.preProcessorExecutor);
assertNotNull(sample.processorsFactory);
assertNotNull(sample.uriLocatorFactory);
assertNotNull(sample.callbackRegistry);
assertSame(injector, sample.injector);
assertNotNull(sample.groupsProcessor);
assertNotNull(sample.metaDataFactory);
=======
assertNotNull(sample.namingStrategy);
assertNotNull(sample.preProcessorExecutor);
assertNotNull(sample.processorsFactory);
assertNotNull(sample.uriLocatorFactory);
assertNotNull(sample.callbackRegistry);
assertSame(injector, sample.injector);
assertNotNull(sample.groupsProcessor);
assertNotNull(sample.bundleProcessor);
>>>>>>>
assertNotNull(sample.namingStrategy);
assertNotNull(sample.preProcessorExecutor);
assertNotNull(sample.processorsFactory);
assertNotNull(sample.uriLocatorFactory);
assertNotNull(sample.callbackRegistry);
assertSame(injector, sample.injector);
assertNotNull(sample.groupsProcessor);
assertNotNull(sample.metaDataFactory);
assertNotNull(sample.bundleProcessor);
<<<<<<<
assertNotNull(sample.metaDataFactory);
=======
assertNotNull(sample.cacheKeyFactory);
assertNotNull(sample.bundleProcessor);
>>>>>>>
assertNotNull(sample.metaDataFactory);
assertNotNull(sample.cacheKeyFactory);
assertNotNull(sample.bundleProcessor);
<<<<<<<
@Inject
MetaDataFactory metaDataFactory;
=======
@Inject
CacheKeyFactory cacheKeyFactory;
@Inject
ResourceBundleProcessor bundleProcessor;
>>>>>>>
@Inject
MetaDataFactory metaDataFactory;
@Inject
CacheKeyFactory cacheKeyFactory;
@Inject
ResourceBundleProcessor bundleProcessor; |
<<<<<<<
import org.apache.commons.lang3.ArrayUtils;
=======
import javax.servlet.http.HttpServletRequest;
import ro.isdc.wro.cache.CacheKey;
import ro.isdc.wro.cache.factory.CacheKeyFactory;
import ro.isdc.wro.cache.factory.CacheKeyFactoryDecorator;
>>>>>>>
import org.apache.commons.lang3.ArrayUtils;
import javax.servlet.http.HttpServletRequest;
import ro.isdc.wro.cache.CacheKey;
import ro.isdc.wro.cache.factory.CacheKeyFactory;
import ro.isdc.wro.cache.factory.CacheKeyFactoryDecorator; |
<<<<<<<
private ExecutorService consumerService;
=======
private ExecutorService completionExecutor;
>>>>>>>
private ExecutorService completionExecutor;
<<<<<<<
public ExecutorService getExecutor() {
=======
private ExecutorService getExecutor() {
>>>>>>>
private ExecutorService getExecutor() {
<<<<<<<
final StopWatch watch = new StopWatch();
watch.start("create executor");
=======
>>>>>>>
<<<<<<<
/**
* @return a not null instance of {@link ExecutorService} which is created lazily.
*/
private ExecutorService getConsumerService() {
if (consumerService == null) {
// it is enough to use an executor with a single thread.
consumerService = Executors.newFixedThreadPool(5);
}
return consumerService;
}
=======
>>>>>>>
<<<<<<<
destroy();
=======
watch.stop();
destroy();
>>>>>>>
watch.stop();
destroy();
<<<<<<<
private <T> Callable<T> decorate(final Callable<T> decorated, final AtomicLong totalTime) {
=======
private Callable<T> decorate(final Callable<T> decorated, final AtomicLong totalTime) {
>>>>>>>
private <T> Callable<T> decorate(final Callable<T> decorated, final AtomicLong totalTime) {
<<<<<<<
/**
* Submits a task to the taskExecutor. This operation is not a blocking one.
*/
private final void submit(final Callable<T> callable) {
getCompletionService().submit(callable);
consumeResult();
}
/**
* Reads asynchronously the latest available result.
*/
private void consumeResult() {
getConsumerService().submit(new Callable<Void>() {
public Void call()
throws Exception {
doConsumeResult();
return null;
}
});
// try {
// doConsumeResult();
// } catch(Exception e) {
// thWroRuntimeException.wrap(e);
// }
}
=======
>>>>>>> |
<<<<<<<
import com.fasterxml.jackson.databind.JsonNode;
import org.entando.entando.aps.system.exception.RestRourceNotFoundException;
=======
import org.entando.entando.aps.system.exception.ResourceNotFoundException;
>>>>>>>
import org.entando.entando.aps.system.exception.ResourceNotFoundException;
import com.fasterxml.jackson.databind.JsonNode; |
<<<<<<<
import com.quorum.tessera.recovery.workflow.BatchResendManager;
=======
import com.quorum.tessera.p2p.resend.ResendRequest;
>>>>>>>
import com.quorum.tessera.recovery.workflow.BatchResendManager;
import com.quorum.tessera.p2p.resend.ResendRequest; |
<<<<<<<
@Override
public String workdir() {
return properties.getProperty("workdir");
}
@Override
public String socket() {
return properties.getProperty("socket");
}
=======
@Override
public String databaseURL() {
return properties.getProperty("databaseURL");
}
>>>>>>>
@Override
public String workdir() {
return properties.getProperty("workdir");
}
@Override
public String socket() {
return properties.getProperty("socket");
}
@Override
public String databaseURL() {
return properties.getProperty("databaseURL");
} |
<<<<<<<
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.entando.entando.aps.system.services.page;
import java.util.List;
import org.entando.entando.aps.system.services.page.model.PageConfigurationDto;
import org.entando.entando.aps.system.services.page.model.PageDto;
import org.entando.entando.aps.system.services.page.model.WidgetConfigurationDto;
import org.entando.entando.web.page.model.PageRequest;
import org.entando.entando.web.page.model.WidgetConfigurationRequest;
/**
*
* @author paddeo
*/
public interface IPageService {
public static final String BEAN_NAME = "PageService";
public static final String STATUS_ONLINE = "online";
public static final String STATUS_DRAFT = "draft";
public PageDto getPage(String pageCode);
public PageDto addPage(PageRequest pageRequest);
public void removePage(String pageName);
public PageDto updatePage(String pageCode, PageRequest pageRequest);
public List<PageDto> getPages(String parentCode);
public PageConfigurationDto getPageConfiguration(String pageCode, String status);
public WidgetConfigurationDto getWidgetConfiguration(String pageCode, int frameId, String status);
public WidgetConfigurationDto updateWidgetConfiguration(String pageCode, int frameId, String status, WidgetConfigurationRequest widget);
}
=======
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.entando.entando.aps.system.services.page;
import java.util.List;
import org.entando.entando.aps.system.services.page.model.PageDto;
import org.entando.entando.web.common.model.PagedMetadata;
import org.entando.entando.web.common.model.RestListRequest;
import org.entando.entando.web.page.model.PageRequest;
/**
*
* @author paddeo
*/
public interface IPageService {
String BEAN_NAME = "PageService";
public static final String STATUS_ONLINE = "published";
public static final String STATUS_DRAFT = "draft";
public PageDto getPage(String pageCode, String status);
public PageDto addPage(PageRequest pageRequest);
public void removePage(String pageName);
public PageDto updatePage(String pageCode, PageRequest pageRequest);
public List<PageDto> getPages(String parentCode);
}
>>>>>>>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.entando.entando.aps.system.services.page;
import java.util.List;
import org.entando.entando.aps.system.services.page.model.PageConfigurationDto;
import org.entando.entando.aps.system.services.page.model.PageDto;
import org.entando.entando.aps.system.services.page.model.WidgetConfigurationDto;
import org.entando.entando.web.page.model.PageRequest;
import org.entando.entando.web.page.model.WidgetConfigurationRequest;
/**
*
* @author paddeo
*/
public interface IPageService {
String BEAN_NAME = "PageService";
public static final String STATUS_ONLINE = "published";
public static final String STATUS_DRAFT = "draft";
public PageDto getPage(String pageCode, String status);
public PageDto addPage(PageRequest pageRequest);
public void removePage(String pageName);
public PageDto updatePage(String pageCode, PageRequest pageRequest);
public List<PageDto> getPages(String parentCode);
public PageConfigurationDto getPageConfiguration(String pageCode, String status);
public WidgetConfigurationDto getWidgetConfiguration(String pageCode, int frameId, String status);
public WidgetConfigurationDto updateWidgetConfiguration(String pageCode, int frameId, String status, WidgetConfigurationRequest widget);
} |
<<<<<<<
package com.agiletec.aps;
import junit.framework.JUnit4TestAdapter;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.entando.entando.aps.system.services.dataobjectmodel.DataObjectModelServiceTest;
import org.entando.entando.aps.system.services.group.GroupServiceIntegrationTest;
import org.entando.entando.aps.system.services.group.GroupServiceTest;
import org.entando.entando.aps.system.services.group.RestListRequestTest;
import org.entando.entando.aps.system.services.guifragment.GuiFragmentServiceTest;
import org.entando.entando.aps.system.services.page.PageServiceIntegrationTest;
import org.entando.entando.aps.system.services.page.PageService_WidgetIntegrationTest;
import org.entando.entando.aps.system.services.pagemodel.PageModelDtoTest;
import org.entando.entando.aps.system.services.pagemodel.PageModelServiceTest;
import org.entando.entando.aps.system.services.pagesettings.PageSettingsServiceIntegrationTest;
public class ServicesAllTests extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite(ServicesAllTests.class.getName());
//
suite.addTestSuite(GroupServiceIntegrationTest.class);
suite.addTestSuite(PageSettingsServiceIntegrationTest.class);
suite.addTestSuite(PageServiceIntegrationTest.class);
suite.addTest(new JUnit4TestAdapter(RestListRequestTest.class));
suite.addTest(new JUnit4TestAdapter(GroupServiceTest.class));
suite.addTest(new JUnit4TestAdapter(GuiFragmentServiceTest.class));
suite.addTest(new JUnit4TestAdapter(DataObjectModelServiceTest.class));
suite.addTest(new JUnit4TestAdapter(PageModelDtoTest.class));
suite.addTest(new JUnit4TestAdapter(PageModelServiceTest.class));
suite.addTest(new JUnit4TestAdapter(PageService_WidgetIntegrationTest.class));
return suite;
}
}
=======
package com.agiletec.aps;
import junit.framework.JUnit4TestAdapter;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.entando.entando.aps.system.services.dataobjectmodel.DataObjectModelServiceTest;
import org.entando.entando.aps.system.services.entity.EntityManagerServiceIntegrationTest;
import org.entando.entando.aps.system.services.entity.EntityManagerServiceTest;
import org.entando.entando.aps.system.services.group.GroupServiceIntegrationTest;
import org.entando.entando.aps.system.services.group.GroupServiceTest;
import org.entando.entando.aps.system.services.group.RestListRequestTest;
import org.entando.entando.aps.system.services.guifragment.GuiFragmentServiceTest;
import org.entando.entando.aps.system.services.pagemodel.PageModelDtoTest;
import org.entando.entando.aps.system.services.pagemodel.PageModelServiceTest;
import org.entando.entando.aps.system.services.page.PageServiceIntegrationTest;
import org.entando.entando.aps.system.services.pagesettings.PageSettingsServiceIntegrationTest;
public class ServicesAllTests extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite(ServicesAllTests.class.getName());
//
suite.addTestSuite(GroupServiceIntegrationTest.class);
suite.addTestSuite(PageSettingsServiceIntegrationTest.class);
suite.addTestSuite(PageServiceIntegrationTest.class);
suite.addTest(new JUnit4TestAdapter(RestListRequestTest.class));
suite.addTest(new JUnit4TestAdapter(GroupServiceTest.class));
suite.addTest(new JUnit4TestAdapter(GuiFragmentServiceTest.class));
suite.addTest(new JUnit4TestAdapter(DataObjectModelServiceTest.class));
suite.addTest(new JUnit4TestAdapter(PageModelDtoTest.class));
suite.addTest(new JUnit4TestAdapter(PageModelServiceTest.class));
suite.addTest(new JUnit4TestAdapter(EntityManagerServiceTest.class));
suite.addTestSuite(EntityManagerServiceIntegrationTest.class);
return suite;
}
}
>>>>>>>
package com.agiletec.aps;
import junit.framework.JUnit4TestAdapter;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.entando.entando.aps.system.services.dataobjectmodel.DataObjectModelServiceTest;
import org.entando.entando.aps.system.services.entity.EntityManagerServiceIntegrationTest;
import org.entando.entando.aps.system.services.entity.EntityManagerServiceTest;
import org.entando.entando.aps.system.services.group.GroupServiceIntegrationTest;
import org.entando.entando.aps.system.services.group.GroupServiceTest;
import org.entando.entando.aps.system.services.group.RestListRequestTest;
import org.entando.entando.aps.system.services.guifragment.GuiFragmentServiceTest;
import org.entando.entando.aps.system.services.page.PageServiceIntegrationTest;
import org.entando.entando.aps.system.services.page.PageService_WidgetIntegrationTest;
import org.entando.entando.aps.system.services.pagemodel.PageModelDtoTest;
import org.entando.entando.aps.system.services.pagemodel.PageModelServiceTest;
import org.entando.entando.aps.system.services.page.PageServiceIntegrationTest;
import org.entando.entando.aps.system.services.pagesettings.PageSettingsServiceIntegrationTest;
public class ServicesAllTests extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite(ServicesAllTests.class.getName());
//
suite.addTestSuite(GroupServiceIntegrationTest.class);
suite.addTestSuite(PageSettingsServiceIntegrationTest.class);
suite.addTestSuite(PageServiceIntegrationTest.class);
suite.addTest(new JUnit4TestAdapter(RestListRequestTest.class));
suite.addTest(new JUnit4TestAdapter(GroupServiceTest.class));
suite.addTest(new JUnit4TestAdapter(GuiFragmentServiceTest.class));
suite.addTest(new JUnit4TestAdapter(DataObjectModelServiceTest.class));
suite.addTest(new JUnit4TestAdapter(PageModelDtoTest.class));
suite.addTest(new JUnit4TestAdapter(PageModelServiceTest.class));
suite.addTest(new JUnit4TestAdapter(EntityManagerServiceTest.class));
suite.addTestSuite(EntityManagerServiceIntegrationTest.class);
suite.addTest(new JUnit4TestAdapter(PageService_WidgetIntegrationTest.class));
return suite;
}
} |
<<<<<<<
private final boolean isJsonOutput;
=======
private final boolean showTopics;
>>>>>>>
private final boolean isJsonOutput;
private final boolean showTopics;
<<<<<<<
isJsonOutput = subscribe.isJsonOutput();
=======
showTopics = subscribe.showTopics();
>>>>>>>
isJsonOutput = subscribe.isJsonOutput();
showTopics = subscribe.showTopics();
<<<<<<<
if (printToStdout) { System.out.println(message); }
=======
String message = payloadMessage;
if (showTopics) {
message = mqtt5Publish.getTopic() + ": " + message;
}
if (printToStdout) { System.out.println(message); }
>>>>>>>
if (printToStdout) { System.out.println(message); } |
<<<<<<<
final boolean printToSTDOUT = subscribe.isPrintToSTDOUT();
client.toAsync()
.subscribe(subscribeMessage, publish -> {
byte[] payload = publish.getPayloadAsBytes();
final String payloadMessage = applyBase64EncodingIfSet(subscribe.isBase64(), payload);
if (!getClientDataMap().get(subscribe.getKey()).getSubscribedTopics().contains(topic)) {
if (finalFileWriter != null) {
finalFileWriter.println(publish.getTopic() + ": " + payloadMessage);
finalFileWriter.flush();
}
if (printToSTDOUT) {
System.out.println(payloadMessage);
}
}
if (subscribe.isVerbose()) {
Logger.trace("received PUBLISH: {}", publish);
}
else if (subscribe.isDebug()) {
Logger.debug("received PUBLISH: (Topic: {}, Message: '{}')", publish.getTopic(), payloadMessage);
}
})
=======
client.subscribe(subscribeMessage, new SubscribeMqtt5PublishCallback(subscribe))
>>>>>>>
client.toAsync()
.subscribe(subscribeMessage, new SubscribeMqtt5PublishCallback(subscribe))
<<<<<<<
final boolean printToSTDOUT = subscribe.isPrintToSTDOUT();
client.toAsync()
.subscribe(subscribeMessage, publish -> {
byte[] payload = publish.getPayloadAsBytes();
final String payloadMessage = applyBase64EncodingIfSet(subscribe.isBase64(), payload);
if (!getClientDataMap().get(subscribe.getKey()).getSubscribedTopics().contains(topic)) {
if (finalFileWriter != null) {
finalFileWriter.println(publish.getTopic() + ": " + payloadMessage);
finalFileWriter.flush();
}
if (printToSTDOUT) {
System.out.println(payloadMessage);
}
}
if (subscribe.isVerbose()) {
Logger.trace("received PUBLISH: {}", publish);
}
else if (subscribe.isDebug()) {
Logger.debug("received PUBLISH: (Topic: {}, Message: '{}')", publish.getTopic(), payloadMessage);
}
})
=======
client.subscribe(subscribeMessage, new SubscribeMqtt3PublishCallback(subscribe))
>>>>>>>
client.toAsync()
.subscribe(subscribeMessage, new SubscribeMqtt3PublishCallback(subscribe)) |
<<<<<<<
private final boolean isJsonOutput;
=======
private final boolean showTopics;
>>>>>>>
private final boolean isJsonOutput;
private final boolean showTopics;
<<<<<<<
isJsonOutput = subscribe.isJsonOutput();
=======
showTopics = subscribe.showTopics();
>>>>>>>
isJsonOutput = subscribe.isJsonOutput();
showTopics = subscribe.showTopics();
<<<<<<<
if (printToStdout) { System.out.println(message); }
=======
String message = payloadMessage;
if (showTopics) {
message = mqtt3Publish.getTopic() + ": " + message;
}
if (printToStdout) { System.out.println(message); }
>>>>>>>
if (printToStdout) { System.out.println(message); } |
<<<<<<<
@CommandLine.Option(names = {"-J", "--jsonOutput"}, defaultValue = "false", description = "Print the received publishes in pretty Json format", order = 1)
private boolean jsonOutput;
=======
@CommandLine.Option(names = {"-T", "--showTopics"}, defaultValue = "false", description = "Prepend the specific topic name to the received publish", order = 1)
private boolean showTopics;
>>>>>>>
@CommandLine.Option(names = {"-J", "--jsonOutput"}, defaultValue = "false", description = "Print the received publishes in pretty Json format", order = 1)
private boolean jsonOutput;
@CommandLine.Option(names = {"-T", "--showTopics"}, defaultValue = "false", description = "Prepend the specific topic name to the received publish", order = 1)
private boolean showTopics;
<<<<<<<
", jsonOutput=" + jsonOutput +
=======
", showTopics=" + showTopics +
(userProperties != null ? (", userProperties=" + Arrays.toString(userProperties)) : "") +
(publishFile != null ? (", publishFile=" + publishFile.getAbsolutePath()) : "") +
>>>>>>>
", jsonOutput=" + jsonOutput +
", showTopics=" + showTopics +
(userProperties != null ? (", userProperties=" + Arrays.toString(userProperties)) : "") +
(publishFile != null ? (", publishFile=" + publishFile.getAbsolutePath()) : "") + |
<<<<<<<
import net.minecraft.entity.EntityType;
=======
import net.minecraft.server.world.ChunkHolder;
>>>>>>>
import net.minecraft.entity.EntityType;
import net.minecraft.server.world.ChunkHolder;
<<<<<<<
import quickcarpet.utils.SpawnEntityCache;
=======
import quickcarpet.utils.IWorld;
import quickcarpet.utils.IWorldChunk;
>>>>>>>
import quickcarpet.utils.SpawnEntityCache;
import quickcarpet.utils.IWorld;
import quickcarpet.utils.IWorldChunk;
<<<<<<<
public abstract class MixinWorld implements SpawnEntityCache {
=======
public abstract class MixinWorld implements IWorld {
>>>>>>>
public abstract class MixinWorld implements IWorld, SpawnEntityCache {
<<<<<<<
private final Map<EntityType<?>, Entity> CACHED_ENTITIES = new HashMap<>();
@Override
public <T extends Entity> T getCachedEntity(EntityType<T> type) {
return (T) CACHED_ENTITIES.get(type);
}
@Override
public <T extends Entity> void setCachedEntity(EntityType<T> type, T entity) {
CACHED_ENTITIES.put(type, entity);
}
=======
/**
* @author 2No2Name
*/
public boolean setBlockStateWithBlockEntity(BlockPos blockPos_1, BlockState blockState_1, BlockEntity newBlockEntity, int int_1)
{
if ((Object) this instanceof EmptyChunk)
return false;
if (World.isHeightInvalid(blockPos_1))
{
return false;
}
else if (!this.isClient && this.properties.getGeneratorType() == LevelGeneratorType.DEBUG_ALL_BLOCK_STATES)
{
return false;
}
else
{
WorldChunk worldChunk_1 = this.getWorldChunk(blockPos_1);
Block block_1 = blockState_1.getBlock();
BlockState blockState_2;
if (newBlockEntity != null && block_1 instanceof BlockEntityProvider)
blockState_2 = ((IWorldChunk) worldChunk_1).setBlockStateWithBlockEntity(blockPos_1, blockState_1, newBlockEntity, (int_1 & 64) != 0);
else
blockState_2 = worldChunk_1.setBlockState(blockPos_1, blockState_1, (int_1 & 64) != 0);
if (blockState_2 == null)
{
return false;
}
else
{
BlockState blockState_3 = this.getBlockState(blockPos_1);
if (blockState_3 != blockState_2 && (blockState_3.getLightSubtracted((BlockView) this, blockPos_1) != blockState_2.getLightSubtracted((BlockView) this, blockPos_1) || blockState_3.getLuminance() != blockState_2.getLuminance() || blockState_3.hasSidedTransparency() || blockState_2.hasSidedTransparency()))
{
this.profiler.push("queueCheckLight");
this.getChunkManager().getLightingProvider().enqueueLightUpdate(blockPos_1);
this.profiler.pop();
}
if (blockState_3 == blockState_1)
{
if (blockState_2 != blockState_3)
{
this.scheduleBlockRender(blockPos_1);
}
if ((int_1 & 2) != 0 && (!this.isClient || (int_1 & 4) == 0) && (this.isClient || worldChunk_1.getLevelType() != null && worldChunk_1.getLevelType().isAfter(ChunkHolder.LevelType.TICKING)))
{
this.updateListeners(blockPos_1, blockState_2, blockState_1, int_1);
}
if (!this.isClient && (int_1 & 1) != 0)
{
this.updateNeighbors(blockPos_1, blockState_2.getBlock());
if (blockState_1.hasComparatorOutput())
{
this.updateHorizontalAdjacent(blockPos_1, block_1);
}
}
if ((int_1 & 16) == 0)
{
int int_2 = int_1 & -2;
blockState_2.method_11637((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_1.updateNeighborStates((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_1.method_11637((net.minecraft.world.IWorld) this, blockPos_1, int_2);
}
this.onBlockChanged(blockPos_1, blockState_2, blockState_3);
}
return true;
}
}
}
>>>>>>>
private final Map<EntityType<?>, Entity> CACHED_ENTITIES = new HashMap<>();
@Override
public <T extends Entity> T getCachedEntity(EntityType<T> type) {
return (T) CACHED_ENTITIES.get(type);
}
@Override
public <T extends Entity> void setCachedEntity(EntityType<T> type, T entity) {
CACHED_ENTITIES.put(type, entity);
}
/**
* @author 2No2Name
*/
public boolean setBlockStateWithBlockEntity(BlockPos blockPos_1, BlockState blockState_1, BlockEntity newBlockEntity, int int_1)
{
if ((Object) this instanceof EmptyChunk)
return false;
if (World.isHeightInvalid(blockPos_1))
{
return false;
}
else if (!this.isClient && this.properties.getGeneratorType() == LevelGeneratorType.DEBUG_ALL_BLOCK_STATES)
{
return false;
}
else
{
WorldChunk worldChunk_1 = this.getWorldChunk(blockPos_1);
Block block_1 = blockState_1.getBlock();
BlockState blockState_2;
if (newBlockEntity != null && block_1 instanceof BlockEntityProvider)
blockState_2 = ((IWorldChunk) worldChunk_1).setBlockStateWithBlockEntity(blockPos_1, blockState_1, newBlockEntity, (int_1 & 64) != 0);
else
blockState_2 = worldChunk_1.setBlockState(blockPos_1, blockState_1, (int_1 & 64) != 0);
if (blockState_2 == null)
{
return false;
}
else
{
BlockState blockState_3 = this.getBlockState(blockPos_1);
if (blockState_3 != blockState_2 && (blockState_3.getLightSubtracted((BlockView) this, blockPos_1) != blockState_2.getLightSubtracted((BlockView) this, blockPos_1) || blockState_3.getLuminance() != blockState_2.getLuminance() || blockState_3.hasSidedTransparency() || blockState_2.hasSidedTransparency()))
{
this.profiler.push("queueCheckLight");
this.getChunkManager().getLightingProvider().enqueueLightUpdate(blockPos_1);
this.profiler.pop();
}
if (blockState_3 == blockState_1)
{
if (blockState_2 != blockState_3)
{
this.scheduleBlockRender(blockPos_1);
}
if ((int_1 & 2) != 0 && (!this.isClient || (int_1 & 4) == 0) && (this.isClient || worldChunk_1.getLevelType() != null && worldChunk_1.getLevelType().isAfter(ChunkHolder.LevelType.TICKING)))
{
this.updateListeners(blockPos_1, blockState_2, blockState_1, int_1);
}
if (!this.isClient && (int_1 & 1) != 0)
{
this.updateNeighbors(blockPos_1, blockState_2.getBlock());
if (blockState_1.hasComparatorOutput())
{
this.updateHorizontalAdjacent(blockPos_1, block_1);
}
}
if ((int_1 & 16) == 0)
{
int int_2 = int_1 & -2;
blockState_2.method_11637((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_1.updateNeighborStates((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_1.method_11637((net.minecraft.world.IWorld) this, blockPos_1, int_2);
}
this.onBlockChanged(blockPos_1, blockState_2, blockState_3);
}
return true;
}
}
} |
<<<<<<<
public void initialiseNestedObjectsWithNullValueDoesNothing() {
final Throwable throwable = catchThrowable(() -> OverrideUtil.initialiseNestedObjects(null));
assertThat(throwable).isNull();
}
@Test
=======
public void initialiseNestedObjectsWithNullValueDoesNothing() {
final Throwable throwable = catchThrowable(() -> OverrideUtil.initialiseNestedObjects(null));
assertThat(throwable).isNull();
}
@Test
>>>>>>>
public void initialiseNestedObjectsWithNullValueDoesNothing() {
final Throwable throwable = catchThrowable(() -> OverrideUtil.initialiseNestedObjects(null));
assertThat(throwable).isNull();
}
@Test
<<<<<<<
public void createConfigInstanceWithInterfaceReturnsNull() {
final ConfigKeyPair keyPair = OverrideUtil.createInstance(ConfigKeyPair.class);
assertThat(keyPair).isNull();
}
=======
public void createConfigInstanceWithInterfaceReturnsNull() {
final OverrideUtil interfaceObject = OverrideUtil.createInstance(OverrideUtil.class);
assertThat(interfaceObject).isNull();
}
@Test
public void overrideExistingValueKeyDataWithPrivateKeyData() {
Config config = OverrideUtil.createInstance(Config.class);
final String value = "NONCE";
OverrideUtil.setValue(config, "keys.keyData.config.privateKeyData.snonce", value);
assertThat(config.getKeys()).isNotNull();
KeyConfiguration keyConfig = config.getKeys();
assertThat(keyConfig.getKeyData()).hasSize(1);
assertThat(keyConfig.getKeyData().get(0)
.getConfig()
.getPrivateKeyData()
.getSnonce()).isEqualTo(value);
>>>>>>>
public void createConfigInstanceWithInterfaceReturnsNull() {
final OverrideUtil interfaceObject = OverrideUtil.createInstance(OverrideUtil.class);
assertThat(interfaceObject).isNull();
}
<<<<<<<
public void setValueOnNullDoesNothing() {
final Throwable throwable = catchThrowable(() -> OverrideUtil.setValue(null, "jdbc.username", "someuser"));
assertThat(throwable).isNull();
}
@Test
=======
public void setValueOnNullDoesNothing() {
final Throwable throwable = catchThrowable(() -> OverrideUtil.setValue(null, "jdbc.username", "someuser"));
assertThat(throwable).isNull();
}
@Test
>>>>>>>
public void setValueOnNullDoesNothing() {
final Throwable throwable = catchThrowable(() -> OverrideUtil.setValue(null, "jdbc.username", "someuser"));
assertThat(throwable).isNull();
}
@Test |
<<<<<<<
@Test
public void testNull() {
Expression e = null;
e = new Expression("null");
assertEquals(null, e.eval());
}
@Test
public void testCalculationWithNull() {
String err = "";
try {
new Expression("null+1").eval();
} catch (ArithmeticException e) {
err = e.getMessage();
}
assertEquals("First operand may not be null",err);
err = "";
try {
new Expression("1 + NULL").eval();
} catch (ArithmeticException e) {
err = e.getMessage();
}
assertEquals("Second operand may not be null",err);
err = "";
try {
new Expression("round(Null, 1)").eval();
} catch (ArithmeticException e) {
err = e.getMessage();
}
assertEquals("First operand may not be null",err);
err = "";
try {
new Expression("round(1, NulL)").eval();
} catch (ArithmeticException e) {
err = e.getMessage();
}
assertEquals("Second operand may not be null",err);
}
=======
@Test
public void canEvalHexExpression() throws Exception {
BigDecimal result = new Expression("0xcafe").eval();
assertEquals("51966", result.toPlainString());
}
@Test
public void hexExpressionCanUseUpperCaseCharacters() throws Exception {
BigDecimal result = new Expression("0XCAFE").eval();
assertEquals("51966", result.toPlainString());
}
@Test
public void longHexExpressionWorks() throws Exception {
BigDecimal result = new Expression("0xcafebabe", MathContext.DECIMAL128).eval();
assertEquals("3405691582", result.toPlainString());
}
@Test(expected = ExpressionException.class)
public void hexExpressionDoesNotAllowNonHexCharacters() throws Exception {
BigDecimal result = new Expression("0xbaby").eval();
}
@Test(expected = NumberFormatException.class)
public void throwsExceptionIfDoesNotContainHexDigits() throws Exception {
BigDecimal result = new Expression("0x").eval();
}
@Test
public void hexExpressionsEvaluatedAsExpected() throws Exception {
BigDecimal result = new Expression("0xcafe + 0xbabe").eval();
assertEquals("99772", result.toPlainString());
}
>>>>>>>
@Test
public void testNull() {
Expression e = null;
e = new Expression("null");
assertEquals(null, e.eval());
}
@Test
public void testCalculationWithNull() {
String err = "";
try {
new Expression("null+1").eval();
} catch (ArithmeticException e) {
err = e.getMessage();
}
assertEquals("First operand may not be null",err);
err = "";
try {
new Expression("1 + NULL").eval();
} catch (ArithmeticException e) {
err = e.getMessage();
}
assertEquals("Second operand may not be null",err);
err = "";
try {
new Expression("round(Null, 1)").eval();
} catch (ArithmeticException e) {
err = e.getMessage();
}
assertEquals("First operand may not be null",err);
err = "";
try {
new Expression("round(1, NulL)").eval();
} catch (ArithmeticException e) {
err = e.getMessage();
}
assertEquals("Second operand may not be null",err);
}
@Test
public void canEvalHexExpression() throws Exception {
BigDecimal result = new Expression("0xcafe").eval();
assertEquals("51966", result.toPlainString());
}
@Test
public void hexExpressionCanUseUpperCaseCharacters() throws Exception {
BigDecimal result = new Expression("0XCAFE").eval();
assertEquals("51966", result.toPlainString());
}
@Test
public void longHexExpressionWorks() throws Exception {
BigDecimal result = new Expression("0xcafebabe", MathContext.DECIMAL128).eval();
assertEquals("3405691582", result.toPlainString());
}
@Test(expected = ExpressionException.class)
public void hexExpressionDoesNotAllowNonHexCharacters() throws Exception {
BigDecimal result = new Expression("0xbaby").eval();
}
@Test(expected = NumberFormatException.class)
public void throwsExceptionIfDoesNotContainHexDigits() throws Exception {
BigDecimal result = new Expression("0x").eval();
}
@Test
public void hexExpressionsEvaluatedAsExpected() throws Exception {
BigDecimal result = new Expression("0xcafe + 0xbabe").eval();
assertEquals("99772", result.toPlainString());
} |
<<<<<<<
=======
import io.mycat.Response;
import io.vertx.core.impl.future.PromiseInternal;
>>>>>>>
import io.mycat.Response;
import io.vertx.core.impl.future.PromiseInternal; |
<<<<<<<
//
// /**
// * 参数:接收的sql
// */
// COMMANDS.put(EXECUTE_PLAN, new Command() {
// @Override
// public Runnable apply(MycatClient client, Context context, MycatSession session) {
// return () -> {
// block(session, mycat -> {
// try (CalciteConnection connection = CalciteEnvironment.INSTANCE.getConnection(MetadataManager.INSTANCE);) {
// connection.setSchema(client.getDefaultSchema());
// final FrameworkConfig config = Frameworks.newConfigBuilder()
// .defaultSchema(connection.getRootSchema()).build();
// DesRelNodeHandler desRelNodeHandler = new DesRelNodeHandler(config);
// RelRunner runner = connection.unwrap(RelRunner.class);
// String explain = context.getExplain();
// PreparedStatement prepare = runner.prepare(desRelNodeHandler.handle(explain));
// LOGGER.debug("session id:{} action: plan {}", session.sessionId(), explain);
// writeToMycatSession(session, new MycatResponse[]{new TextResultSetResponse(new JdbcRowBaseIteratorImpl(prepare, prepare.executeQuery()))});
// TransactionSessionUtil.afterDoAction();
// }
// });
// };
// }
//
// @Override
// public Runnable explain(MycatClient client, Context context, MycatSession session) {
// return () -> {
// block(session, mycat -> {
// try (CalciteConnection connection = CalciteEnvironment.INSTANCE.getConnection(MetadataManager.INSTANCE);) {
// connection.setSchema(client.getDefaultSchema());
// final FrameworkConfig config = Frameworks.newConfigBuilder().defaultSchema(connection.getRootSchema()).build();
// writePlan(session, RelOptUtil.toString(new DesRelNodeHandler(config).handle(context.getExplain())));
// TransactionSessionUtil.afterDoAction();
// }
// });
// return;
// };
// }
// });
=======
/**
* 参数:接收的sql
*/
COMMANDS.put(EXECUTE_PLAN, new Command() {
@Override
public Runnable apply(MycatClient client, Context context, MycatSession session) {
return () -> {
block(session, mycat -> {
try (CalciteConnection connection = CalciteEnvironment.INSTANCE.getConnection(MetadataManager.INSTANCE);) {
connection.setSchema(client.getDefaultSchema());
final FrameworkConfig config = Frameworks.newConfigBuilder()
.defaultSchema(connection.getRootSchema()).build();
DesRelNodeHandler desRelNodeHandler = new DesRelNodeHandler(config);
RelRunner runner = connection.unwrap(RelRunner.class);
String explain = context.getExplain();
PreparedStatement prepare = runner.prepare(desRelNodeHandler.handle(explain));
LOGGER.debug("session id:{} action: plan {}", session.sessionId(), explain);
writeToMycatSession(session, new MycatResponse[]{new TextResultSetResponse(new JdbcRowBaseIteratorImpl(prepare, prepare.executeQuery()))});
TransactionSessionUtil.afterDoAction();
}
});
};
}
@Override
public Runnable explain(MycatClient client, Context context, MycatSession session) {
return () -> {
block(session, mycat -> {
try (CalciteConnection connection = CalciteEnvironment.INSTANCE.getConnection(MetadataManager.INSTANCE);) {
connection.setSchema(client.getDefaultSchema());
final FrameworkConfig config = Frameworks.newConfigBuilder().defaultSchema(connection.getRootSchema()).build();
writePlan(session, RelOptUtil.toString(new DesRelNodeHandler(config).handle(context.getExplain())));
TransactionSessionUtil.afterDoAction();
}
});
return;
};
}
});
>>>>>>>
//
// /**
// * 参数:接收的sql
// */
// COMMANDS.put(EXECUTE_PLAN, new Command() {
// @Override
// public Runnable apply(MycatClient client, Context context, MycatSession session) {
// return () -> {
// block(session, mycat -> {
// try (CalciteConnection connection = CalciteEnvironment.INSTANCE.getConnection(MetadataManager.INSTANCE);) {
// connection.setSchema(client.getDefaultSchema());
// final FrameworkConfig config = Frameworks.newConfigBuilder()
// .defaultSchema(connection.getRootSchema()).build();
// DesRelNodeHandler desRelNodeHandler = new DesRelNodeHandler(config);
// RelRunner runner = connection.unwrap(RelRunner.class);
// String explain = context.getExplain();
// PreparedStatement prepare = runner.prepare(desRelNodeHandler.handle(explain));
// LOGGER.debug("session id:{} action: plan {}", session.sessionId(), explain);
// writeToMycatSession(session, new MycatResponse[]{new TextResultSetResponse(new JdbcRowBaseIteratorImpl(prepare, prepare.executeQuery()))});
// TransactionSessionUtil.afterDoAction();
// }
// });
// };
// }
//
// @Override
// public Runnable explain(MycatClient client, Context context, MycatSession session) {
// return () -> {
// block(session, mycat -> {
// try (CalciteConnection connection = CalciteEnvironment.INSTANCE.getConnection(MetadataManager.INSTANCE);) {
// connection.setSchema(client.getDefaultSchema());
// final FrameworkConfig config = Frameworks.newConfigBuilder().defaultSchema(connection.getRootSchema()).build();
// writePlan(session, RelOptUtil.toString(new DesRelNodeHandler(config).handle(context.getExplain())));
// TransactionSessionUtil.afterDoAction();
// }
// });
// return;
// };
// }
// });
/**
* 参数:接收的sql
*/
// COMMANDS.put(EXECUTE_PLAN, new Command() {
// @Override
// public Runnable apply(MycatClient client, Context context, MycatSession session) {
// return () -> {
// block(session, mycat -> {
// try (CalciteConnection connection = CalciteEnvironment.INSTANCE.getConnection(MetadataManager.INSTANCE);) {
// connection.setSchema(client.getDefaultSchema());
// final FrameworkConfig config = Frameworks.newConfigBuilder()
// .defaultSchema(connection.getRootSchema()).build();
// DesRelNodeHandler desRelNodeHandler = new DesRelNodeHandler(config);
// RelRunner runner = connection.unwrap(RelRunner.class);
// String explain = context.getExplain();
// PreparedStatement prepare = runner.prepare(desRelNodeHandler.handle(explain));
// LOGGER.debug("session id:{} action: plan {}", session.sessionId(), explain);
// writeToMycatSession(session, new MycatResponse[]{new TextResultSetResponse(new JdbcRowBaseIteratorImpl(prepare, prepare.executeQuery()))});
// TransactionSessionUtil.afterDoAction();
// }
// });
// };
// }
//
// @Override
// public Runnable explain(MycatClient client, Context context, MycatSession session) {
// return () -> {
// block(session, mycat -> {
// try (CalciteConnection connection = CalciteEnvironment.INSTANCE.getConnection(MetadataManager.INSTANCE);) {
// connection.setSchema(client.getDefaultSchema());
// final FrameworkConfig config = Frameworks.newConfigBuilder().defaultSchema(connection.getRootSchema()).build();
// writePlan(session, RelOptUtil.toString(new DesRelNodeHandler(config).handle(context.getExplain())));
// TransactionSessionUtil.afterDoAction();
// }
// });
// return;
// };
// }
// }); |
<<<<<<<
import com.alibaba.fastsql.sql.ast.statement.SQLUpdateStatement;
import io.mycat.*;
=======
import com.alibaba.fastsql.sql.dialect.mysql.ast.statement.MySqlDeleteStatement;
import com.alibaba.fastsql.sql.dialect.mysql.ast.statement.MySqlInsertStatement;
import com.alibaba.fastsql.sql.dialect.mysql.ast.statement.MySqlUpdateStatement;
import io.mycat.DataNode;
import io.mycat.MycatConnection;
import io.mycat.MycatDataContext;
import io.mycat.TransactionSession;
>>>>>>>
import com.alibaba.fastsql.sql.ast.statement.SQLUpdateStatement;
import io.mycat.*;
import com.alibaba.fastsql.sql.dialect.mysql.ast.statement.MySqlDeleteStatement;
import com.alibaba.fastsql.sql.dialect.mysql.ast.statement.MySqlInsertStatement;
import com.alibaba.fastsql.sql.dialect.mysql.ast.statement.MySqlUpdateStatement;
import io.mycat.DataNode;
import io.mycat.MycatConnection;
import io.mycat.MycatDataContext;
import io.mycat.TransactionSession;
<<<<<<<
import io.mycat.calcite.rewriter.Distribution;
import io.mycat.gsi.GSIService;
=======
import io.mycat.calcite.rewriter.Distribution;
>>>>>>>
import io.mycat.calcite.rewriter.Distribution;
import io.mycat.gsi.GSIService;
<<<<<<<
import java.sql.Connection;
import java.sql.SQLException;
=======
import java.sql.*;
>>>>>>>
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.*;
<<<<<<<
private final MycatDataContext context;
private final Distribution distribution;
/**
* 逻辑语法树(用户在前端写的SQL语句)
*/
private final SQLStatement logicStatement;
/**
* 逻辑参数 (用户在前端写的SQL语句中的参数)
*/
private final List<Object> logicParameters;
/**
* 由逻辑SQL 改成真正发送给后端数据库的sql语句. 一个不可变的集合 {@link Collections#unmodifiableSet(Set)}
*/
private final Set<SQL> reallySqlSet;
private final DataSourceFactory factory;
=======
private MycatDataContext context;
private final Distribution values;
private final SQLStatement sqlStatement;
private List<Object> inParameters;
private List<Object> outParameters;
private final HashSet<GroupKey> groupKeys;
private DataSourceFactory factory;
>>>>>>>
private final MycatDataContext context;
private final Distribution distribution;
/**
* 逻辑语法树(用户在前端写的SQL语句)
*/
private final SQLStatement logicStatement;
/**
* 逻辑参数 (用户在前端写的SQL语句中的参数)
*/
private final List<Object> logicParameters;
/**
* 由逻辑SQL 改成真正发送给后端数据库的sql语句. 一个不可变的集合 {@link Collections#unmodifiableSet(Set)}
*/
private final Set<SQL> reallySqlSet;
private final DataSourceFactory factory;
<<<<<<<
this.distribution = distribution;
this.logicStatement = logicStatement;
this.logicParameters = parameters;
=======
this.values = values;
this.sqlStatement = sqlStatement;
this.inParameters = parameters;
>>>>>>>
this.distribution = distribution;
this.logicStatement = logicStatement;
this.logicParameters = parameters;
<<<<<<<
String sql = apply(parameterizedSql, logicParameters);
return Pair.of(key.getTarget(), sql);
=======
String sql = apply(parameterizedSql, inParameters);
return Pair.of(context.resolveDatasourceTargetName(key.getTarget(),true), sql);
>>>>>>>
String sql = apply(parameterizedSql, logicParameters);
return Pair.of(key.getTarget(), sql);
<<<<<<<
LOGGER.debug("{} targetName:{} sql:{} parameters:{} ", mycatConnection, target, parameterizedSql, logicParameters);
=======
LOGGER.debug("{} targetName:{} sql:{} parameters:{} ", mycatConnection, target, sql, inParameters);
>>>>>>>
LOGGER.debug("{} targetName:{} sql:{} parameters:{} ", mycatConnection, target, parameterizedSql, logicParameters);
<<<<<<<
SQL.UpdateResult updateResult = sql.executeUpdate(connection);
Long lastInsertId = updateResult.getLastInsertId();
int subAffectedRow = updateResult.getAffectedRow();
sqlRecord.addSubRecord(parameterizedSql,start,SqlRecord.now(),target,subAffectedRow);
=======
PreparedStatement preparedStatement = connection.prepareStatement(sql, insertId ? Statement.RETURN_GENERATED_KEYS : NO_GENERATED_KEYS);
ParameterMetaData parameterMetaData = preparedStatement.getParameterMetaData();
if (parameterMetaData.getParameterCount() > 0) {
MycatPreparedStatementUtil.setParams(preparedStatement, outParameters);
}
int subAffectedRow = 0;
subAffectedRow = preparedStatement.executeUpdate();
sqlRecord.addSubRecord(sql, start, SqlRecord.now(), target, subAffectedRow);
>>>>>>>
SQL.UpdateResult updateResult = sql.executeUpdate(connection);
Long lastInsertId = updateResult.getLastInsertId();
int subAffectedRow = updateResult.getAffectedRow();
sqlRecord.addSubRecord(parameterizedSql,start,SqlRecord.now(),target,subAffectedRow);
<<<<<<<
private static Set<SQL> buildReallySqlList(Distribution distribution, SQLStatement statement, List<Object> parameters) {
Iterable<DataNode> dataNodes = distribution.getDataNodes(parameters);
Map<SQL,SQL> sqlMap = new LinkedHashMap<>();
=======
@NotNull
private HashSet<GroupKey> getGroup() {
Iterable<DataNode> dataNodes = values.getDataNodes(inParameters);
HashSet<GroupKey> groupHashMap = new HashSet<>();
>>>>>>>
private static Set<SQL> buildReallySqlList(Distribution distribution, SQLStatement statement, List<Object> parameters) {
Iterable<DataNode> dataNodes = distribution.getDataNodes(parameters);
Map<SQL,SQL> sqlMap = new LinkedHashMap<>();
<<<<<<<
for (SQL sql : reallySqlSet) {
String target = sql.getTarget();
String parameterizedSql = sql.getParameterizedSql();
explainWriter.item("target:" + target + " " + parameterizedSql, logicParameters);
=======
for (GroupKey groupKey : groupKeys) {
String target = groupKey.getTarget();
String parameterizedSql = groupKey.getParameterizedSql();
explainWriter.item("target:" + target + " " + parameterizedSql, inParameters);
>>>>>>>
for (SQL sql : reallySqlSet) {
String target = sql.getTarget();
String parameterizedSql = sql.getParameterizedSql();
explainWriter.item("target:" + target + " " + parameterizedSql, logicParameters); |
<<<<<<<
import java.util.Map;
=======
import java.util.Locale;
>>>>>>>
import java.util.Map;
import java.util.Locale;
<<<<<<<
=======
private short mConnectionSecurity;
private String mUsername; /* Stores the username for authentications */
private String mAlias; /* Stores the alias for the user's mailbox */
private String mPassword; /* Stores the password for authentications */
private String mUrl; /* Stores the base URL for the server */
private String mHost; /* Stores the host name for the server */
private String mPath; /* Stores the path for the server */
private String mAuthPath; /* Stores the path off of the server to post data to for form based authentication */
private String mMailboxPath; /* Stores the user specified path to the mailbox */
private URI mUri; /* Stores the Uniform Resource Indicator with all connection info */
private boolean mSecure;
private WebDavHttpClient mHttpClient = null;
private HttpContext mContext = null;
private String mAuthString;
private CookieStore mAuthCookies = null;
private short mAuthentication = AUTH_TYPE_NONE;
private String mCachedLoginUrl;
private Folder mSendFolder = null;
private HashMap<String, WebDavFolder> mFolderList = new HashMap<String, WebDavFolder>();
>>>>>>> |
<<<<<<<
public static final MessageFormat DEFAULT_MESSAGE_FORMAT = MessageFormat.HTML;
public static final QuoteStyle DEFAULT_QUOTE_STYLE = QuoteStyle.PREFIX;
public static final String DEFAULT_QUOTE_PREFIX = ">";
public static final boolean DEFAULT_REPLY_AFTER_QUOTE = false;
public static final String ACCOUNT_DESCRIPTION_KEY = "description";
public static final String STORE_URI_KEY = "storeUri";
public static final String TRANSPORT_URI_KEY = "transportUri";
public static final String IDENTITY_NAME_KEY = "name";
public static final String IDENTITY_EMAIL_KEY = "email";
public static final String IDENTITY_DESCRIPTION_KEY = "description";
=======
private static final MessageFormat DEFAULT_MESSAGE_FORMAT = MessageFormat.HTML;
private static final boolean DEFAULT_MESSAGE_READ_RECEIPT = false;
private static final QuoteStyle DEFAULT_QUOTE_STYLE = QuoteStyle.PREFIX;
private static final String DEFAULT_QUOTE_PREFIX = ">";
private static final boolean DEFAULT_QUOTED_TEXT_SHOWN = true;
private static final boolean DEFAULT_REPLY_AFTER_QUOTE = false;
>>>>>>>
public static final MessageFormat DEFAULT_MESSAGE_FORMAT = MessageFormat.HTML;
public static final boolean DEFAULT_MESSAGE_READ_RECEIPT = false;
public static final QuoteStyle DEFAULT_QUOTE_STYLE = QuoteStyle.PREFIX;
public static final String DEFAULT_QUOTE_PREFIX = ">";
public static final boolean DEFAULT_QUOTED_TEXT_SHOWN = true;
public static final boolean DEFAULT_REPLY_AFTER_QUOTE = false;
public static final String ACCOUNT_DESCRIPTION_KEY = "description";
public static final String STORE_URI_KEY = "storeUri";
public static final String TRANSPORT_URI_KEY = "transportUri";
public static final String IDENTITY_NAME_KEY = "name";
public static final String IDENTITY_EMAIL_KEY = "email";
public static final String IDENTITY_DESCRIPTION_KEY = "description"; |
<<<<<<<
import com.actionbarsherlock.app.SherlockDialogFragment;
import com.fsck.k9.K9;
=======
>>>>>>>
import com.fsck.k9.K9; |
<<<<<<<
=======
import android.text.Editable;
import android.text.TextUtils.TruncateAt;
import android.text.TextWatcher;
>>>>>>>
import android.text.TextUtils.TruncateAt; |
<<<<<<<
private ActivityListener mListener = new ActivityListener() {
@Override
public void informUserOfStatus() {
mHandler.refreshTitle();
}
=======
private ActivityListener mListener = new ActivityListener() {
>>>>>>>
private ActivityListener mListener = new ActivityListener() {
@Override
public void informUserOfStatus() {
mHandler.refreshTitle();
}
<<<<<<<
public void listFoldersStarted(Account account) {
if (account.equals(mAccount)) {
mHandler.progress(true);
=======
public void listFoldersStarted(Account account) {
if (!account.equals(mAccount)) {
return;
>>>>>>>
public void listFoldersStarted(Account account) {
if (account.equals(mAccount)) {
mHandler.progress(true);
<<<<<<<
public void listFoldersFailed(Account account, String message) {
if (account.equals(mAccount)) {
=======
public void listFoldersFailed(Account account, String message) {
if (!account.equals(mAccount)) {
return;
}
>>>>>>>
public void listFoldersFailed(Account account, String message) {
if (account.equals(mAccount)) {
<<<<<<<
if (Config.LOGV) {
Log.v(K9.LOG_TAG, "listFoldersFailed " + message);
}
=======
if (Config.LOGV) {
Log.v(K9.LOG_TAG, "listFoldersFailed " + message);
>>>>>>>
if (Config.LOGV) {
Log.v(K9.LOG_TAG, "listFoldersFailed " + message);
}
<<<<<<<
public void listFoldersFinished(Account account) {
if (account.equals(mAccount)) {
=======
public void listFoldersFinished(Account account) {
if (!account.equals(mAccount)) {
return;
}
>>>>>>>
public void listFoldersFinished(Account account) {
if (account.equals(mAccount)) {
<<<<<<<
Collections.sort(newFolders);
Collections.sort(topFolders);
topFolders.addAll(newFolders);
mHandler.newFolders(topFolders);
=======
if (folder.isInTopGroup()) {
topFolders.add(holder);
} else {
newFolders.add(holder);
}
>>>>>>>
Collections.sort(newFolders);
Collections.sort(topFolders);
topFolders.addAll(newFolders);
mHandler.newFolders(topFolders);
<<<<<<<
if (account.equals(mAccount)) {
=======
mHandler.refreshTitle();
if (!account.equals(mAccount)) {
return;
}
mHandler.progress(true);
mHandler.folderLoading(folder, true);
mHandler.dataChanged();
}
@Override
public void synchronizeMailboxHeadersStarted(Account account, String folder) {
super.synchronizeMailboxHeadersStarted(account, folder);
mHandler.refreshTitle();
}
@Override
public void synchronizeMailboxHeadersProgress(Account account, String folder, int completed, int total) {
super.synchronizeMailboxHeadersProgress(account, folder, completed, total);
mHandler.refreshTitle();
}
@Override
public void synchronizeMailboxHeadersFinished(Account account, String folder,
int total, int completed) {
super.synchronizeMailboxHeadersFinished(account, folder, total, completed);
mHandler.refreshTitle();
}
>>>>>>>
if (account.equals(mAccount)) {
<<<<<<<
=======
@Override
public void synchronizeMailboxProgress(Account account, String folder, int completed, int total) {
super.synchronizeMailboxProgress(account, folder, completed, total);
mHandler.refreshTitle();
>>>>>>>
<<<<<<<
if (account.equals(mAccount)) {
mHandler.progress(false);
mHandler.folderLoading(folder, false);
=======
mHandler.refreshTitle();
if (!account.equals(mAccount)) {
return;
}
mHandler.progress(false);
mHandler.folderLoading(folder, false);
refreshFolder(account, folder);
>>>>>>>
if (account.equals(mAccount)) {
mHandler.progress(false);
mHandler.folderLoading(folder, false);
<<<<<<<
public void synchronizeMailboxFailed(Account account, String folder, String message) {
=======
public void synchronizeMailboxFailed(Account account, String folder,
String message) {
>>>>>>>
public void synchronizeMailboxFailed(Account account, String folder, String message) {
<<<<<<<
if (!account.equals(mAccount)) {
=======
mHandler.refreshTitle();
if (!account.equals(mAccount)) {
>>>>>>>
if (!account.equals(mAccount)) {
<<<<<<<
if (account.equals(mAccount)) {
refreshFolder(account, mAccount.getOutboxFolderName());
=======
mHandler.refreshTitle();
if (!account.equals(mAccount)) {
return;
>>>>>>>
if (account.equals(mAccount)) {
refreshFolder(account, mAccount.getOutboxFolderName());
<<<<<<<
if (account.equals(mAccount)) {
mHandler.dataChanged();
=======
if (!account.equals(mAccount)) {
return;
>>>>>>>
if (account.equals(mAccount)) {
mHandler.dataChanged(); |
<<<<<<<
private MessageReference mActiveMessage;
/**
* {@code true} after {@link #onCreate(Bundle)} was executed. Used in {@link #updateTitle()} to
* make sure we don't access member variables before initialization is complete.
*/
private boolean mInitialized = false;
=======
private boolean mLoaderJustInitialized;
>>>>>>>
private boolean mLoaderJustInitialized;
private MessageReference mActiveMessage;
/**
* {@code true} after {@link #onCreate(Bundle)} was executed. Used in {@link #updateTitle()} to
* make sure we don't access member variables before initialization is complete.
*/
private boolean mInitialized = false;
<<<<<<<
private static final int ACTION_OPEN_MESSAGE = 6;
=======
private static final int ACTION_RESTORE_LIST_POSITION = 6;
>>>>>>>
private static final int ACTION_RESTORE_LIST_POSITION = 6;
private static final int ACTION_OPEN_MESSAGE = 7;
<<<<<<<
public void openMessage(MessageReference messageReference) {
android.os.Message msg = android.os.Message.obtain(this, ACTION_OPEN_MESSAGE,
messageReference);
sendMessage(msg);
}
=======
public void restoreListPosition() {
if (!hasMessages(ACTION_RESTORE_LIST_POSITION)) {
android.os.Message msg = android.os.Message.obtain(this,
ACTION_RESTORE_LIST_POSITION);
sendMessage(msg);
}
}
>>>>>>>
public void restoreListPosition() {
if (!hasMessages(ACTION_RESTORE_LIST_POSITION)) {
android.os.Message msg = android.os.Message.obtain(this,
ACTION_RESTORE_LIST_POSITION);
sendMessage(msg);
}
}
public void openMessage(MessageReference messageReference) {
android.os.Message msg = android.os.Message.obtain(this, ACTION_OPEN_MESSAGE,
messageReference);
sendMessage(msg);
}
<<<<<<<
case ACTION_OPEN_MESSAGE: {
MessageReference messageReference = (MessageReference) msg.obj;
mFragmentListener.openMessage(messageReference);
break;
}
=======
case ACTION_RESTORE_LIST_POSITION: {
mListView.onRestoreInstanceState(mSavedListState);
mSavedListState = null;
break;
}
>>>>>>>
case ACTION_RESTORE_LIST_POSITION: {
mListView.onRestoreInstanceState(mSavedListState);
mSavedListState = null;
break;
}
case ACTION_OPEN_MESSAGE: {
MessageReference messageReference = (MessageReference) msg.obj;
mFragmentListener.openMessage(messageReference);
break;
}
<<<<<<<
outState.putParcelable(STATE_ACTIVE_MESSAGE, mActiveMessage);
=======
outState.putParcelable(STATE_MESSAGE_LIST, mListView.onSaveInstanceState());
>>>>>>>
outState.putParcelable(STATE_MESSAGE_LIST, mListView.onSaveInstanceState());
outState.putParcelable(STATE_ACTIVE_MESSAGE, mActiveMessage);
<<<<<<<
mActiveMessage = savedInstanceState.getParcelable(STATE_ACTIVE_MESSAGE);
=======
mSavedListState = savedInstanceState.getParcelable(STATE_MESSAGE_LIST);
>>>>>>>
mSavedListState = savedInstanceState.getParcelable(STATE_MESSAGE_LIST);
mActiveMessage = savedInstanceState.getParcelable(STATE_ACTIVE_MESSAGE); |
<<<<<<<
public void loadContactPicture(Address address, QuickContactBadge badge) {
String email = address.getAddress();
=======
public void loadContactPicture(Address address, QuickContactBadge badge) {
String email = address.getAddress();
>>>>>>>
public void loadContactPicture(Address address, QuickContactBadge badge) {
String email = address.getAddress();
<<<<<<<
} else if (isEmailInUnknownContactsCache(email)) {
// This email address doesn't belong to a contact we have a picture for. Use the
// default picture.
badge.setImageBitmap(calculateFallbackBitmap(address));
=======
>>>>>>>
<<<<<<<
bitmap = calculateFallbackBitmap(mAddress);
=======
bitmap = calculateFallbackBitmap(mAddress);
>>>>>>>
bitmap = calculateFallbackBitmap(mAddress); |
<<<<<<<
// This will be called either automatically for you on 2.0
// or later, or by the code above on earlier versions of the
// platform.
if (mEncryptCheckbox.isChecked()) {
showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED);
}
else if (mDraftNeedsSaving) {
=======
if (mDraftNeedsSaving) {
>>>>>>>
if (mEncryptCheckbox.isChecked()) {
showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED);
}
else if (mDraftNeedsSaving) { |
<<<<<<<
MessageListFragment fragment = MessageListFragment.newInstance(mSearch, false, true);
addMessageListFragment(fragment);
=======
MessageListFragment fragment = MessageListFragment.newInstance(searchAccount, searchFolder,
queryString, true);
mMenu.findItem(R.id.search_remote).setVisible(false);
addMessageListFragment(fragment, false);
>>>>>>>
MessageListFragment fragment = MessageListFragment.newInstance(mSearch, false, true);
mMenu.findItem(R.id.search_remote).setVisible(false);
addMessageListFragment(fragment, false); |
<<<<<<<
import com.quorum.tessera.config.*;
import com.quorum.tessera.io.FilesDelegate;
import org.junit.Before;
=======
import com.quorum.tessera.config.KeyData;
import com.quorum.tessera.config.KeyDataConfig;
import com.quorum.tessera.config.PrivateKeyData;
import com.quorum.tessera.config.keypairs.ConfigKeyPair;
import com.quorum.tessera.config.keypairs.DirectKeyPair;
import com.quorum.tessera.config.keypairs.FilesystemKeyPair;
import com.quorum.tessera.config.keypairs.InlineKeypair;
>>>>>>>
import com.quorum.tessera.config.KeyData;
import com.quorum.tessera.config.KeyDataConfig;
import com.quorum.tessera.config.PrivateKeyData;
import com.quorum.tessera.config.keypairs.ConfigKeyPair;
import com.quorum.tessera.config.keypairs.DirectKeyPair;
import com.quorum.tessera.config.keypairs.FilesystemKeyPair;
import com.quorum.tessera.config.keypairs.InlineKeypair;
<<<<<<<
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
=======
>>>>>>>
<<<<<<<
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
=======
import static org.assertj.core.api.Assertions.assertThat;
>>>>>>>
import static org.assertj.core.api.Assertions.assertThat;
<<<<<<<
public void marshallUnlockedKey() {
final KeyData keyData = new KeyData(new KeyDataConfig(null, UNLOCKED), "PRIV", "PUB", null, null, null, null);
final KeyData marshalledKey = adapter.marshal(keyData);
=======
public void marshallDirectKeys() {
final ConfigKeyPair keys = new DirectKeyPair("PUB", "PRIV");
final KeyData expected = new KeyData(null, "PRIV", "PUB", null, null);
>>>>>>>
public void marshallDirectKeys() {
final ConfigKeyPair keys = new DirectKeyPair("PUB", "PRIV");
final KeyData expected = new KeyData(null, "PRIV", "PUB", null, null, null, null);
<<<<<<<
public void marshallKeyWithoutConfiguration() {
final KeyData keyData = new KeyData(null, "PRIV", "PUB", null, null, null, null);
=======
public void marshallInlineKeys() {
final PrivateKeyData pkd = new PrivateKeyData("val", null, null, null, null, null);
final ConfigKeyPair keys = new InlineKeypair("PUB", new KeyDataConfig(pkd, UNLOCKED));
final KeyData expected = new KeyData(new KeyDataConfig(pkd, UNLOCKED), null, "PUB", null, null);
>>>>>>>
public void marshallInlineKeys() {
final PrivateKeyData pkd = new PrivateKeyData("val", null, null, null, null, null);
final ConfigKeyPair keys = new InlineKeypair("PUB", new KeyDataConfig(pkd, UNLOCKED));
final KeyData expected = new KeyData(new KeyDataConfig(pkd, UNLOCKED), null, "PUB", null, null, null, null);
<<<<<<<
final KeyData keyData = new KeyData(
new KeyDataConfig(new PrivateKeyData(null, null, null, null, null, null), PrivateKeyType.LOCKED),
"PRIV", "PUB", null, null, null, null
);
=======
final KeyData marshalledKey = adapter.marshal(keys);
>>>>>>>
final KeyData marshalledKey = adapter.marshal(keys);
<<<<<<<
public void unmarshallKeysWithUnlockedPrivateKey() {
final KeyData keyData = new KeyData(
new KeyDataConfig(
new PrivateKeyData("LITERAL_PRIVATE", null, null, null, null, null),
UNLOCKED
),
null,
"PUB",
null,
null,
null,
null
);
final KeyData unmarshalled = adapter.unmarshal(keyData);
assertThat(unmarshalled.getPrivateKey()).isEqualTo("LITERAL_PRIVATE");
}
@Test
public void unmarshallKeysWithLockedPrivateKey() {
final KeyData keyData = new KeyData(
new KeyDataConfig(
new PrivateKeyData(
null,
"x3HUNXH6LQldKtEv3q0h0hR4S12Ur9pC",
"7Sem2tc6fjEfW3yYUDN/kSslKEW0e1zqKnBCWbZu2Zw=",
"d0CmRus0rP0bdc7P7d/wnOyEW14pwFJmcLbdu2W3HmDNRWVJtoNpHrauA/Sr5Vxc",
new ArgonOptions("id", 10, 1048576, 4),
"q"
),
PrivateKeyType.LOCKED
),
null,
"PUB", null, null, null, null
);
final KeyData unmarshalled = adapter.unmarshal(keyData);
assertThat(unmarshalled.getPrivateKey()).isEqualTo("6ccai0+GXRRVbNckE+JubN+UQ9+8pMCx86dZI683X7w=");
}
@Test
public void fileUnmarshallingSucceeds() throws IOException {
final String publicKey = "publicKey";
final String privateKey = "{\"data\":{\"bytes\":\"Wl+xSyXVuuqzpvznOS7dOobhcn4C5auxkFRi7yLtgtA=\"},\"type\":\"unlocked\"}";
final Path pub = Files.createTempFile("public", ".pub");
final Path priv = Files.createTempFile("private", ".key");
Files.write(pub, publicKey.getBytes(UTF_8));
Files.write(priv, privateKey.getBytes(UTF_8));
final KeyData keyData = new KeyData(null, null, null, priv, pub, null, null);
final KeyData resolved = this.adapter.unmarshal(keyData);
assertThat(resolved.getPublicKey()).isEqualTo(publicKey);
assertThat(resolved.getPrivateKey()).isEqualTo("Wl+xSyXVuuqzpvznOS7dOobhcn4C5auxkFRi7yLtgtA=");
assertThat(resolved.getConfig().getType()).isEqualTo(UNLOCKED);
}
@Test
public void bothPathsMustBeSetIfUsingKeyPathsPrivReturnsAndDoesNotThrowError() throws Exception {
final Path priv = Files.createTempFile("private", ".key");
final KeyData badConfig = new KeyData(null, null, null, priv, null, null, null);
KeyData result = this.adapter.unmarshal(badConfig);
assertThat(result).isSameAs(badConfig);
}
@Test
public void bothPathsMustBeSetIfUsingKeyPathsPubReturnsAndDoesNotThrowError() throws Exception {
final Path pub = Files.createTempFile("public", ".pub");
final KeyData badConfig = new KeyData(null, null, null, null, pub, null, null);
KeyData result = this.adapter.unmarshal(badConfig);
assertThat(result).isSameAs(badConfig);
}
@Test
public void decryptingPrivateKeyWithWrongPasswordErrorsReturnsAndDoesNotThrowError() {
final KeyData keyData = new KeyData(
new KeyDataConfig(
new PrivateKeyData(
null,
"x3HUNXH6LQldKtEv3q0h0hR4S12Ur9pC",
"7Sem2tc6fjEfW3yYUDN/kSslKEW0e1zqKnBCWbZu2Zw=",
"d0CmRus0rP0bdc7P7d/wnOyEW14pwFJmcLbdu2W3HmDNRWVJtoNpHrauA/Sr5Vxc",
new ArgonOptions("id", 10, 1048576, 4),
"badpassword"
),
PrivateKeyType.LOCKED
),
null,
"PUB", null, null, null, null
);
KeyData result = this.adapter.unmarshal(keyData);
assertThat(result.getPrivateKey()).startsWith("NACL_FAILURE");
}
@Test
public void unmarshallingLockedWithNoPasswordFailsReturnsAndDoesNotThrowError() {
final KeyData keyData = new KeyData(
new KeyDataConfig(
new PrivateKeyData(
null,
"x3HUNXH6LQldKtEv3q0h0hR4S12Ur9pC",
"7Sem2tc6fjEfW3yYUDN/kSslKEW0e1zqKnBCWbZu2Zw=",
"d0CmRus0rP0bdc7P7d/wnOyEW14pwFJmcLbdu2W3HmDNRWVJtoNpHrauA/Sr5Vxc",
new ArgonOptions("id", 10, 1048576, 4),
null
),
PrivateKeyType.LOCKED
),
null,
"PUB", null, null, null, null
);
KeyData result = this.adapter.unmarshal(keyData);
assertThat(result).isSameAs(keyData);
}
@Test
public void unmarshallingLockedWithNonExistentPublicKeyFileFailsReturnsAndDoesNotThrowError() {
FilesDelegate filesDelegate = mock(FilesDelegate.class);
adapter.setFilesDelegate(filesDelegate);
Path privateKeyPath = mock(Path.class);
Path publicKeyPath = mock(Path.class);
when(filesDelegate.notExists(publicKeyPath)).thenReturn(true);
when(filesDelegate.notExists(privateKeyPath)).thenReturn(false);
final KeyData keyData = new KeyData(
new KeyDataConfig(
new PrivateKeyData(
null,
"x3HUNXH6LQldKtEv3q0h0hR4S12Ur9pC",
"7Sem2tc6fjEfW3yYUDN/kSslKEW0e1zqKnBCWbZu2Zw=",
"d0CmRus0rP0bdc7P7d/wnOyEW14pwFJmcLbdu2W3HmDNRWVJtoNpHrauA/Sr5Vxc",
new ArgonOptions("id", 10, 1048576, 4),
null
),
PrivateKeyType.LOCKED
),
null,
"PUB", privateKeyPath, publicKeyPath.toAbsolutePath(),
null, null
);
KeyData result = this.adapter.unmarshal(keyData);
assertThat(result).isSameAs(keyData);
}
@Test
public void unmarshallingLockedWithNonExistentPrivateKeyFileFailsReturnsAndDoesNotThrowError() {
FilesDelegate filesDelegate = mock(FilesDelegate.class);
adapter.setFilesDelegate(filesDelegate);
Path privateKeyPath = mock(Path.class);
Path publicKeyPath = mock(Path.class);
when(filesDelegate.notExists(publicKeyPath)).thenReturn(false);
when(filesDelegate.notExists(privateKeyPath)).thenReturn(true);
final KeyData keyData = new KeyData(
new KeyDataConfig(
new PrivateKeyData(
null,
"x3HUNXH6LQldKtEv3q0h0hR4S12Ur9pC",
"7Sem2tc6fjEfW3yYUDN/kSslKEW0e1zqKnBCWbZu2Zw=",
"d0CmRus0rP0bdc7P7d/wnOyEW14pwFJmcLbdu2W3HmDNRWVJtoNpHrauA/Sr5Vxc",
new ArgonOptions("id", 10, 1048576, 4),
null
),
PrivateKeyType.LOCKED
),
null,
"PUB", privateKeyPath, publicKeyPath,
null, null
);
KeyData result = this.adapter.unmarshal(keyData);
assertThat(result).isSameAs(keyData);
=======
public void unmarshallingDirectKeysGivesCorrectKeypair() {
final KeyData input = new KeyData(null, "private", "public", null, null);
>>>>>>>
public void unmarshallingDirectKeysGivesCorrectKeypair() {
final KeyData input = new KeyData(null, "private", "public", null, null, null, null);
<<<<<<<
public void pathsSetDoesntReturnWholeConfig() {
final KeyData keyData = new KeyData(
new KeyDataConfig(
new PrivateKeyData(
null,
"x3HUNXH6LQldKtEv3q0h0hR4S12Ur9pC",
"7Sem2tc6fjEfW3yYUDN/kSslKEW0e1zqKnBCWbZu2Zw=",
"d0CmRus0rP0bdc7P7d/wnOyEW14pwFJmcLbdu2W3HmDNRWVJtoNpHrauA/Sr5Vxc",
new ArgonOptions("id", 10, 1048576, 4),
null
),
PrivateKeyType.LOCKED
),
null,
"PUB", Paths.get("priv"), Paths.get("pub"),
null, null
);
=======
public void unmarshallingInlineKeysGivesCorrectKeypair() {
final KeyData input = new KeyData(new KeyDataConfig(null, null), null, "public", null, null);
>>>>>>>
public void unmarshallingInlineKeysGivesCorrectKeypair() {
final KeyData input = new KeyData(new KeyDataConfig(null, null), null, "public", null, null, null, null);
<<<<<<<
public void pathsSetDoesntReturnWholeConfigPublicOnly() {
final KeyData keyData = new KeyData(
new KeyDataConfig(
new PrivateKeyData(
null,
"x3HUNXH6LQldKtEv3q0h0hR4S12Ur9pC",
"7Sem2tc6fjEfW3yYUDN/kSslKEW0e1zqKnBCWbZu2Zw=",
"d0CmRus0rP0bdc7P7d/wnOyEW14pwFJmcLbdu2W3HmDNRWVJtoNpHrauA/Sr5Vxc",
new ArgonOptions("id", 10, 1048576, 4),
null
),
PrivateKeyType.LOCKED
),
null,
"PUB", null, Paths.get("pub"),
null, null
);
=======
public void unmarshallingFilesystemKeysGivesCorrectKeypair() {
final KeyData input = new KeyData(null, null, null, Paths.get("private"), Paths.get("public"));
>>>>>>>
public void unmarshallingFilesystemKeysGivesCorrectKeypair() {
final KeyData input = new KeyData(null, null, null, Paths.get("private"), Paths.get("public"), null, null); |
<<<<<<<
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.Serializable;
import java.nio.charset.Charset;
=======
import java.io.UnsupportedEncodingException;
>>>>>>>
import java.nio.charset.Charset;
<<<<<<<
import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
=======
>>>>>>> |
<<<<<<<
=======
//TODO check all CLI options have assertions here
>>>>>>>
//TODO check all CLI options have assertions here
<<<<<<<
=======
public void resolveUnixFilePathInitialValueOnly() {
Path relativePath = Paths.get("somepath.ipc");
Optional<Path> result = LegacyCliAdapter.resolveUnixFilePath(relativePath, null, null);
assertThat(result).isPresent().get().isEqualTo(relativePath);
}
@Test
public void resolveUnixFilePathAllNull() {
Optional<Path> result = LegacyCliAdapter.resolveUnixFilePath(null, null, null);
assertThat(result).isNotPresent();
}
@Test
public void resolveUnixFilePathWorkdirOnly() {
Optional<Path> result = LegacyCliAdapter.resolveUnixFilePath(null, "dir", null);
assertThat(result).isNotPresent();
}
@Test
public void resolveUnixFilePathFileNameOnly() {
Optional<Path> result = LegacyCliAdapter.resolveUnixFilePath(null, null, "filename");
assertThat(result).isPresent().get().isEqualTo(Paths.get("filename"));
}
@Test
public void resolveUnixFilePathWorkdirAndFileName() {
Optional<Path> result = LegacyCliAdapter.resolveUnixFilePath(null, "dir", "somefile.file");
assertThat(result).isPresent().get().isEqualTo(Paths.get("dir", "somefile.file"));
}
@Test
public void resolveListOfUnixFilePathsInitialValueOnly() {
List<Path> paths = new ArrayList<>();
paths.add(Paths.get("path"));
Optional<List<Path>> result = LegacyCliAdapter.resolveListOfUnixFilePaths(paths, null, null);
assertThat(result).isPresent().get().isEqualToComparingFieldByField(paths);
}
@Test
public void resolveListOfUnixFilePathsAllNull() {
Optional<List<Path>> result = LegacyCliAdapter.resolveListOfUnixFilePaths(null, null, null);
assertThat(result).isNotPresent();
}
@Test
public void resolveListOfUnixFilePathsWorkdirOnly() {
Optional<List<Path>> result = LegacyCliAdapter.resolveListOfUnixFilePaths(null, "workdir", null);
assertThat(result).isNotPresent();
}
@Test
public void resolveListOfUnixFilePathsFilenameOnly() {
List<String> filepaths = new ArrayList<>();
filepaths.add("file1");
filepaths.add("file2");
Optional<List<Path>> result = LegacyCliAdapter.resolveListOfUnixFilePaths(null, null, filepaths);
assertThat(result).isNotPresent();
}
@Test
public void resolveListOfUnixFilePathsWorkdirAndFilename() {
List<String> filepaths = new ArrayList<>();
filepaths.add("file1");
filepaths.add("file2");
Optional<List<Path>> result = LegacyCliAdapter.resolveListOfUnixFilePaths(null, "workdir", filepaths);
List<Path> expected = new ArrayList<>();
expected.add(Paths.get("workdir/file1"));
expected.add(Paths.get("workdir/file2"));
assertThat(result.get().size()).isEqualTo(2);
assertThat(result).isPresent().get().isEqualToComparingFieldByField(expected);
}
@Test
>>>>>>> |
<<<<<<<
@Override
public void goBack() {
FragmentManager fragmentManager = getSupportFragmentManager();
if (fragmentManager.getBackStackEntryCount() > 0) {
fragmentManager.popBackStack();
} else if (mMessageListFragment.isManualSearch()) {
onBackPressed();
} else if (!mSingleFolderMode) {
onAccounts();
} else {
onShowFolderList();
}
}
=======
public void enableActionBarProgress(boolean enable) {
if (mMenuButtonCheckMail != null && mMenuButtonCheckMail.isVisible()) {
mActionBarProgress.setVisibility(ProgressBar.GONE);
if (enable) {
mMenuButtonCheckMail
.setActionView(mActionButtonIndeterminateProgress);
} else {
mMenuButtonCheckMail.setActionView(null);
}
} else {
if (mMenuButtonCheckMail != null)
mMenuButtonCheckMail.setActionView(null);
if (enable) {
mActionBarProgress.setVisibility(ProgressBar.VISIBLE);
} else {
mActionBarProgress.setVisibility(ProgressBar.GONE);
}
}
}
>>>>>>>
@Override
public void goBack() {
FragmentManager fragmentManager = getSupportFragmentManager();
if (fragmentManager.getBackStackEntryCount() > 0) {
fragmentManager.popBackStack();
} else if (mMessageListFragment.isManualSearch()) {
onBackPressed();
} else if (!mSingleFolderMode) {
onAccounts();
} else {
onShowFolderList();
}
}
public void enableActionBarProgress(boolean enable) {
if (mMenuButtonCheckMail != null && mMenuButtonCheckMail.isVisible()) {
mActionBarProgress.setVisibility(ProgressBar.GONE);
if (enable) {
mMenuButtonCheckMail
.setActionView(mActionButtonIndeterminateProgress);
} else {
mMenuButtonCheckMail.setActionView(null);
}
} else {
if (mMenuButtonCheckMail != null)
mMenuButtonCheckMail.setActionView(null);
if (enable) {
mActionBarProgress.setVisibility(ProgressBar.VISIBLE);
} else {
mActionBarProgress.setVisibility(ProgressBar.GONE);
}
}
} |
<<<<<<<
// set a random selection of values that are not sufficient to make a complete key pair of any type
final UnsupportedKeyPair keyPair =
new UnsupportedKeyPair(
keyDataConfig,
"priv",
null,
path,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null);
=======
// set a random selection of values that are not sufficient to make a complete key pair of any type
final UnsupportedKeyPair keyPair =
new UnsupportedKeyPair(
keyDataConfig, "priv", null, path, null, null, null, null, null, null, null, null, null, null);
>>>>>>>
// set a random selection of values that are not sufficient to make a complete key pair of any type
final UnsupportedKeyPair keyPair =
new UnsupportedKeyPair(
keyDataConfig, "priv", null, path, null, null, null, null, null, null, null, null, null, null, null, null);
<<<<<<<
}
@Test
public void unmarshallingFilesystemKeysGivesCorrectKeypair() {
final KeyData input = new KeyData();
input.setPublicKeyPath(Paths.get("public"));
input.setPrivateKeyPath(Paths.get("private"));
final ConfigKeyPair result = this.adapter.unmarshal(input);
assertThat(result).isInstanceOf(FilesystemKeyPair.class);
=======
>>>>>>>
<<<<<<<
@Test
public void unmarshallingAWSPublicOnlyGivesUnsupportedKeyPair() {
final KeyData input = new KeyData();
input.setAwsSecretsManagerPublicKeyId("pubId");
final ConfigKeyPair result = this.adapter.unmarshal(input);
assertThat(result).isInstanceOf(UnsupportedKeyPair.class);
}
@Test
public void unmarshallingAWSPrivateOnlyGivesUnsupportedKeyPair() {
final KeyData input = new KeyData();
input.setAwsSecretsManagerPrivateKeyId("privId");
final ConfigKeyPair result = this.adapter.unmarshal(input);
assertThat(result).isInstanceOf(UnsupportedKeyPair.class);
}
=======
@Test
public void unmarshalWithoutKeyEncryptorReturnNull() {
KeyEncryptorHolder.INSTANCE.setKeyEncryptor(null);
KeyData keyData = mock(KeyData.class);
ConfigKeyPair result = adapter.unmarshal(keyData);
assertThat(result).isNull();
}
@Test
public void marshalWithoutKeyEncryptorReturnNull() {
KeyEncryptorHolder.INSTANCE.setKeyEncryptor(null);
ConfigKeyPair configKeyPair = mock(ConfigKeyPair.class);
KeyData result = adapter.marshal(configKeyPair);
assertThat(result).isNull();
}
@Test
public void unmarshalInlineKeyPair() throws Exception {
KeyData keyData = mock(KeyData.class);
Path privateKeyPath = Files.createFile(Paths.get("target", UUID.randomUUID().toString()));
privateKeyPath.toFile().deleteOnExit();
Path publicKeyPath = Files.createFile(Paths.get("target", UUID.randomUUID().toString()));
publicKeyPath.toFile().deleteOnExit();
when(keyData.getPrivateKeyPath()).thenReturn(privateKeyPath);
when(keyData.getPublicKeyPath()).thenReturn(publicKeyPath);
String d =
" {\n"
+ " \"config\": {\n"
+ " \"data\": {\n"
+ " \"aopts\": {\n"
+ " \"variant\": \"id\",\n"
+ " \"memory\": 1024,\n"
+ " \"iterations\": 1,\n"
+ " \"parallelism\": 1\n"
+ " },\n"
+ " \"snonce\": \"dwixVoY+pOI2FMuu4k0jLqN/naQiTzWe\",\n"
+ " \"asalt\": \"JoPVq9G6NdOb+Ugv+HnUeA==\",\n"
+ " \"sbox\": \"6Jd/MXn29fk6jcrFYGPb75l7sDJae06I3Y1Op+bZSZqlYXsMpa/8lLE29H0sX3yw\"\n"
+ " },\n"
+ " \"type\": \"argon2sbox\"\n"
+ " },\n"
+ " \"publicKey\": \"UFVCTElDX0tFWQ==\"\n"
+ " }";
InputStream dataIn = new java.io.ByteArrayInputStream(d.getBytes());
ConfigKeyPair configKeyPair = adapter.unmarshal(keyData);
assertThat(configKeyPair).isExactlyInstanceOf(FilesystemKeyPair.class);
}
@Test
public void createDefaultInstance() {
KeyDataAdapter keyDataAdapter = new KeyDataAdapter();
assertThat(keyDataAdapter).isNotNull();
}
>>>>>>>
@Test
public void unmarshalWithoutKeyEncryptorReturnNull() {
KeyEncryptorHolder.INSTANCE.setKeyEncryptor(null);
KeyData keyData = mock(KeyData.class);
ConfigKeyPair result = adapter.unmarshal(keyData);
assertThat(result).isNull();
}
@Test
public void marshalWithoutKeyEncryptorReturnNull() {
KeyEncryptorHolder.INSTANCE.setKeyEncryptor(null);
ConfigKeyPair configKeyPair = mock(ConfigKeyPair.class);
KeyData result = adapter.marshal(configKeyPair);
assertThat(result).isNull();
}
@Test
public void unmarshalInlineKeyPair() throws Exception {
KeyData keyData = mock(KeyData.class);
Path privateKeyPath = Files.createFile(Paths.get("target", UUID.randomUUID().toString()));
privateKeyPath.toFile().deleteOnExit();
Path publicKeyPath = Files.createFile(Paths.get("target", UUID.randomUUID().toString()));
publicKeyPath.toFile().deleteOnExit();
when(keyData.getPrivateKeyPath()).thenReturn(privateKeyPath);
when(keyData.getPublicKeyPath()).thenReturn(publicKeyPath);
String d =
" {\n"
+ " \"config\": {\n"
+ " \"data\": {\n"
+ " \"aopts\": {\n"
+ " \"variant\": \"id\",\n"
+ " \"memory\": 1024,\n"
+ " \"iterations\": 1,\n"
+ " \"parallelism\": 1\n"
+ " },\n"
+ " \"snonce\": \"dwixVoY+pOI2FMuu4k0jLqN/naQiTzWe\",\n"
+ " \"asalt\": \"JoPVq9G6NdOb+Ugv+HnUeA==\",\n"
+ " \"sbox\": \"6Jd/MXn29fk6jcrFYGPb75l7sDJae06I3Y1Op+bZSZqlYXsMpa/8lLE29H0sX3yw\"\n"
+ " },\n"
+ " \"type\": \"argon2sbox\"\n"
+ " },\n"
+ " \"publicKey\": \"UFVCTElDX0tFWQ==\"\n"
+ " }";
InputStream dataIn = new java.io.ByteArrayInputStream(d.getBytes());
ConfigKeyPair configKeyPair = adapter.unmarshal(keyData);
assertThat(configKeyPair).isExactlyInstanceOf(FilesystemKeyPair.class);
}
@Test
public void createDefaultInstance() {
KeyDataAdapter keyDataAdapter = new KeyDataAdapter();
assertThat(keyDataAdapter).isNotNull();
} |
<<<<<<<
import com.moandjiezana.toml.Toml;
import com.quorum.tessera.config.ArgonOptions;
import com.quorum.tessera.config.KeyDataConfig;
import com.quorum.tessera.config.SslAuthenticationMode;
=======
import com.moandjiezana.toml.Toml;
import com.quorum.tessera.config.*;
>>>>>>>
import com.moandjiezana.toml.Toml;
import com.quorum.tessera.config.ArgonOptions;
import com.quorum.tessera.config.KeyDataConfig;
import com.quorum.tessera.config.SslAuthenticationMode;
import com.quorum.tessera.config.*;
<<<<<<<
private final FilesDelegate filesDelegate;
public TomlConfigFactory() {
this(FilesDelegate.create());
}
public TomlConfigFactory(FilesDelegate filesDelegate) {
this.filesDelegate = Objects.requireNonNull(filesDelegate);
}
public ConfigBuilder create(InputStream configData, ArgonOptions options, String... filenames) {
=======
@Override
public Config create(InputStream configData, ArgonOptions options, String... filenames) {
>>>>>>>
@Override
public ConfigBuilder create(InputStream configData, ArgonOptions options, String... filenames) {
<<<<<<<
final String tls = toml.getString("tls", "strict").toUpperCase();
=======
final Path unixSocketFile;
if(socket != null) {
unixSocketFile = Paths.get(workdir, socket);
} else {
unixSocketFile = null;
}
final String tls = toml.getString("tls", "off").toUpperCase();
>>>>>>>
final String tls = toml.getString("tls", "off").toUpperCase();
<<<<<<<
.serverHostname(url)
.unixSocketFile(socket)
=======
.serverHostname(urlWithoutPort)
.unixSocketFile(unixSocketFile)
>>>>>>>
.serverHostname(urlWithoutPort)
.unixSocketFile(socket) |
<<<<<<<
=======
import password.pwm.PwmApplication;
>>>>>>>
import password.pwm.PwmApplication;
<<<<<<<
=======
import java.util.ArrayList;
import java.util.Collections;
>>>>>>>
import java.util.ArrayList;
import java.util.Collections;
<<<<<<<
private boolean enableExport;
private int exportMaxDepth;
=======
private int maxAdvancedSearchAttributes;
private List<SearchAttribute> advancedSearchAttributes;
private boolean enableExport;
private int exportMaxDepth;
@Value
@Builder
public static class SearchAttribute implements Serializable
{
private String attribute;
private String label;
private FormConfiguration.Type type;
private Map<String, String> options;
public static List<SearchAttribute> searchAttributesFromForm(
final Locale locale,
final List<FormConfiguration> formConfigurations
)
{
final List<SearchAttribute> returnList = new ArrayList<>( );
for ( final FormConfiguration formConfiguration : formConfigurations )
{
final String attribute = formConfiguration.getName();
final String label = formConfiguration.getLabel( locale );
final SearchAttribute searchAttribute = SearchAttribute.builder()
.attribute( attribute )
.type( formConfiguration.getType() )
.label( label )
.options( formConfiguration.getSelectOptions() )
.build();
returnList.add( searchAttribute );
}
return Collections.unmodifiableList( returnList );
}
}
>>>>>>>
private int maxAdvancedSearchAttributes;
private List<SearchAttribute> advancedSearchAttributes;
private boolean enableExport;
private int exportMaxDepth;
@Value
@Builder
public static class SearchAttribute implements Serializable
{
private String attribute;
private String label;
private FormConfiguration.Type type;
private Map<String, String> options;
public static List<SearchAttribute> searchAttributesFromForm(
final Locale locale,
final List<FormConfiguration> formConfigurations
)
{
final List<SearchAttribute> returnList = new ArrayList<>( );
for ( final FormConfiguration formConfiguration : formConfigurations )
{
final String attribute = formConfiguration.getName();
final String label = formConfiguration.getLabel( locale );
final SearchAttribute searchAttribute = SearchAttribute.builder()
.attribute( attribute )
.type( formConfiguration.getType() )
.label( label )
.options( formConfiguration.getSelectOptions() )
.build();
returnList.add( searchAttribute );
}
return Collections.unmodifiableList( returnList );
}
}
<<<<<<<
final Configuration configuration = pwmRequest.getConfig();
=======
final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
final Configuration configuration = pwmApplication.getConfig();
final Locale locale = pwmRequest.getLocale();
>>>>>>>
final PwmApplication pwmApplication = pwmRequest.getPwmApplication();
final Configuration configuration = pwmApplication.getConfig();
final Locale locale = pwmRequest.getLocale();
<<<<<<<
=======
final List<SearchAttribute> searchAttributes = SearchAttribute.searchAttributesFromForm( locale, peopleSearchConfiguration.getSearchForm() );
>>>>>>>
final List<SearchAttribute> searchAttributes = SearchAttribute.searchAttributesFromForm( locale, peopleSearchConfiguration.getSearchForm() );
<<<<<<<
.enableExport( peopleSearchConfiguration.isEnableExportCsv() )
.exportMaxDepth( peopleSearchConfiguration.getExportCsvMaxDepth() )
=======
.enableAdvancedSearch( peopleSearchConfiguration.isEnableAdvancedSearch() )
.maxAdvancedSearchAttributes( 3 )
.advancedSearchAttributes( searchAttributes )
.enableExport( peopleSearchConfiguration.isEnableExportCsv() )
.exportMaxDepth( peopleSearchConfiguration.getExportCsvMaxDepth() )
>>>>>>>
.enableAdvancedSearch( peopleSearchConfiguration.isEnableAdvancedSearch() )
.maxAdvancedSearchAttributes( 3 )
.advancedSearchAttributes( searchAttributes )
.enableExport( peopleSearchConfiguration.isEnableExportCsv() )
.exportMaxDepth( peopleSearchConfiguration.getExportCsvMaxDepth() ) |
<<<<<<<
REMOTE_WEB_SERVICE(RemoteWebServiceValue.factory()),
=======
CUSTOMLINKS(CustomLinkValue.factory()),
>>>>>>>
CUSTOMLINKS(CustomLinkValue.factory()),
REMOTE_WEB_SERVICE(RemoteWebServiceValue.factory()), |
<<<<<<<
try {
while (true) {
Map<K, ValueHolder<V>> chainContents = resolver.resolveAll(chainIterator.next(), timeSource.getTimeMillis());
if (!chainContents.isEmpty()) {
return chainContents.entrySet().stream().map(entry -> {
K key = entry.getKey();
ValueHolder<V> valueHolder = entry.getValue();
return new Cache.Entry<K, ValueHolder<V>>() {
@Override
public K getKey() {
return key;
}
@Override
public ValueHolder<V> getValue() {
return valueHolder;
}
@Override
public String toString() {
return getKey() + "=" + getValue();
}
};
}).iterator();
}
=======
while (chainIterator.hasNext()) {
Map<K, PutOperation<K, V>> chainContents = resolver.resolveChain(chainIterator.next(), timeSource.getTimeMillis());
if (!chainContents.isEmpty()) {
return chainContents.entrySet().stream().map(entry -> {
K key = entry.getKey();
PutOperation<K, V> operation = entry.getValue();
ValueHolder<V> valueHolder;
if (operation.isExpiryAvailable()) {
valueHolder = new ClusteredValueHolder<>(operation.getValue(), operation.expirationTime());
} else {
valueHolder = new ClusteredValueHolder<>(operation.getValue());
}
return new Cache.Entry<K, ValueHolder<V>>() {
@Override
public K getKey() {
return key;
}
@Override
public ValueHolder<V> getValue() {
return valueHolder;
}
@Override
public String toString() {
return getKey() + "=" + getValue();
}
};
}).iterator();
>>>>>>>
while (chainIterator.hasNext()) {
Map<K, ValueHolder<V>> chainContents = resolver.resolveAll(chainIterator.next(), timeSource.getTimeMillis());
if (!chainContents.isEmpty()) {
return chainContents.entrySet().stream().map(entry -> {
K key = entry.getKey();
ValueHolder<V> valueHolder = entry.getValue();
return new Cache.Entry<K, ValueHolder<V>>() {
@Override
public K getKey() {
return key;
}
@Override
public ValueHolder<V> getValue() {
return valueHolder;
}
@Override
public String toString() {
return getKey() + "=" + getValue();
}
};
}).iterator(); |
<<<<<<<
import static java.lang.Math.max;
import static org.ehcache.config.Eviction.noAdvice;
import static org.ehcache.core.spi.service.ServiceUtils.findSingletonAmongst;
import static org.terracotta.offheapstore.util.MemoryUnit.BYTES;
=======
import static java.lang.Long.max;
import static java.util.Arrays.asList;
import static org.ehcache.core.spi.ServiceLocator.findSingletonAmongst;
import static org.ehcache.core.spi.ServiceLocator.findSingletonAmongst;
import static org.terracotta.offheapstore.util.MemoryUnit.BYTES;
>>>>>>>
import static java.lang.Math.max;
import static org.ehcache.config.Eviction.noAdvice;
import static org.ehcache.core.spi.service.ServiceUtils.findSingletonAmongst;
import static java.util.Arrays.asList;
import static org.terracotta.offheapstore.util.MemoryUnit.BYTES;
<<<<<<<
PersistentPortability<K> keyPortability = persistent(new SerializerPortability<>(keySerializer));
PersistentPortability<OffHeapValueHolder<V>> elementPortability = persistent(new OffHeapValueHolderPortability<>(valueSerializer));
=======
PersistentPortability<K> keyPortability = persistent(new SerializerPortability<K>(keySerializer));
PersistentPortability<OffHeapValueHolder<V>> valuePortability = persistent(createValuePortability(valueSerializer));
>>>>>>>
PersistentPortability<K> keyPortability = persistent(new SerializerPortability<>(keySerializer));
PersistentPortability<OffHeapValueHolder<V>> valuePortability = persistent(createValuePortability(valueSerializer));
<<<<<<<
max((size / diskSegments) / 10, 1024), BYTES, keyPortability, elementPortability, writeWorkers, false);
=======
max((size / 16) / 10, 1024), BYTES, keyPortability, valuePortability, writeWorkers, false);
EhcachePersistentSegmentFactory<K, OffHeapValueHolder<V>> factory = new EhcachePersistentSegmentFactory<K, OffHeapValueHolder<V>>(
source,
storageEngineFactory,
64,
evictionVeto,
mapEvictionListener, false);
EhcachePersistentConcurrentOffHeapClockCache m = new EhcachePersistentConcurrentOffHeapClockCache<K, OffHeapValueHolder<V>>(input, evictionVeto, factory);
>>>>>>>
max((size / diskSegments) / 10, 1024), BYTES, keyPortability, valuePortability, writeWorkers, false);
<<<<<<<
MappedPageSource source = new MappedPageSource(getDataFile(), size);
PersistentPortability<K> keyPortability = persistent(new SerializerPortability<>(keySerializer));
PersistentPortability<OffHeapValueHolder<V>> elementPortability = persistent(new OffHeapValueHolderPortability<>(valueSerializer));
=======
PersistentPortability<K> keyPortability = persistent(new SerializerPortability<K>(keySerializer));
PersistentPortability<OffHeapValueHolder<V>> valuePortability = persistent(createValuePortability(valueSerializer));
>>>>>>>
MappedPageSource source = new MappedPageSource(getDataFile(), size);
PersistentPortability<K> keyPortability = persistent(new SerializerPortability<>(keySerializer));
PersistentPortability<OffHeapValueHolder<V>> valuePortability = persistent(createValuePortability(valueSerializer));
<<<<<<<
max((size / diskSegments) / 10, 1024), BYTES, keyPortability, elementPortability, writeWorkers, true);
=======
max((size / 16) / 10, 1024), BYTES, keyPortability, valuePortability, writeWorkers, true);
>>>>>>>
max((size / diskSegments) / 10, 1024), BYTES, keyPortability, valuePortability, writeWorkers, true);
<<<<<<<
final Class<?> normalKlazz = normal.getClass();
Class<?>[] delegateInterfaces = normalKlazz.getInterfaces();
Class<?>[] proxyInterfaces = Arrays.copyOf(delegateInterfaces, delegateInterfaces.length + 1);
proxyInterfaces[delegateInterfaces.length] = PersistentPortability.class;
return (PersistentPortability<T>) Proxy.newProxyInstance(normal.getClass().getClassLoader(), proxyInterfaces, (o, method, os) -> {
if (method.getDeclaringClass().equals(Persistent.class)) {
return null;
} else {
return method.invoke(normal, os);
}
});
=======
if (normal instanceof PersistentPortability<?>) {
return (PersistentPortability<T>) normal;
} else {
LinkedHashSet<Class<?>> proxyInterfaces = new LinkedHashSet<>();
for (Class<?> klazz = normal.getClass(); klazz != null; klazz = klazz.getSuperclass()) {
proxyInterfaces.addAll(asList(klazz.getInterfaces()));
}
proxyInterfaces.add(PersistentPortability.class);
return (PersistentPortability<T>) Proxy.newProxyInstance(normal.getClass().getClassLoader(), proxyInterfaces.toArray(new Class[0]), (o, method, os) -> {
if (method.getDeclaringClass().equals(Persistent.class)) {
return null;
} else {
return method.invoke(normal, os);
}
});
}
>>>>>>>
if (normal instanceof PersistentPortability<?>) {
return (PersistentPortability<T>) normal;
} else {
LinkedHashSet<Class<?>> proxyInterfaces = new LinkedHashSet<>();
for (Class<?> klazz = normal.getClass(); klazz != null; klazz = klazz.getSuperclass()) {
proxyInterfaces.addAll(asList(klazz.getInterfaces()));
}
proxyInterfaces.add(PersistentPortability.class);
return (PersistentPortability<T>) Proxy.newProxyInstance(normal.getClass().getClassLoader(), proxyInterfaces.toArray(new Class[0]), (o, method, os) -> {
if (method.getDeclaringClass().equals(Persistent.class)) {
return null;
} else {
return method.invoke(normal, os);
}
});
} |
<<<<<<<
ClusterTierManagerClientEntityFactory factory = new ClusterTierManagerClientEntityFactory(CONNECTION);
assertFalse(factory.abandonLeadership("testAbandonLeadershipWhenNotOwning", true));
=======
ClusterTierManagerClientEntityFactory factory = new ClusterTierManagerClientEntityFactory(CONNECTION, Runnable::run);
assertFalse(factory.abandonLeadership("testAbandonLeadershipWhenNotOwning"));
>>>>>>>
ClusterTierManagerClientEntityFactory factory = new ClusterTierManagerClientEntityFactory(CONNECTION, Runnable::run);
assertFalse(factory.abandonLeadership("testAbandonLeadershipWhenNotOwning", true)); |
<<<<<<<
import org.ehcache.core.spi.service.DiskResourceService;
import org.ehcache.core.spi.store.StoreAccessException;
=======
>>>>>>>
import org.ehcache.core.spi.service.DiskResourceService;
<<<<<<<
import static java.util.Collections.singleton;
import static org.ehcache.core.internal.service.ServiceLocator.dependencySet;
=======
>>>>>>>
import static org.ehcache.core.internal.service.ServiceLocator.dependencySet; |
<<<<<<<
import org.ehcache.core.store.StoreConfigurationImpl;
import org.ehcache.spi.resilience.StoreAccessException;
import org.ehcache.core.statistics.LowerCachingTierOperationsOutcome;
import org.ehcache.CachePersistenceException;
import org.ehcache.expiry.ExpiryPolicy;
import org.ehcache.impl.config.store.disk.OffHeapDiskStoreConfiguration;
=======
import org.ehcache.exceptions.CacheAccessException;
import org.ehcache.exceptions.CachePersistenceException;
import org.ehcache.expiry.Expiry;
import org.ehcache.impl.internal.store.offheap.portability.AssertingOffHeapValueHolderPortability;
import org.ehcache.impl.internal.store.offheap.portability.OffHeapValueHolderPortability;
>>>>>>>
import org.ehcache.core.store.StoreConfigurationImpl;
import org.ehcache.spi.resilience.StoreAccessException;
import org.ehcache.core.statistics.LowerCachingTierOperationsOutcome;
import org.ehcache.CachePersistenceException;
import org.ehcache.expiry.ExpiryPolicy;
import org.ehcache.impl.config.store.disk.OffHeapDiskStoreConfiguration;
import org.ehcache.impl.internal.store.offheap.portability.AssertingOffHeapValueHolderPortability;
import org.ehcache.impl.internal.store.offheap.portability.OffHeapValueHolderPortability;
<<<<<<<
StoreConfigurationImpl<String, String> storeConfiguration = new StoreConfigurationImpl<>(String.class, String.class,
null, classLoader, expiry, null, 0, true, keySerializer, valueSerializer, null, false);
OffHeapDiskStore<String, String> offHeapStore = new OffHeapDiskStore<>(
getPersistenceContext(),
new OnDemandExecutionService(), null, DEFAULT_WRITER_CONCURRENCY, DEFAULT_DISK_SEGMENTS,
storeConfiguration, timeSource,
new TestStoreEventDispatcher<>(),
MB.toBytes(1));
=======
StoreConfigurationImpl<String, String> storeConfiguration = new StoreConfigurationImpl<String, String>(String.class, String.class,
null, classLoader, expiry, null, 0, keySerializer, valueSerializer);
OffHeapDiskStore<String, String> offHeapStore = new OffHeapDiskStore<String, String>(
getPersistenceContext(),
new OnDemandExecutionService(), null, 1,
storeConfiguration, timeSource,
new TestStoreEventDispatcher<String, String>(),
MemoryUnit.MB.toBytes(1)) {
@Override
protected OffHeapValueHolderPortability<String> createValuePortability(Serializer<String> serializer) {
return new AssertingOffHeapValueHolderPortability<>(serializer);
}
};
>>>>>>>
StoreConfigurationImpl<String, String> storeConfiguration = new StoreConfigurationImpl<>(String.class, String.class,
null, classLoader, expiry, null, 0, true, keySerializer, valueSerializer, null, false);
OffHeapDiskStore<String, String> offHeapStore = new OffHeapDiskStore<String, String>(
getPersistenceContext(),
new OnDemandExecutionService(), null, DEFAULT_WRITER_CONCURRENCY, DEFAULT_DISK_SEGMENTS,
storeConfiguration, timeSource,
new TestStoreEventDispatcher<>(),
MB.toBytes(1)) {
@Override
protected OffHeapValueHolderPortability<String> createValuePortability(Serializer<String> serializer) {
return new AssertingOffHeapValueHolderPortability<>(serializer);
}
};
<<<<<<<
StoreConfigurationImpl<String, byte[]> storeConfiguration = new StoreConfigurationImpl<>(String.class, byte[].class,
evictionAdvisor, getClass().getClassLoader(), expiry, null, 0, true, keySerializer, valueSerializer, null, false);
OffHeapDiskStore<String, byte[]> offHeapStore = new OffHeapDiskStore<>(
getPersistenceContext(),
new OnDemandExecutionService(), null, DEFAULT_WRITER_CONCURRENCY, DEFAULT_DISK_SEGMENTS,
storeConfiguration, timeSource,
new TestStoreEventDispatcher<>(),
MB.toBytes(1));
=======
StoreConfigurationImpl<String, byte[]> storeConfiguration = new StoreConfigurationImpl<String, byte[]>(String.class, byte[].class,
evictionVeto, getClass().getClassLoader(), expiry, null, 0, keySerializer, valueSerializer);
OffHeapDiskStore<String, byte[]> offHeapStore = new OffHeapDiskStore<String, byte[]>(
getPersistenceContext(),
new OnDemandExecutionService(), null, 1,
storeConfiguration, timeSource,
new TestStoreEventDispatcher<String, byte[]>(),
MemoryUnit.MB.toBytes(1)) {
@Override
protected OffHeapValueHolderPortability<byte[]> createValuePortability(Serializer<byte[]> serializer) {
return new AssertingOffHeapValueHolderPortability<>(serializer);
}
};
>>>>>>>
StoreConfigurationImpl<String, byte[]> storeConfiguration = new StoreConfigurationImpl<>(String.class, byte[].class,
evictionAdvisor, getClass().getClassLoader(), expiry, null, 0, true, keySerializer, valueSerializer, null, false);
OffHeapDiskStore<String, byte[]> offHeapStore = new OffHeapDiskStore<String, byte[]>(
getPersistenceContext(),
new OnDemandExecutionService(), null, DEFAULT_WRITER_CONCURRENCY, DEFAULT_DISK_SEGMENTS,
storeConfiguration, timeSource,
new TestStoreEventDispatcher<>(),
MB.toBytes(1)) {
@Override
protected OffHeapValueHolderPortability<byte[]> createValuePortability(Serializer<byte[]> serializer) {
return new AssertingOffHeapValueHolderPortability<>(serializer);
}
}; |
<<<<<<<
Class<?> persistedKeyType = classLoader.loadClass(properties.getProperty(KEY_TYPE_PROPERTY_NAME));
if (!keyType.equals(persistedKeyType)) {
throw new IllegalArgumentException("Persisted key type '" + persistedKeyType.getName() + "' is not the same as the configured key type '" + keyType.getName() + "'");
=======
Class<?> persistedKeyType = Class.forName(properties.getProperty(KEY_TYPE_PROPERTY_NAME), false, classLoader);
if (!keyType.isAssignableFrom(persistedKeyType)) {
throw new IllegalArgumentException("Persisted key type '" + persistedKeyType.getName() + "' is not assignable from configured key type '" + keyType.getName() + "'");
>>>>>>>
Class<?> persistedKeyType = Class.forName(properties.getProperty(KEY_TYPE_PROPERTY_NAME), false, classLoader);
if (!keyType.equals(persistedKeyType)) {
throw new IllegalArgumentException("Persisted key type '" + persistedKeyType.getName() + "' is not the same as the configured key type '" + keyType.getName() + "'");
<<<<<<<
Class<?> persistedValueType = classLoader.loadClass(properties.getProperty(VALUE_TYPE_PROPERTY_NAME));
if (!valueType.equals(persistedValueType)) {
throw new IllegalArgumentException("Persisted value type '" + persistedValueType.getName() + "' is not the same as the configured value type '" + valueType.getName() + "'");
=======
Class<?> persistedValueType = Class.forName(properties.getProperty(VALUE_TYPE_PROPERTY_NAME), false, classLoader);
if (!valueType.isAssignableFrom(persistedValueType)) {
throw new IllegalArgumentException("Persisted value type '" + persistedValueType.getName() + "' is not assignable from configured value type '" + valueType.getName() + "'");
>>>>>>>
Class<?> persistedValueType = Class.forName(properties.getProperty(VALUE_TYPE_PROPERTY_NAME), false, classLoader);
if (!valueType.equals(persistedValueType)) {
throw new IllegalArgumentException("Persisted value type '" + persistedValueType.getName() + "' is not the same as the configured value type '" + valueType.getName() + "'"); |
<<<<<<<
offHeapStore = createAndInitStore(timeSource, new Expiry<String, String>() {
@Override
public Duration getExpiryForCreation(String key, String value) {
return Duration.INFINITE;
}
@Override
public Duration getExpiryForAccess(String key, ValueSupplier<? extends String> value) {
return Duration.ZERO;
}
@Override
public Duration getExpiryForUpdate(String key, ValueSupplier<? extends String> oldValue, String newValue) {
return Duration.INFINITE;
}
});
offHeapStore.put("key", "value");
=======
TestTimeSource timeSource = new TestTimeSource();
AbstractOffHeapStore<String, String> store = createAndInitStore(timeSource, Expirations.builder().setAccess(Duration.ZERO).build());
store.put("key", "value");
>>>>>>>
offHeapStore = createAndInitStore(timeSource, Expirations.builder().setAccess(Duration.ZERO).build());
offHeapStore.put("key", "value");
<<<<<<<
offHeapStore = createAndInitStore(timeSource, new Expiry<String, String>() {
@Override
public Duration getExpiryForCreation(String key, String value) {
return Duration.INFINITE;
}
@Override
public Duration getExpiryForAccess(String key, ValueSupplier<? extends String> value) {
return Duration.ZERO;
}
@Override
public Duration getExpiryForUpdate(String key, ValueSupplier<? extends String> oldValue, String newValue) {
return Duration.ZERO;
}
});
=======
AbstractOffHeapStore<String, String> store = createAndInitStore(timeSource,
Expirations.builder().setAccess(Duration.ZERO).setUpdate(Duration.ZERO).build());
>>>>>>>
offHeapStore = createAndInitStore(timeSource,
Expirations.builder().setAccess(Duration.ZERO).setUpdate(Duration.ZERO).build());
<<<<<<<
offHeapStore = createAndInitStore(timeSource, new Expiry<String, String>() {
@Override
public Duration getExpiryForCreation(String key, String value) {
return Duration.INFINITE;
}
@Override
public Duration getExpiryForAccess(String key, ValueSupplier<? extends String> value) {
return Duration.ZERO;
}
@Override
public Duration getExpiryForUpdate(String key, ValueSupplier<? extends String> oldValue, String newValue) {
return Duration.ZERO;
}
});
=======
AbstractOffHeapStore<String, String> store = createAndInitStore(timeSource,
Expirations.builder().setAccess(Duration.ZERO).setUpdate(Duration.ZERO).build());
>>>>>>>
offHeapStore = createAndInitStore(timeSource,
Expirations.builder().setAccess(Duration.ZERO).setUpdate(Duration.ZERO).build()); |
<<<<<<<
import org.ehcache.config.Builder;
=======
import java.io.Closeable;
>>>>>>>
import java.io.Closeable;
import org.ehcache.config.Builder;
<<<<<<<
/**
* Retrieves the {@link Cache} associated with the given alias, if one is known.
*
* @param alias the alias under which to look the {@link Cache} up
* @param keyType the {@link Cache} key class
* @param valueType the {@link Cache} value class
* @param <K> the key type for the cache
* @param <V> the value type for the cache
* @return the {@link Cache} associated with the given alias, {@code null} if no such cache exists
*
* @throws java.lang.IllegalArgumentException if the keyType or valueType do not match the ones with which the
* {@code Cache} was created
*/
<K, V> Cache<K, V> getCache(String alias, Class<K> keyType, Class<V> valueType);
/**
* Removes the {@link Cache} associated with the alias provided, if one is known.
* <P>
* When the cache is removed, it will release all resources it used.
* </P>
*
* @param alias the alias for which to remove the {@link Cache}
*/
void removeCache(String alias);
/**
* Transitions this {@code CacheManager} to {@link Status#AVAILABLE AVAILABLE}.
* <P>
* This will start all {@link org.ehcache.spi.service.Service Service}s managed by this {@code CacheManager}, as well
* as initializing all {@link Cache}s registered with it.
* </P>
* <P>
* If an error occurs before the {@code CacheManager} is {@code AVAILABLE}, it will revert to
* {@link org.ehcache.Status#UNINITIALIZED UNINITIALIZED} attempting to close all services it had already started.
* </P>
*
* @throws IllegalStateException if the {@code CacheManager} is not {@code UNINITIALIZED}
* @throws StateTransitionException if the {@code CacheManager} could not be made {@code AVAILABLE}
*/
void init() throws StateTransitionException;
/**
* Transitions this {@code CacheManager} to {@link Status#UNINITIALIZED UNINITIALIZED}.
* <P>
* This will close all {@link Cache}s known to this {@code CacheManager} and stop all
* {@link org.ehcache.spi.service.Service Service}s managed by this {@code CacheManager}.
* </P>
* <P>
* Failure to close any {@code Cache} or to stop any {@code Service} will not prevent others from being closed or
* stopped.
* </P>
*
* @throws StateTransitionException if the {@code CacheManager} could not reach {@code UNINITIALIZED} cleanly
* @throws IllegalStateException if the {@code CacheManager} is not {@code AVAILABLE}
*/
void close() throws StateTransitionException;
/**
* Returns the current {@link org.ehcache.Status Status} of this {@code CacheManager}.
*
* @return the current {@code Status}
*/
Status getStatus();
/**
* Returns the current {@link Configuration} used by this {@code CacheManager}.
*
* @return the configuration instance backing this {@code CacheManager}
*/
Configuration getRuntimeConfiguration();
=======
@Override
void close();
>>>>>>>
/**
* Retrieves the {@link Cache} associated with the given alias, if one is known.
*
* @param alias the alias under which to look the {@link Cache} up
* @param keyType the {@link Cache} key class
* @param valueType the {@link Cache} value class
* @param <K> the key type for the cache
* @param <V> the value type for the cache
* @return the {@link Cache} associated with the given alias, {@code null} if no such cache exists
*
* @throws java.lang.IllegalArgumentException if the keyType or valueType do not match the ones with which the
* {@code Cache} was created
*/
<K, V> Cache<K, V> getCache(String alias, Class<K> keyType, Class<V> valueType);
/**
* Removes the {@link Cache} associated with the alias provided, if one is known.
* <P>
* When the cache is removed, it will release all resources it used.
* </P>
*
* @param alias the alias for which to remove the {@link Cache}
*/
void removeCache(String alias);
/**
* Transitions this {@code CacheManager} to {@link Status#AVAILABLE AVAILABLE}.
* <P>
* This will start all {@link org.ehcache.spi.service.Service Service}s managed by this {@code CacheManager}, as well
* as initializing all {@link Cache}s registered with it.
* </P>
* <P>
* If an error occurs before the {@code CacheManager} is {@code AVAILABLE}, it will revert to
* {@link org.ehcache.Status#UNINITIALIZED UNINITIALIZED} attempting to close all services it had already started.
* </P>
*
* @throws IllegalStateException if the {@code CacheManager} is not {@code UNINITIALIZED}
* @throws StateTransitionException if the {@code CacheManager} could not be made {@code AVAILABLE}
*/
void init() throws StateTransitionException;
/**
* Transitions this {@code CacheManager} to {@link Status#UNINITIALIZED UNINITIALIZED}.
* <P>
* This will close all {@link Cache}s known to this {@code CacheManager} and stop all
* {@link org.ehcache.spi.service.Service Service}s managed by this {@code CacheManager}.
* </P>
* <P>
* Failure to close any {@code Cache} or to stop any {@code Service} will not prevent others from being closed or
* stopped.
* </P>
*
* @throws StateTransitionException if the {@code CacheManager} could not reach {@code UNINITIALIZED} cleanly
* @throws IllegalStateException if the {@code CacheManager} is not {@code AVAILABLE}
*/
@Override
void close() throws StateTransitionException;
/**
* Returns the current {@link org.ehcache.Status Status} of this {@code CacheManager}.
*
* @return the current {@code Status}
*/
Status getStatus();
/**
* Returns the current {@link Configuration} used by this {@code CacheManager}.
*
* @return the configuration instance backing this {@code CacheManager}
*/
Configuration getRuntimeConfiguration(); |
<<<<<<<
protected PutStatus silentPut(final K key, final V value) throws StoreAccessException {
=======
private void silentPut(final K key, final V value) throws StoreAccessException {
>>>>>>>
protected void silentPut(final K key, final V value) throws StoreAccessException {
<<<<<<<
protected boolean silentRemove(K key) throws StoreAccessException {
=======
public ValueHolder<V> getAndRemove(K key) throws StoreAccessException {
removeObserver.begin();
ValueHolder<V> value = silentRemove(key);
if(value != null) {
removeObserver.end(StoreOperationOutcomes.RemoveOutcome.REMOVED);
} else {
removeObserver.end(StoreOperationOutcomes.RemoveOutcome.MISS);
}
return value;
}
private ValueHolder<V> silentRemove(final K key) throws StoreAccessException {
>>>>>>>
public ValueHolder<V> getAndRemove(K key) throws StoreAccessException {
removeObserver.begin();
ValueHolder<V> value = silentRemove(key);
if(value != null) {
removeObserver.end(StoreOperationOutcomes.RemoveOutcome.REMOVED);
} else {
removeObserver.end(StoreOperationOutcomes.RemoveOutcome.MISS);
}
return value;
}
protected ValueHolder<V> silentRemove(final K key) throws StoreAccessException {
<<<<<<<
ServerStoreProxy.ChainEntry chain = storeProxy.getAndAppend(extractedKey, payload);
return resolver.resolve(chain, key, timeSource.getTimeMillis()) != null;
=======
Chain chain = storeProxy.getAndAppend(extractedKey, payload);
ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key, timeSource.getTimeMillis());
Result<K, V> result = resolvedChain.getResolvedResult(key);
if(result != null) {
storeProxy.replaceAtHead(extractedKey, chain, resolvedChain.getCompactedChain());
}
if (result == null) {
return null;
} else {
return new ClusteredValueHolder<>(result.getValue());
}
>>>>>>>
ServerStoreProxy.ChainEntry chain = storeProxy.getAndAppend(extractedKey, payload);
return resolver.resolve(chain, key, timeSource.getTimeMillis()); |
<<<<<<<
import org.junit.ClassRule;
=======
import org.junit.Ignore;
>>>>>>>
import org.junit.ClassRule;
import org.junit.Ignore;
<<<<<<<
import static org.ehcache.clustered.client.config.builders.TimeoutsBuilder.timeouts;
import static org.ehcache.testing.StandardTimeouts.eventually;
import static org.hamcrest.Matchers.greaterThan;
=======
import static org.awaitility.Awaitility.await;
import static org.ehcache.event.EventType.CREATED;
import static org.ehcache.event.EventType.EVICTED;
import static org.ehcache.event.EventType.EXPIRED;
import static org.ehcache.event.EventType.REMOVED;
import static org.ehcache.event.EventType.UPDATED;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.either;
import static org.hamcrest.Matchers.hasEntry;
>>>>>>>
import static org.ehcache.clustered.client.config.builders.TimeoutsBuilder.timeouts;
import static org.ehcache.testing.StandardTimeouts.eventually;
import static org.ehcache.event.EventType.CREATED;
import static org.ehcache.event.EventType.EVICTED;
import static org.ehcache.event.EventType.EXPIRED;
import static org.ehcache.event.EventType.REMOVED;
import static org.ehcache.event.EventType.UPDATED;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.either;
import static org.hamcrest.Matchers.hasEntry;
<<<<<<<
@RunWith(Parallel.class)
=======
/*
* Eventing behavior is broken across a failover due to actives and passives
* evicting independently. Until this behavior is fixed or at least detectable
* this test cannot reliably assert anything.
*/
@Ignore("Eventing is broken across failover")
>>>>>>>
/*
* Eventing behavior is broken across a failover due to actives and passives
* evicting independently. Until this behavior is fixed or at least detectable
* this test cannot reliably assert anything.
*/
@Ignore("Eventing is broken across failover")
@RunWith(Parallel.class)
<<<<<<<
eventually().runsCleanly(() -> {
assertThat(accountingCacheEventListener1.events.get(EventType.CREATED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener1.events.get(EventType.EVICTED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.CREATED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.EVICTED), hasSize(greaterThan(0)));
});
=======
await().atMost(TIMEOUT).untilAsserted(() -> range(0, KEYS).forEach(k -> {
if (cache1.containsKey(k)) {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
} else {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED, EVICTED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
}
}));
>>>>>>>
eventually().runsCleanly(() -> range(0, KEYS).forEach(k -> {
if (cache1.containsKey(k)) {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
} else {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED, EVICTED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
}
}));
<<<<<<<
eventually().runsCleanly(() -> {
assertThat(accountingCacheEventListener1.events.get(EventType.UPDATED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.UPDATED), hasSize(greaterThan(0)));
});
=======
await().atMost(TIMEOUT).untilAsserted(() -> range(0, KEYS).forEach(k -> {
if (cache1.containsKey(k)) {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k),
either(containsInAnyOrder(CREATED, UPDATED))
.or(containsInAnyOrder(CREATED, EVICTED, CREATED))));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
} else {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k),
either(containsInAnyOrder(CREATED, UPDATED, EVICTED))
.or(containsInAnyOrder(CREATED, EVICTED, CREATED, EVICTED))));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
}
}));
>>>>>>>
eventually().runsCleanly(() -> range(0, KEYS).forEach(k -> {
if (cache1.containsKey(k)) {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k),
either(containsInAnyOrder(CREATED, UPDATED))
.or(containsInAnyOrder(CREATED, EVICTED, CREATED))));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
} else {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k),
either(containsInAnyOrder(CREATED, UPDATED, EVICTED))
.or(containsInAnyOrder(CREATED, EVICTED, CREATED, EVICTED))));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
}
}));
<<<<<<<
eventually().runsCleanly(() -> {
assertThat(accountingCacheEventListener1.events.get(EventType.REMOVED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.REMOVED), hasSize(greaterThan(0)));
});
=======
await().atMost(TIMEOUT).untilAsserted(() -> range(0, KEYS).forEach(k -> {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k),
either(containsInAnyOrder(CREATED, UPDATED, REMOVED))
.or(containsInAnyOrder(CREATED, EVICTED, CREATED, REMOVED))
.or(containsInAnyOrder(CREATED, UPDATED, EVICTED))
.or(containsInAnyOrder(CREATED, EVICTED, CREATED, EVICTED))));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
}));
>>>>>>>
eventually().runsCleanly(() -> range(0, KEYS).forEach(k -> {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k),
either(containsInAnyOrder(CREATED, UPDATED, REMOVED))
.or(containsInAnyOrder(CREATED, EVICTED, CREATED, REMOVED))
.or(containsInAnyOrder(CREATED, UPDATED, EVICTED))
.or(containsInAnyOrder(CREATED, EVICTED, CREATED, EVICTED))));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
}));
<<<<<<<
eventually().runsCleanly(() -> {
assertThat(accountingCacheEventListener1.events.get(EventType.CREATED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener1.events.get(EventType.EVICTED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.CREATED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.EVICTED), hasSize(greaterThan(0)));
});
=======
await().atMost(TIMEOUT).untilAsserted(() -> range(KEYS, KEYS * 2).forEach(k -> {
if (cache1.containsKey(k)) {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
} else {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED, EVICTED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
}
}));
>>>>>>>
eventually().runsCleanly(() -> range(KEYS, KEYS * 2).forEach(k -> {
if (cache1.containsKey(k)) {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
} else {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED, EVICTED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
}
}));
<<<<<<<
range(0, KEYS).forEach(k -> {
cache1.put(k, value);
});
eventually().runsCleanly(() -> {
assertThat(accountingCacheEventListener1.events.get(EventType.CREATED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener1.events.get(EventType.EVICTED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.CREATED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.EVICTED), hasSize(greaterThan(0)));
});
=======
range(0, KEYS).forEach(k -> cache1.put(k, value));
await().atMost(TIMEOUT).untilAsserted(() -> range(0, KEYS).forEach(k -> {
if (cache1.containsKey(k)) {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
} else {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(is(CREATED), isOneOf(EVICTED, EXPIRED))));
//assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(is(CREATED), isOneOf(EVICTED, EXPIRED))));
}
}));
>>>>>>>
range(0, KEYS).forEach(k -> cache1.put(k, value));
eventually().runsCleanly(() -> range(0, KEYS).forEach(k -> {
if (cache1.containsKey(k)) {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(CREATED)));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
} else {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(is(CREATED), isOneOf(EVICTED, EXPIRED))));
//assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(is(CREATED), isOneOf(EVICTED, EXPIRED))));
}
}));
<<<<<<<
eventually().runsCleanly(() -> {
assertThat(accountingCacheEventListener1.events.get(EventType.EXPIRED), hasSize(greaterThan(0)));
assertThat(accountingCacheEventListener2.events.get(EventType.EXPIRED), hasSize(greaterThan(0)));
});
=======
await().atMost(TIMEOUT).untilAsserted(() -> range(0, KEYS).forEach(k -> {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(is(CREATED), isOneOf(EVICTED, EXPIRED))));
//assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(is(CREATED), isOneOf(EVICTED, EXPIRED))));
}));
>>>>>>>
eventually().runsCleanly(() -> range(0, KEYS).forEach(k -> {
assertThat(accountingCacheEventListener1.events, hasEntry(is(k), containsInAnyOrder(is(CREATED), isOneOf(EVICTED, EXPIRED))));
//assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(accountingCacheEventListener1.events.get(k).toArray())));
assertThat(accountingCacheEventListener2.events, hasEntry(is(k), containsInAnyOrder(is(CREATED), isOneOf(EVICTED, EXPIRED))));
})); |
<<<<<<<
// Hack to keep the name of the column in order to be able to access it later
return sqlKeyword + "(" + field + ") AS " + field;
=======
return aggregatorKeyword + "(" + field + ")";
>>>>>>>
// Hack to keep the name of the column in order to be able to access it later
return aggregatorKeyword + "(" + field + ") AS " + field; |
<<<<<<<
import com.rapleaf.jack.QueryOrderConstraint;
import com.rapleaf.jack.LimitCriterion;
=======
import com.rapleaf.jack.OrderCriterion;
>>>>>>>
import com.rapleaf.jack.OrderCriterion;
import com.rapleaf.jack.LimitCriterion; |
<<<<<<<
import java.util.Map;
=======
import java.util.Collection;
>>>>>>>
import java.util.Map;
import java.util.Collection;
<<<<<<<
import com.google.common.collect.ImmutableMap;
=======
>>>>>>>
import com.google.common.collect.ImmutableMap;
<<<<<<<
@FunctionalInterface
private interface ItemGetter {
Object getItem(ResultSet resultSet, String sqlKeyword) throws SQLException;
}
private static final Map<Class<?>, ItemGetter> ITEM_GETTERS = ImmutableMap.<Class<?>, ItemGetter>builder()
.put(Integer.class, ResultSet::getInt)
.put(Long.class, ResultSet::getLong)
.put(java.sql.Date.class, QueryFetcher::getDate)
.put(Timestamp.class, QueryFetcher::getTimestamp)
.put(Double.class, ResultSet::getDouble)
.put(String.class, ResultSet::getString)
.put(Boolean.class, ResultSet::getBoolean)
.put(byte[].class, ResultSet::getBytes)
.build();
private static Long getDate(ResultSet resultSet, String sqlKeyword) throws SQLException {
java.sql.Date date = resultSet.getDate(sqlKeyword);
return date == null ? null : date.getTime();
}
private static Long getTimestamp(ResultSet resultSet, String sqlKeyword) throws SQLException {
Timestamp timestamp = resultSet.getTimestamp(sqlKeyword);
return timestamp == null ? null : timestamp.getTime();
}
public static Record parseResultSet(ResultSet resultSet, Set<Column> selectedColumns) throws SQLException {
=======
static Record parseResultSet(ResultSet resultSet, Collection<Column> selectedColumns) throws SQLException {
>>>>>>>
@FunctionalInterface
private interface ItemGetter {
Object getItem(ResultSet resultSet, String sqlKeyword) throws SQLException;
}
private static final Map<Class<?>, ItemGetter> ITEM_GETTERS = ImmutableMap.<Class<?>, ItemGetter>builder()
.put(Integer.class, ResultSet::getInt)
.put(Long.class, ResultSet::getLong)
.put(java.sql.Date.class, QueryFetcher::getDate)
.put(Timestamp.class, QueryFetcher::getTimestamp)
.put(Double.class, ResultSet::getDouble)
.put(String.class, ResultSet::getString)
.put(Boolean.class, ResultSet::getBoolean)
.put(byte[].class, ResultSet::getBytes)
.build();
private static Long getDate(ResultSet resultSet, String sqlKeyword) throws SQLException {
java.sql.Date date = resultSet.getDate(sqlKeyword);
return date == null ? null : date.getTime();
}
private static Long getTimestamp(ResultSet resultSet, String sqlKeyword) throws SQLException {
Timestamp timestamp = resultSet.getTimestamp(sqlKeyword);
return timestamp == null ? null : timestamp.getTime();
}
public static Record parseResultSet(ResultSet resultSet, Collection<Column> selectedColumns) throws SQLException { |
<<<<<<<
protected void executeQuery(Collection<T> foundSet, PreparedStatement stmt) throws IOException {
int retryCount = 0;
=======
protected void executeQuery(Set<T> foundSet, PreparedStatement stmt) throws SQLException {
>>>>>>>
protected void executeQuery(Collection<T> foundSet, PreparedStatement stmt) throws SQLException {
<<<<<<<
protected void executeQuery(Collection<T> foundSet, String statemenString) throws IOException {
executeQuery(foundSet, conn.getPreparedStatement(statemenString));
=======
protected void executeQuery(Set<T> foundSet, String statemenString) throws IOException {
int retryCount = 0;
PreparedStatement stmt;
while (true) {
try {
stmt = conn.getPreparedStatement(statemenString);
executeQuery(foundSet, stmt);
break;
} catch (SQLRecoverableException e) {
if (++retryCount > MAX_CONNECTION_RETRIES) {
throw new IOException(e);
}
} catch (SQLException e) {
throw new IOException(e);
}
}
>>>>>>>
protected void executeQuery(Collection<T> foundSet, String statemenString) throws IOException {
int retryCount = 0;
PreparedStatement stmt;
while (true) {
try {
stmt = conn.getPreparedStatement(statemenString);
executeQuery(foundSet, stmt);
break;
} catch (SQLRecoverableException e) {
if (++retryCount > MAX_CONNECTION_RETRIES) {
throw new IOException(e);
}
} catch (SQLException e) {
throw new IOException(e);
}
} |
<<<<<<<
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.util.ReflectionTestUtils;
=======
import org.springframework.test.context.junit4.SpringRunner;
>>>>>>>
import org.springframework.test.context.junit4.SpringRunner;
<<<<<<<
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.ZoneId;
=======
import javax.persistence.EntityManager;
>>>>>>>
import javax.persistence.EntityManager;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
<<<<<<<
import de.tum.in.www1.exerciseapp.domain.enumeration.ParticipationState;
=======
>>>>>>>
<<<<<<<
@ActiveProfiles(profiles = "jira,bamboo,bitbucket")
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = ExerciseApplicationApp.class)
@WebAppConfiguration
@IntegrationTest
=======
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ExerciseApplicationApp.class)
>>>>>>>
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ExerciseApplicationApp.class)
<<<<<<<
@Before
public void initTest() {
participation = new Participation();
participation.setRepositoryUrl(DEFAULT_REPOSITORY_URL);
participation.setBuildPlanId(DEFAULT_BUILD_PLAN_ID);
participation.setInitializationState(DEFAULT_INITIALIZATION_STATE);
participation.setInitializationDate(DEFAULT_INITIALIZATION_DATE);
=======
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Participation createEntity(EntityManager em) {
Participation participation = new Participation();
participation.setCloneUrl(DEFAULT_CLONE_URL);
participation.setRepositorySlug(DEFAULT_REPOSITORY_SLUG);
return participation;
}
@Before
public void initTest() {
participation = createEntity(em);
>>>>>>>
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Participation createEntity(EntityManager em) {
Participation participation = new Participation();
participation = new Participation();
participation.setRepositoryUrl(DEFAULT_REPOSITORY_URL);
participation.setBuildPlanId(DEFAULT_BUILD_PLAN_ID);
participation.setInitializationState(DEFAULT_INITIALIZATION_STATE);
participation.setInitializationDate(DEFAULT_INITIALIZATION_DATE);
return participation;
}
@Before
public void initTest() {
participation = createEntity(em);
<<<<<<<
List<Participation> participations = participationRepository.findAll();
assertThat(participations).hasSize(databaseSizeBeforeCreate + 1);
Participation testParticipation = participations.get(participations.size() - 1);
assertThat(testParticipation.getRepositoryUrl()).isEqualTo(DEFAULT_REPOSITORY_URL);
assertThat(testParticipation.getBuildPlanId()).isEqualTo(DEFAULT_BUILD_PLAN_ID);
assertThat(testParticipation.getInitializationState()).isEqualTo(DEFAULT_INITIALIZATION_STATE);
assertThat(testParticipation.getInitializationDate()).isEqualTo(DEFAULT_INITIALIZATION_DATE);
=======
List<Participation> participationList = participationRepository.findAll();
assertThat(participationList).hasSize(databaseSizeBeforeCreate + 1);
Participation testParticipation = participationList.get(participationList.size() - 1);
assertThat(testParticipation.getCloneUrl()).isEqualTo(DEFAULT_CLONE_URL);
assertThat(testParticipation.getRepositorySlug()).isEqualTo(DEFAULT_REPOSITORY_SLUG);
>>>>>>>
List<Participation> participationList = participationRepository.findAll();
assertThat(participationList).hasSize(databaseSizeBeforeCreate + 1);
Participation testParticipation = participationList.get(participationList.size() - 1);
assertThat(testParticipation.getRepositoryUrl()).isEqualTo(DEFAULT_REPOSITORY_URL);
assertThat(testParticipation.getBuildPlanId()).isEqualTo(DEFAULT_BUILD_PLAN_ID);
assertThat(testParticipation.getInitializationState()).isEqualTo(DEFAULT_INITIALIZATION_STATE);
assertThat(testParticipation.getInitializationDate()).isEqualTo(DEFAULT_INITIALIZATION_DATE);
<<<<<<<
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(jsonPath("$.[*].id").value(hasItem(participation.getId().intValue())))
.andExpect(jsonPath("$.[*].repositoryUrl").value(hasItem(DEFAULT_REPOSITORY_URL.toString())))
.andExpect(jsonPath("$.[*].buildPlanId").value(hasItem(DEFAULT_BUILD_PLAN_ID.toString())))
.andExpect(jsonPath("$.[*].initializationState").value(hasItem(DEFAULT_INITIALIZATION_STATE.toString())))
.andExpect(jsonPath("$.[*].initializationDate").value(hasItem(DEFAULT_INITIALIZATION_DATE_STR)));
=======
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(participation.getId().intValue())))
.andExpect(jsonPath("$.[*].cloneUrl").value(hasItem(DEFAULT_CLONE_URL.toString())))
.andExpect(jsonPath("$.[*].repositorySlug").value(hasItem(DEFAULT_REPOSITORY_SLUG.toString())));
>>>>>>>
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(participation.getId().intValue())))
.andExpect(jsonPath("$.[*].repositoryUrl").value(hasItem(DEFAULT_REPOSITORY_URL.toString())))
.andExpect(jsonPath("$.[*].buildPlanId").value(hasItem(DEFAULT_BUILD_PLAN_ID.toString())))
.andExpect(jsonPath("$.[*].initializationState").value(hasItem(DEFAULT_INITIALIZATION_STATE.toString())))
.andExpect(jsonPath("$.[*].initializationDate").value(hasItem(DEFAULT_INITIALIZATION_DATE_STR)));
<<<<<<<
Participation updatedParticipation = new Participation();
updatedParticipation.setId(participation.getId());
updatedParticipation.setRepositoryUrl(UPDATED_REPOSITORY_URL);
updatedParticipation.setBuildPlanId(UPDATED_BUILD_PLAN_ID);
updatedParticipation.setInitializationState(UPDATED_INITIALIZATION_STATE);
updatedParticipation.setInitializationDate(UPDATED_INITIALIZATION_DATE);
=======
Participation updatedParticipation = participationRepository.findOne(participation.getId());
updatedParticipation.setCloneUrl(UPDATED_CLONE_URL);
updatedParticipation.setRepositorySlug(UPDATED_REPOSITORY_SLUG);
>>>>>>>
Participation updatedParticipation = participationRepository.findOne(participation.getId());
updatedParticipation.setRepositoryUrl(UPDATED_REPOSITORY_URL);
updatedParticipation.setBuildPlanId(UPDATED_BUILD_PLAN_ID);
updatedParticipation.setInitializationState(UPDATED_INITIALIZATION_STATE);
updatedParticipation.setInitializationDate(UPDATED_INITIALIZATION_DATE);
<<<<<<<
List<Participation> participations = participationRepository.findAll();
assertThat(participations).hasSize(databaseSizeBeforeUpdate);
Participation testParticipation = participations.get(participations.size() - 1);
assertThat(testParticipation.getRepositoryUrl()).isEqualTo(UPDATED_REPOSITORY_URL);
assertThat(testParticipation.getBuildPlanId()).isEqualTo(UPDATED_BUILD_PLAN_ID);
assertThat(testParticipation.getInitializationState()).isEqualTo(UPDATED_INITIALIZATION_STATE);
assertThat(testParticipation.getInitializationDate()).isEqualTo(UPDATED_INITIALIZATION_DATE);
=======
List<Participation> participationList = participationRepository.findAll();
assertThat(participationList).hasSize(databaseSizeBeforeUpdate);
Participation testParticipation = participationList.get(participationList.size() - 1);
assertThat(testParticipation.getCloneUrl()).isEqualTo(UPDATED_CLONE_URL);
assertThat(testParticipation.getRepositorySlug()).isEqualTo(UPDATED_REPOSITORY_SLUG);
>>>>>>>
List<Participation> participationList = participationRepository.findAll();
assertThat(participationList).hasSize(databaseSizeBeforeUpdate);
Participation testParticipation = participationList.get(participationList.size() - 1);
assertThat(testParticipation.getRepositoryUrl()).isEqualTo(UPDATED_REPOSITORY_URL);
assertThat(testParticipation.getBuildPlanId()).isEqualTo(UPDATED_BUILD_PLAN_ID);
assertThat(testParticipation.getInitializationState()).isEqualTo(UPDATED_INITIALIZATION_STATE);
assertThat(testParticipation.getInitializationDate()).isEqualTo(UPDATED_INITIALIZATION_DATE); |
<<<<<<<
authenticationManagerBuilder.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
if(remoteUserAuthenticationProvider.isPresent()) {
authenticationManagerBuilder.authenticationProvider(remoteUserAuthenticationProvider.get());
}
=======
authenticationManagerBuilder
.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoder());
>>>>>>>
authenticationManagerBuilder
.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoder());
if(remoteUserAuthenticationProvider.isPresent()) {
authenticationManagerBuilder.authenticationProvider(remoteUserAuthenticationProvider.get());
}
<<<<<<<
.antMatchers("/api/lti/launch/*").permitAll()
.antMatchers("/api/account/reset_password/init").permitAll()
.antMatchers("/api/account/reset_password/finish").permitAll()
=======
.antMatchers("/api/account/reset-password/init").permitAll()
.antMatchers("/api/account/reset-password/finish").permitAll()
>>>>>>>
.antMatchers("/api/lti/launch/*").permitAll()
.antMatchers("/api/account/reset-password/init").permitAll()
.antMatchers("/api/account/reset-password/finish").permitAll() |
<<<<<<<
exercise.setAllowOnlineEditor(DEFAULT_ALLOW_ONLINE_EDITOR);
=======
return exercise;
}
@Before
public void initTest() {
exercise = createEntity(em);
>>>>>>>
exercise.setAllowOnlineEditor(DEFAULT_ALLOW_ONLINE_EDITOR);
return exercise;
}
@Before
public void initTest() {
exercise = createEntity(em);
<<<<<<<
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(jsonPath("$.[*].id").value(hasItem(exercise.getId().intValue())))
.andExpect(jsonPath("$.[*].title").value(hasItem(DEFAULT_TITLE.toString())))
.andExpect(jsonPath("$.[*].baseRepositoryUrl").value(hasItem(DEFAULT_BASE_REPOSITORY_URL.toString())))
.andExpect(jsonPath("$.[*].baseBuildPlanId").value(hasItem(DEFAULT_BASE_BUILD_PLAN_ID.toString())))
.andExpect(jsonPath("$.[*].publishBuildPlanUrl").value(hasItem(DEFAULT_PUBLISH_BUILD_PLAN_URL.booleanValue())))
.andExpect(jsonPath("$.[*].releaseDate").value(hasItem(DEFAULT_RELEASE_DATE_STR)))
.andExpect(jsonPath("$.[*].dueDate").value(hasItem(DEFAULT_DUE_DATE_STR)))
.andExpect(jsonPath("$.[*].allowOnlineEditor").value(hasItem(DEFAULT_ALLOW_ONLINE_EDITOR.booleanValue())));
=======
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(exercise.getId().intValue())))
.andExpect(jsonPath("$.[*].title").value(hasItem(DEFAULT_TITLE.toString())))
.andExpect(jsonPath("$.[*].baseProjectKey").value(hasItem(DEFAULT_BASE_PROJECT_KEY.toString())))
.andExpect(jsonPath("$.[*].baseRepositorySlug").value(hasItem(DEFAULT_BASE_REPOSITORY_SLUG.toString())))
.andExpect(jsonPath("$.[*].baseBuildPlanSlug").value(hasItem(DEFAULT_BASE_BUILD_PLAN_SLUG.toString())))
.andExpect(jsonPath("$.[*].releaseDate").value(hasItem(sameInstant(DEFAULT_RELEASE_DATE))))
.andExpect(jsonPath("$.[*].dueDate").value(hasItem(sameInstant(DEFAULT_DUE_DATE))));
>>>>>>>
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(jsonPath("$.[*].id").value(hasItem(exercise.getId().intValue())))
.andExpect(jsonPath("$.[*].title").value(hasItem(DEFAULT_TITLE.toString())))
.andExpect(jsonPath("$.[*].baseRepositoryUrl").value(hasItem(DEFAULT_BASE_REPOSITORY_URL.toString())))
.andExpect(jsonPath("$.[*].baseBuildPlanId").value(hasItem(DEFAULT_BASE_BUILD_PLAN_ID.toString())))
.andExpect(jsonPath("$.[*].publishBuildPlanUrl").value(hasItem(DEFAULT_PUBLISH_BUILD_PLAN_URL.booleanValue())))
.andExpect(jsonPath("$.[*].releaseDate").value(hasItem(DEFAULT_RELEASE_DATE_STR)))
.andExpect(jsonPath("$.[*].dueDate").value(hasItem(DEFAULT_DUE_DATE_STR)))
.andExpect(jsonPath("$.[*].allowOnlineEditor").value(hasItem(DEFAULT_ALLOW_ONLINE_EDITOR.booleanValue())));
<<<<<<<
.andExpect(jsonPath("$.baseRepositoryUrl").value(DEFAULT_BASE_REPOSITORY_URL.toString()))
.andExpect(jsonPath("$.baseBuildPlanId").value(DEFAULT_BASE_BUILD_PLAN_ID.toString()))
.andExpect(jsonPath("$.publishBuildPlanUrl").value(DEFAULT_PUBLISH_BUILD_PLAN_URL.booleanValue()))
.andExpect(jsonPath("$.releaseDate").value(DEFAULT_RELEASE_DATE_STR))
.andExpect(jsonPath("$.dueDate").value(DEFAULT_DUE_DATE_STR))
.andExpect(jsonPath("$.allowOnlineEditor").value(DEFAULT_ALLOW_ONLINE_EDITOR.booleanValue()));
=======
.andExpect(jsonPath("$.baseProjectKey").value(DEFAULT_BASE_PROJECT_KEY.toString()))
.andExpect(jsonPath("$.baseRepositorySlug").value(DEFAULT_BASE_REPOSITORY_SLUG.toString()))
.andExpect(jsonPath("$.baseBuildPlanSlug").value(DEFAULT_BASE_BUILD_PLAN_SLUG.toString()))
.andExpect(jsonPath("$.releaseDate").value(sameInstant(DEFAULT_RELEASE_DATE)))
.andExpect(jsonPath("$.dueDate").value(sameInstant(DEFAULT_DUE_DATE)));
>>>>>>>
.andExpect(jsonPath("$.baseRepositoryUrl").value(DEFAULT_BASE_REPOSITORY_URL.toString()))
.andExpect(jsonPath("$.baseBuildPlanId").value(DEFAULT_BASE_BUILD_PLAN_ID.toString()))
.andExpect(jsonPath("$.publishBuildPlanUrl").value(DEFAULT_PUBLISH_BUILD_PLAN_URL.booleanValue()))
.andExpect(jsonPath("$.releaseDate").value(DEFAULT_RELEASE_DATE_STR))
.andExpect(jsonPath("$.dueDate").value(DEFAULT_DUE_DATE_STR))
.andExpect(jsonPath("$.allowOnlineEditor").value(DEFAULT_ALLOW_ONLINE_EDITOR.booleanValue())); |
<<<<<<<
=======
import com.quorum.tessera.config.keypairs.FilesystemKeyPair;
import com.quorum.tessera.key.generation.KeyGenerator;
>>>>>>>
import com.quorum.tessera.config.keypairs.FilesystemKeyPair;
import com.quorum.tessera.key.generation.KeyGenerator; |
<<<<<<<
import org.springframework.beans.factory.annotation.Value;
=======
import org.springframework.cache.CacheManager;
>>>>>>>
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
<<<<<<<
public UserService(UserRepository userRepository, PersistentTokenRepository persistentTokenRepository, AuthorityRepository authorityRepository) {
=======
private final CacheManager cacheManager;
public UserService(UserRepository userRepository, PasswordEncoder passwordEncoder, PersistentTokenRepository persistentTokenRepository, AuthorityRepository authorityRepository, CacheManager cacheManager) {
>>>>>>>
private final CacheManager cacheManager;
public UserService(UserRepository userRepository, PersistentTokenRepository persistentTokenRepository, AuthorityRepository authorityRepository, CacheManager cacheManager) { |
<<<<<<<
import org.apache.commons.lang.exception.ExceptionUtils;
=======
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.apache.commons.lang.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<<<<<<<
//errorDTO = new ErrorDTO(ErrorConstants.ERR_INTERNAL_SERVER_ERROR, "Internal server error");
errorDTO = new ErrorDTO(ErrorConstants.ERR_INTERNAL_SERVER_ERROR, ExceptionUtils.getStackTrace(ex));
=======
errorVM = new ErrorVM(ErrorConstants.ERR_INTERNAL_SERVER_ERROR, "Internal server error");
>>>>>>>
errorVM = new ErrorVM(ErrorConstants.ERR_INTERNAL_SERVER_ERROR, ExceptionUtils.getStackTrace(ex)); |
<<<<<<<
=======
import com.github.nexus.api.Nexus;
import com.github.nexus.configuration.ConfigurationParser;
import com.github.nexus.configuration.PropertyLoader;
>>>>>>>
import com.github.nexus.api.Nexus;
import com.github.nexus.configuration.ConfigurationParser;
import com.github.nexus.configuration.PropertyLoader; |
<<<<<<<
import de.tum.in.www1.exerciseapp.domain.enumeration.ParticipationState;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
=======
import org.springframework.stereotype.Repository;
import org.springframework.data.jpa.repository.*;
>>>>>>>
import de.tum.in.www1.exerciseapp.domain.enumeration.ParticipationState;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.data.jpa.repository.*;
<<<<<<<
public interface ParticipationRepository extends JpaRepository<Participation, Long> {
List<Participation> findByExerciseId(@Param("exerciseId") Long exerciseId);
@Query("select p from Participation p where p.exercise.course.id = :courseId")
List<Participation> findByCourseId(@Param("courseId") Long courseId);
Participation findOneByExerciseIdAndStudentLogin(Long exerciseId, String username);
Participation findOneByExerciseIdAndStudentLoginAndInitializationState(Long exerciseId, String username, ParticipationState state);
=======
@Repository
public interface ParticipationRepository extends JpaRepository<Participation, Long> {
>>>>>>>
@Repository
public interface ParticipationRepository extends JpaRepository<Participation, Long> {
List<Participation> findByExerciseId(@Param("exerciseId") Long exerciseId);
@Query("select p from Participation p where p.exercise.course.id = :courseId")
List<Participation> findByCourseId(@Param("courseId") Long courseId);
Participation findOneByExerciseIdAndStudentLogin(Long exerciseId, String username);
Participation findOneByExerciseIdAndStudentLoginAndInitializationState(Long exerciseId, String username, ParticipationState state); |
<<<<<<<
=======
import com.asf.appcoins.sdk.iab.wallet.AndroidUtils;
import io.reactivex.Completable;
>>>>>>>
import io.reactivex.Completable;
<<<<<<<
=======
import io.reactivex.Single;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
>>>>>>>
import io.reactivex.Single;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; |
<<<<<<<
import com.asf.appcoins.sdk.iab.payment.PaymentStatus;
=======
import io.reactivex.Completable;
>>>>>>>
import com.asf.appcoins.sdk.iab.payment.PaymentStatus;
import io.reactivex.Completable;
<<<<<<<
PaymentDetails currentPayment = paymentService.getCurrentPayment();
String txHash = currentPayment
=======
return Observable.fromCallable(() -> paymentService.getCurrentPayment()
>>>>>>>
PaymentDetails currentPayment = paymentService.getCurrentPayment();
String txHash = currentPayment
<<<<<<<
.getHash();
String skuId = currentPayment.getSkuId();
boolean hasTxHash = txHash != null;
if (hasTxHash) {
return Observable.interval(0, period, TimeUnit.SECONDS, scheduler)
.flatMap(longTimed -> paymentService.getPaymentDetailsUnchecked(skuId, txHash))
.takeUntil(paymentDetails -> paymentDetails.getPaymentStatus() == PaymentStatus.SUCCESS);
} else {
return Observable.just(currentPayment);
}
=======
.getHash() != null)
.flatMap(hasTxHash -> hasTxHash ? getPayment(paymentService.getCurrentPayment()
.getSkuId()) : Observable.just(paymentService.getCurrentPayment()));
>>>>>>>
.getHash();
String skuId = currentPayment.getSkuId();
boolean hasTxHash = txHash != null;
if (hasTxHash) {
return Observable.interval(0, period, TimeUnit.SECONDS, scheduler)
.flatMap(longTimed -> paymentService.getPaymentDetailsUnchecked(skuId, txHash))
.takeUntil(paymentDetails -> paymentDetails.getPaymentStatus() == PaymentStatus.SUCCESS);
} else {
return Observable.just(currentPayment);
} |
<<<<<<<
this.addMorph(morphs, world, "minecraft:rabbit", "Toast", "{CustomName:\"Toast\"}");
=======
this.addMorph(morphs, world, "Rabbit", "Toast", "{CustomName:\"Toast\"}");
/* Blocks */
this.addBlockMorph(morphs, world, "{Block:\"minecraft:stone\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:cobblestone\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:grass\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:dirt\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:log\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:diamond_block\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:sponge\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:deadbush\"}");
/* Players */
this.addPlayerMorph(morphs, world, "McHorseYT", "players.yt");
this.addPlayerMorph(morphs, world, "ExplodingTNT", "players.yt");
this.addPlayerMorph(morphs, world, "TheMineboxYT", "players.yt");
this.addPlayerMorph(morphs, world, "VignetteCoeff", "players.shaderdev");
this.addPlayerMorph(morphs, world, "Poslovitch", "players.moddev");
this.addPlayerMorph(morphs, world, "The_Fireplace", "players.moddev");
this.addPlayerMorph(morphs, world, "iChun", "players.moddev");
>>>>>>>
this.addMorph(morphs, world, "minecraft:rabbit", "Toast", "{CustomName:\"Toast\"}");
/* Blocks */
this.addBlockMorph(morphs, world, "{Block:\"minecraft:stone\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:cobblestone\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:grass\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:dirt\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:log\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:diamond_block\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:sponge\"}");
this.addBlockMorph(morphs, world, "{Block:\"minecraft:deadbush\"}");
/* Players */
this.addPlayerMorph(morphs, world, "McHorseYT", "players.yt");
this.addPlayerMorph(morphs, world, "ExplodingTNT", "players.yt");
this.addPlayerMorph(morphs, world, "TheMineboxYT", "players.yt");
this.addPlayerMorph(morphs, world, "VignetteCoeff", "players.shaderdev");
this.addPlayerMorph(morphs, world, "Poslovitch", "players.moddev");
this.addPlayerMorph(morphs, world, "The_Fireplace", "players.moddev");
this.addPlayerMorph(morphs, world, "iChun", "players.moddev"); |
<<<<<<<
EntityMorph morphEntity = new EntityMorph(player.world, player.getUniqueID(), morph);
=======
SpawnGhostEvent spawnGhostEvent = new SpawnGhostEvent.Pre(player, morph);
if (MinecraftForge.EVENT_BUS.post(spawnGhostEvent) || spawnGhostEvent.morph == null)
{
return;
}
morph = spawnGhostEvent.morph;
EntityMorph morphEntity = new EntityMorph(player.worldObj, player.getUniqueID(), morph);
>>>>>>>
SpawnGhostEvent spawnGhostEvent = new SpawnGhostEvent.Pre(player, morph);
if (MinecraftForge.EVENT_BUS.post(spawnGhostEvent) || spawnGhostEvent.morph == null)
{
return;
}
morph = spawnGhostEvent.morph;
EntityMorph morphEntity = new EntityMorph(player.world, player.getUniqueID(), morph);
<<<<<<<
player.world.spawnEntity(morphEntity);
=======
player.worldObj.spawnEntityInWorld(morphEntity);
MinecraftForge.EVENT_BUS.post(new SpawnGhostEvent.Post(player, morph));
>>>>>>>
player.world.spawnEntity(morphEntity);
MinecraftForge.EVENT_BUS.post(new SpawnGhostEvent.Post(player, morph)); |
<<<<<<<
EntityMorph morph = name.equals("VillagerGolem") ? new IronGolemMorph() : new EntityMorph();
EntityLivingBase entity = (EntityLivingBase) EntityList.createEntityByIDFromName(new ResourceLocation(name), world);
=======
EntityMorph morph = this.morphFromName(name);
EntityLivingBase entity = (EntityLivingBase) EntityList.createEntityByName(name, world);
>>>>>>>
EntityMorph morph = this.morphFromName(name);
EntityLivingBase entity = (EntityLivingBase) EntityList.createEntityByIDFromName(new ResourceLocation(name), world);
<<<<<<<
Class<? extends Entity> clazz = null;
ResourceLocation key = new ResourceLocation(name);
=======
if (name.equals("metamorph.Block"))
{
return true;
}
Class<? extends Entity> clazz = EntityList.NAME_TO_CLASS.get(name);
>>>>>>>
if (name.equals("metamorph.Block"))
{
return true;
}
Class<? extends Entity> clazz = null;
ResourceLocation key = new ResourceLocation(name);
<<<<<<<
if (MorphManager.NAME_TO_RL.containsKey(name))
{
name = MorphManager.NAME_TO_RL.get(name).toString();
}
=======
if (name.equals("metamorph.Block"))
{
BlockMorph morph = new BlockMorph();
morph.fromNBT(tag);
return morph;
}
>>>>>>>
/* TODO: figure out what did this thing do */
if (MorphManager.NAME_TO_RL.containsKey(name))
{
name = MorphManager.NAME_TO_RL.get(name).toString();
}
if (name.equals("metamorph.Block"))
{
BlockMorph morph = new BlockMorph();
morph.fromNBT(tag);
return morph;
}
<<<<<<<
EntityMorph morph = name.equals("minecraft:villager_golem") ? new IronGolemMorph() : new EntityMorph();
=======
EntityMorph morph = morphFromName(name);
>>>>>>>
EntityMorph morph = morphFromName(name); |
<<<<<<<
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
=======
>>>>>>>
<<<<<<<
}
private void updateAir(EntityLivingBase target)
{
if (target instanceof EntityPlayer)
{
IMorphing morphing = Morphing.get((EntityPlayer)target);
if (morphing != null)
{
if (target.isInWater())
{
morphing.setSquidAir(300);
target.setAir(300);
}
else
{
int air = morphing.getSquidAir() - 1;
if (air <= -20)
{
air = 0;
target.attackEntityFrom(DamageSource.drown, 2.0F);
}
morphing.setSquidAir(air);
}
}
}
}
@Override
public void onMorph(EntityLivingBase target)
{
IMorphing morphing = Morphing.get((EntityPlayer)target);
if (morphing != null)
{
morphing.setSquidAir(target.getAir());
morphing.setHasSquidAir(true);
}
}
@Override
public void onDemorph(EntityLivingBase target)
{
IMorphing morphing = Morphing.get((EntityPlayer)target);
if (morphing != null)
{
target.setAir(morphing.getSquidAir());
morphing.setHasSquidAir(false);
}
=======
>>>>>>> |
<<<<<<<
import mchorse.metamorph.client.gui.builder.GuiMorphBuilder;
import mchorse.metamorph.client.gui.elements.GuiHud;
=======
>>>>>>>
import mchorse.metamorph.client.gui.elements.GuiHud; |
<<<<<<<
category.height = MathHelper.ceil((float) category.cells.size() / (float) this.perRow);
category.y = this.scrollHeight + 10;
=======
category.height = MathHelper.ceiling_float_int((float) category.cells.size() / (float) this.perRow);
category.y = this.scroll.scrollSize + 10;
>>>>>>>
category.height = MathHelper.ceil((float) category.cells.size() / (float) this.perRow);
category.y = this.scroll.scrollSize + 10;
<<<<<<<
cat.height = MathHelper.ceil((float) i / (float) this.perRow);
cat.y = this.scrollHeight + 10;
=======
cat.height = MathHelper.ceiling_float_int((float) i / (float) this.perRow);
cat.y = this.scroll.scrollSize + 10;
>>>>>>>
cat.height = MathHelper.ceil((float) i / (float) this.perRow);
cat.y = this.scroll.scrollSize + 10; |
<<<<<<<
/**
* Default constructor
*
* This method is responsible for constructing the morphs for rendering and
* also selecting the morph that player uses right now.
*/
public GuiCreativeMenu()
{
EntityPlayer player = Minecraft.getMinecraft().player;
IMorphing morphing = Morphing.get(player);
this.pane = new GuiCreativeMorphs(6, morphing.getCurrentMorph());
}
=======
>>>>>>>
<<<<<<<
this.renderMorph(morph.morph, Minecraft.getMinecraft().player, 70, height - (int) ((float) height / 2.6), 43);
=======
morph.render(Minecraft.getMinecraft().thePlayer, 70, height - (int) ((float) height / 2.6), 43);
>>>>>>>
morph.render(Minecraft.getMinecraft().player, 70, height - (int) ((float) height / 2.6), 43); |
<<<<<<<
public class Player implements Serializable {
/**
* For serialization
*/
private static final long serialVersionUID = 559137800510426092L;
/**
* An integer that identifies the player
*/
int ID = 0;
/**
* The amount of resources owned by the player
*/
=======
public class Player {
int ID = 0;
>>>>>>>
public class Player {
/**
* An integer that identifies the player
*/
int ID = 0;
/**
* The amount of resources owned by the player
*/ |
<<<<<<<
public class PhysicalGameState implements Serializable {
/**
*
*/
private static final long serialVersionUID = -4561827960954391384L;
/**
* Indicates a free tile
*/
public static final int TERRAIN_NONE = 0;
/**
* Indicates a blocked tile
*/
=======
public class PhysicalGameState {
public static final int TERRAIN_NONE = 0;
>>>>>>>
public class PhysicalGameState {
/**
* Indicates a free tile
*/
public static final int TERRAIN_NONE = 0;
/**
* Indicates a blocked tile
*/
<<<<<<<
/**
* Returns the winner of the game, given the unit counts or -1 if the game is not over
* TODO: verify where unit counts are being compared!
* @return
*/
int winner() {
int unitcounts[] = new int[players.size()];
for (Unit u : units) {
if (u.getPlayer() >= 0)
unitcounts[u.getPlayer()]++;
}
int winner = -1;
for (int i = 0; i < unitcounts.length; i++) {
if (unitcounts[i] > 0) {
if (winner == -1) {
winner = i;
} else {
return -1;
}
}
}
=======
public int winner() {
int unitcounts[] = new int[players.size()];
for(Unit u:units) {
if (u.getPlayer()>=0) unitcounts[u.getPlayer()]++;
}
int winner = -1;
for(int i = 0;i<unitcounts.length;i++) {
if (unitcounts[i]>0) {
if (winner==-1) {
winner = i;
} else {
return -1;
}
}
}
>>>>>>>
/**
* Returns the winner of the game, given the unit counts or -1 if the game is not over
* TODO: verify where unit counts are being compared!
* @return
*/
public int winner() {
int unitcounts[] = new int[players.size()];
for (Unit u : units) {
if (u.getPlayer() >= 0)
unitcounts[u.getPlayer()]++;
}
int winner = -1;
for (int i = 0; i < unitcounts.length; i++) {
if (unitcounts[i] > 0) {
if (winner == -1) {
winner = i;
} else {
return -1;
}
}
} |
<<<<<<<
private boolean botUser;
private String buildServerUrl;
=======
private String authTokenCredentialId;
>>>>>>>
private String authTokenCredentialId;
private boolean botUser;
<<<<<<<
public boolean getBotUser() {
return botUser;
}
public String getBuildServerUrl() {
if(buildServerUrl == null || "".equals(buildServerUrl)) {
JenkinsLocationConfiguration jenkinsConfig = new JenkinsLocationConfiguration();
return jenkinsConfig.getUrl();
}
else {
return buildServerUrl;
}
=======
public String getAuthTokenCredentialId() {
return authTokenCredentialId;
>>>>>>>
public String getAuthTokenCredentialId() {
return authTokenCredentialId;
}
public boolean getBotUser() {
return botUser;
<<<<<<<
public SlackNotifier(final String teamDomain, final String authToken, final boolean botUser, final String room, final String buildServerUrl,
=======
public SlackNotifier(final String teamDomain, final String authToken, final String room, final String authTokenCredentialId,
>>>>>>>
public SlackNotifier(final String teamDomain, final String authToken, final boolean botUser, final String room, final String authTokenCredentialId,
<<<<<<<
this.botUser = botUser;
this.buildServerUrl = buildServerUrl;
=======
this.authTokenCredentialId = StringUtils.trim(authTokenCredentialId);
>>>>>>>
this.authTokenCredentialId = StringUtils.trim(authTokenCredentialId);
this.botUser = botUser;
<<<<<<<
return new StandardSlackService(teamDomain, authToken, botUser, room);
=======
return new StandardSlackService(teamDomain, authToken, authTokenCredentialId, room);
>>>>>>>
return new StandardSlackService(teamDomain, authToken, authTokenCredentialId, botUser, room);
<<<<<<<
private boolean botUser;
=======
private String tokenCredentialId;
>>>>>>>
private String tokenCredentialId;
private boolean botUser;
<<<<<<<
boolean botUser = "true".equals(sr.getParameter("slackBotUser"));
=======
String tokenCredentialId = json.getString("tokenCredentialId");
>>>>>>>
String tokenCredentialId = json.getString("tokenCredentialId");
boolean botUser = "true".equals(sr.getParameter("slackBotUser"));
<<<<<<<
return new SlackNotifier(teamDomain, token, botUser, room, buildServerUrl, sendAs, startNotification, notifyAborted,
=======
return new SlackNotifier(teamDomain, token, room, tokenCredentialId, sendAs, startNotification, notifyAborted,
>>>>>>>
return new SlackNotifier(teamDomain, token, botUser, room, tokenCredentialId, sendAs, startNotification, notifyAborted,
<<<<<<<
botUser = "true".equals(sr.getParameter("slackBotUser"));
=======
tokenCredentialId = formData.getJSONObject("slack").getString("tokenCredentialId");
>>>>>>>
tokenCredentialId = formData.getJSONObject("slack").getString("tokenCredentialId");
botUser = "true".equals(sr.getParameter("slackBotUser"));
<<<<<<<
if(buildServerUrl == null || "".equals(buildServerUrl)) {
JenkinsLocationConfiguration jenkinsConfig = new JenkinsLocationConfiguration();
buildServerUrl = jenkinsConfig.getUrl();
}
if (buildServerUrl != null && !buildServerUrl.endsWith("/")) {
buildServerUrl = buildServerUrl + "/";
}
=======
>>>>>>>
<<<<<<<
SlackService getSlackService(final String teamDomain, final String authToken, final boolean botUser, final String room) {
return new StandardSlackService(teamDomain, authToken, botUser, room);
=======
SlackService getSlackService(final String teamDomain, final String authToken, final String authTokenCredentialId, final String room) {
return new StandardSlackService(teamDomain, authToken, authTokenCredentialId, room);
>>>>>>>
SlackService getSlackService(final String teamDomain, final String authToken, final String authTokenCredentialId, final boolean botUser, final String room) {
return new StandardSlackService(teamDomain, authToken, authTokenCredentialId, botUser, room);
<<<<<<<
@QueryParameter("slackBotUser") final boolean botUser,
@QueryParameter("slackRoom") final String room,
@QueryParameter("slackBuildServerUrl") final String buildServerUrl) throws FormException {
=======
@QueryParameter("tokenCredentialId") final String authTokenCredentialId,
@QueryParameter("slackRoom") final String room) throws FormException {
>>>>>>>
@QueryParameter("tokenCredentialId") final String authTokenCredentialId,
@QueryParameter("slackBotUser") final boolean botUser,
@QueryParameter("slackRoom") final String room) throws FormException {
<<<<<<<
String targetBuildServerUrl = buildServerUrl;
if (StringUtils.isEmpty(targetBuildServerUrl)) {
targetBuildServerUrl = this.buildServerUrl;
}
SlackService testSlackService = getSlackService(targetDomain, targetToken, targetBotUser, targetRoom);
String message = "Slack/Jenkins plugin: you're all set on " + targetBuildServerUrl;
=======
SlackService testSlackService = getSlackService(targetDomain, targetToken, targetTokenCredentialId, targetRoom);
String message = "Slack/Jenkins plugin: you're all set on " + DisplayURLProvider.get().getRoot();
>>>>>>>
SlackService testSlackService = getSlackService(targetDomain, targetToken, targetTokenCredentialId, targetBotUser, targetRoom);
String message = "Slack/Jenkins plugin: you're all set on " + DisplayURLProvider.get().getRoot(); |
<<<<<<<
slackSendStep.setBotUser(false);
=======
slackSendStep.setTokenCredentialId("tokenCredentialId");
>>>>>>>
slackSendStep.setTokenCredentialId("tokenCredentialId");
slackSendStep.setBotUser(false);
<<<<<<<
when(stepExecution.getSlackService(anyString(), anyString(), anyBoolean(), anyString())).thenReturn(slackServiceMock);
=======
when(stepExecution.getSlackService(anyString(), anyString(), anyString(), anyString())).thenReturn(slackServiceMock);
>>>>>>>
when(stepExecution.getSlackService(anyString(), anyString(), anyString(), anyBoolean(), anyString())).thenReturn(slackServiceMock);
<<<<<<<
verify(stepExecution, times(1)).getSlackService("teamDomain", "token", false, "channel");
=======
verify(stepExecution, times(1)).getSlackService("teamDomain", "token", "tokenCredentialId", "channel");
>>>>>>>
verify(stepExecution, times(1)).getSlackService("teamDomain", "token", "tokenCredentialId", false, "channel");
<<<<<<<
when(slackDescMock.getBotUser()).thenReturn(false);
=======
when(slackDescMock.getTokenCredentialId()).thenReturn("globalTokenCredentialId");
>>>>>>>
when(slackDescMock.getTokenCredentialId()).thenReturn("globalTokenCredentialId");
when(slackDescMock.getBotUser()).thenReturn(false);
<<<<<<<
when(stepExecution.getSlackService(anyString(), anyString(), anyBoolean(), anyString())).thenReturn(slackServiceMock);
=======
when(stepExecution.getSlackService(anyString(), anyString(), anyString(), anyString())).thenReturn(slackServiceMock);
>>>>>>>
when(stepExecution.getSlackService(anyString(), anyString(), anyString(), anyBoolean(), anyString())).thenReturn(slackServiceMock); |
<<<<<<<
private boolean botUser;
=======
private String tokenCredentialId;
>>>>>>>
private String tokenCredentialId;
private boolean botUser;
<<<<<<<
public boolean getBotUser() {
return botUser;
}
@DataBoundSetter
public void setBotUser(boolean botUser) {
this.botUser = botUser;
}
=======
public String getTokenCredentialId() {
return tokenCredentialId;
}
@DataBoundSetter
public void setTokenCredentialId(String tokenCredentialId) {
this.tokenCredentialId = Util.fixEmpty(tokenCredentialId);
}
>>>>>>>
public String getTokenCredentialId() {
return tokenCredentialId;
}
@DataBoundSetter
public void setTokenCredentialId(String tokenCredentialId) {
this.tokenCredentialId = Util.fixEmpty(tokenCredentialId);
}
public boolean getBotUser() {
return botUser;
}
@DataBoundSetter
public void setBotUser(boolean botUser) {
this.botUser = botUser;
}
<<<<<<<
String token;
boolean botUser;
if (step.token != null) {
token = step.token;
botUser = step.botUser;
} else {
token = slackDesc.getToken();
botUser = slackDesc.getBotUser();
}
=======
String token = step.token != null ? step.token : slackDesc.getToken();
String tokenCredentialId = step.tokenCredentialId != null ? step.tokenCredentialId : slackDesc.getTokenCredentialId();
>>>>>>>
String tokenCredentialId = step.tokenCredentialId != null ? step.tokenCredentialId : slackDesc.getTokenCredentialId();
String token;
boolean botUser;
if (step.token != null) {
token = step.token;
botUser = step.botUser;
} else {
token = slackDesc.getToken();
botUser = slackDesc.getBotUser();
}
<<<<<<<
SlackService slackService = getSlackService(team, token, botUser, channel);
=======
SlackService slackService = getSlackService(team, token, tokenCredentialId, channel);
>>>>>>>
SlackService slackService = getSlackService(team, token, tokenCredentialId, botUser, channel);
<<<<<<<
SlackService getSlackService(String team, String token, boolean botUser, String channel) {
return new StandardSlackService(team, token, botUser, channel);
=======
SlackService getSlackService(String team, String token, String tokenCredentialId, String channel) {
return new StandardSlackService(team, token, tokenCredentialId, channel);
>>>>>>>
SlackService getSlackService(String team, String token, String tokenCredentialId, boolean botUser, String channel) {
return new StandardSlackService(team, token, tokenCredentialId, botUser, channel); |
<<<<<<<
public SlackNotifierStub(String teamDomain, String authToken, boolean botUser, String room, String buildServerUrl,
=======
public SlackNotifierStub(String teamDomain, String authToken, String authTokenCredentialId, String room,
>>>>>>>
public SlackNotifierStub(String teamDomain, String authToken, boolean botUser, String room, String authTokenCredentialId,
<<<<<<<
super(teamDomain, authToken, botUser, room, buildServerUrl, sendAs, startNotification, notifyAborted, notifyFailure,
=======
super(teamDomain, authToken, authTokenCredentialId, room, sendAs, startNotification, notifyAborted, notifyFailure,
>>>>>>>
super(teamDomain, authToken, botUser, room, authTokenCredentialId, sendAs, startNotification, notifyAborted, notifyFailure,
<<<<<<<
SlackService getSlackService(final String teamDomain, final String authToken, final boolean botUser, final String room) {
=======
SlackService getSlackService(final String teamDomain, final String authToken, final String authTokenCredentialId, final String room) {
>>>>>>>
SlackService getSlackService(final String teamDomain, final String authToken, final String authTokenCredentialId, final boolean botUser, final String room) { |
<<<<<<<
assertEquals(false, notifier.getBotUser());
assertEquals("http://localhost:8080/", notifier.getBuildServerUrl());
=======
>>>>>>>
assertEquals(false, notifier.getBotUser());
<<<<<<<
assertEquals(false, notifier.getBotUser());
assertEquals("http://localhost:8080/", notifier.getBuildServerUrl());
=======
>>>>>>>
assertEquals(false, notifier.getBotUser());
<<<<<<<
assertEquals(false, notifier.getBotUser());
assertEquals(j.getURL().toString(), notifier.getBuildServerUrl());
=======
>>>>>>>
assertEquals(false, notifier.getBotUser());
<<<<<<<
assertEquals(false, notifier.getBotUser());
assertEquals(j.getURL().toString(), notifier.getBuildServerUrl());
=======
>>>>>>>
assertEquals(false, notifier.getBotUser()); |
<<<<<<<
import hudson.ProxyConfiguration;
import jenkins.model.Jenkins;
=======
import hudson.security.ACL;
>>>>>>>
import hudson.security.ACL;
<<<<<<<
=======
import org.jenkinsci.plugins.plaincredentials.StringCredentials;
import com.cloudbees.plugins.credentials.CredentialsMatcher;
import com.cloudbees.plugins.credentials.CredentialsMatchers;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.domains.DomainRequirement;
import org.json.JSONObject;
>>>>>>>
import org.jenkinsci.plugins.plaincredentials.StringCredentials;
import com.cloudbees.plugins.credentials.CredentialsMatcher;
import com.cloudbees.plugins.credentials.CredentialsMatchers;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.domains.DomainRequirement;
<<<<<<<
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
=======
import java.util.Collections;
import java.util.List;
>>>>>>>
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.List;
<<<<<<<
=======
import jenkins.model.Jenkins;
import hudson.ProxyConfiguration;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.lang.StringUtils;
>>>>>>>
import jenkins.model.Jenkins;
import hudson.ProxyConfiguration;
import org.apache.commons.lang.StringUtils;
<<<<<<<
private boolean botUser;
=======
private String authTokenCredentialId;
>>>>>>>
private String authTokenCredentialId;
private boolean botUser;
<<<<<<<
public StandardSlackService(String teamDomain, String token, boolean botUser, String roomId) {
=======
public StandardSlackService(String teamDomain, String token, String authTokenCredentialId, String roomId) {
>>>>>>>
public StandardSlackService(String teamDomain, String token, String authTokenCredentialId, boolean botUser, String roomId) {
<<<<<<<
this.botUser = botUser;
=======
this.authTokenCredentialId = StringUtils.trim(authTokenCredentialId);
>>>>>>>
this.authTokenCredentialId = StringUtils.trim(authTokenCredentialId);
this.botUser = botUser;
<<<<<<<
//prepare attachments first
JSONObject field = new JSONObject();
field.put("short", false);
field.put("value", message);
JSONArray fields = new JSONArray();
fields.put(field);
JSONObject attachment = new JSONObject();
attachment.put("fallback", message);
attachment.put("color", color);
attachment.put("fields", fields);
JSONArray mrkdwn = new JSONArray();
mrkdwn.put("pretext");
mrkdwn.put("text");
mrkdwn.put("fields");
attachment.put("mrkdwn_in", mrkdwn);
JSONArray attachments = new JSONArray();
attachments.put(attachment);
PostMethod post;
String url;
//prepare post methods for both requests types
if (!botUser) {
url = "https://" + teamDomain + "." + host + "/services/hooks/jenkins-ci?token=" + token;
post = new PostMethod(url);
JSONObject json = new JSONObject();
=======
String url = "https://" + teamDomain + "." + host + "/services/hooks/jenkins-ci?token=" + getTokenToUse();
logger.fine("Posting: to " + roomId + " on " + teamDomain + " using " + url +": " + message + " " + color);
HttpClient client = getHttpClient();
PostMethod post = new PostMethod(url);
JSONObject json = new JSONObject();
try {
JSONObject field = new JSONObject();
field.put("short", false);
field.put("value", message);
JSONArray fields = new JSONArray();
fields.put(field);
JSONObject attachment = new JSONObject();
attachment.put("fallback", message);
attachment.put("color", color);
attachment.put("fields", fields);
JSONArray mrkdwn = new JSONArray();
mrkdwn.put("pretext");
mrkdwn.put("text");
mrkdwn.put("fields");
attachment.put("mrkdwn_in", mrkdwn);
JSONArray attachments = new JSONArray();
attachments.put(attachment);
>>>>>>>
//prepare attachments first
JSONObject field = new JSONObject();
field.put("short", false);
field.put("value", message);
JSONArray fields = new JSONArray();
fields.put(field);
JSONObject attachment = new JSONObject();
attachment.put("fallback", message);
attachment.put("color", color);
attachment.put("fields", fields);
JSONArray mrkdwn = new JSONArray();
mrkdwn.put("pretext");
mrkdwn.put("text");
mrkdwn.put("fields");
attachment.put("mrkdwn_in", mrkdwn);
JSONArray attachments = new JSONArray();
attachments.put(attachment);
PostMethod post;
String url;
//prepare post methods for both requests types
if (!botUser) {
url = "https://" + teamDomain + "." + host + "/services/hooks/jenkins-ci?token=" + getTokenToUse();
post = new PostMethod(url);
JSONObject json = new JSONObject();
<<<<<<<
} else {
logger.info("Posting succeeded");
=======
}
else {
logger.fine("Posting succeeded");
>>>>>>>
} else {
logger.info("Posting succeeded"); |
<<<<<<<
=======
@NotNull
@Pattern(regexp = "[a-zA-Z0-9.\\-_/\\\\]+")
>>>>>>> |
<<<<<<<
@SpringBootTest(classes = BootElastiCacheAwsTest.BootElastiCacheAwsTestConfig.class)
class BootElastiCacheAwsTest extends ElastiCacheAwsTest {
=======
@SpringBootTest(classes = BootElastiCacheAwsTest.BootElastiCacheAwsTestConfig.class,
properties = {
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
public class BootElastiCacheAwsTest extends ElastiCacheAwsTest {
>>>>>>>
@SpringBootTest(classes = BootElastiCacheAwsTest.BootElastiCacheAwsTestConfig.class,
properties = {
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
class BootElastiCacheAwsTest extends ElastiCacheAwsTest { |
<<<<<<<
@SpringBootTest(classes = BootNotificationMessagingTemplateIntegrationTest.NotificationMessagingTemplateIntegrationTestConfiguration.class)
class BootNotificationMessagingTemplateIntegrationTest
=======
@SpringBootTest(
classes = BootNotificationMessagingTemplateIntegrationTest.NotificationMessagingTemplateIntegrationTestConfiguration.class)
public class BootNotificationMessagingTemplateIntegrationTest
>>>>>>>
@SpringBootTest(
classes = BootNotificationMessagingTemplateIntegrationTest.NotificationMessagingTemplateIntegrationTestConfiguration.class)
class BootNotificationMessagingTemplateIntegrationTest |
<<<<<<<
"cloud.aws.loader.queueCapacity=0" })
class BootResourceLoaderAwsTest extends ResourceLoaderAwsTest {
=======
"cloud.aws.loader.queueCapacity=0",
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
public class BootResourceLoaderAwsTest extends ResourceLoaderAwsTest {
>>>>>>>
"cloud.aws.loader.queueCapacity=0",
"cloud.aws.credentials.access-key=${aws-integration-tests.accessKey}",
"cloud.aws.credentials.secret-key=${aws-integration-tests.secretKey}" })
class BootResourceLoaderAwsTest extends ResourceLoaderAwsTest { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.