conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
import java.util.UUID;
import com.google.common.base.Optional;
>>>>>>>
import java.util.UUID;
import com.google.common.base.Optional; |
<<<<<<<
import java.util.ArrayList;
import java.util.List;
import cam72cam.immersiverailroading.library.*;
import org.apache.commons.lang3.ArrayUtils;
=======
>>>>>>>
<<<<<<<
import cam72cam.immersiverailroading.entity.EntityMoveableRollingStock;
import cam72cam.immersiverailroading.entity.EntityRollingStock;
import cam72cam.immersiverailroading.entity.Freight;
import cam72cam.immersiverailroading.entity.FreightTank;
import cam72cam.immersiverailroading.entity.Locomotive;
import cam72cam.immersiverailroading.entity.Tender;
=======
import cam72cam.immersiverailroading.library.*;
>>>>>>>
import cam72cam.immersiverailroading.entity.EntityMoveableRollingStock;
import cam72cam.immersiverailroading.entity.EntityRollingStock;
import cam72cam.immersiverailroading.entity.Freight;
import cam72cam.immersiverailroading.entity.FreightTank;
import cam72cam.immersiverailroading.entity.Locomotive;
import cam72cam.immersiverailroading.entity.Tender;
import cam72cam.immersiverailroading.library.*;
<<<<<<<
public BlockPos getParentReplaced() {
if (this.replaced == null) {
return null;
}
if (!this.replaced.hasKey("parent")) {
return null;
}
return BlockPos.fromLong(this.replaced.getLong("parent")).add(pos);
}
=======
public void toggleSwitchForced() {
TileRail teParent = this.getParentTile().getParentTile();
if (teParent != null) {
if (teParent.info.settings.type == TrackItems.SWITCH) {
teParent.info = new RailInfo(world, teParent.info.settings, teParent.info.placementInfo, teParent.info.customInfo, teParent.info.switchState, !teParent.info.switchForced, teParent.info.tablePos);
this.markDirty();
}
}
}
public boolean isSwitchForced() {
TileRail teParent = this.getParentTile().getParentTile();
if (teParent != null) {
if (teParent.info.settings.type == TrackItems.SWITCH) {
return teParent.info.switchForced;
}
}
return false;
}
>>>>>>>
public BlockPos getParentReplaced() {
if (this.replaced == null) {
return null;
}
if (!this.replaced.hasKey("parent")) {
return null;
}
return BlockPos.fromLong(this.replaced.getLong("parent")).add(pos);
}
public void toggleSwitchForced() {
TileRail teParent = this.getParentTile().getParentTile();
if (teParent != null) {
if (teParent.info.settings.type == TrackItems.SWITCH) {
teParent.info = new RailInfo(world, teParent.info.settings, teParent.info.placementInfo, teParent.info.customInfo, teParent.info.switchState, !teParent.info.switchForced, teParent.info.tablePos);
this.markDirty();
}
}
}
public boolean isSwitchForced() {
TileRail teParent = this.getParentTile().getParentTile();
if (teParent != null) {
if (teParent.info.settings.type == TrackItems.SWITCH) {
return teParent.info.switchForced;
}
}
return false;
} |
<<<<<<<
=======
// @since 2.8
>>>>>>>
<<<<<<<
=======
/**
* @param m ObjectMapper to use for newly constructed module
*
* @since 2.8
*/
>>>>>>>
/**
* @param m ObjectMapper to use for newly constructed module
*/ |
<<<<<<<
verifyException(e, "Cannot map `null` into type byte");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "byteValue");
=======
verifyException(e, "Cannot map `null` into type `byte`");
verifyPath(e, "byteValue");
>>>>>>>
verifyException(e, "Cannot map `null` into type `byte`");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "byteValue");
<<<<<<<
verifyException(e, "Cannot map `null` into type short");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "shortValue");
=======
verifyException(e, "Cannot map `null` into type `short`");
verifyPath(e, "shortValue");
>>>>>>>
verifyException(e, "Cannot map `null` into type `short`");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "shortValue");
<<<<<<<
verifyException(e, "Cannot map `null` into type float");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "floatValue");
=======
verifyException(e, "Cannot map `null` into type `float`");
verifyPath(e, "floatValue");
>>>>>>>
verifyException(e, "Cannot map `null` into type `float`");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "floatValue");
<<<<<<<
verifyException(e, "Cannot map `null` into type double");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "doubleValue");
=======
verifyException(e, "Cannot map `null` into type `double`");
verifyPath(e, "doubleValue");
>>>>>>>
verifyException(e, "Cannot map `null` into type `double`");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "doubleValue");
<<<<<<<
verifyException(e, "Cannot map `null` into type char");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "charValue");
=======
verifyException(e, "Cannot map `null` into type `char`");
verifyPath(e, "charValue");
>>>>>>>
verifyException(e, "Cannot map `null` into type `char`");
// 17-Dec-2020, tatu: Path doubled for some reason
// verifyPath(e, "charValue"); |
<<<<<<<
private final ObjectMapper MAPPER = newAfterburnerMapper();
=======
// [databind#2101]
static class PrimitiveCreatorBean
{
@JsonCreator
public PrimitiveCreatorBean(@JsonProperty(value="a",required=true) int a,
@JsonProperty(value="b",required=true) int b) { }
}
// [databind#2197]
static class VoidBean {
public Void value;
}
private final ObjectMapper MAPPER = newAfterburnerMapper();
>>>>>>>
// [databind#2101]
static class PrimitiveCreatorBean
{
@JsonCreator
public PrimitiveCreatorBean(@JsonProperty(value="a",required=true) int a,
@JsonProperty(value="b",required=true) int b) { }
}
// [databind#2197]
static class VoidBean {
public Void value;
}
private final ObjectMapper MAPPER = newAfterburnerMapper();
<<<<<<<
ObjectMapper mapper = afterburnerMapperBuilder()
.enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
.build();
=======
>>>>>>>
<<<<<<<
final CharacterBean charBean = MAPPER.readerFor(CharacterBean.class)
.without(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
.readValue("{\"v\":null}");
=======
final CharacterBean charBean = MAPPER.readerFor(CharacterBean.class)
.without(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
.readValue("{\"v\":null}");
>>>>>>>
final CharacterBean charBean = MAPPER.readerFor(CharacterBean.class)
.without(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
.readValue("{\"v\":null}");
<<<<<<<
// [databind#381]
final ObjectMapper mapper = afterburnerMapperBuilder()
.disable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
.build();
try {
mapper.readValue("{\"v\":[3]}", IntBean.class);
fail("Did not throw exception when reading a value from a single value array with the UNWRAP_SINGLE_VALUE_ARRAYS feature disabled");
} catch (JsonMappingException exp) {
//Correctly threw exception
}
ObjectReader r = mapper.readerFor(IntBean.class)
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS);
result = r.readValue("{\"v\":[3]}");
assertEquals(3, result._v);
result = r.readValue("[{\"v\":[3]}]");
assertEquals(3, result._v);
try {
mapper.readValue("[{\"v\":[3,3]}]", IntBean.class);
fail("Did not throw exception while reading a value from a multi value array with UNWRAP_SINGLE_VALUE_ARRAY feature enabled");
} catch (JsonMappingException exp) {
//threw exception as required
}
result = r.readValue("{\"v\":[null]}");
assertNotNull(result);
assertEquals(0, result._v);
array = r.forType(int[].class).readValue("[ [ null ] ]");
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(0, array[0]);
=======
>>>>>>>
// [databind#381]
final ObjectMapper mapper = afterburnerMapperBuilder()
.disable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
.build();
try {
mapper.readValue("{\"v\":[3]}", IntBean.class);
fail("Did not throw exception when reading a value from a single value array with the UNWRAP_SINGLE_VALUE_ARRAYS feature disabled");
} catch (JsonMappingException exp) {
//Correctly threw exception
}
ObjectReader r = mapper.readerFor(IntBean.class)
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS);
result = r.readValue("{\"v\":[3]}");
assertEquals(3, result._v);
result = r.readValue("[{\"v\":[3]}]");
assertEquals(3, result._v);
try {
mapper.readValue("[{\"v\":[3,3]}]", IntBean.class);
fail("Did not throw exception while reading a value from a multi value array with UNWRAP_SINGLE_VALUE_ARRAY feature enabled");
} catch (JsonMappingException exp) {
//threw exception as required
}
result = r.readValue("{\"v\":[null]}");
assertNotNull(result);
assertEquals(0, result._v);
array = r.forType(int[].class).readValue("[ [ null ] ]");
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(0, array[0]);
<<<<<<<
// [databind#381]
final ObjectMapper mapper = afterburnerMapperBuilder()
.disable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
.build();
try {
mapper.readValue("{\"v\":[3]}", LongBean.class);
fail("Did not throw exception when reading a value from a single value array with the UNWRAP_SINGLE_VALUE_ARRAYS feature disabled");
} catch (JsonMappingException exp) {
//Correctly threw exception
}
ObjectReader r = mapper.readerFor(LongBean.class)
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS);
result = r.readValue("{\"v\":[3]}");
assertEquals(3, result._v);
result = r.readValue("[{\"v\":[3]}]");
assertEquals(3, result._v);
try {
r.readValue("[{\"v\":[3,3]}]");
fail("Did not throw exception while reading a value from a multi value array with UNWRAP_SINGLE_VALUE_ARRAY feature enabled");
} catch (JsonMappingException exp) {
//threw exception as required
}
result = r.readValue("{\"v\":[null]}");
assertNotNull(result);
assertEquals(0, result._v);
array = r.forType(long[].class)
.readValue("[ [ null ] ]");
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(0, array[0]);
=======
>>>>>>>
// [databind#381]
final ObjectMapper mapper = afterburnerMapperBuilder()
.disable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
.build();
try {
mapper.readValue("{\"v\":[3]}", LongBean.class);
fail("Did not throw exception when reading a value from a single value array with the UNWRAP_SINGLE_VALUE_ARRAYS feature disabled");
} catch (JsonMappingException exp) {
//Correctly threw exception
}
ObjectReader r = mapper.readerFor(LongBean.class)
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS);
result = r.readValue("{\"v\":[3]}");
assertEquals(3, result._v);
result = r.readValue("[{\"v\":[3]}]");
assertEquals(3, result._v);
try {
r.readValue("[{\"v\":[3,3]}]");
fail("Did not throw exception while reading a value from a multi value array with UNWRAP_SINGLE_VALUE_ARRAY feature enabled");
} catch (JsonMappingException exp) {
//threw exception as required
}
result = r.readValue("{\"v\":[null]}");
assertNotNull(result);
assertEquals(0, result._v);
array = r.forType(long[].class)
.readValue("[ [ null ] ]");
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(0, array[0]);
<<<<<<<
public void testDoubleAsArray() throws Exception
{
final ObjectMapper mapper = afterburnerMapperBuilder()
.disable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
.build();
final double value = 0.016;
try {
mapper.readValue("{\"v\":[" + value + "]}", DoubleBean.class);
fail("Did not throw exception when reading a value from a single value array with the UNWRAP_SINGLE_VALUE_ARRAYS feature disabled");
} catch (JsonMappingException exp) {
//Correctly threw exception
}
ObjectReader r = mapper.readerFor(DoubleBean.class)
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS);
DoubleBean result = r.readValue("{\"v\":[" + value + "]}");
assertEquals(value, result._v);
result = r.readValue("[{\"v\":[" + value + "]}]");
assertEquals(value, result._v);
try {
mapper.readValue("[{\"v\":[" + value + "," + value + "]}]", DoubleBean.class);
fail("Did not throw exception while reading a value from a multi value array with UNWRAP_SINGLE_VALUE_ARRAY feature enabled");
} catch (JsonMappingException exp) {
//threw exception as required
}
result = r.readValue("{\"v\":[null]}");
assertNotNull(result);
assertEquals(0d, result._v);
double[] array = r.forType(double[].class)
.readValue("[ [ null ] ]");
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(0d, array[0]);
}
public void testDoublePrimitiveNonNumeric() throws Exception
{
// first, simple case:
// bit tricky with binary fps but...
double value = Double.POSITIVE_INFINITY;
DoubleBean result = MAPPER.readValue("{\"v\":\""+value+"\"}", DoubleBean.class);
assertEquals(value, result._v);
// should work with arrays too..
double[] array = MAPPER.readValue("[ \"Infinity\" ]", double[].class);
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(Double.POSITIVE_INFINITY, array[0]);
}
public void testFloatPrimitiveNonNumeric() throws Exception
{
// bit tricky with binary fps but...
float value = Float.POSITIVE_INFINITY;
FloatBean result = MAPPER.readValue("{\"v\":\""+value+"\"}", FloatBean.class);
assertEquals(value, result._v);
// should work with arrays too..
float[] array = MAPPER.readValue("[ \"Infinity\" ]", float[].class);
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(Float.POSITIVE_INFINITY, array[0]);
}
=======
>>>>>>>
public void testDoubleAsArray() throws Exception
{
final ObjectMapper mapper = afterburnerMapperBuilder()
.disable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
.build();
final double value = 0.016;
try {
mapper.readValue("{\"v\":[" + value + "]}", DoubleBean.class);
fail("Did not throw exception when reading a value from a single value array with the UNWRAP_SINGLE_VALUE_ARRAYS feature disabled");
} catch (JsonMappingException exp) {
//Correctly threw exception
}
ObjectReader r = mapper.readerFor(DoubleBean.class)
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS);
DoubleBean result = r.readValue("{\"v\":[" + value + "]}");
assertEquals(value, result._v);
result = r.readValue("[{\"v\":[" + value + "]}]");
assertEquals(value, result._v);
try {
mapper.readValue("[{\"v\":[" + value + "," + value + "]}]", DoubleBean.class);
fail("Did not throw exception while reading a value from a multi value array with UNWRAP_SINGLE_VALUE_ARRAY feature enabled");
} catch (JsonMappingException exp) {
//threw exception as required
}
result = r.readValue("{\"v\":[null]}");
assertNotNull(result);
assertEquals(0d, result._v);
double[] array = r.forType(double[].class)
.readValue("[ [ null ] ]");
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(0d, array[0]);
}
public void testDoublePrimitiveNonNumeric() throws Exception
{
// first, simple case:
// bit tricky with binary fps but...
double value = Double.POSITIVE_INFINITY;
DoubleBean result = MAPPER.readValue("{\"v\":\""+value+"\"}", DoubleBean.class);
assertEquals(value, result._v);
// should work with arrays too..
double[] array = MAPPER.readValue("[ \"Infinity\" ]", double[].class);
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(Double.POSITIVE_INFINITY, array[0]);
}
public void testFloatPrimitiveNonNumeric() throws Exception
{
// bit tricky with binary fps but...
float value = Float.POSITIVE_INFINITY;
FloatBean result = MAPPER.readValue("{\"v\":\""+value+"\"}", FloatBean.class);
assertEquals(value, result._v);
// should work with arrays too..
float[] array = MAPPER.readValue("[ \"Infinity\" ]", float[].class);
assertNotNull(array);
assertEquals(1, array.length);
assertEquals(Float.POSITIVE_INFINITY, array[0]);
} |
<<<<<<<
ObjectMapper mapper = newMrBeanMapper();
Bean bean = mapper.readValue("{ \"x\" : \"abc\", \"y\" : 13 }", CoffeeBean.class);
=======
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new MrBeanModule());
Bean bean = mapper.readValue("{ \"x\" : \"abc\", \"y\" : 13, \"z\" : \"def\" }", CoffeeBean.class);
>>>>>>>
ObjectMapper mapper = newMrBeanMapper();
Bean bean = mapper.readValue("{ \"x\" : \"abc\", \"y\" : 13, \"z\" : \"def\" }", CoffeeBean.class);
<<<<<<<
Bean bean2 = mapper.readValue("{ \"x\" : \"abc\", \"y\" : 13 }", PeruvianCoffeeBean.class);
=======
Bean bean2 = mapper.readValue("{ \"x\" : \"abc\", \"y\" : 13, \"z\" : \"def\" }", PeruvianCoffeeBean.class);
>>>>>>>
Bean bean2 = mapper.readValue("{ \"x\" : \"abc\", \"y\" : 13, \"z\" : \"def\" }", PeruvianCoffeeBean.class); |
<<<<<<<
import java.io.IOException;
=======
>>>>>>>
import java.io.IOException;
<<<<<<<
public class XhtmlSelectorView extends AbstractXmlYogaView
{
@Override
public void render(Selector selector, Object value, YogaRequestContext context) throws IOException
{
Element rootElement = new DOMElement( "html" );
initHead( rootElement );
HierarchicalModel<Element> model = getModel( value, rootElement );
resultTraverser.traverse( value, selector, model, context );
write( context, rootElement );
}
protected HierarchicalModel<Element> getModel(Object value, Element rootElement)
{
Element topDiv = rootElement
.addElement( "body" )
.addElement( "div" )
.addAttribute( "class", getClassName( value ) );
return new XhtmlHierarchyModel( topDiv );
}
protected void initHead(Element rootElement)
{
Element cssLink = rootElement.addElement( "head" ).addElement( "link" );
cssLink.addAttribute( "href", "/css/xhtml.css" );
cssLink.addAttribute( "rel", "stylesheet" );
}
@Override
public String getContentType()
{
return "text/html";
}
@Override
public String getHrefSuffix()
{
return "xhtml";
}
=======
import org.skyscreamer.yoga.util.NameUtil;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
public class XhtmlSelectorView extends AbstractYogaView
{
@Override
public void render( OutputStream outputStream, Selector selector, Object value, HttpServletResponse response ) throws IOException
{
YogaRequestContext context = new YogaRequestContext( getHrefSuffix(), response );
DOMDocument domDocument = new DOMDocument();
Element rootElement = new DOMElement( "html" );
domDocument.setRootElement( rootElement );
Element cssLink = rootElement.addElement( "head" ).addElement( "link" );
cssLink.addAttribute( "href", "/css/xhtml.css" );
cssLink.addAttribute( "rel", "stylesheet" );
Element body = rootElement.addElement( "body" );
if ( value instanceof Iterable )
{
for ( Object child : (Iterable<?>) value )
{
traverse( child, selector, resultTraverser, body, context );
}
}
else
{
traverse( value, selector, resultTraverser, body, context );
}
write( outputStream, domDocument );
}
public void traverse( Object value, Selector selector, ResultTraverser traverser, Element body, YogaRequestContext context )
{
String name = NameUtil.getName( _classFinderStrategy.findClass( value ) );
HierarchicalModel model = new XhtmlHierarchyModel( body.addElement( "div" ).addAttribute( "class", name ) );
traverser.traverse( value, selector, model, context );
}
@Override
public String getContentType()
{
return "text/html";
}
@Override
public String getHrefSuffix()
{
return "xhtml";
}
>>>>>>>
public class XhtmlSelectorView extends AbstractXmlYogaView
{
@Override
public void render( Selector selector, Object value, YogaRequestContext context )
throws IOException
{
Element rootElement = new DOMElement( "html" );
initHead( rootElement );
HierarchicalModel<Element> model = getModel( value, rootElement );
resultTraverser.traverse( value, selector, model, context );
write( context, rootElement );
}
protected HierarchicalModel<Element> getModel( Object value, Element rootElement )
{
Element topDiv = rootElement.addElement( "body" ).addElement( "div" )
.addAttribute( "class", getClassName( value ) );
return new XhtmlHierarchyModel( topDiv );
}
protected void initHead( Element rootElement )
{
Element cssLink = rootElement.addElement( "head" ).addElement( "link" );
cssLink.addAttribute( "href", "/css/xhtml.css" );
cssLink.addAttribute( "rel", "stylesheet" );
}
@Override
public String getContentType()
{
return "text/html";
}
@Override
public String getHrefSuffix()
{
return "xhtml";
} |
<<<<<<<
public abstract class AbstractHierarchicalModel<T> implements HierarchicalModel<T>
=======
public abstract class AbstractHierarchicalModel implements HierarchicalModel
>>>>>>>
public abstract class AbstractHierarchicalModel<T> implements HierarchicalModel<T>
<<<<<<<
public HierarchicalModel<?> createChild(String name)
=======
public HierarchicalModel createChild( String name )
>>>>>>>
public HierarchicalModel<?> createChild( String name )
<<<<<<<
public HierarchicalModel<?> createChild()
=======
public HierarchicalModel createChild()
>>>>>>>
public HierarchicalModel<?> createChild()
<<<<<<<
public HierarchicalModel<?> createList(String name)
=======
public HierarchicalModel createList( String name )
>>>>>>>
public HierarchicalModel<?> createList( String name ) |
<<<<<<<
* Copyright (c) 2012 Pivotal Software, Inc.
=======
* Copyright (c) 2012, 2014 GoPivotal, Inc.
>>>>>>>
* Copyright (c) 2012, 2014 Pivotal Software, Inc. |
<<<<<<<
ClassPathModel.getClassPathModel(project, monitor); // Forces initialisation of the model.
notifyJDT();
=======
project.getGradleModel(monitor); // Forces initialisation of the model.
JobUtil.withRule(JobUtil.buildRule(), monitor, 1, new GradleRunnable("Set classpath "+project.getDisplayName()) {
public void doit(IProgressMonitor mon) throws Exception {
notifyJDT();
}
});
>>>>>>>
ClassPathModel.getClassPathModel(project, monitor); // Forces initialisation of the model.
JobUtil.withRule(JobUtil.buildRule(), monitor, 1, new GradleRunnable("Set classpath "+project.getDisplayName()) {
public void doit(IProgressMonitor mon) throws Exception {
notifyJDT();
}
}); |
<<<<<<<
import java.util.function.Predicate;
import java.util.function.Supplier;
=======
>>>>>>>
import java.util.function.Predicate;
import java.util.function.Supplier;
<<<<<<<
* Gets the value on Success or throws a checked exception.
*
* @return new composed Try
* @throws Throwable produced by the supplier function argument
*/
public abstract <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X;
/**
* Gets the value T on Success or throws the cause of the failure.
=======
* Gets the value T on Success or throws the cause of the failure.
>>>>>>>
* Gets the value T on Success or throws the cause of the failure.
*
* @return T
* @throws Throwable produced by the supplier function argument
*/
public abstract <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X;
/**
* Gets the value T on Success or throws the cause of the failure.
<<<<<<<
@Override
public Optional<T> toOptional() {
return Optional.ofNullable(value);
}
@Override
public <E extends Throwable> Try<T> onFailure(TryConsumer<Throwable, E> action) {
return this;
}
=======
>>>>>>>
@Override
public Optional<T> toOptional() {
return Optional.ofNullable(value);
}
@Override
public <E extends Throwable> Try<T> onFailure(TryConsumer<Throwable, E> action) {
return this;
}
<<<<<<<
@Override
public Optional<T> toOptional() {
return Optional.empty();
}
@Override
public <E extends Throwable> Try<T> onFailure(TryConsumer<Throwable, E> action) throws E {
action.accept(e);
return this;
}
=======
>>>>>>>
@Override
public Optional<T> toOptional() {
return Optional.empty();
}
@Override
public <E extends Throwable> Try<T> onFailure(TryConsumer<Throwable, E> action) throws E {
action.accept(e);
return this;
} |
<<<<<<<
import pl.baczkowicz.spy.utils.ConversionUtils;
=======
import pl.baczkowicz.mqttspy.ui.scripts.InteractiveScriptManager;
import pl.baczkowicz.mqttspy.utils.ConversionUtils;
>>>>>>>
import pl.baczkowicz.mqttspy.ui.scripts.InteractiveScriptManager;
import pl.baczkowicz.spy.utils.ConversionUtils; |
<<<<<<<
=======
import pl.baczkowicz.mqttspy.ui.panes.PaneVisibilityStatus;
import pl.baczkowicz.mqttspy.ui.panes.TabStatus;
import pl.baczkowicz.mqttspy.ui.scripts.InteractiveScriptManager;
>>>>>>>
import pl.baczkowicz.mqttspy.ui.scripts.InteractiveScriptManager; |
<<<<<<<
if (PrefStore.showUpgradeMessage(this)) show(Dialogs.UPGRADE);
=======
setPreferenceListeners(getPreferenceManager(), version >= MIN_VERSION_BACKUP);
if (PrefStore.showUpgradeMessage(this)) {
show(Dialogs.UPGRADE);
}
>>>>>>>
if (PrefStore.showUpgradeMessage(this)) show(Dialogs.UPGRADE);
setPreferenceListeners(getPreferenceManager(), version >= MIN_VERSION_BACKUP);
<<<<<<<
private void setPreferenceListeners(final PreferenceManager prefMgr) {
=======
private void updateAutoBackupSettings(boolean enabled) {
getPreferenceManager().findPreference("auto_backup_settings").setEnabled(enabled);
}
private void setPreferenceListeners(final PreferenceManager prefMgr, boolean backup) {
if (backup) {
prefMgr.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(
new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
BackupManagerWrapper.dataChanged(SmsSync.this);
}
}
);
}
>>>>>>>
private void setPreferenceListeners(final PreferenceManager prefMgr, boolean backup) {
if (backup) {
prefMgr.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(
new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
BackupManagerWrapper.dataChanged(SmsSync.this);
}
}
);
}
<<<<<<<
runOnUiThread(new Runnable() {
@Override public void run() { show(Dialogs.INVALID_IMAP_FOLDER); }
});
return false;
=======
runOnUiThread(new Runnable() {
@Override public void run() {
show(Dialogs.INVALID_IMAP_FOLDER);
}
});
return false;
>>>>>>>
runOnUiThread(new Runnable() {
@Override public void run() { show(Dialogs.INVALID_IMAP_FOLDER); }
});
return false; |
<<<<<<<
=======
VideoContainer videoContainer = VideoContainer.empty();
PlayerListenersHolder listenersHolder = new PlayerListenersHolder();
>>>>>>>
PlayerListenersHolder listenersHolder = new PlayerListenersHolder();
<<<<<<<
surfaceHolderRequester.requestSurfaceHolder(new SurfaceHolderRequester.Callback() {
@Override
public void onSurfaceHolderReady(SurfaceHolder surfaceHolder) {
exoPlayer.clearVideoSurfaceHolder(surfaceHolder);
exoPlayer.setVideoSurfaceHolder(surfaceHolder);
exoPlayer.setPlayWhenReady(true);
getStateChangedListeners().onVideoPlaying();
}
});
=======
exoPlayer.setPlayWhenReady(true);
listenersHolder.getStateChangedListeners().onVideoPlaying();
>>>>>>>
surfaceHolderRequester.requestSurfaceHolder(new SurfaceHolderRequester.Callback() {
@Override
public void onSurfaceHolderReady(SurfaceHolder surfaceHolder) {
exoPlayer.clearVideoSurfaceHolder(surfaceHolder);
exoPlayer.setVideoSurfaceHolder(surfaceHolder);
exoPlayer.setPlayWhenReady(true);
listenersHolder.getStateChangedListeners().onVideoPlaying();
}
});
<<<<<<<
getPreparedListeners().reset();
=======
listenersHolder.getPreparedListeners().reset();
showContainer();
>>>>>>>
listenersHolder.getPreparedListeners().reset();
<<<<<<<
=======
@Override
public PlayerListenersHolder getListenersHolder() {
return listenersHolder;
}
private void showContainer() {
videoContainer.show();
}
>>>>>>>
@Override
public PlayerListenersHolder getListenersHolder() {
return listenersHolder;
} |
<<<<<<<
verify(exoPlayerFacade).loadVideo(surfaceHolder, drmSessionCreator, uri, OPTIONS, forwarder, mediaCodecSelector);
=======
verify(exoPlayerFacade).loadVideo(surface, drmSessionCreator, uri, ANY_CONTENT_TYPE, forwarder, mediaCodecSelector);
>>>>>>>
verify(exoPlayerFacade).loadVideo(surface, drmSessionCreator, uri, OPTIONS, forwarder, mediaCodecSelector);
<<<<<<<
verify(exoPlayerFacade).loadVideo(surfaceHolder, drmSessionCreator, uri, OPTIONS, forwarder, mediaCodecSelector);
=======
verify(exoPlayerFacade).loadVideo(surface, drmSessionCreator, uri, ANY_CONTENT_TYPE, forwarder, mediaCodecSelector);
>>>>>>>
verify(exoPlayerFacade).loadVideo(surface, drmSessionCreator, uri, OPTIONS, forwarder, mediaCodecSelector);
<<<<<<<
public Void answer(InvocationOnMock invocation) {
SurfaceHolderRequester.Callback callback = invocation.getArgument(0);
callback.onSurfaceHolderReady(surfaceHolder);
=======
public Void answer(InvocationOnMock invocation) throws Throwable {
SurfaceRequester.Callback callback = invocation.getArgument(0);
callback.onSurfaceReady(surface);
>>>>>>>
public Void answer(InvocationOnMock invocation) {
SurfaceRequester.Callback callback = invocation.getArgument(0);
callback.onSurfaceReady(surface); |
<<<<<<<
private boolean seekingWithIntentToPlay;
private VideoContainer videoContainer;
=======
>>>>>>>
private boolean seekingWithIntentToPlay;
<<<<<<<
videoContainer.show();
=======
>>>>>>>
<<<<<<<
=======
public void play() {
startBeatingHeart();
mediaPlayer.start();
listenersHolder.getStateChangedListeners().onVideoPlaying();
}
@Override
>>>>>>>
<<<<<<<
=======
private void startBeatingHeart() {
heart.startBeatingHeart();
}
>>>>>>>
<<<<<<<
videoContainer.show();
=======
>>>>>>>
<<<<<<<
public void stop() {
mediaPlayer.stop();
=======
public void reset() {
release();
>>>>>>>
public void stop() {
mediaPlayer.stop(); |
<<<<<<<
LogHelper.info("Tile Entities registered");
=======
*/
LogHelper.debug("Tile Entities registered");
>>>>>>>
LogHelper.debug("Tile Entities registered"); |
<<<<<<<
return noPlayerExoPlayerCreator.createExoPlayer(context, drmSessionCreator, useSecureCodec);
=======
return exoPlayerCreator.createExoPlayer(context, drmSessionCreator, downgradeSecureDecoder);
>>>>>>>
return noPlayerExoPlayerCreator.createExoPlayer(context, drmSessionCreator, downgradeSecureDecoder);
<<<<<<<
public static UnableToCreatePlayerException deviceDoesNotMeetTargetApiException(DrmType drmType,
int targetApiLevel,
AndroidDeviceVersion actualApiLevel) {
return new UnableToCreatePlayerException(
"Device must be target: "
+ targetApiLevel
+ " but was: "
+ actualApiLevel.sdkInt()
+ " for DRM type: "
+ drmType.name()
);
=======
UnableToCreatePlayerException(String reason) {
super(reason);
}
}
static class ExoPlayerCreator {
private final ExoPlayerTwoImplFactory factory;
static ExoPlayerCreator newInstance() {
ExoPlayerTwoImplFactory factory = new ExoPlayerTwoImplFactory();
return new ExoPlayerCreator(factory);
}
ExoPlayerCreator(ExoPlayerTwoImplFactory factory) {
this.factory = factory;
}
Player createExoPlayer(Context context, DrmSessionCreator drmSessionCreator, boolean downgradeSecureDecoder) {
ExoPlayerTwoImpl player = factory.create(context, drmSessionCreator, downgradeSecureDecoder);
player.initialise();
return player;
}
}
static class MediaPlayerCreator {
private final AndroidMediaPlayerImplFactory factory;
static MediaPlayerCreator newInstance() {
AndroidMediaPlayerImplFactory factory = new AndroidMediaPlayerImplFactory();
return new MediaPlayerCreator(factory);
}
MediaPlayerCreator(AndroidMediaPlayerImplFactory factory) {
this.factory = factory;
>>>>>>>
public static UnableToCreatePlayerException deviceDoesNotMeetTargetApiException(DrmType drmType,
int targetApiLevel,
AndroidDeviceVersion actualApiLevel) {
return new UnableToCreatePlayerException(
"Device must be target: "
+ targetApiLevel
+ " but was: "
+ actualApiLevel.sdkInt()
+ " for DRM type: "
+ drmType.name()
); |
<<<<<<<
import com.mrcrayfish.device.api.app.Dialog;
import com.mrcrayfish.device.api.io.Folder;
=======
>>>>>>>
import com.mrcrayfish.device.api.app.Dialog;
import com.mrcrayfish.device.api.io.Folder; |
<<<<<<<
private static final String UNFORMATTED_SPLIT = "(?<=%1$s)|(?=%1$s)";
private static final String[] DELIMITERS = {"(\\s|$)(?=(([^\"]*\"){2})*[^\"]*$)", "[\\p{Punct}&&[^@\"]]", "\\p{Digit}+"};
private static final String SPLIT_REGEX;
static
{
StringJoiner joiner = new StringJoiner("|");
for(String s : DELIMITERS)
{
joiner.add(s);
}
SPLIT_REGEX = String.format(UNFORMATTED_SPLIT, "(" + joiner.toString() + ")");
}
private FontRenderer fontRendererObj;
=======
protected FontRenderer fontRenderer;
protected String text = "";
protected String placeholder = null;
>>>>>>>
private static final String UNFORMATTED_SPLIT = "(?<=%1$s)|(?=%1$s)";
private static final String[] DELIMITERS = {"(\\s|$)(?=(([^\"]*\"){2})*[^\"]*$)", "[\\p{Punct}&&[^@\"]]", "\\p{Digit}+"};
private static final String SPLIT_REGEX;
static
{
StringJoiner joiner = new StringJoiner("|");
for(String s : DELIMITERS)
{
joiner.add(s);
}
SPLIT_REGEX = String.format(UNFORMATTED_SPLIT, "(" + joiner.toString() + ")");
}
protected FontRenderer fontRenderer;
protected String text = "";
protected String placeholder = null;
<<<<<<<
this.fontRendererObj = Laptop.fontRenderer;
=======
this.fontRenderer = Minecraft.getMinecraft().fontRenderer;
>>>>>>>
this.fontRenderer = Laptop.fontRenderer;
<<<<<<<
this.visibleLines = (int) Math.floor((height - padding * 2 + 1) / fontRendererObj.FONT_HEIGHT);
this.lines.add("");
=======
this.maxLines = (int) Math.floor((height - padding * 2) / fontRenderer.FONT_HEIGHT);
>>>>>>>
this.visibleLines = (int) Math.floor((height - padding * 2 + 1) / fontRenderer.FONT_HEIGHT);
this.lines.add("");
<<<<<<<
mc.fontRendererObj.drawSplitString(placeholder, x + padding, y + padding, width - padding * 2 - 2, placeholderColour);
}
GL11.glEnable(GL11.GL_SCISSOR_TEST);
GLHelper.scissor(x + padding, y + padding, width - padding * 2, height - padding * 2);
for(int i = 0; i < visibleLines && i + verticalScroll < lines.size(); i++)
{
float scrollPercentage = (verticalScroll + verticalOffset) / (float) (lines.size() - visibleLines);
float pixelsPerUnit = (float) maxLineWidth / (float) (width - padding * 2);
int scrollX = MathHelper.clamp(horizontalScroll + (int)(horizontalOffset * pixelsPerUnit), 0, Math.max(0, maxLineWidth - (width - padding * 2)));
int scrollY = (int) ((lines.size() - visibleLines) * (scrollPercentage));
int lineY = i + MathHelper.clamp(scrollY, 0, Math.max(0, lines.size() - visibleLines));
if(highlight != null)
{
String[] words = lines.get(lineY).split(SPLIT_REGEX);
StringBuilder builder = new StringBuilder();
for(String word : words)
{
TextFormatting[] formatting = highlight.getKeywordFormatting(word);
for(TextFormatting format : formatting)
{
builder.append(format);
}
builder.append(word);
builder.append(TextFormatting.RESET);
}
fontRendererObj.drawString(builder.toString(), x + padding - scrollX, y + padding + i * fontRendererObj.FONT_HEIGHT, -1);
}
else
{
fontRendererObj.drawString(lines.get(lineY), x + padding - scrollX, y + padding + i * fontRendererObj.FONT_HEIGHT, textColour);
}
}
GLHelper.scissor(x + padding, y + padding - 1, width - padding * 2 + 1, height - padding * 2 + 1);
if(editable && isFocused)
{
float linesPerUnit = (float) lines.size() / (float) visibleLines;
int scroll = MathHelper.clamp(verticalScroll + verticalOffset * (int) linesPerUnit, 0, Math.max(0, lines.size() - visibleLines));
if(this.isFocused && cursorY >= scroll && cursorY < scroll + visibleLines)
{
if((this.cursorTick / 10) % 2 == 0)
{
String subString = getActiveLine().substring(0, cursorX);
int visibleWidth = width - padding * 2;
float pixelsPerUnit = (float) maxLineWidth / (float) (width - padding * 2);
int stringWidth = fontRendererObj.getStringWidth(subString);
int posX = x + padding + stringWidth - MathHelper.clamp(horizontalScroll + (int) (horizontalOffset * pixelsPerUnit), 0, Math.max(0, maxLineWidth - visibleWidth));
int posY = y + padding + (cursorY - scroll) * fontRendererObj.FONT_HEIGHT;
Gui.drawRect(posX, posY - 1, posX + 1, posY + fontRendererObj.FONT_HEIGHT - 1, Color.WHITE.getRGB());
}
}
}
GL11.glDisable(GL11.GL_SCISSOR_TEST);
if(scrollBarVisible)
{
if(lines.size() > visibleLines)
{
int visibleScrollBarHeight = height - 4;
int scrollBarHeight = Math.max(20, (int) ((float) visibleLines / (float) lines.size() * (float) visibleScrollBarHeight));
float scrollPercentage = MathHelper.clamp((verticalScroll + verticalOffset) / (float) (lines.size() - visibleLines), 0.0F, 1.0F);
int scrollBarY = (int) ((visibleScrollBarHeight - scrollBarHeight) * scrollPercentage);
int scrollY = yPosition + 2 + scrollBarY;
Gui.drawRect(x + width - 2 - scrollBarSize, scrollY, x + width - 2, scrollY + scrollBarHeight, placeholderColour);
}
if(!wrapText && maxLineWidth >= width - padding * 2)
{
int visibleWidth = width - padding * 2;
int visibleScrollBarWidth = width - 4 - (lines.size() > visibleLines ? scrollBarSize + 1 : 0);
float scrollPercentage = (float) (horizontalScroll + 1) / (float) (maxLineWidth - visibleWidth + 1);
int scrollBarWidth = Math.max(20, (int) ((float) visibleWidth / (float) maxLineWidth * (float) visibleScrollBarWidth));
int relativeScrollX = (int) (scrollPercentage * (visibleScrollBarWidth - scrollBarWidth));
int scrollX = xPosition + 2 + MathHelper.clamp(relativeScrollX + horizontalOffset, 0, visibleScrollBarWidth - scrollBarWidth);
Gui.drawRect(scrollX, y + height - scrollBarSize - 2, scrollX + scrollBarWidth, y + height - 2, placeholderColour);
}
}
}
}
=======
mc.fontRenderer.drawSplitString(placeholder, x + padding + 1, y + padding + 2, width - padding * 2 - 2, placeholderColour);
}
String text = this.text;
if (this.updateCount / 6 % 2 == 0)
{
text = text + (this.isFocused ? "_" : "");
}
else
{
text = text + TextFormatting.GRAY + (this.isFocused ? "_" : "");
}
this.fontRenderer.drawSplitString(text, xPosition + padding + 1, yPosition + padding + 2, width - padding * 2 - 2, textColour);
}
}
>>>>>>>
mc.fontRenderer.drawSplitString(placeholder, x + padding, y + padding, width - padding * 2 - 2, placeholderColour);
}
GL11.glEnable(GL11.GL_SCISSOR_TEST);
GLHelper.scissor(x + padding, y + padding, width - padding * 2, height - padding * 2);
for(int i = 0; i < visibleLines && i + verticalScroll < lines.size(); i++)
{
float scrollPercentage = (verticalScroll + verticalOffset) / (float) (lines.size() - visibleLines);
float pixelsPerUnit = (float) maxLineWidth / (float) (width - padding * 2);
int scrollX = MathHelper.clamp(horizontalScroll + (int)(horizontalOffset * pixelsPerUnit), 0, Math.max(0, maxLineWidth - (width - padding * 2)));
int scrollY = (int) ((lines.size() - visibleLines) * (scrollPercentage));
int lineY = i + MathHelper.clamp(scrollY, 0, Math.max(0, lines.size() - visibleLines));
if(highlight != null)
{
String[] words = lines.get(lineY).split(SPLIT_REGEX);
StringBuilder builder = new StringBuilder();
for(String word : words)
{
TextFormatting[] formatting = highlight.getKeywordFormatting(word);
for(TextFormatting format : formatting)
{
builder.append(format);
}
builder.append(word);
builder.append(TextFormatting.RESET);
}
fontRenderer.drawString(builder.toString(), x + padding - scrollX, y + padding + i * fontRenderer.FONT_HEIGHT, -1);
}
else
{
fontRenderer.drawString(lines.get(lineY), x + padding - scrollX, y + padding + i * fontRenderer.FONT_HEIGHT, textColour);
}
}
GLHelper.scissor(x + padding, y + padding - 1, width - padding * 2 + 1, height - padding * 2 + 1);
if(editable && isFocused)
{
float linesPerUnit = (float) lines.size() / (float) visibleLines;
int scroll = MathHelper.clamp(verticalScroll + verticalOffset * (int) linesPerUnit, 0, Math.max(0, lines.size() - visibleLines));
if(this.isFocused && cursorY >= scroll && cursorY < scroll + visibleLines)
{
if((this.cursorTick / 10) % 2 == 0)
{
String subString = getActiveLine().substring(0, cursorX);
int visibleWidth = width - padding * 2;
float pixelsPerUnit = (float) maxLineWidth / (float) (width - padding * 2);
int stringWidth = fontRenderer.getStringWidth(subString);
int posX = x + padding + stringWidth - MathHelper.clamp(horizontalScroll + (int) (horizontalOffset * pixelsPerUnit), 0, Math.max(0, maxLineWidth - visibleWidth));
int posY = y + padding + (cursorY - scroll) * fontRenderer.FONT_HEIGHT;
Gui.drawRect(posX, posY - 1, posX + 1, posY + fontRenderer.FONT_HEIGHT - 1, Color.WHITE.getRGB());
}
}
}
GL11.glDisable(GL11.GL_SCISSOR_TEST);
if(scrollBarVisible)
{
if(lines.size() > visibleLines)
{
int visibleScrollBarHeight = height - 4;
int scrollBarHeight = Math.max(20, (int) ((float) visibleLines / (float) lines.size() * (float) visibleScrollBarHeight));
float scrollPercentage = MathHelper.clamp((verticalScroll + verticalOffset) / (float) (lines.size() - visibleLines), 0.0F, 1.0F);
int scrollBarY = (int) ((visibleScrollBarHeight - scrollBarHeight) * scrollPercentage);
int scrollY = yPosition + 2 + scrollBarY;
Gui.drawRect(x + width - 2 - scrollBarSize, scrollY, x + width - 2, scrollY + scrollBarHeight, placeholderColour);
}
if(!wrapText && maxLineWidth >= width - padding * 2)
{
int visibleWidth = width - padding * 2;
int visibleScrollBarWidth = width - 4 - (lines.size() > visibleLines ? scrollBarSize + 1 : 0);
float scrollPercentage = (float) (horizontalScroll + 1) / (float) (maxLineWidth - visibleWidth + 1);
int scrollBarWidth = Math.max(20, (int) ((float) visibleWidth / (float) maxLineWidth * (float) visibleScrollBarWidth));
int relativeScrollX = (int) (scrollPercentage * (visibleScrollBarWidth - scrollBarWidth));
int scrollX = xPosition + 2 + MathHelper.clamp(relativeScrollX + horizontalOffset, 0, visibleScrollBarWidth - scrollBarWidth);
Gui.drawRect(scrollX, y + height - scrollBarSize - 2, scrollX + scrollBarWidth, y + height - 2, placeholderColour);
}
}
}
}
<<<<<<<
this.visibleLines = (int) Math.floor((height - padding * 2) / fontRendererObj.FONT_HEIGHT);
=======
this.maxLines = (int) Math.floor((height - padding * 2) / fontRenderer.FONT_HEIGHT);
>>>>>>>
this.visibleLines = (int) Math.floor((height - padding * 2) / fontRenderer.FONT_HEIGHT); |
<<<<<<<
protected List<E> items = NonNullList.create();
=======
protected boolean showAll = true;
protected boolean resized = false;
protected boolean initialized = false;
protected List<E> items = new ArrayList<>();
>>>>>>>
protected boolean showAll = true;
protected boolean resized = false;
protected boolean initialized = false;
protected List<E> items = NonNullList.create();
<<<<<<<
if(e == null)
throw new IllegalArgumentException("A null object cannot be added to an ItemList");
items.add(e);
sort();
}
/**
* Appends an item to the list
*
* @param newItems the items
*/
public void setItems(List<E> newItems)
{
items.clear();
items.addAll(newItems);
sort();
=======
if(e != null)
{
items.add(e);
if(initialized)
updateComponent();
}
>>>>>>>
if(e == null)
throw new IllegalArgumentException("A null object cannot be added to an ItemList");
items.add(e);
sort();
if(initialized)
updateComponent();
}
/**
* Appends an item to the list
*
* @param newItems the items
*/
public void setItems(List<E> newItems)
{
items.clear();
items.addAll(newItems);
sort();
<<<<<<<
return e;
=======
if(initialized)
updateComponent();
>>>>>>>
if(initialized)
updateComponent();
return e; |
<<<<<<<
=======
import com.mrcrayfish.device.api.print.PrintingManager;
>>>>>>>
import com.mrcrayfish.device.api.print.PrintingManager;
<<<<<<<
ApplicationManager.registerApplication(new ResourceLocation(Reference.MOD_ID, "text_area"), ApplicationTextArea.class);
=======
ApplicationManager.registerApplication(new ResourceLocation(Reference.MOD_ID, "test"), ApplicationTest.class);
>>>>>>>
ApplicationManager.registerApplication(new ResourceLocation(Reference.MOD_ID, "text_area"), ApplicationTextArea.class);
ApplicationManager.registerApplication(new ResourceLocation(Reference.MOD_ID, "test"), ApplicationTest.class); |
<<<<<<<
=======
import com.mrcrayfish.device.api.io.Folder;
import com.mrcrayfish.device.api.task.Callback;
import com.mrcrayfish.device.core.io.FileSystem;
>>>>>>>
import com.mrcrayfish.device.core.io.FileSystem;
<<<<<<<
folder.search(file -> file.isForApplication(this)).stream().forEach(file ->
{
notes.addItem(Note.fromTag(file.getData()));
});
=======
if(success)
{
folder.search(file -> file.isForApplication(this)).forEach(file -> notes.addItem(file));
}
else
{
//TODO error dialog
}
>>>>>>>
if(success)
{
folder.search(file -> file.isForApplication(this)).forEach(file -> {
notes.addItem(Note.fromTag(file.getData()));
});
}
else
{
//TODO error dialog
} |
<<<<<<<
=======
>>>>>>>
<<<<<<<
//resource crop seeds
if(ConfigurationHandler.resourcePlants) {
//vanilla resources
=======
//register natura seeds to the ore dictionary if natura is installed
if(ModIntegration.LoadedMods.natura) {
OreDictionary.registerOre(Names.OreDict.listAllseed, NContent.plantItem);
}
//register ex nihilo seeds to the ore dictionary if ex nihilo is installed
if(ModIntegration.LoadedMods.exNihilo) {
OreDictionary.registerOre(Names.OreDict.listAllseed, ExNihiloHelper.seedCarrot);
OreDictionary.registerOre(Names.OreDict.listAllseed, ExNihiloHelper.seedPotato);
OreDictionary.registerOre(Names.OreDict.listAllseed, ExNihiloHelper.seedSugarCane);
}
//register plant mega pack seeds to the ore dictionary if plant mega pack is installed
if(ModIntegration.LoadedMods.plantMegaPack) {
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedOnion"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedSpinach"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedCelery"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedLettuce"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedBellPepperYellow"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedCorn"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedCucumber"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedTomato"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedBeet"));
}
//register witchery seeds to the ore dictionary if witchery is installed
if(Loader.isModLoaded("witchery")) {
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("witchery:seedsbelladonna"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("witchery:seedsmandrake"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("witchery:seedsartichoke"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("witchery:seedssnowbell"));
}
LogHelper.info("Seeds registered");
}
//resource crop seeds
public static void initResourceSeeds() {
if (ConfigurationHandler.resourcePlants) {
//vanilla resources
>>>>>>>
//register natura seeds to the ore dictionary if natura is installed
if(ModIntegration.LoadedMods.natura) {
OreDictionary.registerOre(Names.OreDict.listAllseed, NContent.plantItem);
}
//register ex nihilo seeds to the ore dictionary if ex nihilo is installed
if(ModIntegration.LoadedMods.exNihilo) {
OreDictionary.registerOre(Names.OreDict.listAllseed, ExNihiloHelper.seedCarrot);
OreDictionary.registerOre(Names.OreDict.listAllseed, ExNihiloHelper.seedPotato);
OreDictionary.registerOre(Names.OreDict.listAllseed, ExNihiloHelper.seedSugarCane);
}
//register plant mega pack seeds to the ore dictionary if plant mega pack is installed
if(ModIntegration.LoadedMods.plantMegaPack) {
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedOnion"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedSpinach"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedCelery"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedLettuce"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedBellPepperYellow"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedCorn"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedCucumber"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedTomato"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("plantmegapack:seedBeet"));
}
//register witchery seeds to the ore dictionary if witchery is installed
if(Loader.isModLoaded("witchery")) {
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("witchery:seedsbelladonna"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("witchery:seedsmandrake"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("witchery:seedsartichoke"));
OreDictionary.registerOre(Names.OreDict.listAllseed, (Item) Item.itemRegistry.getObject("witchery:seedssnowbell"));
}
LogHelper.info("Seeds registered");
}
//resource crop seeds
public static void initResourceSeeds() {
if (ConfigurationHandler.resourcePlants) {
//vanilla resources |
<<<<<<<
=======
import com.mrcrayfish.device.api.app.Layout;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
>>>>>>>
<<<<<<<
=======
private int draggingWindow;
>>>>>>>
private int draggingWindow;
<<<<<<<
=======
private boolean dirty = false;
private Layout context = null;
>>>>>>>
private boolean dirty = false;
private Layout context = null;
<<<<<<<
pos = laptop.getPos();
=======
this.windows = new Window[5];
this.bar = new TaskBar();
Laptop.system = this;
>>>>>>>
this.windows = new Window[5];
this.bar = new TaskBar();
Laptop.system = this;
pos = laptop.getPos();
<<<<<<<
/* Send system data */
NBTTagCompound systemData = new NBTTagCompound();
systemData.setInteger("CurrentWallpaper", currentWallpaper);
TaskPipeline.sendTask(new TaskUpdateSystemData(pos, systemData));
/* Send file system data */
TaskPipeline.sendTask(new TaskUpdateFileSystem(pos, fileSystem.toTag()));
=======
data.setInteger("CurrentWallpaper", this.currentWallpaper);
if(dirty)
{
PacketHandler.INSTANCE.sendToServer(new MessageSaveData(tileX, tileY, tileZ, data));
}
Laptop.system = null;
>>>>>>>
/* Send system data */
NBTTagCompound systemData = new NBTTagCompound();
systemData.setInteger("CurrentWallpaper", currentWallpaper);
TaskPipeline.sendTask(new TaskUpdateSystemData(pos, systemData));
/* Send file system data */
TaskPipeline.sendTask(new TaskUpdateFileSystem(pos, fileSystem.toTag()));
Laptop.pos = null;
Laptop.system = null; |
<<<<<<<
import java.awt.Color;
import java.util.Arrays;
=======
>>>>>>>
import java.awt.Color;
import java.util.List;
<<<<<<<
=======
>>>>>>>
<<<<<<<
Info info = ApplicationManager.getApps().get(i + offset);
if(info.getIcon() != null)
{
mc.getTextureManager().bindTexture(info.getIcon().getResource());
gui.drawTexturedModalRect(x + 18 + i * 16, y + 2, info.getIcon().getU(), info.getIcon().getV(), 14, 14);
}
else
=======
Application app = applications.get(i + offset);
AppInfo info = app.getInfo();
mc.getTextureManager().bindTexture(Laptop.ICON_TEXTURES);
RenderUtil.drawApplicationIcon(info, x + 18 + i * 16, y + 2);
if(gui.isAppRunning(app.getInfo().getId()))
>>>>>>>
AppInfo info = applications.get(i + offset).getInfo();
RenderUtil.drawApplicationIcon(info, x + 18 + i * 16, y + 2);
if(gui.isApplicationRunning(info.getFormattedId()))
<<<<<<<
gui.drawTexturedModalRect(x + 18 + i * 16, y + 2, 0, 30, 14, 14);
}
if(gui.isAppRunning(info.getID()))
{
=======
>>>>>>>
<<<<<<<
laptop.open((Application) ApplicationManager.getApps().get(appIndex));
=======
laptop.open(applications.get(appIndex));
>>>>>>>
laptop.open(applications.get(appIndex)); |
<<<<<<<
import org.n52.iceland.component.SingleTypeComponentFactory;
import org.n52.iceland.encode.ResponseWriter;
import org.n52.iceland.encode.ResponseWriterFactory;
import org.n52.iceland.encode.ResponseWriterKey;
=======
import org.n52.iceland.coding.encode.ResponseWriterFactory;
>>>>>>>
import javax.inject.Inject;
import org.apache.xmlbeans.XmlOptions;
import org.n52.iceland.coding.encode.ResponseWriter;
import org.n52.iceland.coding.encode.ResponseWriterFactory;
import org.n52.iceland.coding.encode.ResponseWriterKey;
import org.n52.iceland.component.SingleTypeComponentFactory;
import org.n52.iceland.util.Producer;
<<<<<<<
*
* @author Carsten Hollmann <[email protected]>
=======
* @author <a href="mailto:[email protected]">Carsten Hollmann</a>
>>>>>>>
*
* @author <a href="mailto:[email protected]">Carsten Hollmann</a> |
<<<<<<<
import com.mrcrayfish.device.Reference;
import com.mrcrayfish.device.api.app.*;
=======
import com.mrcrayfish.device.api.app.Application;
>>>>>>>
import com.mrcrayfish.device.Reference;
import com.mrcrayfish.device.api.app.*;
<<<<<<<
import com.mrcrayfish.device.api.print.IPrint;
=======
>>>>>>>
import com.mrcrayfish.device.api.print.IPrint; |
<<<<<<<
import com.mrcrayfish.device.block.BlockRouter;
=======
import com.mrcrayfish.device.item.ItemLaptop;
>>>>>>>
import com.mrcrayfish.device.block.BlockRouter;
import com.mrcrayfish.device.item.ItemLaptop; |
<<<<<<<
if (config.getControlPort() > 0) {
controlServer.startServer();
}
=======
circuitManager.startBuildingCircuits();
>>>>>>>
circuitManager.startBuildingCircuits();
if (config.getControlPort() > 0) {
controlServer.startServer();
} |
<<<<<<<
return signRawTransaction(hex, null, null, "ALL");
}
@Override
public String signRawTransaction(String hex, List<ExtendedTxInput> inputs, List<String> privateKeys) {
return signRawTransaction(hex, inputs, privateKeys, "ALL");
}
public String signRawTransaction(String hex, List<ExtendedTxInput> inputs, List<String> privateKeys, String sigHashType) {
List<Map> pInputs = null;
if (inputs != null) {
pInputs = new ArrayList<>();
for (final ExtendedTxInput txInput : inputs) {
pInputs.add(new LinkedHashMap() {
{
put("txid", txInput.txid());
put("vout", txInput.vout());
put("scriptPubKey", txInput.scriptPubKey());
put("redeemScript", txInput.redeemScript());
put("amount", txInput.amount());
}
});
}
}
Map result = (Map) query("signrawtransaction", hex, pInputs, privateKeys, sigHashType); //if sigHashType is null it will return the default "ALL"
=======
return signRawTransaction(hex, null, null);
}
@Override
public String signRawTransaction(String hex, List<TxInput> inputs, List<String> privateKeys) throws BitcoinRpcException {
List<Map> pInputs = new ArrayList<>();
if (inputs != null)
for (final TxInput txInput : inputs) {
pInputs.add(new LinkedHashMap() {
{
put("txid", txInput.txid());
put("vout", txInput.vout());
}
});
}
if (privateKeys == null)
privateKeys = new ArrayList<>();
Map result = (Map) query("signrawtransaction", hex, pInputs, privateKeys);
>>>>>>>
return signRawTransaction(hex, null, null, "ALL");
}
public String signRawTransaction(String hex, List<ExtendedTxInput> inputs, List<String> privateKeys) {
return signRawTransaction(hex, inputs, privateKeys, "ALL");
}
public String signRawTransaction(String hex, List<ExtendedTxInput> inputs, List<String> privateKeys, String sigHashType) {
List<Map> pInputs = null;
if (inputs != null) {
pInputs = new ArrayList<>();
for (final ExtendedTxInput txInput : inputs) {
pInputs.add(new LinkedHashMap() {
{
put("txid", txInput.txid());
put("vout", txInput.vout());
put("scriptPubKey", txInput.scriptPubKey());
put("redeemScript", txInput.redeemScript());
put("amount", txInput.amount());
}
});
}
}
Map result = (Map) query("signrawtransaction", hex, pInputs, privateKeys, sigHashType); //if sigHashType is null it will return the default "ALL" |
<<<<<<<
=======
import static android.R.layout.simple_dropdown_item_1line;
import static android.accounts.AccountManager.KEY_ACCOUNT_NAME;
import static android.accounts.AccountManager.KEY_ACCOUNT_TYPE;
import static android.accounts.AccountManager.KEY_AUTHTOKEN;
import static android.accounts.AccountManager.KEY_BOOLEAN_RESULT;
import static android.view.KeyEvent.ACTION_DOWN;
import static android.view.KeyEvent.KEYCODE_ENTER;
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
import static com.donnfelker.android.bootstrap.core.Constants.Http.HEADER_PARSE_APP_ID;
import static com.donnfelker.android.bootstrap.core.Constants.Http.HEADER_PARSE_REST_API_KEY;
import static com.donnfelker.android.bootstrap.core.Constants.Http.PARSE_APP_ID;
import static com.donnfelker.android.bootstrap.core.Constants.Http.PARSE_REST_API_KEY;
import static com.donnfelker.android.bootstrap.core.Constants.Http.URL_AUTH;
import static com.github.kevinsawicki.http.HttpRequest.get;
>>>>>>>
<<<<<<<
import static android.R.layout.simple_dropdown_item_1line;
import static android.accounts.AccountManager.KEY_ACCOUNT_NAME;
import static android.accounts.AccountManager.KEY_ACCOUNT_TYPE;
import static android.accounts.AccountManager.KEY_AUTHTOKEN;
import static android.accounts.AccountManager.KEY_BOOLEAN_RESULT;
import static android.view.KeyEvent.ACTION_DOWN;
import static android.view.KeyEvent.KEYCODE_ENTER;
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
import static com.donnfelker.android.bootstrap.core.Constants.Http.HEADER_PARSE_APP_ID;
import static com.donnfelker.android.bootstrap.core.Constants.Http.HEADER_PARSE_REST_API_KEY;
import static com.donnfelker.android.bootstrap.core.Constants.Http.PARSE_APP_ID;
import static com.donnfelker.android.bootstrap.core.Constants.Http.PARSE_REST_API_KEY;
import static com.donnfelker.android.bootstrap.core.Constants.Http.URL_AUTH;
import static com.github.kevinsawicki.http.HttpRequest.get;
=======
>>>>>>>
import static android.R.layout.simple_dropdown_item_1line;
import static android.accounts.AccountManager.KEY_ACCOUNT_NAME;
import static android.accounts.AccountManager.KEY_ACCOUNT_TYPE;
import static android.accounts.AccountManager.KEY_AUTHTOKEN;
import static android.accounts.AccountManager.KEY_BOOLEAN_RESULT;
import static android.view.KeyEvent.ACTION_DOWN;
import static android.view.KeyEvent.KEYCODE_ENTER;
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
import static com.donnfelker.android.bootstrap.core.Constants.Http.HEADER_PARSE_APP_ID;
import static com.donnfelker.android.bootstrap.core.Constants.Http.HEADER_PARSE_REST_API_KEY;
import static com.donnfelker.android.bootstrap.core.Constants.Http.PARSE_APP_ID;
import static com.donnfelker.android.bootstrap.core.Constants.Http.PARSE_REST_API_KEY;
import static com.donnfelker.android.bootstrap.core.Constants.Http.URL_AUTH;
import static com.github.kevinsawicki.http.HttpRequest.get;
<<<<<<<
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
if (actionId == IME_ACTION_DONE && signinButton.isEnabled()) {
handleLogin(signinButton);
=======
public boolean onEditorAction(final TextView v, final int actionId,
final KeyEvent event) {
if (actionId == IME_ACTION_DONE && mSignInButton.isEnabled()) {
handleLogin(mSignInButton);
>>>>>>>
public boolean onEditorAction(final TextView v, final int actionId,
final KeyEvent event) {
if (actionId == IME_ACTION_DONE && mSignInButton.isEnabled()) {
handleLogin(mSignInButton);
<<<<<<<
if (request.ok()) {
final User model = new Gson().fromJson(Strings.toString(request.buffer()), User.class);
token = model.getSessionToken();
=======
if(request.ok()) {
final User model = new Gson().fromJson(
Strings.toString(request.buffer()),
User.class
);
mToken = model.getSessionToken();
>>>>>>>
if (request.ok()) {
final User model = new Gson().fromJson(
Strings.toString(request.buffer()),
User.class
);
mToken = model.getSessionToken(); |
<<<<<<<
=======
import com.donnfelker.android.bootstrap.util.Ln;
import com.donnfelker.android.bootstrap.util.Strings;
>>>>>>>
import com.donnfelker.android.bootstrap.util.Ln; |
<<<<<<<
=======
import org.eclipse.buildship.core.gradle.Specs;
import org.eclipse.buildship.core.projectimport.internal.DefaultProjectCreatedEvent;
>>>>>>>
import org.eclipse.buildship.core.projectimport.internal.DefaultProjectCreatedEvent;
<<<<<<<
workspaceProject = workspaceOperations.includeProject(projectDescription.get(), childProjectLocations, gradleNature, new SubProgressMonitor(monitor, 2));
=======
workspaceProject = workspaceOperations.includeProject(projectDescription.get(), childProjectLocations, gradleNature,
new SubProgressMonitor(monitor, 2));
// persist the Gradle-specific configuration in the Eclipse project's .settings
// folder
ProjectConfiguration projectConfiguration = ProjectConfiguration.from(this.fixedAttributes, project);
CorePlugin.projectConfigurationManager().saveProjectConfiguration(projectConfiguration, workspaceProject);
>>>>>>>
workspaceProject = workspaceOperations.includeProject(projectDescription.get(), childProjectLocations, gradleNature, new SubProgressMonitor(monitor, 2)); |
<<<<<<<
import java.security.PrivateKey;
import java.security.Signature;
=======
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
>>>>>>>
import java.security.PrivateKey;
import java.security.Signature;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
<<<<<<<
/**
* This method digest and encrypt the given {@code InputStream} with indicated private key and signature algorithm. To find the signature object
* the list of registered security Providers, starting with the most preferred Provider is traversed.
*
* This method returns an array of bytes representing the signature value. Signature object that implements the specified signature algorithm. It traverses the list of
* registered security Providers, starting with the most preferred Provider. A new Signature object encapsulating the SignatureSpi implementation from the first Provider
* that supports the specified algorithm is returned. The {@code NoSuchAlgorithmException} exception is wrapped in a DSSException.
*
* @param signatureAlgorithm signature algorithm under JAVA form.
* @param privateKey private key to use
* @param bytes the data to digest
* @return digested and encrypted array of bytes
*/
@Deprecated
public static byte[] encrypt(String signatureAlgorithm, PrivateKey privateKey, byte[] bytes) {
try {
Signature signature = Signature.getInstance(signatureAlgorithm);
signature.initSign(privateKey);
signature.update(bytes);
return signature.sign();
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
}
public static byte[] addPadding(byte[] digest) {
return ArrayUtils.addAll(DigestAlgorithm.SHA256.digestInfoPrefix(), digest);
}
=======
public static X509Certificate toX509Certificate(String certificate) {
try {
return TestSigningUtil.toX509Certificate(certificate.getBytes());
} catch (CertificateException e) {
throw new RuntimeException(e);
}
}
/*
* RESTRICTED METHODS
*/
private static X509Certificate toX509Certificate(byte[] cert) throws CertificateException {
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
synchronized (certificateFactory) {
return (X509Certificate) certificateFactory.generateCertificate(new ByteArrayInputStream(cert));
}
}
>>>>>>>
public static X509Certificate toX509Certificate(String certificate) {
try {
return TestSigningUtil.toX509Certificate(certificate.getBytes());
} catch (CertificateException e) {
throw new RuntimeException(e);
}
}
public static byte[] addPadding(byte[] digest) {
return ArrayUtils.addAll(DigestAlgorithm.SHA256.digestInfoPrefix(), digest);
}
/**
* This method digest and encrypt the given {@code InputStream} with indicated private key and signature algorithm. To find the signature object
* the list of registered security Providers, starting with the most preferred Provider is traversed.
*
* This method returns an array of bytes representing the signature value. Signature object that implements the specified signature algorithm. It traverses the list of
* registered security Providers, starting with the most preferred Provider. A new Signature object encapsulating the SignatureSpi implementation from the first Provider
* that supports the specified algorithm is returned. The {@code NoSuchAlgorithmException} exception is wrapped in a DSSException.
*
* @param signatureAlgorithm signature algorithm under JAVA form.
* @param privateKey private key to use
* @param bytes the data to digest
* @return digested and encrypted array of bytes
*/
@Deprecated
public static byte[] encrypt(String signatureAlgorithm, PrivateKey privateKey, byte[] bytes) {
try {
Signature signature = Signature.getInstance(signatureAlgorithm);
signature.initSign(privateKey);
signature.update(bytes);
return signature.sign();
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
}
/*
* RESTRICTED METHODS
*/
private static X509Certificate toX509Certificate(byte[] cert) throws CertificateException {
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
synchronized (certificateFactory) {
return (X509Certificate) certificateFactory.generateCertificate(new ByteArrayInputStream(cert));
}
} |
<<<<<<<
@Test
public void whenExistingContainer_hasWrongMimeSlash_weShouldNotThrowException() {
ValidationResult result = ContainerBuilder.aContainer()
.fromExistingFile("src/test/resources/testFiles/invalid-containers/INC166120_wrong_mime_slash.bdoc")
.withConfiguration(new Configuration(Configuration.Mode.TEST))
.build().validate();
Assert.assertFalse("Container is not invalid", result.isValid());
}
=======
@Test(expected = DigiDoc4JException.class)
public void whenOpeningContainer_withSignatureInfo_butNoSignedDataObject_shouldThrowException() {
Container container = ContainerBuilder.aContainer()
.fromExistingFile("src/test/resources/testFiles/invalid-containers/3863_bdoc21_TM_no_datafile.bdoc")
.withConfiguration(new Configuration(Configuration.Mode.TEST))
.build();
}
>>>>>>>
@Test
public void whenExistingContainer_hasWrongMimeSlash_weShouldNotThrowException() {
ValidationResult result = ContainerBuilder.aContainer()
.fromExistingFile("src/test/resources/testFiles/invalid-containers/INC166120_wrong_mime_slash.bdoc")
.withConfiguration(new Configuration(Configuration.Mode.TEST))
.build().validate();
Assert.assertFalse("Container is not invalid", result.isValid());
}
@Test(expected = DigiDoc4JException.class)
public void whenOpeningContainer_withSignatureInfo_butNoSignedDataObject_shouldThrowException() {
Container container = ContainerBuilder.aContainer()
.fromExistingFile("src/test/resources/testFiles/invalid-containers/3863_bdoc21_TM_no_datafile.bdoc")
.withConfiguration(new Configuration(Configuration.Mode.TEST))
.build();
} |
<<<<<<<
logger.debug("");
ConfigManager.init("jdigidoc.cfg");
=======
//ConfigManager.init("jdigidoc.cfg");
Configuration configuration = new Configuration();
configuration.addConfiguration("digidoc4j.yaml");
ConfigManager.init(configuration.getJDigiDocConf());
>>>>>>>
logger.debug("");
//ConfigManager.init("jdigidoc.cfg");
Configuration configuration = new Configuration();
configuration.addConfiguration("digidoc4j.yaml");
ConfigManager.init(configuration.getJDigiDocConf()); |
<<<<<<<
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
=======
import org.digidoc4j.api.Configuration;
>>>>>>>
import org.digidoc4j.api.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<<<<<<<
logger.debug("");
String location = "http://www.openxades.org/cgi-bin/ocsp.cgi";
logger.debug("OCSP Access location: " + location);
return location;
//return "http://ocsp.org.ee";
=======
Configuration configuration = new Configuration();
return configuration.getOcspSource();
>>>>>>>
logger.debug("");
Configuration configuration = new Configuration();
String location = configuration.getOcspSource;
logger.debug("OCSP Access location: " + location);
return configuration.getOcspSource(); |
<<<<<<<
import com.hubspot.slack.client.methods.params.channels.ChannelsInfoParams;
=======
import com.hubspot.slack.client.methods.params.channels.ChannelsKickParams;
>>>>>>>
import com.hubspot.slack.client.methods.params.channels.ChannelsInfoParams;
import com.hubspot.slack.client.methods.params.channels.ChannelsKickParams;
<<<<<<<
CompletableFuture<Result<ChannelsInfoResponse, SlackError>> getChannelInfo(ChannelsInfoParams params);
=======
CompletableFuture<Result<ChannelsInfoResponse, SlackError>> getChannelInfo(AbstractChannelsInfoParams params);
CompletableFuture<Result<ChannelsKickResponse, SlackError>> kickUserFromChannel(ChannelsKickParams channelKickParams);
>>>>>>>
CompletableFuture<Result<ChannelsInfoResponse, SlackError>> getChannelInfo(ChannelsInfoParams params);
CompletableFuture<Result<ChannelsKickResponse, SlackError>> kickUserFromChannel(ChannelsKickParams channelKickParams); |
<<<<<<<
import com.hubspot.slack.client.models.events.user.SlackMemberJoinedChannelEvent;
=======
import com.hubspot.slack.client.models.events.user.SlackUserChangeEvent;
>>>>>>>
import com.hubspot.slack.client.models.events.user.SlackMemberJoinedChannelEvent;
import com.hubspot.slack.client.models.events.user.SlackUserChangeEvent;
<<<<<<<
@Test
public void itCanDeserMemberJoinedChannelEventWithoutInviter() throws IOException {
SlackMemberJoinedChannelEvent event = fetchAndDeserializeSlackEvent("member_joined_channel.json").toDetailedEvent();
assertThat(event.getType()).isEqualTo(SlackEventType.MEMBER_JOINED_CHANNEL);
}
@Test
public void itCanDeserMemberJoinedChannelEventWithInviter() throws IOException {
SlackMemberJoinedChannelEvent event = fetchAndDeserializeSlackEvent("member_joined_channel_with_inviter.json").toDetailedEvent();
assertThat(event.getType()).isEqualTo(SlackEventType.MEMBER_JOINED_CHANNEL);
}
=======
@Test
public void itCanDeserUserChangeEvent() throws IOException {
SlackUserChangeEvent event = fetchAndDeserializeSlackEvent("user_change.json").toDetailedEvent();
assertThat(event.getType()).isEqualTo(SlackEventType.USER_CHANGE);
assertThat(event.getUser().isDeleted().isPresent() && event.getUser().isDeleted().get());
}
>>>>>>>
@Test
public void itCanDeserMemberJoinedChannelEventWithoutInviter() throws IOException {
SlackMemberJoinedChannelEvent event = fetchAndDeserializeSlackEvent("member_joined_channel.json").toDetailedEvent();
assertThat(event.getType()).isEqualTo(SlackEventType.MEMBER_JOINED_CHANNEL);
}
@Test
public void itCanDeserMemberJoinedChannelEventWithInviter() throws IOException {
SlackMemberJoinedChannelEvent event = fetchAndDeserializeSlackEvent("member_joined_channel_with_inviter.json").toDetailedEvent();
assertThat(event.getType()).isEqualTo(SlackEventType.MEMBER_JOINED_CHANNEL);
}
@Test
public void itCanDeserUserChangeEvent() throws IOException {
SlackUserChangeEvent event = fetchAndDeserializeSlackEvent("user_change.json").toDetailedEvent();
assertThat(event.getType()).isEqualTo(SlackEventType.USER_CHANGE);
assertThat(event.getUser().isDeleted().isPresent() && event.getUser().isDeleted().get());
} |
<<<<<<<
@Parameter(description = "port the server will listen on.", names = "-port")
private int port = 5555;
@Parameter(description = "timeout that will be used to start Android emulators", names = "-timeoutEmulatorStart")
private long timeoutEmulatorStart = 300000;
@Parameter(description = "if true, adb will be restarted while starting selendroid-standalone.", names = "-restartAdb")
private boolean restartAdb = false;
@Parameter(description = "location of the application under test. Absolute path to the apk", names = {
"-app", "-aut" })
private List<String> supportedApps = new ArrayList<String>();
@Parameter(description = "for developers who already have the app installed (and emulator running) format = tld.company.app/ActivityClass:version", names = { "-installedApp" })
private String installedApp = null;
@Parameter(names = "-verbose", description = "Debug mode")
private boolean verbose = false;
@Parameter(names = "-emulatorPort", description = "port number to start running emulators on")
private int emulatorPort = 5560;
@Parameter(names = "-deviceScreenshot", description = "if true, screenshots will be taken on the device instead of using the ddmlib libary.")
private boolean deviceScreenshot = false;
@Parameter(description = "the port the selendroid-standalone is using to communicate with instrumentation server", names = { "-selendroidServerPort" })
private int selendroidServerPort = 8080;
@Parameter(description = "The file of the keystore to be used", names = { "-keystore" })
private String keystore = null;
public void setKeystore(String keystore) {
this.keystore = keystore;
}
public String getKeystore() {
return keystore;
}
public void setSelendroidServerPort(int selendroidServerPort) {
this.selendroidServerPort = selendroidServerPort;
}
public int getSelendroidServerPort() {
return selendroidServerPort;
}
public void addSupportedApp(String appAbsolutPath) {
supportedApps.add(appAbsolutPath);
}
public List<String> getSupportedApps() {
return supportedApps;
}
public void setInstalledApp(String installedApp) {
this.installedApp = installedApp;
}
public String getInstalledApp() {
return installedApp;
}
public static SelendroidConfiguration create(String[] args) {
SelendroidConfiguration res = new SelendroidConfiguration();
new JCommander(res).parse(args);
return res;
}
public void setPort(int port) {
this.port = port;
}
public int getPort() {
return this.port;
}
public void setEmulatorPort(int port) {
emulatorPort = port;
}
public int getEmulatorPort() {
return emulatorPort;
}
public long getTimeoutEmulatorStart() {
return timeoutEmulatorStart;
}
public void setTimeoutEmulatorStart(long timeoutEmulatorStart) {
this.timeoutEmulatorStart = timeoutEmulatorStart;
}
public boolean isRestartAdb() {
return restartAdb;
}
public void setRestartAdb(boolean restartAdb) {
this.restartAdb = restartAdb;
}
public boolean isVerbose() {
return verbose;
}
public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
public boolean isDeviceScreenshot() {
return deviceScreenshot;
}
public void setDeviceScreenshot(boolean deviceScreenshot) {
this.deviceScreenshot = deviceScreenshot;
}
=======
@Parameter(description = "port the server will listen on.", names = "-port")
private int port = 5555;
@Parameter(description = "host of the node. Ip address needs to be specified for registering to a grid hub (guessing can be wrong complex).", names = "-host")
private String serverHost;
@Parameter(description = "timeout that will be used to start Android emulators", names = "-timeoutEmulatorStart")
private long timeoutEmulatorStart = 300000;
@Parameter(description = "if specified, will send a registration request to the given url. Example : http://localhost:4444/grid/register", names = "-hub")
private String registrationUrl = null;
@Parameter(description = "if specified, will specify the remote proxy to use on the grid. Example : io.selendroid.grid.SelendroidSessionProxy", names = "-proxy")
private String proxy = null;
@Parameter(description = "location of the application under test. Absolute path to the apk", names = {
"-app", "-aut"})
private List<String> supportedApps = new ArrayList<String>();
@Parameter(description = "for developers who already have the app installed (and emulator running) format = tld.company.app/ActivityClass:version", names = {"-installedApp"})
private String installedApp = null;
@Parameter(names = "-verbose", description = "Debug mode")
private boolean verbose = false;
@Parameter(names = "-emulatorPort", description = "port number to start running emulators on")
private int emulatorPort = 5560;
@Parameter(names = "-deviceScreenshot", description = "if true, screenshots will be taken on the device instead of using the ddmlib libary.")
private boolean deviceScreenshot = false;
public void addSupportedApp(String appAbsolutPath) {
supportedApps.add(appAbsolutPath);
}
public List<String> getSupportedApps() {
return supportedApps;
}
public void setInstalledApp(String installedApp) {
this.installedApp = installedApp;
}
public String getInstalledApp() {
return installedApp;
}
public static SelendroidConfiguration create(String[] args) {
SelendroidConfiguration res = new SelendroidConfiguration();
new JCommander(res).parse(args);
return res;
}
public void setPort(int port) {
this.port = port;
}
public int getPort() {
return this.port;
}
public void setEmulatorPort(int port) {
emulatorPort = port;
}
public int getEmulatorPort() {
return emulatorPort;
}
public long getTimeoutEmulatorStart() {
return timeoutEmulatorStart;
}
public void setTimeoutEmulatorStart(long timeoutEmulatorStart) {
this.timeoutEmulatorStart = timeoutEmulatorStart;
}
public boolean isVerbose() {
return verbose;
}
public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
public boolean isDeviceScreenshot() {
return deviceScreenshot;
}
public void setDeviceScreenshot(boolean deviceScreenshot) {
this.deviceScreenshot = deviceScreenshot;
}
public String getRegistrationUrl() {
return registrationUrl;
}
public void setRegistrationUrl(String registrationUrl) {
this.registrationUrl = registrationUrl;
}
public String getProxy() {
return proxy;
}
public void setProxy(String proxy) {
this.proxy = proxy;
}
public String getServerHost() {
return serverHost;
}
public void setServerHost(String serverHost) {
this.serverHost = serverHost;
}
>>>>>>>
@Parameter(description = "port the server will listen on.", names = "-port")
private int port = 5555;
@Parameter(description = "timeout that will be used to start Android emulators", names = "-timeoutEmulatorStart")
private long timeoutEmulatorStart = 300000;
@Parameter(description = "if true, adb will be restarted while starting selendroid-standalone.", names = "-restartAdb")
private boolean restartAdb = false;
@Parameter(description = "location of the application under test. Absolute path to the apk", names = {
"-app", "-aut" })
private List<String> supportedApps = new ArrayList<String>();
@Parameter(description = "for developers who already have the app installed (and emulator running) format = tld.company.app/ActivityClass:version", names = { "-installedApp" })
private String installedApp = null;
@Parameter(names = "-verbose", description = "Debug mode")
private boolean verbose = false;
@Parameter(names = "-emulatorPort", description = "port number to start running emulators on")
private int emulatorPort = 5560;
@Parameter(names = "-deviceScreenshot", description = "if true, screenshots will be taken on the device instead of using the ddmlib libary.")
private boolean deviceScreenshot = false;
@Parameter(description = "the port the selendroid-standalone is using to communicate with instrumentation server", names = { "-selendroidServerPort" })
private int selendroidServerPort = 8080;
@Parameter(description = "The file of the keystore to be used", names = { "-keystore" })
private String keystore = null;
@Parameter(description = "if specified, will send a registration request to the given url. Example : http://localhost:4444/grid/register", names = "-hub")
private String registrationUrl = null;
@Parameter(description = "if specified, will specify the remote proxy to use on the grid. Example : io.selendroid.grid.SelendroidSessionProxy", names = "-proxy")
private String proxy = null;
@Parameter(description = "host of the node. Ip address needs to be specified for registering to a grid hub (guessing can be wrong complex).", names = "-host")
private String serverHost;
public void setKeystore(String keystore) {
this.keystore = keystore;
}
public String getKeystore() {
return keystore;
}
public void setSelendroidServerPort(int selendroidServerPort) {
this.selendroidServerPort = selendroidServerPort;
}
public int getSelendroidServerPort() {
return selendroidServerPort;
}
public void addSupportedApp(String appAbsolutPath) {
supportedApps.add(appAbsolutPath);
}
public List<String> getSupportedApps() {
return supportedApps;
}
public void setInstalledApp(String installedApp) {
this.installedApp = installedApp;
}
public String getInstalledApp() {
return installedApp;
}
public static SelendroidConfiguration create(String[] args) {
SelendroidConfiguration res = new SelendroidConfiguration();
new JCommander(res).parse(args);
return res;
}
public void setPort(int port) {
this.port = port;
}
public int getPort() {
return this.port;
}
public void setEmulatorPort(int port) {
emulatorPort = port;
}
public int getEmulatorPort() {
return emulatorPort;
}
public long getTimeoutEmulatorStart() {
return timeoutEmulatorStart;
}
public void setTimeoutEmulatorStart(long timeoutEmulatorStart) {
this.timeoutEmulatorStart = timeoutEmulatorStart;
}
public boolean isRestartAdb() {
return restartAdb;
}
public void setRestartAdb(boolean restartAdb) {
this.restartAdb = restartAdb;
}
public boolean isVerbose() {
return verbose;
}
public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
public boolean isDeviceScreenshot() {
return deviceScreenshot;
}
public void setDeviceScreenshot(boolean deviceScreenshot) {
this.deviceScreenshot = deviceScreenshot;
}
public String getRegistrationUrl() {
return registrationUrl;
}
public void setRegistrationUrl(String registrationUrl) {
this.registrationUrl = registrationUrl;
}
public String getProxy() {
return proxy;
}
public void setProxy(String proxy) {
this.proxy = proxy;
}
public String getServerHost() {
return serverHost;
}
public void setServerHost(String serverHost) {
this.serverHost = serverHost;
} |
<<<<<<<
public static final String DEFAULT_HOSTNAME = "http://www.android.com";
=======
public static final String DEFAULT_ENDPOINT = "http://www.google.com";
>>>>>>>
public static final String DEFAULT_ENDPOINT = "http://www.android.com"; |
<<<<<<<
import de.neuland.jade4j.filter.*;
=======
import de.neuland.jade4j.filter.CDATAFilter;
import de.neuland.jade4j.filter.CssFilter;
import de.neuland.jade4j.filter.CustomTestFilter;
import de.neuland.jade4j.filter.JsFilter;
import de.neuland.jade4j.filter.MarkdownFilter;
import de.neuland.jade4j.filter.PlainFilter;
import de.neuland.jade4j.filter.VerbatimFilter;
>>>>>>>
import de.neuland.jade4j.filter.*;
<<<<<<<
=======
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
>>>>>>>
<<<<<<<
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
=======
>>>>>>>
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
<<<<<<<
private static String[] ignoredCases = new String[]{"131", "153"};
=======
private static String[] ignoredCases = new String[]{"100","131"};
>>>>>>>
private static String[] ignoredCases = new String[]{"131"}; |
<<<<<<<
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
=======
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
>>>>>>>
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
<<<<<<<
root.getChildren().add(buttonOrderHbox);
VBox.setVgrow(buttonOrderHbox, Priority.NEVER);
final ToggleButton uniformButtonBtn = new ToggleButton("Uniform Button Size");
uniformButtonBtn.selectedProperty().bindBidirectional( buttonBar.buttonUniformSizeProperty());
HBox panel = new HBox(uniformButtonBtn);
root.getChildren().add( panel);
VBox.setVgrow(panel, Priority.ALWAYS);
=======
root.getChildren().add(buttonOrderHbox);
// spacer to push button bar to bottom
Region spacer = new Region();
VBox.setVgrow(spacer, Priority.ALWAYS);
root.getChildren().add(spacer);
>>>>>>>
root.getChildren().add(buttonOrderHbox);
VBox.setVgrow(buttonOrderHbox, Priority.NEVER);
final ToggleButton uniformButtonBtn = new ToggleButton("Uniform Button Size");
uniformButtonBtn.selectedProperty().bindBidirectional( buttonBar.buttonUniformSizeProperty());
HBox panel = new HBox(uniformButtonBtn);
// spacer to push button bar to bottom
Region spacer = new Region();
VBox.setVgrow(spacer, Priority.ALWAYS);
root.getChildren().add(spacer);
root.getChildren().add( panel);
VBox.setVgrow(panel, Priority.ALWAYS);
<<<<<<<
root.getChildren().add(buttonBar);
VBox.setVgrow(buttonBar, Priority.NEVER);
=======
root.getChildren().add(buttonBar);
return root;
}
@Override public void start(Stage stage) throws Exception {
stage.setTitle("ButtonBar Demo");
>>>>>>>
root.getChildren().add(buttonBar);
root.getChildren().add(buttonBar);
VBox.setVgrow(buttonBar, Priority.NEVER);
return root;
}
@Override public void start(Stage stage) throws Exception {
stage.setTitle("ButtonBar Demo"); |
<<<<<<<
if (code.isLetterKey() || code.isDigitKey() || code == KeyCode.SPACE) {
String letter = code.getChar();
=======
if (code.isLetterKey() || code.isDigitKey() || code == KeyCode.SPACE || code == KeyCode.BACK_SPACE) {
if (event.getSource() instanceof PrefixSelectionComboBox) {
if (code == KeyCode.BACK_SPACE && ! ((PrefixSelectionComboBox) event.getSource()).isBackSpaceAllowed()) {
return;
}
}
String letter = code.impl_getChar();
>>>>>>>
if (code.isLetterKey() || code.isDigitKey() || code == KeyCode.SPACE || code == KeyCode.BACK_SPACE) {
if (event.getSource() instanceof PrefixSelectionComboBox) {
if (code == KeyCode.BACK_SPACE && ! ((PrefixSelectionComboBox) event.getSource()).isBackSpaceAllowed()) {
return;
}
}
String letter = code.getChar(); |
<<<<<<<
Objects.requireNonNull(fixedCorner, "The specified fixed corner must not be null."); //$NON-NLS-1$
Objects.requireNonNull(diagonalCorner, "The specified diagonal corner must not be null."); //$NON-NLS-1$
if (ratio < 0)
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
=======
Objects.requireNonNull(fixedCorner, "The specified fixed corner must not be null.");
Objects.requireNonNull(diagonalCorner, "The specified diagonal corner must not be null.");
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero.");
}
>>>>>>>
Objects.requireNonNull(fixedCorner, "The specified fixed corner must not be null."); //$NON-NLS-1$
Objects.requireNonNull(diagonalCorner, "The specified diagonal corner must not be null."); //$NON-NLS-1$
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
<<<<<<<
Objects.requireNonNull(original, "The specified original rectangle must not be null."); //$NON-NLS-1$
if (ratio < 0)
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
=======
Objects.requireNonNull(original, "The specified original rectangle must not be null.");
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero.");
}
>>>>>>>
Objects.requireNonNull(original, "The specified original rectangle must not be null."); //$NON-NLS-1$
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
<<<<<<<
Objects.requireNonNull(original, "The specified original rectangle must not be null."); //$NON-NLS-1$
Objects.requireNonNull(bounds, "The specified bounds for the new rectangle must not be null."); //$NON-NLS-1$
if (ratio < 0)
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
=======
Objects.requireNonNull(original, "The specified original rectangle must not be null.");
Objects.requireNonNull(bounds, "The specified bounds for the new rectangle must not be null.");
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero.");
}
>>>>>>>
Objects.requireNonNull(original, "The specified original rectangle must not be null."); //$NON-NLS-1$
Objects.requireNonNull(bounds, "The specified bounds for the new rectangle must not be null."); //$NON-NLS-1$
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
<<<<<<<
if (!centerPointInBounds)
throw new IllegalArgumentException("The center point " + centerPoint //$NON-NLS-1$
+ " of the original rectangle is out of the specified bounds."); //$NON-NLS-1$
=======
if (!centerPointInBounds) {
throw new IllegalArgumentException("The center point " + centerPoint
+ " of the original rectangle is out of the specified bounds.");
}
>>>>>>>
if (!centerPointInBounds) {
throw new IllegalArgumentException("The center point " + centerPoint //$NON-NLS-1$
+ " of the original rectangle is out of the specified bounds."); //$NON-NLS-1$
}
<<<<<<<
Objects.requireNonNull(centerPoint, "The specified center point of the new rectangle must not be null."); //$NON-NLS-1$
if (area < 0)
throw new IllegalArgumentException("The specified area " + area + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
if (ratio < 0)
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
=======
Objects.requireNonNull(centerPoint, "The specified center point of the new rectangle must not be null.");
if (area < 0) {
throw new IllegalArgumentException("The specified area " + area + " must be larger than zero.");
}
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero.");
}
>>>>>>>
Objects.requireNonNull(centerPoint, "The specified center point of the new rectangle must not be null."); //$NON-NLS-1$
if (area < 0) {
throw new IllegalArgumentException("The specified area " + area + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
<<<<<<<
if (!centerPointInBounds)
throw new IllegalArgumentException("The center point " + centerPoint //$NON-NLS-1$
+ " of the original rectangle is out of the specified bounds."); //$NON-NLS-1$
if (area < 0)
throw new IllegalArgumentException("The specified area " + area + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
if (ratio < 0)
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
=======
if (!centerPointInBounds) {
throw new IllegalArgumentException("The center point " + centerPoint
+ " of the original rectangle is out of the specified bounds.");
}
if (area < 0) {
throw new IllegalArgumentException("The specified area " + area + " must be larger than zero.");
}
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero.");
}
>>>>>>>
if (!centerPointInBounds) {
throw new IllegalArgumentException("The center point " + centerPoint //$NON-NLS-1$
+ " of the original rectangle is out of the specified bounds."); //$NON-NLS-1$
}
if (area < 0) {
throw new IllegalArgumentException("The specified area " + area + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
<<<<<<<
if (!centerPointInBounds)
throw new IllegalArgumentException("The center point " + centerPoint //$NON-NLS-1$
+ " of the original rectangle is out of the specified bounds."); //$NON-NLS-1$
if (width < 0)
throw new IllegalArgumentException("The specified width " + width + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
if (height < 0)
throw new IllegalArgumentException("The specified height " + height + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
=======
if (!centerPointInBounds) {
throw new IllegalArgumentException("The center point " + centerPoint
+ " of the original rectangle is out of the specified bounds.");
}
if (width < 0) {
throw new IllegalArgumentException("The specified width " + width + " must be larger than zero.");
}
if (height < 0) {
throw new IllegalArgumentException("The specified height " + height + " must be larger than zero.");
}
>>>>>>>
if (!centerPointInBounds) {
throw new IllegalArgumentException("The center point " + centerPoint //$NON-NLS-1$
+ " of the original rectangle is out of the specified bounds."); //$NON-NLS-1$
}
if (width < 0) {
throw new IllegalArgumentException("The specified width " + width + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
if (height < 0) {
throw new IllegalArgumentException("The specified height " + height + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
}
<<<<<<<
Objects.requireNonNull(edge, "The specified edge must not be null."); //$NON-NLS-1$
Objects.requireNonNull(point, "The specified point must not be null."); //$NON-NLS-1$
Objects.requireNonNull(bounds, "The specified bounds must not be null."); //$NON-NLS-1$
=======
Objects.requireNonNull(edge, "The specified edge must not be null.");
Objects.requireNonNull(point, "The specified point must not be null.");
Objects.requireNonNull(bounds, "The specified bounds must not be null.");
>>>>>>>
Objects.requireNonNull(edge, "The specified edge must not be null."); //$NON-NLS-1$
Objects.requireNonNull(point, "The specified point must not be null."); //$NON-NLS-1$
Objects.requireNonNull(bounds, "The specified bounds must not be null."); //$NON-NLS-1$
<<<<<<<
"The specified edge " + edge + " is not entirely contained on the specified bounds."); //$NON-NLS-1$ //$NON-NLS-2$
if (ratio < 0)
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
=======
"The specified edge " + edge + " is not entirely contained on the specified bounds.");
}
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero.");
}
>>>>>>>
"The specified edge " + edge + " is not entirely contained on the specified bounds."); //$NON-NLS-1$ //$NON-NLS-2$
}
if (ratio < 0) {
throw new IllegalArgumentException("The specified ratio " + ratio + " must be larger than zero."); //$NON-NLS-1$ //$NON-NLS-2$
} |
<<<<<<<
import javafx.scene.control.TableCell;
import javafx.scene.control.skin.TableCellSkin;
=======
import javafx.scene.control.MenuButton;
import javafx.scene.control.TableColumn;
>>>>>>>
import javafx.scene.control.MenuButton;
import javafx.scene.control.TableColumn;
import javafx.scene.control.skin.TableCellSkin; |
<<<<<<<
=======
import com.sun.javafx.scene.control.skin.BehaviorSkinBase;
import com.sun.javafx.scene.traversal.Algorithm;
>>>>>>>
import com.sun.javafx.scene.traversal.Algorithm;
<<<<<<<
=======
@Override protected void handleControlPropertyChanged(String p) {
super.handleControlPropertyChanged(p);
if ("ORIENTATION".equals(p)) { //$NON-NLS-1$
orientation = getSkinnable().getOrientation();
if (showTickMarks && tickLine != null) {
tickLine.setSide(isHorizontal() ? Side.BOTTOM : Side.RIGHT);
}
getSkinnable().requestLayout();
} else if ("MIN".equals(p) ) { //$NON-NLS-1$
if (showTickMarks && tickLine != null) {
tickLine.setLowerBound(getSkinnable().getMin());
}
getSkinnable().requestLayout();
} else if ("MAX".equals(p)) { //$NON-NLS-1$
if (showTickMarks && tickLine != null) {
tickLine.setUpperBound(getSkinnable().getMax());
}
getSkinnable().requestLayout();
} else if ("SHOW_TICK_MARKS".equals(p) || "SHOW_TICK_LABELS".equals(p)) { //$NON-NLS-1$ //$NON-NLS-2$
setShowTickMarks(getSkinnable().isShowTickMarks(), getSkinnable().isShowTickLabels());
if (!getChildren().contains(highThumb))
getChildren().add(highThumb);
if (!getChildren().contains(rangeBar))
getChildren().add(rangeBar);
} else if ("MAJOR_TICK_UNIT".equals(p)) { //$NON-NLS-1$
if (tickLine != null) {
tickLine.setTickUnit(getSkinnable().getMajorTickUnit());
getSkinnable().requestLayout();
}
} else if ("MINOR_TICK_COUNT".equals(p)) { //$NON-NLS-1$
if (tickLine != null) {
tickLine.setMinorTickCount(Math.max(getSkinnable().getMinorTickCount(),0) + 1);
getSkinnable().requestLayout();
}
} else if ("LOW_VALUE".equals(p)) { //$NON-NLS-1$
positionLowThumb();
rangeBar.resizeRelocate(rangeStart, rangeBar.getLayoutY(),
rangeEnd - rangeStart, rangeBar.getHeight());
} else if ("HIGH_VALUE".equals(p)) { //$NON-NLS-1$
positionHighThumb();
rangeBar.resize(rangeEnd-rangeStart, rangeBar.getHeight());
}
super.handleControlPropertyChanged(p);
}
>>>>>>> |
<<<<<<<
if (!docker.getContainerStatus(element.getElementId()).isPresent() || element.isRebuild()) {
addTask(new ContainerTask(ADD, element));
=======
if (!docker.hasContainerWithElementId(element.getElementId()) || element.isRebuild()) {
addTask(new ContainerTask(ADD, element.getElementId(), null));
>>>>>>>
if (!docker.getContainerStatus(element.getElementId()).isPresent() || element.isRebuild()) {
addTask(new ContainerTask(ADD, element.getElementId(), null));
<<<<<<<
element.setContainerId(container.getId());
element.setContainerIpAddress(docker.getContainerIpAddress(container.getId()));
String containerName = container.getNames()[0].substring(1);
ElementStatus status = docker.getFullContainerStatus(container.getId());
=======
elementOptional.get().setContainerId(container.getId());
elementOptional.get().setContainerIpAddress(docker.getContainerIpAddress(container.getId()));
String containerName = docker.getContainerName(container);
ElementStatus status = docker.getContainerStatus(container.getId());
>>>>>>>
elementOptional.get().setContainerId(container.getId());
elementOptional.get().setContainerIpAddress(docker.getContainerIpAddress(container.getId()));
String containerName = docker.getContainerName(container);
ElementStatus status = docker.getFullContainerStatus(container.getId()); |
<<<<<<<
result = getJSON(controllerUrl + "instance/provision/key/" + key + "/fogtype/" + Constants.FOG_TYPE);
=======
result = getJSON(controllerUrl + "instance/provision/key/" + key + "/fabrictype/" + Configuration.getFogType().getCode());
>>>>>>>
result = getJSON(controllerUrl + "instance/provision/key/" + key + "/fogtype/" + Configuration.getFogType().getCode()); |
<<<<<<<
if (SystemUtils.IS_OS_LINUX) {
String distrName = getDistributionName();
if (distrName.toLowerCase().contains("ubuntu")
|| distrName.toLowerCase().contains("debian")
|| distrName.toLowerCase().contains("raspbian")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "apt-cache policy " + PACKAGE_NAME + " | grep Installed | awk '{print $2}'";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "apt-cache policy " + PACKAGE_NAME + " | grep Candidate | awk '{print $2}'";
} else if (distrName.toLowerCase().contains("fedora")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "dnf --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n 1p";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "dnf --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n \"$p\"";
} else if (distrName.toLowerCase().contains("red hat")
|| distrName.toLowerCase().contains("centos")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "yum --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n 1p";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "yum --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n \"$p\"";
} else {
LoggingService.logWarning(MODULE_NAME, "it looks like your distribution is not supported");
}
=======
String distrName = getDistributionName().toLowerCase();
if (distrName.contains("ubuntu")
|| distrName.contains("debian")
|| distrName.contains("raspbian")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "apt-cache policy " + PACKAGE_NAME + " | grep Installed | awk '{print $2}'";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "apt-cache policy " + PACKAGE_NAME + " | grep Candidate | awk '{print $2}'";
UPDATE_PACKAGE_REPOSITORY = "apt-get update";
} else if (distrName.contains("fedora")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "dnf --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n 1p";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "dnf --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n \"$p\"";
UPDATE_PACKAGE_REPOSITORY = "dnf update";
} else if (distrName.contains("red hat")
|| distrName.contains("centos")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "yum --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n 1p";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "yum --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n \"$p\"";
UPDATE_PACKAGE_REPOSITORY = "yum update";
} else if (distrName.contains("amazon")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "yum --showduplicates list | grep iofog | awk '{print $2}' | sed -n 1p";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "yum --showduplicates list | grep iofog | awk '{print $2}' | sed -n \"$p\"";
UPDATE_PACKAGE_REPOSITORY = "yum update";
} else {
logWarning(MODULE_NAME, "it looks like your distribution is not supported");
>>>>>>>
if (SystemUtils.IS_OS_LINUX) {
String distrName = getDistributionName().toLowerCase();
if (distrName.contains("ubuntu")
|| distrName.contains("debian")
|| distrName.contains("raspbian")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "apt-cache policy " + PACKAGE_NAME + " | grep Installed | awk '{print $2}'";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "apt-cache policy " + PACKAGE_NAME + " | grep Candidate | awk '{print $2}'";
UPDATE_PACKAGE_REPOSITORY = "apt-get update";
} else if (distrName.contains("fedora")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "dnf --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n 1p";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "dnf --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n \"$p\"";
UPDATE_PACKAGE_REPOSITORY = "dnf update";
} else if (distrName.contains("red hat")
|| distrName.contains("centos")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "yum --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n 1p";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "yum --showduplicates list " + PACKAGE_NAME + " | grep iofog | awk '{print $2}' | sed -n \"$p\"";
UPDATE_PACKAGE_REPOSITORY = "yum update";
} else if (distrName.contains("amazon")) {
GET_IOFOG_PACKAGE_INSTALLED_VERSION = "yum --showduplicates list | grep iofog | awk '{print $2}' | sed -n 1p";
GET_IOFOG_PACKAGE_CANDIDATE_VERSION = "yum --showduplicates list | grep iofog | awk '{print $2}' | sed -n \"$p\"";
UPDATE_PACKAGE_REPOSITORY = "yum update";
} else {
logWarning(MODULE_NAME, "it looks like your distribution is not supported");
}
<<<<<<<
if (SystemUtils.IS_OS_WINDOWS) {
return false;
}
CommandShellExecutor.executeCommand("apt-get update");
=======
CommandShellExecutor.executeCommand(UPDATE_PACKAGE_REPOSITORY);
>>>>>>>
if (SystemUtils.IS_OS_WINDOWS) {
return false;
}
CommandShellExecutor.executeCommand(UPDATE_PACKAGE_REPOSITORY); |
<<<<<<<
public void sendUSBInfoFromHalToController() {
if (notProvisioned()) {
return;
}
Optional<StringBuilder> response = getResponse(USB_INFO_URL);
if (!response.isPresent()) {
return;
}
String usbInfo = response.get().toString();
StatusReporter.setResourceManagerStatus().setUsbConnectionsInfo(usbInfo);
Map<String, Object> postParams = new HashMap<>();
postParams.put("info", usbInfo);
try {
orchestrator.doCommand(COMMAND_USB_INFO, null, postParams);
} catch (Exception e) {
LoggingService.logWarning(MODULE_NAME, e.getMessage());
}
}
public void sendHWInfoFromHalToController() {
if (notProvisioned()) {
return;
}
Optional<StringBuilder> response = getResponse(HW_INFO_URL);
if (!response.isPresent()) {
return;
}
String hwInfo = response.get().toString();
StatusReporter.setResourceManagerStatus().setHwInfo(hwInfo);
Map<String, Object> postParams = new HashMap<>();
postParams.put("info", hwInfo);
JsonObject jsonSendHWInfoResult = null;
try {
jsonSendHWInfoResult = orchestrator.doCommand(COMMAND_HW_INFO, null, postParams);
} catch (Exception e) {
LoggingService.logWarning(MODULE_NAME, e.getMessage());
}
LoggingService.logInfo(MODULE_NAME, jsonSendHWInfoResult == null ?
"Can't get HW Info from HAL." : jsonSendHWInfoResult.toString());
}
private Optional<StringBuilder> getResponse(String spec) {
Optional<HttpURLConnection> connection = sendHttpGetReq(spec);
StringBuilder content = null;
if (connection.isPresent()) {
content = new StringBuilder();
try (BufferedReader in = new BufferedReader(
new InputStreamReader(connection.get().getInputStream()))) {
String inputLine;
content = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
} catch (IOException exc) {
LoggingService.logInfo(MODULE_NAME, exc.getMessage());
}
connection.get().disconnect();
}
return Optional.ofNullable(content);
}
private Optional<HttpURLConnection> sendHttpGetReq(String spec) {
HttpURLConnection connection = null;
try {
URL url = new URL(spec);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod(HttpMethod.GET);
connection.getResponseCode();
} catch (IOException exc) {
LoggingService.logInfo(MODULE_NAME, exc.getMessage());
}
return Optional.ofNullable(connection);
}
=======
private void checkResponseStatus(JsonObject result) {
if (!result.getString("status").equals("ok")) {
logWarning("Error from fog controller: bad response status");
throw new RuntimeException("error from fog controller");
}
}
>>>>>>>
private void checkResponseStatus(JsonObject result) {
if (!result.getString("status").equals("ok")) {
logWarning("Error from fog controller: bad response status");
throw new RuntimeException("error from fog controller");
}
}
public void sendUSBInfoFromHalToController() {
if (notProvisioned()) {
return;
}
Optional<StringBuilder> response = getResponse(USB_INFO_URL);
if (!response.isPresent()) {
return;
}
String usbInfo = response.get().toString();
StatusReporter.setResourceManagerStatus().setUsbConnectionsInfo(usbInfo);
Map<String, Object> postParams = new HashMap<>();
postParams.put("info", usbInfo);
try {
orchestrator.doCommand(COMMAND_USB_INFO, null, postParams);
} catch (Exception e) {
LoggingService.logWarning(MODULE_NAME, e.getMessage());
}
}
public void sendHWInfoFromHalToController() {
if (notProvisioned()) {
return;
}
Optional<StringBuilder> response = getResponse(HW_INFO_URL);
if (!response.isPresent()) {
return;
}
String hwInfo = response.get().toString();
StatusReporter.setResourceManagerStatus().setHwInfo(hwInfo);
Map<String, Object> postParams = new HashMap<>();
postParams.put("info", hwInfo);
JsonObject jsonSendHWInfoResult = null;
try {
jsonSendHWInfoResult = orchestrator.doCommand(COMMAND_HW_INFO, null, postParams);
} catch (Exception e) {
LoggingService.logWarning(MODULE_NAME, e.getMessage());
}
LoggingService.logInfo(MODULE_NAME, jsonSendHWInfoResult == null ?
"Can't get HW Info from HAL." : jsonSendHWInfoResult.toString());
}
private Optional<StringBuilder> getResponse(String spec) {
Optional<HttpURLConnection> connection = sendHttpGetReq(spec);
StringBuilder content = null;
if (connection.isPresent()) {
content = new StringBuilder();
try (BufferedReader in = new BufferedReader(
new InputStreamReader(connection.get().getInputStream()))) {
String inputLine;
content = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
} catch (IOException exc) {
LoggingService.logInfo(MODULE_NAME, exc.getMessage());
}
connection.get().disconnect();
}
return Optional.ofNullable(content);
}
private Optional<HttpURLConnection> sendHttpGetReq(String spec) {
HttpURLConnection connection = null;
try {
URL url = new URL(spec);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod(HttpMethod.GET);
connection.getResponseCode();
} catch (IOException exc) {
LoggingService.logInfo(MODULE_NAME, exc.getMessage());
}
return Optional.ofNullable(connection);
} |
<<<<<<<
=======
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.List;
import java.util.concurrent.Callable;
import io.netty.handler.codec.http.*;
import org.eclipse.iofog.element.Element;
import org.eclipse.iofog.element.ElementManager;
import org.eclipse.iofog.utils.configuration.Configuration;
import org.eclipse.iofog.utils.logging.LoggingService;
>>>>>>>
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.List;
import java.util.concurrent.Callable;
import io.netty.handler.codec.http.*;
import org.eclipse.iofog.element.Element;
import org.eclipse.iofog.element.ElementManager;
import org.eclipse.iofog.utils.configuration.Configuration;
import org.eclipse.iofog.utils.logging.LoggingService;
<<<<<<<
import io.netty.handler.codec.http.*;
=======
>>>>>>>
<<<<<<<
* @param ctx ChannelHandlerContext
* @param msg Object
=======
* @param ctx, msg
* @return void
>>>>>>>
* @param ctx ChannelHandlerContext
* @param msg Object
<<<<<<<
* @param ctx ChannelHandlerContext
=======
* @param ctx
* @return void
>>>>>>>
* @param ctx ChannelHandlerContext
<<<<<<<
* @param ctx ChannelHandlerContext
=======
* @param ctx
* @return void
>>>>>>>
* @param ctx ChannelHandlerContext
<<<<<<<
public String getLocalIp() {
InetAddress address;
=======
private String getLocalIp() throws Exception {
InetAddress address = null;
>>>>>>>
private String getLocalIp() throws Exception {
InetAddress address; |
<<<<<<<
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
=======
import java.util.stream.Collectors;
>>>>>>>
import java.util.stream.Collectors;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
<<<<<<<
* @param status - status of {@link ElementStatus}
=======
* @return memory usage in bytes
*/
public long getMemoryUsage(String containerId) {
if (!hasContainerWithContainerId(containerId))
return 0;
StatsCallback statsCallback = new StatsCallback();
dockerClient.statsCmd(containerId).withContainerId(containerId).exec(statsCallback);
while (!statsCallback.gotStats()) {
try {
Thread.sleep(50);
} catch (InterruptedException exp) {
LoggingService.logWarning(MODULE_NAME, exp.getMessage());
}
}
Map<String, Object> memoryUsage = statsCallback.getStats().getMemoryStats();
return Long.parseLong(memoryUsage.get("usage").toString());
}
/**
* computes cpu usage of given {@link Container}
*
* @param containerId - id of {@link Container}
* @return a float number between 0-100
>>>>>>>
* @param status - status of {@link ElementStatus}
<<<<<<<
private ElementStatus setUsage(String containerId, ElementStatus status) {
if (!getContainerStatus(containerId).isPresent()) {
return status;
}
=======
public float getCpuUsage(String containerId) {
if (!hasContainerWithContainerId(containerId))
return 0;
>>>>>>>
private ElementStatus setUsage(String containerId, ElementStatus status) {
if (!getContainerStatus(containerId).isPresent()) {
return status;
}
<<<<<<<
=======
* returns whether the {@link Container} exists or not
*
* @param elementId - id of {@link Element}
* @return boolean true if exists and false in other case
*/
public boolean hasContainerWithElementId(String elementId) {
List<Container> containers = getContainers();
Optional<Container> containerOptional = containers.stream()
.filter(c -> getContainerName(c).equals(elementId))
.findAny();
return containerOptional.isPresent();
}
/**
* returns whether the {@link Container} exists or not
*
* @param containerId - id of {@link Element}
* @return boolean true if exists and false in other case
*/
public boolean hasContainerWithContainerId(String containerId) {
List<Container> containers = getContainers();
Optional<Container> containerOptional = containers.stream()
.filter(container -> container.getId().equals(containerId))
.findAny();
return containerOptional.isPresent();
}
/**
>>>>>>> |
<<<<<<<
GPS_MODE(GpsMode.AUTO.name().toLowerCase(), "", "gps_mode", "gpsmode"),
GPS_COORDINATES("", "gps", "gps_coordinates", "gpscoordinates"),
POST_DIAGNOSTICS_FREQ ("10", "df", "post_diagnostics_freq", "postdiagnosticsfreq");
=======
GPS_MODE("", "", "", "gpsmode"),
GPS_COORDINATES(GpsMode.AUTO.name().toLowerCase(), "gps", "gps", "gpscoordinates");
>>>>>>>
GPS_MODE("", "", "", "gpsmode"),
GPS_COORDINATES(GpsMode.AUTO.name().toLowerCase(), "gps", "gps", "gpscoordinates"),
POST_DIAGNOSTICS_FREQ ("10", "df", "post_diagnostics_freq", "postdiagnosticsfreq"); |
<<<<<<<
FormMappingService getFormMappingService();
=======
BusinessDataRepository getBusinessDataRepository();
BusinessDataService getBusinessDataService();
BusinessDataModelRepository getBusinessDataModelRepository();
RefBusinessDataService getRefBusinessDataService();
>>>>>>>
FormMappingService getFormMappingService();
BusinessDataRepository getBusinessDataRepository();
BusinessDataService getBusinessDataService();
BusinessDataModelRepository getBusinessDataModelRepository();
RefBusinessDataService getRefBusinessDataService(); |
<<<<<<<
private final RefBusinessDataService refBusinessDataService;
=======
private FlowNodeStateManager stateManager;
>>>>>>>
private final RefBusinessDataService refBusinessDataService;
private FlowNodeStateManager stateManager;
<<<<<<<
final ExpressionResolverService expressionResolverService,
final DataInstanceService dataInstanceService, final TechnicalLoggerService logger, final TransientDataService transientDataService,
final ArchiveService archiveService, final ParentContainerResolver parentContainerResolver, RefBusinessDataService refBusinessDataService) {
=======
final ExpressionResolverService expressionResolverService, final DataInstanceService dataInstanceService, final TechnicalLoggerService logger,
final TransientDataService transientDataService, final ParentContainerResolver parentContainerResolver) {
>>>>>>>
final ExpressionResolverService expressionResolverService,
final DataInstanceService dataInstanceService, final TechnicalLoggerService logger, final TransientDataService transientDataService,
final ParentContainerResolver parentContainerResolver, RefBusinessDataService refBusinessDataService) { |
<<<<<<<
List<SWaitingEvent> waitingEvents = searchWaitingEvents(SWaitingEvent.class, queryOptions);
do {
for (final SWaitingEvent sWaitingEvent : waitingEvents) {
deleteWaitingEvent(sWaitingEvent);
}
waitingEvents = searchWaitingEvents(SWaitingEvent.class, queryOptions);
} while (waitingEvents.size() > 0);
=======
do {
for (final SWaitingEvent sWaitingEvent : waitingEvents) {
deleteWaitingEvent(sWaitingEvent);
}
queryOptions = new QueryOptions(0, 10, Collections.singletonList(orderByOption), filters, null);
waitingEvents = searchWaitingEvents(SWaitingEvent.class, queryOptions);
} while (waitingEvents.size() > 0);
} catch (final SBonitaReadException e) {
throw new SFlowNodeReadException(e); // To change body of catch statement use File | Settings | File Templates.
}
>>>>>>>
List<SWaitingEvent> waitingEvents = searchWaitingEvents(SWaitingEvent.class, queryOptions);
do {
for (final SWaitingEvent sWaitingEvent : waitingEvents) {
deleteWaitingEvent(sWaitingEvent);
}
waitingEvents = searchWaitingEvents(SWaitingEvent.class, queryOptions);
} while (waitingEvents.size() > 0);
<<<<<<<
=======
if (selectOne == null) {
throw new SMessageInstanceNotFoundException(messageInstanceId);
}
return selectOne;
}
@Override
public long getNumberOfEventTriggerInstances(final Class<? extends SEventTriggerInstance> entityClass, final QueryOptions countOptions)
throws SBonitaReadException {
return getPersistenceService().getNumberOfEntities(entityClass, countOptions, null);
>>>>>>>
<<<<<<<
public long getNumberOfTimerEventTriggerInstances(final long processInstanceId, final QueryOptions queryOptions) throws SBonitaSearchException {
try {
final Map<String, Object> parameters = Collections.singletonMap("processInstanceId", (Object) processInstanceId);
return getPersistenceService().getNumberOfEntities(STimerEventTriggerInstance.class, "ByProcessInstance", queryOptions, parameters);
} catch (final SBonitaReadException e) {
throw new SBonitaSearchException(e);
}
}
@Override
public List<STimerEventTriggerInstance> searchTimerEventTriggerInstances(final long processInstanceId, final QueryOptions queryOptions)
throws SBonitaSearchException {
try {
final Map<String, Object> parameters = Collections.singletonMap("processInstanceId", (Object) processInstanceId);
return getPersistenceService().searchEntity(STimerEventTriggerInstance.class, "ByProcessInstance", queryOptions, parameters);
} catch (final SBonitaReadException e) {
throw new SBonitaSearchException(e);
}
}
@Override
public <T extends SWaitingEvent> List<T> searchWaitingEvents(final Class<T> entityClass, final QueryOptions searchOptions) throws SBonitaSearchException {
try {
return getPersistenceService().searchEntity(entityClass, searchOptions, null);
} catch (final SBonitaReadException e) {
throw new SBonitaSearchException(e);
}
=======
public <T extends SWaitingEvent> List<T> searchWaitingEvents(final Class<T> entityClass, final QueryOptions searchOptions) throws SBonitaReadException {
return getPersistenceService().searchEntity(entityClass, searchOptions, null);
>>>>>>>
public long getNumberOfTimerEventTriggerInstances(final long processInstanceId, final QueryOptions queryOptions) throws SBonitaReadException {
final Map<String, Object> parameters = Collections.singletonMap("processInstanceId", (Object) processInstanceId);
return getPersistenceService().getNumberOfEntities(STimerEventTriggerInstance.class, "ByProcessInstance", queryOptions, parameters);
}
@Override
public List<STimerEventTriggerInstance> searchTimerEventTriggerInstances(final long processInstanceId, final QueryOptions queryOptions)
throws SBonitaReadException {
final Map<String, Object> parameters = Collections.singletonMap("processInstanceId", (Object) processInstanceId);
return getPersistenceService().searchEntity(STimerEventTriggerInstance.class, "ByProcessInstance", queryOptions, parameters);
}
@Override
public <T extends SWaitingEvent> List<T> searchWaitingEvents(final Class<T> entityClass, final QueryOptions searchOptions) throws SBonitaReadException {
return getPersistenceService().searchEntity(entityClass, searchOptions, null); |
<<<<<<<
.isEqualTo("SELECT testObj.* FROM test_object testObj WHERE (testObj.age < 25)");
}
=======
.isEqualTo("SELECT testObj.* FROM test_object testObj WHERE (testObj.age < :p1)");
assertThat(queryBuilder.getQueryParameters().get("p1")).isEqualTo(25);
}
>>>>>>>
.isEqualTo("SELECT testObj.* FROM test_object testObj WHERE (testObj.age < :p1)");
assertThat(queryBuilder.getQueryParameters().get("p1")).isEqualTo(25);
}
<<<<<<<
public void should_generate_query_with_less_or_equals_filter() throws Exception {
=======
public void should_getQueryFilters_append_OR_clause_when_wordSearch_is_enabled() {
final StringBuilder stringBuilder = new StringBuilder();
final QueryBuilder queryBuilder = createBaseQueryBuilder();
queryBuilder.buildLikeClauseForOneFieldOneTerm(stringBuilder, "myField", "foo", true);
assertThat(stringBuilder.toString())
.as("query should contains like to check if the field start with foo and if the field contains a word starting by foo")
.isEqualTo("myField LIKE :p1 ESCAPE '§' OR myField LIKE :p2 ESCAPE '§'");
assertThat(queryBuilder.getQueryParameters().get("p1")).isEqualTo("foo%");
assertThat(queryBuilder.getQueryParameters().get("p2")).isEqualTo("% foo%");
}
@Test
public void should_getQueryFilters_append_OR_clause_when_wordSearch_is_not_enabled() {
final StringBuilder stringBuilder = new StringBuilder();
final QueryBuilder queryBuilder = createBaseQueryBuilder();
queryBuilder.buildLikeClauseForOneFieldOneTerm(stringBuilder, "myField", "foo", false);
assertThat(stringBuilder.toString()).isEqualTo("myField LIKE :p1 ESCAPE '§'");
assertThat(queryBuilder.getQueryParameters().get("p1")).isEqualTo("foo%");
}
@Test
public void should_generate_query_with_less_or_equals_filter() {
>>>>>>>
public void should_generate_query_with_less_or_equals_filter() {
<<<<<<<
public void should_generate_query_with_parenthesis_filter() throws Exception {
=======
public void should_generate_query_with_in_filter() {
//given
QueryBuilder queryBuilder = createQueryBuilder("SELECT testObj.* FROM test_object testObj");
//when
FilterOption age = new FilterOption(TestObject.class, "age");
final List<Integer> inValues = Arrays.asList(25, 26, 27);
age.setIn(inValues);
age.setFilterOperationType(FilterOperationType.IN);
queryBuilder.appendFilters(Collections.singletonList(age), null,
false);
//then
assertThat(queryBuilder.getQuery())
.isEqualTo("SELECT testObj.* FROM test_object testObj WHERE (testObj.age IN (:p1))");
assertThat(queryBuilder.getQueryParameters().get("p1")).isEqualTo(inValues);
}
@Test
public void should_generate_query_with_parenthesis_filter() {
>>>>>>>
public void should_generate_query_with_parenthesis_filter() { |
<<<<<<<
import java.lang.reflect.Method;
=======
import java.lang.reflect.UndeclaredThrowableException;
>>>>>>>
import java.lang.reflect.Method;
import java.lang.reflect.UndeclaredThrowableException;
<<<<<<<
private final boolean cleanSession;
=======
private TechnicalLoggerService technicalLogger;
>>>>>>>
private final boolean cleanSession;
private TechnicalLoggerService technicalLogger;
<<<<<<<
try {
sessionAccessor = beforeInvokeMethod(options, apiInterfaceName);
final Session session = (Session) options.get("session");
return invokeAPI(apiInterfaceName, methodName, classNameParameters, parametersValues, session);
} catch (final ServerAPIRuntimeException e) {
throw e.getCause();
}
} catch (final BonitaRuntimeException e) {
throw new ServerWrappedException(e);
} catch (final BonitaException e) {
=======
sessionAccessor = beforeInvokeMethod(options, apiInterfaceName);
return invokeAPI(apiInterfaceName, methodName, classNameParameters, parametersValues);
} catch (final UndeclaredThrowableException e) {
if (technicalLogger != null && technicalLogger.isLoggable(this.getClass(), TechnicalLogSeverity.DEBUG)) {
technicalLogger.log(this.getClass(), TechnicalLogSeverity.DEBUG, e);
}
throw new ServerWrappedException(e);
} catch (final ServerWrappedException e) {
throw e;
} catch (final Exception e) {
>>>>>>>
try {
sessionAccessor = beforeInvokeMethod(options, apiInterfaceName);
final Session session = (Session) options.get("session");
return invokeAPI(apiInterfaceName, methodName, classNameParameters, parametersValues, session);
} catch (final ServerAPIRuntimeException e) {
throw e.getCause();
}
} catch (final BonitaRuntimeException e) {
throw new ServerWrappedException(e);
} catch (final BonitaException e) {
throw new ServerWrappedException(e);
} catch (final UndeclaredThrowableException e) {
if (technicalLogger != null && technicalLogger.isLoggable(this.getClass(), TechnicalLogSeverity.DEBUG)) {
technicalLogger.log(this.getClass(), TechnicalLogSeverity.DEBUG, e);
}
<<<<<<<
private SessionType getSessionType(final Session session) {
=======
private Session getSession(final Map<String, Serializable> options) {
return (Session) options.get("session");
}
private SessionType getSessionType(final Session session) throws ServerWrappedException {
>>>>>>>
private SessionType getSessionType(final Session session) { |
<<<<<<<
=======
private final ServerAPIImpl apiImpl;
>>>>>>>
<<<<<<<
this.serverApi = serverApi;
// System.out.println(this.getClass().getSimpleName() + " - " + this.getName() + "starting...");
=======
this.apiImpl = apiImpl;
// System.out.println(this.getClass().getSimpleName() + " - " + this.getName() + "starting...");
>>>>>>>
this.serverApi = serverApi;
// System.out.println(this.getClass().getSimpleName() + " - " + this.getName() + "starting...");
<<<<<<<
// System.out.println(this.getClass().getSimpleName() + " - " + this.getName() + "got an exception during the invokeMethod: " + e.getClass() + ": "
// + e.getMessage());
e.printStackTrace();
return e;
=======
// System.out.println(this.getClass().getSimpleName() + " - " + this.getName() + "got an exception during the invokeMethod: " + e.getClass() + ": "
// + e.getMessage());
return StackTraceTransformer.mergeStackTraces(e);
>>>>>>>
// System.out.println(this.getClass().getSimpleName() + " - " + this.getName() + "got an exception during the invokeMethod: " + e.getClass() + ": "
// + e.getMessage());
return StackTraceTransformer.mergeStackTraces(e); |
<<<<<<<
=======
@Test
public void getNumberOfSProcessInstanceFailed_should_return_number_of_distinct_process_instances() {
// Given
repository.add(buildFailedProcessInstance(1));
final SProcessInstanceImpl processInstanceWithFailedFlowNode = new SProcessInstanceImpl("process2", 10L);
processInstanceWithFailedFlowNode.setId(2);
processInstanceWithFailedFlowNode.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
repository.add(processInstanceWithFailedFlowNode);
repository.add(buildFailedGateway(852, processInstanceWithFailedFlowNode.getId()));
final SProcessInstanceImpl failedProcessInstanceWithFailedFlowNode = repository.add(buildFailedProcessInstance(3));
repository.add(buildFailedGateway(56, failedProcessInstanceWithFailedFlowNode.getId()));
// When
final long numberOfSProcessInstanceFailed = repository.getNumberOfSProcessInstanceFailed();
// Then
assertEquals(3, numberOfSProcessInstanceFailed);
}
@Test
public void getNumberOfSProcessInstanceFailed_should_return_number_of_failed_process_instances() {
// Given
repository.add(buildFailedProcessInstance(1));
// When
final long numberOfSProcessInstanceFailed = repository.getNumberOfSProcessInstanceFailed();
// Then
assertEquals(1, numberOfSProcessInstanceFailed);
}
@Test
public void getNumberOfSProcessInstanceFailed_should_return_number_of_process_instances_with_failed_flow_nodes() {
// Given
final SProcessInstanceImpl processInstanceWithFailedFlowNode = new SProcessInstanceImpl("process2", 10L);
processInstanceWithFailedFlowNode.setId(2);
processInstanceWithFailedFlowNode.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
repository.add(processInstanceWithFailedFlowNode);
repository.add(buildFailedGateway(1, processInstanceWithFailedFlowNode.getId()));
// When
final long numberOfSProcessInstanceFailed = repository.getNumberOfSProcessInstanceFailed();
// Then
assertEquals(1, numberOfSProcessInstanceFailed);
}
@Test
public void searchSProcessInstanceFailed_return_distinct_process_instances() {
// Given
final SProcessInstanceImpl failedProcessInstance = repository.add(buildFailedProcessInstance(1));
final SProcessInstanceImpl processInstanceWithFailedFlowNode = new SProcessInstanceImpl("process2", 10L);
processInstanceWithFailedFlowNode.setId(2);
processInstanceWithFailedFlowNode.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
repository.add(processInstanceWithFailedFlowNode);
repository.add(buildFailedGateway(1, processInstanceWithFailedFlowNode.getId()));
final SProcessInstanceImpl failedProcessInstanceWithFailedFlowNode = repository.add(buildFailedProcessInstance(3));
repository.add(buildFailedGateway(2, failedProcessInstanceWithFailedFlowNode.getId()));
// When
final List<SProcessInstance> failedSProcessInstance = repository.searchSProcessInstanceFailed();
// Then
assertEquals(3, failedSProcessInstance.size());
assertEquals(failedProcessInstance, failedSProcessInstance.get(0));
assertEquals(processInstanceWithFailedFlowNode, failedSProcessInstance.get(1));
assertEquals(failedProcessInstanceWithFailedFlowNode, failedSProcessInstance.get(2));
}
@Test
public void searchSProcessInstanceFailed_return_failed_process_instances() {
// Given
final SProcessInstanceImpl failedProcessInstance = repository.add(buildFailedProcessInstance(1));
// When
final List<SProcessInstance> failedSProcessInstance = repository.searchSProcessInstanceFailed();
// Then
assertEquals(1, failedSProcessInstance.size());
assertEquals(failedProcessInstance, failedSProcessInstance.get(0));
}
@Test
public void searchSProcessInstanceFailed_return_process_instances_with_failed_flow_nodes() {
// Given
final SProcessInstanceImpl processInstanceWithFailedFlowNode = new SProcessInstanceImpl("process2", 10L);
processInstanceWithFailedFlowNode.setId(2);
processInstanceWithFailedFlowNode.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
repository.add(processInstanceWithFailedFlowNode);
repository.add(buildFailedGateway(1, processInstanceWithFailedFlowNode.getId()));
// When
final List<SProcessInstance> failedSProcessInstance = repository.searchSProcessInstanceFailed();
// Then
assertEquals(1, failedSProcessInstance.size());
assertEquals(processInstanceWithFailedFlowNode, failedSProcessInstance.get(0));
}
private SGatewayInstanceImpl buildFailedGateway(final long gatewayId, final long parentProcessInstanceId) {
final SGatewayInstanceImpl sGatewayInstanceImpl = new SGatewayInstanceImpl();
sGatewayInstanceImpl.setId(gatewayId);
sGatewayInstanceImpl.setStateId(3);
sGatewayInstanceImpl.setLogicalGroup(3, parentProcessInstanceId);
sGatewayInstanceImpl.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
return sGatewayInstanceImpl;
}
private SProcessInstanceImpl buildFailedProcessInstance(final long processInstanceId) {
final SProcessInstanceImpl sProcessInstance = new SProcessInstanceImpl("process" + processInstanceId, 9L);
sProcessInstance.setId(processInstanceId);
sProcessInstance.setStateId(7);
sProcessInstance.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
return sProcessInstance;
}
>>>>>>>
@Test
public void getNumberOfSProcessInstanceFailed_should_return_number_of_distinct_process_instances() {
// Given
repository.add(buildFailedProcessInstance(1));
final SProcessInstanceImpl processInstanceWithFailedFlowNode = new SProcessInstanceImpl("process2", 10L);
processInstanceWithFailedFlowNode.setId(2);
processInstanceWithFailedFlowNode.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
repository.add(processInstanceWithFailedFlowNode);
repository.add(buildFailedGateway(852, processInstanceWithFailedFlowNode.getId()));
final SProcessInstanceImpl failedProcessInstanceWithFailedFlowNode = repository.add(buildFailedProcessInstance(3));
repository.add(buildFailedGateway(56, failedProcessInstanceWithFailedFlowNode.getId()));
// When
final long numberOfSProcessInstanceFailed = repository.getNumberOfSProcessInstanceFailed();
// Then
assertEquals(3, numberOfSProcessInstanceFailed);
}
@Test
public void getNumberOfSProcessInstanceFailed_should_return_number_of_failed_process_instances() {
// Given
repository.add(buildFailedProcessInstance(1));
// When
final long numberOfSProcessInstanceFailed = repository.getNumberOfSProcessInstanceFailed();
// Then
assertEquals(1, numberOfSProcessInstanceFailed);
}
@Test
public void getNumberOfSProcessInstanceFailed_should_return_number_of_process_instances_with_failed_flow_nodes() {
// Given
final SProcessInstanceImpl processInstanceWithFailedFlowNode = new SProcessInstanceImpl("process2", 10L);
processInstanceWithFailedFlowNode.setId(2);
processInstanceWithFailedFlowNode.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
repository.add(processInstanceWithFailedFlowNode);
repository.add(buildFailedGateway(1, processInstanceWithFailedFlowNode.getId()));
// When
final long numberOfSProcessInstanceFailed = repository.getNumberOfSProcessInstanceFailed();
// Then
assertEquals(1, numberOfSProcessInstanceFailed);
}
@Test
public void searchSProcessInstanceFailed_return_distinct_process_instances() {
// Given
final SProcessInstanceImpl failedProcessInstance = repository.add(buildFailedProcessInstance(1));
final SProcessInstanceImpl processInstanceWithFailedFlowNode = new SProcessInstanceImpl("process2", 10L);
processInstanceWithFailedFlowNode.setId(2);
processInstanceWithFailedFlowNode.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
repository.add(processInstanceWithFailedFlowNode);
repository.add(buildFailedGateway(1, processInstanceWithFailedFlowNode.getId()));
final SProcessInstanceImpl failedProcessInstanceWithFailedFlowNode = repository.add(buildFailedProcessInstance(3));
repository.add(buildFailedGateway(2, failedProcessInstanceWithFailedFlowNode.getId()));
// When
final List<SProcessInstance> failedSProcessInstance = repository.searchSProcessInstanceFailed();
// Then
assertEquals(3, failedSProcessInstance.size());
assertEquals(failedProcessInstance, failedSProcessInstance.get(0));
assertEquals(processInstanceWithFailedFlowNode, failedSProcessInstance.get(1));
assertEquals(failedProcessInstanceWithFailedFlowNode, failedSProcessInstance.get(2));
}
@Test
public void searchSProcessInstanceFailed_return_failed_process_instances() {
// Given
final SProcessInstanceImpl failedProcessInstance = repository.add(buildFailedProcessInstance(1));
// When
final List<SProcessInstance> failedSProcessInstance = repository.searchSProcessInstanceFailed();
// Then
assertEquals(1, failedSProcessInstance.size());
assertEquals(failedProcessInstance, failedSProcessInstance.get(0));
}
@Test
public void searchSProcessInstanceFailed_return_process_instances_with_failed_flow_nodes() {
// Given
final SProcessInstanceImpl processInstanceWithFailedFlowNode = new SProcessInstanceImpl("process2", 10L);
processInstanceWithFailedFlowNode.setId(2);
processInstanceWithFailedFlowNode.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
repository.add(processInstanceWithFailedFlowNode);
repository.add(buildFailedGateway(1, processInstanceWithFailedFlowNode.getId()));
// When
final List<SProcessInstance> failedSProcessInstance = repository.searchSProcessInstanceFailed();
// Then
assertEquals(1, failedSProcessInstance.size());
assertEquals(processInstanceWithFailedFlowNode, failedSProcessInstance.get(0));
}
private SGatewayInstanceImpl buildFailedGateway(final long gatewayId, final long parentProcessInstanceId) {
final SGatewayInstanceImpl sGatewayInstanceImpl = new SGatewayInstanceImpl();
sGatewayInstanceImpl.setId(gatewayId);
sGatewayInstanceImpl.setStateId(3);
sGatewayInstanceImpl.setLogicalGroup(3, parentProcessInstanceId);
sGatewayInstanceImpl.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
return sGatewayInstanceImpl;
}
private SProcessInstanceImpl buildFailedProcessInstance(final long processInstanceId) {
final SProcessInstanceImpl sProcessInstance = new SProcessInstanceImpl("process" + processInstanceId, 9L);
sProcessInstance.setId(processInstanceId);
sProcessInstance.setStateId(7);
sProcessInstance.setTenantId(PersistentObjectBuilder.DEFAULT_TENANT_ID);
return sProcessInstance;
} |
<<<<<<<
final TenantServiceAccessor tenantAccessor = getTenantAccessor();
final ActivityInstanceService activityInstanceService = tenantAccessor.getActivityInstanceService();
try {
final ProcessInstance processInstance = getProcessInstance(processInstanceId);
if (isUserProcessInstanceInitiator(userId, processInstance)) {
return true;
}
if (isUserManagerOfProcessInstanceInitiator(userId, processInstance.getStartedBy())) {
return true;
}
final List<OrderByOption> archivedOrderByOptions = Arrays.asList(new OrderByOption(SAHumanTaskInstance.class, "id", OrderByType.ASC));
final List<FilterOption> archivedFilterOptions = Arrays.asList(new FilterOption(SAHumanTaskInstance.class, "logicalGroup4", processInstanceId));
QueryOptions archivedQueryOptions = new QueryOptions(0, BATCH_SIZE, archivedOrderByOptions, archivedFilterOptions, null);
List<SAHumanTaskInstance> sArchivedHumanTasks = activityInstanceService.searchArchivedTasks(archivedQueryOptions);
while (!sArchivedHumanTasks.isEmpty()) {
for (final SAHumanTaskInstance sArchivedHumanTask : sArchivedHumanTasks) {
if (userId == sArchivedHumanTask.getAssigneeId()) {
return true;
}
}
archivedQueryOptions = QueryOptions.getNextPage(archivedQueryOptions);
sArchivedHumanTasks = activityInstanceService.searchArchivedTasks(archivedQueryOptions);
}
final List<OrderByOption> orderByOptions = Arrays.asList(new OrderByOption(SHumanTaskInstance.class, "id", OrderByType.ASC));
final List<FilterOption> filterOptions = Arrays.asList(new FilterOption(SHumanTaskInstance.class, "logicalGroup4", processInstanceId));
QueryOptions queryOptions = new QueryOptions(0, BATCH_SIZE, orderByOptions, filterOptions, null);
List<SHumanTaskInstance> sHumanTaskInstances = activityInstanceService.searchHumanTasks(queryOptions);
while (!sHumanTaskInstances.isEmpty()) {
for (final SHumanTaskInstance sHumanTaskInstance : sHumanTaskInstances) {
if (userId == sHumanTaskInstance.getAssigneeId()) {
return true;
}
if (checkIfUserIsActorMemberOrManagerOfActorMember(userId,
sHumanTaskInstance.getActorId())) {
return true;
}
}
queryOptions = QueryOptions.getNextPage(queryOptions);
sHumanTaskInstances = activityInstanceService.searchHumanTasks(queryOptions);
}
// search in archived human tasks
checkIfProcessInstanceExistsWhenNoHumanTask(processInstanceId);
return false;
} catch (final SBonitaException e) {
// no rollback, read only method
throw new BonitaRuntimeException(e);// TODO refactor Exceptions!!!!!!!!!!!!!!!!!!!
}
}
private boolean isUserManagerOfProcessInstanceInitiator(final long userId, final long startedByUserId) {
final IdentityService identityService = getTenantAccessor().getIdentityService();
SUser sUser;
try {
sUser = identityService.getUser(startedByUserId);
} catch (final SUserNotFoundException e) {
return false;
}
if (userId == sUser.getManagerUserId()) {
return true;
}
return false;
}
private boolean isUserProcessInstanceInitiator(final long userId, final ProcessInstance processInstance) {
return userId == processInstance.getStartedBy();
}
private void checkIfProcessInstanceExistsWhenNoHumanTask(final long processInstanceId) throws SBonitaReadException, SProcessInstanceReadException,
ProcessInstanceNotFoundException {
final TenantServiceAccessor tenantAccessor = getTenantAccessor();
final ActivityInstanceService activityInstanceService = tenantAccessor.getActivityInstanceService();
final List<FilterOption> filterOptions = Arrays.asList(new FilterOption(SHumanTaskInstance.class, "logicalGroup4", processInstanceId));
final QueryOptions queryOptions = new QueryOptions(filterOptions, null);
if (activityInstanceService.getNumberOfHumanTasks(queryOptions) == 0) {
// check if the process exists in case of there is no results
try {
tenantAccessor.getProcessInstanceService().getProcessInstance(processInstanceId);
} catch (final SProcessInstanceNotFoundException e) {
throw new ProcessInstanceNotFoundException(processInstanceId);
=======
return new ProcessInvolvementAPIImpl(this).isInvolvedInProcessInstance(userId, processInstanceId);
>>>>>>>
return new ProcessInvolvementAPIImpl(this).isInvolvedInProcessInstance(userId, processInstanceId);
<<<<<<<
tenantAccessor.getTechnicalLoggerService(), tenantAccessor.getTokenService(), tenantAccessor.getParentContainerResolver(),
tenantAccessor.getRefBusinessDataService());
=======
tenantAccessor.getTechnicalLoggerService(), tenantAccessor.getProcessInstanceService(), tenantAccessor.getParentContainerResolver());
>>>>>>>
tenantAccessor.getTechnicalLoggerService(), tenantAccessor.getProcessInstanceService(), tenantAccessor.getParentContainerResolver());
tenantAccessor.getTechnicalLoggerService(), tenantAccessor.getTokenService(), tenantAccessor.getParentContainerResolver(),
tenantAccessor.getRefBusinessDataService()); |
<<<<<<<
import org.bonitasoft.engine.api.PageAPI;
import org.bonitasoft.engine.api.TenantAPIAccessor;
=======
import com.bonitasoft.engine.BPMTestSPUtil;
import com.bonitasoft.engine.CommonAPISPIT;
import com.bonitasoft.engine.api.ProcessConfigurationAPI;
>>>>>>>
import org.bonitasoft.engine.api.PageAPI;
import org.bonitasoft.engine.api.TenantAPIAccessor;
import com.bonitasoft.engine.BPMTestSPUtil;
import com.bonitasoft.engine.CommonAPISPIT;
import com.bonitasoft.engine.api.ProcessConfigurationAPI; |
<<<<<<<
=======
@Test(expected = RetrieveException.class)
public void getConnectorsImplementations_should_throw__exception() throws Exception {
//given
final SConnectorException sConnectorException = new SConnectorException("message");
doThrow(sConnectorException).when(connectorService).getConnectorImplementations(anyLong(), anyLong(),
anyInt(), anyInt(), anyString(),
any(OrderByType.class));
//when then exception
processAPI.getConnectorImplementations(PROCESS_DEFINITION_ID, START_INDEX, MAX_RESULT, CONNECTOR_CRITERION_DEFINITION_ID_ASC);
}
@Test(expected = RetrieveException.class)
public void getNumberOfConnectorImplementations_should_throw__exception() throws Exception {
//given
final SConnectorException sConnectorException = new SConnectorException("message");
doThrow(sConnectorException).when(connectorService).getNumberOfConnectorImplementations(anyLong(), anyLong());
//when then exception
processAPI.getNumberOfConnectorImplementations(PROCESS_DEFINITION_ID);
}
@Test
public void getConnectorsImplementations_should_return_list() throws Exception {
//given
final List<SConnectorImplementationDescriptor> sConnectorImplementationDescriptors = createConnectorList();
doReturn(sConnectorImplementationDescriptors).when(connectorService).getConnectorImplementations(anyLong(), anyLong(),
anyInt(), anyInt(), anyString(),
any(OrderByType.class));
//when
final List<ConnectorImplementationDescriptor> connectorImplementations = processAPI.getConnectorImplementations(PROCESS_DEFINITION_ID, START_INDEX,
MAX_RESULT, CONNECTOR_CRITERION_DEFINITION_ID_ASC);
//then
assertThat(connectorImplementations).as("should return connectore implementation").hasSameSizeAs(sConnectorImplementationDescriptors);
}
@Test
public void getNumberOfConnectorImplementations_should_return_count() throws Exception {
//given
final List<SConnectorImplementationDescriptor> sConnectorImplementationDescriptors = createConnectorList();
doReturn((long) sConnectorImplementationDescriptors.size()).when(connectorService)
.getNumberOfConnectorImplementations(PROCESS_DEFINITION_ID, TENANT_ID);
//when
final long numberOfConnectorImplementations = processAPI.getNumberOfConnectorImplementations(PROCESS_DEFINITION_ID);
//then
assertThat(numberOfConnectorImplementations).as("should return count").isEqualTo(sConnectorImplementationDescriptors.size());
}
private List<SConnectorImplementationDescriptor> createConnectorList() {
final List<SConnectorImplementationDescriptor> sConnectorImplementationDescriptors = new ArrayList<SConnectorImplementationDescriptor>();
final SConnectorImplementationDescriptor sConnectorImplementationDescriptor = new SConnectorImplementationDescriptor("className", "id", "version",
"definitionId", "definitionVersion", new JarDependencies(Arrays.asList("dep1", "dep2")));
sConnectorImplementationDescriptors.add(sConnectorImplementationDescriptor);
sConnectorImplementationDescriptors.add(sConnectorImplementationDescriptor);
sConnectorImplementationDescriptors.add(sConnectorImplementationDescriptor);
return sConnectorImplementationDescriptors;
}
@Test
public void evaluateExpressionsOnCompletedActivityInstance_should_call_getLastArchivedProcessInstance_using_parentProcessInstanceId() throws Exception {
//given
final ArchivedActivityInstance activityInstance = mock(ArchivedActivityInstance.class);
when(activityInstance.getProcessInstanceId()).thenReturn(PROCESS_INSTANCE_ID);
when(activityInstance.getArchiveDate()).thenReturn(new Date());
doReturn(activityInstance).when(processAPI).getArchivedActivityInstance(FLOW_NODE_INSTANCE_ID);
final ArchivedProcessInstance procInst = mock(ArchivedProcessInstance.class);
when(procInst.getProcessDefinitionId()).thenReturn(1000L);
doReturn(procInst).when(processAPI).getLastArchivedProcessInstance(anyLong());
//when
processAPI.evaluateExpressionsOnCompletedActivityInstance(FLOW_NODE_INSTANCE_ID, new HashMap<Expression, Map<String, Serializable>>());
//then
verify(processAPI).getLastArchivedProcessInstance(PROCESS_INSTANCE_ID);
verify(activityInstance, never()).getParentContainerId();
verify(activityInstance, never()).getParentActivityInstanceId();
verify(activityInstance, never()).getRootContainerId();
}
@Test
public void purgeClassLoader_should_call_delegate() throws Exception {
processAPI.purgeClassLoader(45L);
verify(managementAPIImplDelegate).purgeClassLoader(45L);
}
@Test(expected = UpdateException.class)
public void updateDueDateOfTask_should_throw_exception_when_date_is_null() throws Exception {
processAPI.updateDueDateOfTask(123456789L, null);
}
>>>>>>>
@Test(expected = RetrieveException.class)
public void getConnectorsImplementations_should_throw__exception() throws Exception {
//given
final SConnectorException sConnectorException = new SConnectorException("message");
doThrow(sConnectorException).when(connectorService).getConnectorImplementations(anyLong(), anyLong(),
anyInt(), anyInt(), anyString(),
any(OrderByType.class));
//when then exception
processAPI.getConnectorImplementations(PROCESS_DEFINITION_ID, START_INDEX, MAX_RESULT, CONNECTOR_CRITERION_DEFINITION_ID_ASC);
}
@Test(expected = RetrieveException.class)
public void getNumberOfConnectorImplementations_should_throw__exception() throws Exception {
//given
final SConnectorException sConnectorException = new SConnectorException("message");
doThrow(sConnectorException).when(connectorService).getNumberOfConnectorImplementations(anyLong(), anyLong());
//when then exception
processAPI.getNumberOfConnectorImplementations(PROCESS_DEFINITION_ID);
}
@Test
public void getConnectorsImplementations_should_return_list() throws Exception {
//given
final List<SConnectorImplementationDescriptor> sConnectorImplementationDescriptors = createConnectorList();
doReturn(sConnectorImplementationDescriptors).when(connectorService).getConnectorImplementations(anyLong(), anyLong(),
anyInt(), anyInt(), anyString(),
any(OrderByType.class));
//when
final List<ConnectorImplementationDescriptor> connectorImplementations = processAPI.getConnectorImplementations(PROCESS_DEFINITION_ID, START_INDEX,
MAX_RESULT, CONNECTOR_CRITERION_DEFINITION_ID_ASC);
//then
assertThat(connectorImplementations).as("should return connectore implementation").hasSameSizeAs(sConnectorImplementationDescriptors);
}
@Test
public void getNumberOfConnectorImplementations_should_return_count() throws Exception {
//given
final List<SConnectorImplementationDescriptor> sConnectorImplementationDescriptors = createConnectorList();
doReturn((long) sConnectorImplementationDescriptors.size()).when(connectorService)
.getNumberOfConnectorImplementations(PROCESS_DEFINITION_ID, TENANT_ID);
//when
final long numberOfConnectorImplementations = processAPI.getNumberOfConnectorImplementations(PROCESS_DEFINITION_ID);
//then
assertThat(numberOfConnectorImplementations).as("should return count").isEqualTo(sConnectorImplementationDescriptors.size());
}
private List<SConnectorImplementationDescriptor> createConnectorList() {
final List<SConnectorImplementationDescriptor> sConnectorImplementationDescriptors = new ArrayList<SConnectorImplementationDescriptor>();
final SConnectorImplementationDescriptor sConnectorImplementationDescriptor = new SConnectorImplementationDescriptor("className", "id", "version",
"definitionId", "definitionVersion", new JarDependencies(Arrays.asList("dep1", "dep2")));
sConnectorImplementationDescriptors.add(sConnectorImplementationDescriptor);
sConnectorImplementationDescriptors.add(sConnectorImplementationDescriptor);
sConnectorImplementationDescriptors.add(sConnectorImplementationDescriptor);
return sConnectorImplementationDescriptors;
}
@Test
public void evaluateExpressionsOnCompletedActivityInstance_should_call_getLastArchivedProcessInstance_using_parentProcessInstanceId() throws Exception {
//given
final long processInstanceId = 21L;
final long activityInstanceId = 5L;
final ArchivedActivityInstance activityInstance = mock(ArchivedActivityInstance.class);
when(activityInstance.getProcessInstanceId()).thenReturn(processInstanceId);
when(activityInstance.getArchiveDate()).thenReturn(new Date());
doReturn(activityInstance).when(processAPI).getArchivedActivityInstance(activityInstanceId);
final ArchivedProcessInstance procInst = mock(ArchivedProcessInstance.class);
when(procInst.getProcessDefinitionId()).thenReturn(1000L);
doReturn(procInst).when(processAPI).getLastArchivedProcessInstance(anyLong());
//when
processAPI.evaluateExpressionsOnCompletedActivityInstance(activityInstanceId, new HashMap<Expression, Map<String, Serializable>>());
//then
verify(processAPI).getLastArchivedProcessInstance(processInstanceId);
verify(activityInstance, never()).getParentContainerId();
verify(activityInstance, never()).getParentActivityInstanceId();
verify(activityInstance, never()).getRootContainerId();
}
@Test
public void purgeClassLoader_should_call_delegate() throws Exception {
processAPI.purgeClassLoader(45L);
verify(managementAPIImplDelegate).purgeClassLoader(45L);
} |
<<<<<<<
if(terminal.isCommandRequest()) {
=======
if (terminal.isCommandRequest()) {
>>>>>>>
if (terminal.isCommandRequest()) {
<<<<<<<
if(welcomeMessage != null) {
=======
if (welcomeMessage != null) {
>>>>>>>
if (welcomeMessage != null) {
<<<<<<<
if(terminal.isEscape()) {
writer.writeText(welcomeMessage, null);
} else {
writer.write(welcomeMessage);
}
=======
if (terminal.isEscape()) {
writer.writeText(welcomeMessage, null);
}
else {
writer.write(welcomeMessage);
}
>>>>>>>
if (terminal.isEscape()) {
writer.writeText(welcomeMessage, null);
else {
}
writer.write(welcomeMessage);
}
<<<<<<<
if(terminal.isEscape()) {
writer.writeText(prompt, null);
} else {
writer.write(prompt);
}
=======
if (terminal.isEscape()) {
writer.writeText(prompt, null);
}
else {
writer.write(prompt);
}
>>>>>>>
if (terminal.isEscape()) {
writer.writeText(prompt, null);
}
writer.write(prompt);
else {
} |
<<<<<<<
=======
import com.bonitasoft.engine.api.APIClient;
import com.bonitasoft.engine.api.IdentityAPI;
import com.bonitasoft.engine.api.PlatformAPI;
import com.bonitasoft.engine.api.PlatformAPIAccessor;
import com.bonitasoft.engine.api.ProcessAPI;
import com.bonitasoft.engine.api.TenantAPIAccessor;
import com.bonitasoft.engine.api.TenantManagementAPI;
import com.bonitasoft.engine.api.TenantStatusException;
import com.bonitasoft.engine.bpm.flownode.ArchivedProcessInstancesSearchDescriptor;
import com.bonitasoft.engine.bpm.process.impl.ProcessDefinitionBuilderExt;
import com.bonitasoft.engine.bpm.process.impl.ProcessInstanceSearchDescriptor;
import com.bonitasoft.engine.platform.TenantActivationException;
import com.bonitasoft.engine.platform.TenantCreator;
import com.bonitasoft.engine.platform.TenantDeactivationException;
import com.bonitasoft.engine.platform.TenantNotFoundException;
>>>>>>>
import com.bonitasoft.engine.api.APIClient;
import com.bonitasoft.engine.api.IdentityAPI; |
<<<<<<<
/*******************************************************************************
* Copyright (C) 2013 BonitaSoft S.A.
* BonitaSoft is a trademark of BonitaSoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package com.bonitasoft.engine;
import org.bonitasoft.engine.BonitaSuiteRunner;
import org.bonitasoft.engine.BonitaSuiteRunner.Initializer;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
import com.bonitasoft.engine.activity.MultiInstanceTest;
import com.bonitasoft.engine.business.data.BDRepositoryIT;
import com.bonitasoft.engine.command.ExecuteBDMQueryCommandIT;
import com.bonitasoft.engine.connector.RemoteConnectorExecutionTestSP;
import com.bonitasoft.engine.external.ExternalCommandsTestSP;
import com.bonitasoft.engine.log.LogTest;
import com.bonitasoft.engine.monitoring.MonitoringAPITest;
import com.bonitasoft.engine.monitoring.PlatformMonitoringAPITest;
import com.bonitasoft.engine.page.PageAPIIT;
import com.bonitasoft.engine.platform.NodeAPITest;
import com.bonitasoft.engine.process.ProcessTests;
import com.bonitasoft.engine.profile.ProfileTests;
import com.bonitasoft.engine.reporting.ReportingAPIIT;
import com.bonitasoft.engine.search.SearchEntitiesTests;
@RunWith(BonitaSuiteRunner.class)
@SuiteClasses({
// SPIdentityTests.class, // slow execution test suite only
// SPProcessManagementTest.class, // slow execution test suite only
PageAPIIT.class,
TenantRemoteTestSpITest.class,
NodeAPITest.class,
LogTest.class,
ExternalCommandsTestSP.class,
MultiInstanceTest.class,
ProcessTests.class,
ProfileTests.class,
RemoteConnectorExecutionTestSP.class,
MonitoringAPITest.class,
SearchEntitiesTests.class,
ReportingAPIIT.class,
PlatformMonitoringAPITest.class,
TenantTest.class,
BDRepositoryIT.class,
ExecuteBDMQueryCommandIT.class
})
@Initializer(TestsInitializerSP.class)
public class BPMRemoteSPTests {
}
=======
/*******************************************************************************
* Copyright (C) 2013 BonitaSoft S.A.
* BonitaSoft is a trademark of BonitaSoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package com.bonitasoft.engine;
import org.bonitasoft.engine.BonitaSuiteRunner;
import org.bonitasoft.engine.BonitaSuiteRunner.Initializer;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
import com.bonitasoft.engine.activity.MultiInstanceTest;
import com.bonitasoft.engine.business.data.BDRepositoryIT;
import com.bonitasoft.engine.command.ExecuteBDMQueryCommandIT;
import com.bonitasoft.engine.connector.RemoteConnectorExecutionTestSP;
import com.bonitasoft.engine.external.ExternalCommandsTestSP;
import com.bonitasoft.engine.log.LogTest;
import com.bonitasoft.engine.monitoring.MonitoringAPITest;
import com.bonitasoft.engine.monitoring.PlatformMonitoringAPITest;
import com.bonitasoft.engine.platform.NodeAPITest;
import com.bonitasoft.engine.process.ProcessTests;
import com.bonitasoft.engine.profile.ProfileTests;
import com.bonitasoft.engine.reporting.ReportingAPIIT;
import com.bonitasoft.engine.search.SearchEntitiesTests;
import com.bonitasoft.engine.supervisor.SupervisedTests;
@RunWith(BonitaSuiteRunner.class)
@SuiteClasses({
// SPIdentityTests.class, // slow execution test suite only
// SPProcessManagementTest.class, // slow execution test suite only
NodeAPITest.class,
LogTest.class,
ExternalCommandsTestSP.class,
MultiInstanceTest.class,
ProcessTests.class,
SupervisedTests.class,
ProfileTests.class,
RemoteConnectorExecutionTestSP.class,
MonitoringAPITest.class,
SearchEntitiesTests.class,
ReportingAPIIT.class,
PlatformMonitoringAPITest.class,
TenantTest.class,
BDRepositoryIT.class,
ExecuteBDMQueryCommandIT.class
})
@Initializer(TestsInitializerSP.class)
public class BPMRemoteSPTests {
}
>>>>>>>
/*******************************************************************************
* Copyright (C) 2013 BonitaSoft S.A.
* BonitaSoft is a trademark of BonitaSoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package com.bonitasoft.engine;
import org.bonitasoft.engine.BonitaSuiteRunner;
import org.bonitasoft.engine.BonitaSuiteRunner.Initializer;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
import com.bonitasoft.engine.activity.MultiInstanceTest;
import com.bonitasoft.engine.business.data.BDRepositoryIT;
import com.bonitasoft.engine.command.ExecuteBDMQueryCommandIT;
import com.bonitasoft.engine.connector.RemoteConnectorExecutionTestSP;
import com.bonitasoft.engine.external.ExternalCommandsTestSP;
import com.bonitasoft.engine.log.LogTest;
import com.bonitasoft.engine.monitoring.MonitoringAPITest;
import com.bonitasoft.engine.monitoring.PlatformMonitoringAPITest;
import com.bonitasoft.engine.page.PageAPIIT;
import com.bonitasoft.engine.platform.NodeAPITest;
import com.bonitasoft.engine.process.ProcessTests;
import com.bonitasoft.engine.profile.ProfileTests;
import com.bonitasoft.engine.reporting.ReportingAPIIT;
import com.bonitasoft.engine.search.SearchEntitiesTests;
import com.bonitasoft.engine.supervisor.SupervisedTests;
@RunWith(BonitaSuiteRunner.class)
@SuiteClasses({
// SPIdentityTests.class, // slow execution test suite only
// SPProcessManagementTest.class, // slow execution test suite only
PageAPIIT.class,
TenantRemoteTestSpITest.class,
NodeAPITest.class,
LogTest.class,
ExternalCommandsTestSP.class,
MultiInstanceTest.class,
ProcessTests.class,
SupervisedTests.class,
ProfileTests.class,
RemoteConnectorExecutionTestSP.class,
MonitoringAPITest.class,
SearchEntitiesTests.class,
ReportingAPIIT.class,
PlatformMonitoringAPITest.class,
TenantTest.class,
BDRepositoryIT.class,
ExecuteBDMQueryCommandIT.class
})
@Initializer(TestsInitializerSP.class)
public class BPMRemoteSPTests {
} |
<<<<<<<
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import java.lang.reflect.Method;
=======
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Mockito.*;
import java.lang.reflect.Method;
>>>>>>>
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Mockito.*;
import java.lang.reflect.Method;
import java.lang.reflect.Method;
<<<<<<<
import org.assertj.core.api.Assertions;
=======
>>>>>>>
<<<<<<<
@Test
public void should_call_on_lazy_loaded_getter_use_lazyLoader() throws Exception {
//given
PersonEntity personEntity = new PersonEntity();
final Method method = PersonEntity.class.getMethod("getWithLazyLoadedAnnotation");
doReturn("lazyResult").when(lazyLoader).load(any(Method.class), anyLong());
//when
PersonEntity proxy = serverProxyfier.proxify(personEntity);
final String withLazyLoadedAnnotation = proxy.getWithLazyLoadedAnnotation();
//
verify(lazyLoader).load(method, personEntity.getPersistenceId());
assertThat(withLazyLoadedAnnotation).isEqualTo("lazyResult");
}
@Test
public void should_not_call_lazyLoader() throws Exception {
//given
PersonEntity personEntity = new PersonEntity();
final Method method = PersonEntity.class.getMethod("getWithoutLazyLoadedAnnotation");
//when
PersonEntity proxy = serverProxyfier.proxify(personEntity);
final String withLazyLoadedAnnotation = proxy.getWithoutLazyLoadedAnnotation();
//
verify(lazyLoader, never()).load(method, personEntity.getPersistenceId());
assertThat(withLazyLoadedAnnotation).isEqualTo("getWithoutLazyLoadedAnnotation");
}
=======
@Test
public void should_call_on_lazy_loaded_getter_use_lazyLoader() throws Exception {
//given
PersonEntity personEntity = new PersonEntity();
final Method method = PersonEntity.class.getMethod("getWithLazyLoadedAnnotation");
doReturn("lazyResult").when(lazyLoader).load(any(Method.class), anyLong());
//when
PersonEntity proxy = serverProxyfier.proxify(personEntity);
final String withLazyLoadedAnnotation = proxy.getWithLazyLoadedAnnotation();
//
verify(lazyLoader).load(method, personEntity.getPersistenceId());
assertThat(withLazyLoadedAnnotation).isEqualTo("lazyResult");
}
@Test
public void should_not_call_lazyLoader() throws Exception {
//given
PersonEntity personEntity = new PersonEntity();
final Method method = PersonEntity.class.getMethod("getWithoutLazyLoadedAnnotation");
//when
PersonEntity proxy = serverProxyfier.proxify(personEntity);
final String withLazyLoadedAnnotation = proxy.getWithoutLazyLoadedAnnotation();
//
verify(lazyLoader, never()).load(method, personEntity.getPersistenceId());
assertThat(withLazyLoadedAnnotation).isEqualTo("getWithoutLazyLoadedAnnotation");
}
>>>>>>>
@Test
public void should_call_on_lazy_loaded_getter_use_lazyLoader() throws Exception {
//given
PersonEntity personEntity = new PersonEntity();
final Method method = PersonEntity.class.getMethod("getWithLazyLoadedAnnotation");
doReturn("lazyResult").when(lazyLoader).load(any(Method.class), anyLong());
//when
PersonEntity proxy = serverProxyfier.proxify(personEntity);
final String withLazyLoadedAnnotation = proxy.getWithLazyLoadedAnnotation();
//
verify(lazyLoader).load(method, personEntity.getPersistenceId());
assertThat(withLazyLoadedAnnotation).isEqualTo("lazyResult");
}
@Test
public void should_not_call_lazyLoader() throws Exception {
//given
PersonEntity personEntity = new PersonEntity();
final Method method = PersonEntity.class.getMethod("getWithoutLazyLoadedAnnotation");
//when
PersonEntity proxy = serverProxyfier.proxify(personEntity);
final String withLazyLoadedAnnotation = proxy.getWithoutLazyLoadedAnnotation();
//
verify(lazyLoader, never()).load(method, personEntity.getPersistenceId());
assertThat(withLazyLoadedAnnotation).isEqualTo("getWithoutLazyLoadedAnnotation");
} |
<<<<<<<
public static ProcessConfigurationAPI getProcessConfigurationAPI(APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException {
return getAPI(ProcessConfigurationAPI.class, session);
}
=======
public static TenantAdministrationAPI getTenantAdministrationAPI(final APISession session) throws BonitaHomeNotSetException, ServerAPIException,
UnknownAPITypeException {
return getAPI(TenantAdministrationAPI.class, session);
}
public static BusinessDataAPI getBusinessDataAPI(APISession session) throws BonitaHomeNotSetException, ServerAPIException,
UnknownAPITypeException {
return getAPI(BusinessDataAPI.class, session);
}
>>>>>>>
public static ProcessConfigurationAPI getProcessConfigurationAPI(APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException {
return getAPI(ProcessConfigurationAPI.class, session);
}
public static TenantAdministrationAPI getTenantAdministrationAPI(final APISession session) throws BonitaHomeNotSetException, ServerAPIException,
UnknownAPITypeException {
return getAPI(TenantAdministrationAPI.class, session);
}
public static BusinessDataAPI getBusinessDataAPI(APISession session) throws BonitaHomeNotSetException, ServerAPIException,
UnknownAPITypeException {
return getAPI(BusinessDataAPI.class, session);
} |
<<<<<<<
public void getJobLogs_should_call_searchJobLogs() throws Exception {
// Given
final long jobDescriptorId = 9L;
final int fromIndex = 0;
final int maxResults = 10;
// When
jobServiceImpl.getJobLogs(jobDescriptorId, fromIndex, maxResults);
// Then
verify(jobServiceImpl).searchJobLogs(any(QueryOptions.class));
}
@Test
public void getNumberOfJobLogs() throws SBonitaReadException, SBonitaSearchException {
// Given
=======
public void getNumberOfJobLogs() throws SBonitaReadException, SBonitaReadException {
>>>>>>>
public void getJobLogs_should_call_searchJobLogs() throws Exception {
// Given
final long jobDescriptorId = 9L;
final int fromIndex = 0;
final int maxResults = 10;
// When
jobServiceImpl.getJobLogs(jobDescriptorId, fromIndex, maxResults);
// Then
verify(jobServiceImpl).searchJobLogs(any(QueryOptions.class));
}
@Test
public void getNumberOfJobLogs() throws SBonitaReadException, SBonitaReadException {
// Given
<<<<<<<
@Test(expected = SBonitaSearchException.class)
public void getNumberOfJobLog_should_throw_exception_when_persistenceService_failed() throws Exception {
// Given
=======
@Test(expected = SBonitaReadException.class)
public void getNumberOfJobLogsThrowException() throws Exception {
>>>>>>>
@Test(expected = SBonitaReadException.class)
public void getNumberOfJobLog_should_throw_exception_when_persistenceService_failed() throws Exception {
// Given
<<<<<<<
public void searchJobLogs() throws SBonitaSearchException, SBonitaReadException {
// Given
=======
public void searchJobLogs() throws SBonitaReadException {
>>>>>>>
public void searchJobLogs() throws SBonitaReadException, SBonitaReadException {
// Given
<<<<<<<
@Test(expected = SBonitaSearchException.class)
public void searchJobLog_should_throw_exception_when_persistenceService_failed() throws SBonitaSearchException, SBonitaReadException {
// Given
=======
@Test(expected = SBonitaReadException.class)
public void searchJobLogsThrowException() throws SBonitaReadException {
>>>>>>>
@Test(expected = SBonitaReadException.class)
public void searchJobLog_should_throw_exception_when_persistenceService_failed() throws SBonitaReadException, SBonitaReadException {
// Given |
<<<<<<<
=======
private static final long FLOW_NODE_INSTANCE_ID = 100;
>>>>>>>
private static final long FLOW_NODE_INSTANCE_ID = 100;
<<<<<<<
=======
@Mock
private SFlowNodeInstance flowNodeInstance;
>>>>>>>
@Mock
private SFlowNodeInstance flowNodeInstance;
<<<<<<<
=======
doReturn(FLOW_NODE_INSTANCE_ID).when(flowNodeInstance).getId();
doReturn(SStateCategory.NORMAL).when(flowNodeInstance).getStateCategory();
>>>>>>>
doReturn(FLOW_NODE_INSTANCE_ID).when(flowNodeInstance).getId();
doReturn(SStateCategory.NORMAL).when(flowNodeInstance).getStateCategory();
<<<<<<<
@Test
public void getNextState_returns_null_if_current_is_in_normal_category_and_is_terminal() {
ExceptionalStateTransitionsManager statesManager = new ExceptionalStateTransitionsManager(stateTransitions);
FlowNodeState nextState = statesManager.getNextState(normalTerminalState);
assertNull(nextState);
=======
@Test(expected = SIllegalStateTransition.class)
public void getNextState_should_throw_SIllegalStateTransition_exception_if_current_is_in_normal_category_and_is_terminal() throws Exception {
ExceptionalStateTransitionsManager statesManager = new ExceptionalStateTransitionsManager(stateTransitions, flowNodeInstance);
statesManager.getNextState(normalTerminalState);
>>>>>>>
@Test(expected = SIllegalStateTransition.class)
public void getNextState_throws_SIllegalStateTransition_if_current_is_in_normal_category_and_is_terminal() throws SIllegalStateTransition {
final ExceptionalStateTransitionsManager statesManager = new ExceptionalStateTransitionsManager(stateTransitions, flowNodeInstance);
statesManager.getNextState(normalTerminalState); |
<<<<<<<
final DefaultReportList reports = new DefaultReportList(
tenantAccessor.getTechnicalLoggerService(),
BonitaHomeServer.getInstance().getTenantReportFolder(tenantId));
=======
final DefaultReportList reports = new DefaultReportList(tenantAccessor.getTechnicalLoggerService(), BonitaHomeServer.getInstance()
.getTenantReportFolder(tenantId));
>>>>>>>
final DefaultReportList reports = new DefaultReportList(tenantAccessor.getTechnicalLoggerService(), BonitaHomeServer.getInstance()
.getTenantReportFolder(tenantId));
<<<<<<<
// stop tenant services and clear the spring context
final TenantServiceAccessor tenantServiceAccessor = platformAccessor.getTenantServiceAccessor(tenantId);
stopServicesOfTenant(logger, tenantId, tenantServiceAccessor);
=======
// stop tenant services and clear the spring context:
TenantServiceAccessor tenantServiceAccessor = platformAccessor.getTenantServiceAccessor(tenantId);
platformAccessor.getTransactionService().executeInTransaction(new SetServiceState(tenantId, new StopServiceStrategy()));
>>>>>>>
// stop tenant services and clear the spring context:
final TenantServiceAccessor tenantServiceAccessor = platformAccessor.getTenantServiceAccessor(tenantId);
platformAccessor.getTransactionService().executeInTransaction(new SetServiceState(tenantId, new StopServiceStrategy()));
<<<<<<<
final TenantServiceAccessor tenantServiceAccessor = getTenantServiceAccessor(tenantId);
=======
final TenantServiceAccessor tenantServiceAccessor = getTenantServiceAccessor(tenantId);
>>>>>>>
final TenantServiceAccessor tenantServiceAccessor = getTenantServiceAccessor(tenantId); |
<<<<<<<
private boolean visitColumns(VisitContext context, VisitCallback callback, String rowKey, boolean visitNodes) {
String treeNodeType = null;
if (visitNodes) {
setRowKey(rowKey);
=======
private boolean visitColumns(VisitContext context, TreeNode root, VisitCallback callback, String rowKey) {
setRowKey(root, rowKey);
>>>>>>>
private boolean visitColumns(VisitContext context, TreeNode root, VisitCallback callback, String rowKey, boolean visitNodes) {
String treeNodeType = null;
if (visitNodes) {
setRowKey(root, rowKey);
<<<<<<<
protected boolean visitNode(VisitContext context, VisitCallback callback, TreeNode treeNode, String rowKey) {
if (visitColumns(context, callback, rowKey, true)) {
=======
protected boolean visitNode(VisitContext context, TreeNode root, VisitCallback callback, TreeNode treeNode, String rowKey) {
if (visitColumns(context, root, callback, rowKey)) {
>>>>>>>
protected boolean visitNode(VisitContext context, TreeNode root, VisitCallback callback, TreeNode treeNode, String rowKey) {
if (visitColumns(context, root, callback, rowKey, true)) { |
<<<<<<<
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
=======
import java.nio.file.Files;
import java.nio.file.Path;
>>>>>>>
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.nio.file.Path;
<<<<<<<
=======
import javax.sql.DataSource;
>>>>>>>
import javax.sql.DataSource; |
<<<<<<<
import org.bonitasoft.engine.page.PageService;
=======
import org.bonitasoft.engine.parameter.ParameterService;
>>>>>>>
import org.bonitasoft.engine.parameter.ParameterService;
import org.bonitasoft.engine.page.PageService;
<<<<<<<
private PageService pageService;
private ApplicationService applicationService;
@Override
=======
private ParameterService parameterService;
>>>>>>>
private ParameterService parameterService;
private PageService pageService;
private ApplicationService applicationService;
@Override
<<<<<<<
/**
* might not be an available service
*/
@Override
public PageService getPageService() {
if (pageService == null) {
pageService = beanAccessor.getService(PageService.class);
}
return pageService;
}
@Override
public ApplicationService getApplicationService() {
if (applicationService == null) {
applicationService = beanAccessor.getService(ApplicationService.class);
}
return applicationService;
}
=======
@Override
public ParameterService getParameterService() {
if (parameterService == null) {
parameterService = beanAccessor.getService(ParameterService.class);
}
return parameterService;
}
>>>>>>>
@Override
public ParameterService getParameterService() {
if (parameterService == null) {
parameterService = beanAccessor.getService(ParameterService.class);
}
return parameterService;
}
/**
* might not be an available service
*/
@Override
public PageService getPageService() {
if (pageService == null) {
pageService = beanAccessor.getService(PageService.class);
}
return pageService;
}
@Override
public ApplicationService getApplicationService() {
if (applicationService == null) {
applicationService = beanAccessor.getService(ApplicationService.class);
}
return applicationService;
} |
<<<<<<<
new OperationBuilder().createSetDocument(documentName, getDocumentValueExpressionWithUrl(url)));
designProcessDefinition.addUserTask("step3", actorName);
=======
new OperationBuilder().createNewInstance().setRightOperand(getDocumentValueExpressionWithUrl(url)).setType(OperatorType.DOCUMENT_CREATE_UPDATE)
.setLeftOperand(documentName, false).done());
designProcessDefinition.addUserTask("step3", ACTOR_NAME);
>>>>>>>
new OperationBuilder().createSetDocument(documentName, getDocumentValueExpressionWithUrl(url)));
designProcessDefinition.addUserTask("step3", ACTOR_NAME); |
<<<<<<<
for (final PlatformLifecycleService serviceWithLifecycle : otherServicesToStart) {
logger.log(getClass(), TechnicalLogSeverity.INFO, "Start service of platform:" + serviceWithLifecycle.getClass().getName());
=======
for (final ServiceWithLifecycle serviceWithLifecycle : otherServicesToStart) {
if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO)) {
logger.log(getClass(), TechnicalLogSeverity.INFO, "Start service of platform : " + serviceWithLifecycle.getClass().getName());
}
>>>>>>>
for (final PlatformLifecycleService serviceWithLifecycle : otherServicesToStart) {
if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO)) {
logger.log(getClass(), TechnicalLogSeverity.INFO, "Start service of platform : " + serviceWithLifecycle.getClass().getName());
}
<<<<<<<
=======
private void startServices(final TechnicalLoggerService logger, final long tenantId, final TenantServiceAccessor tenantServiceAccessor)
throws SBonitaException {
tenantServiceAccessor.getWorkService().start();
final TransactionExecutor tenantExecutor = tenantServiceAccessor.getTransactionExecutor();
tenantExecutor.execute(new RefreshTenantClassLoaders(tenantServiceAccessor, tenantId));
// start the connector executor thread pool
// TODO should be like the platform services to start...
final ConnectorExecutor connectorExecutor = tenantServiceAccessor.getConnectorExecutor();
if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO)) {
logger.log(getClass(), TechnicalLogSeverity.INFO, "Start service of tenant " + tenantId + " : "
+ connectorExecutor.getClass().getName());
}
connectorExecutor.start();
}
>>>>>>>
<<<<<<<
final SetServiceState stopService = new SetServiceState(tenant.getId(), new StopServiceStrategy());
platformAccessor.getTransactionService().executeInTransaction(stopService);
=======
final TenantServiceAccessor tenantServiceAccessor = platformAccessor.getTenantServiceAccessor(tenant.getId());
final ConnectorExecutor connectorExecutor = tenantServiceAccessor.getConnectorExecutor();
if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO)) {
logger.log(getClass(), TechnicalLogSeverity.INFO, "Stop service of tenant " + tenant.getId() + ": "
+ connectorExecutor.getClass().getName());
}
WorkService workService = tenantServiceAccessor.getWorkService();
if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO)) {
logger.log(getClass(), TechnicalLogSeverity.INFO, "Stop service of tenant " + tenant.getId() + " : "
+ connectorExecutor.getClass().getName());
}
workService.stop();
>>>>>>>
final SetServiceState stopService = new SetServiceState(tenant.getId(), new StopServiceStrategy());
platformAccessor.getTransactionService().executeInTransaction(stopService); |
<<<<<<<
import java.util.Map;
=======
>>>>>>>
import java.util.Map; |
<<<<<<<
final Expression employeeExpression = new ExpressionBuilder().createGroovyScriptExpression("createNewEmployee",
"import org.bonita.pojo.Employee; Employee e = new Employee(); e.firstName = 'Jane'; e.lastName = 'Doe'; return e;", EMPLOYEE_QUALIF_CLASSNAME);
=======
final Expression employeeExpression = new ExpressionBuilder().createGroovyScriptExpression("createNewEmployee", "import " + EMPLOYEE_QUALIF_CLASSNAME
+ "; Employee e = new Employee(); e.firstName = 'John'; e.lastName = 'Doe'; return e;", EMPLOYEE_QUALIF_CLASSNAME);
>>>>>>>
final Expression employeeExpression = new ExpressionBuilder().createGroovyScriptExpression("createNewEmployee", "import " + EMPLOYEE_QUALIF_CLASSNAME
+ "; Employee e = new Employee(); e.firstName = 'Jane'; e.lastName = 'Doe'; return e;", EMPLOYEE_QUALIF_CLASSNAME); |
<<<<<<<
import org.bonitasoft.engine.exception.AlreadyExistsException;
import org.bonitasoft.engine.exception.BonitaException;
import org.bonitasoft.engine.exception.BonitaHomeNotSetException;
import org.bonitasoft.engine.exception.CreationException;
import org.bonitasoft.engine.exception.DeletionException;
import org.bonitasoft.engine.exception.RetrieveException;
import org.bonitasoft.engine.exception.SearchException;
import org.bonitasoft.engine.exception.ServerAPIException;
import org.bonitasoft.engine.exception.UnknownAPITypeException;
import org.bonitasoft.engine.exception.UpdateException;
=======
import org.bonitasoft.engine.connector.Connector;
import org.bonitasoft.engine.exception.AlreadyExistsException;
import org.bonitasoft.engine.exception.BonitaException;
import org.bonitasoft.engine.exception.CreationException;
import org.bonitasoft.engine.exception.DeletionException;
import org.bonitasoft.engine.exception.RetrieveException;
import org.bonitasoft.engine.exception.SearchException;
import org.bonitasoft.engine.exception.UpdateException;
>>>>>>>
import org.bonitasoft.engine.connector.Connector;
import org.bonitasoft.engine.exception.AlreadyExistsException;
import org.bonitasoft.engine.exception.BonitaException;
import org.bonitasoft.engine.exception.BonitaHomeNotSetException;
import org.bonitasoft.engine.exception.CreationException;
import org.bonitasoft.engine.exception.DeletionException;
import org.bonitasoft.engine.exception.RetrieveException;
import org.bonitasoft.engine.exception.SearchException;
import org.bonitasoft.engine.exception.ServerAPIException;
import org.bonitasoft.engine.exception.UnknownAPITypeException;
import org.bonitasoft.engine.exception.UpdateException; |
<<<<<<<
@Column(name = "data_id")
=======
>>>>>>>
@Column(name = "data_id") |
<<<<<<<
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false).withDeleted(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN).build());
repository.add(aUserTask().withName("normalTask2").withStateExecuting(false).withStable(true).withTerminal(false).withDeleted(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN).build());
repository.add(aUserTask().withName("normalTask3").withStateExecuting(false).withStable(true).withTerminal(false).withDeleted(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN).build());
=======
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).build());
repository.add(aUserTask().withName("normalTask2").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).build());
repository.add(aUserTask().withName("normalTask3").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).build());
>>>>>>>
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN).build());
repository.add(aUserTask().withName("normalTask2").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN).build());
repository.add(aUserTask().withName("normalTask3").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN).withAssigneeId(JACK_ID).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN).build());
<<<<<<<
repository.add(aUserTask().withName("deletedTask").withStateExecuting(false).withStable(true).withTerminal(false).withDeleted(true)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).withAssigneeId(JACK_ID).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).build());
repository.add(aUserTask().withName("executingTask").withStateExecuting(true).withStable(true).withTerminal(false).withDeleted(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).withAssigneeId(JACK_ID).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).build());
repository.add(aUserTask().withName("notStableTask").withStateExecuting(false).withStable(false).withTerminal(true).withDeleted(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).withAssigneeId(JACK_ID).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).build());
repository.add(aUserTask().withName("terminalTask").withStateExecuting(false).withStable(true).withTerminal(true).withDeleted(false)
=======
repository.add(aUserTask().withName("executingTask").withStateExecuting(true).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).withAssigneeId(JACK_ID).build());
repository.add(aUserTask().withName("notStableTask").withStateExecuting(false).withStable(false).withTerminal(true)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).withAssigneeId(JACK_ID).build());
repository.add(aUserTask().withName("terminalTask").withStateExecuting(false).withStable(true).withTerminal(true)
>>>>>>>
repository.add(aUserTask().withName("executingTask").withStateExecuting(true).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).withAssigneeId(JACK_ID).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).build());
repository.add(aUserTask().withName("notStableTask").withStateExecuting(false).withStable(false).withTerminal(true)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).withAssigneeId(JACK_ID).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).build());
repository.add(aUserTask().withName("notStableTask").withStateExecuting(false).withStable(false).withTerminal(true)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).withAssigneeId(JACK_ID).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).build());
repository.add(aUserTask().withName("terminalTask").withStateExecuting(false).withStable(true).withTerminal(true)
<<<<<<<
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false).withDeleted(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_BOB).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_BOB).withAssigneeId(PAUL_ID).build());
=======
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_BOB).withAssigneeId(PAUL_ID).build());
>>>>>>>
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_BOB).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_SUPERVISED_BY_BOB).withAssigneeId(PAUL_ID).build());
<<<<<<<
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false).withDeleted(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_NOT_SUPERVISED).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_NOT_SUPERVISED).withAssigneeId(PAUL_ID).build());
=======
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_NOT_SUPERVISED).withAssigneeId(PAUL_ID).build());
>>>>>>>
repository.add(aUserTask().withName("normalTask1").withStateExecuting(false).withStable(true).withTerminal(false)
.withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_NOT_SUPERVISED).withStateId(4).withProcessDefinition(PROCESS_DEFINITION_ID_NOT_SUPERVISED).withAssigneeId(PAUL_ID).build());
<<<<<<<
private void buildAndAddAssigneeAndHiddenTask() {
final SUserTaskInstanceImpl activity = (SUserTaskInstanceImpl) repository.add(aUserTask().withName("normalTask1").withStateExecuting(false)
.withStable(true).withTerminal(false).withDeleted(false).withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN)
.withAssigneeId(JACK_ID).build());
final SHiddenTaskInstanceImpl sHiddenTaskInstanceImpl = new SHiddenTaskInstanceImpl();
sHiddenTaskInstanceImpl.setActivityId(activity.getId());
sHiddenTaskInstanceImpl.setUserId(JACK_ID);
sHiddenTaskInstanceImpl.setTenantId(1L);
sHiddenTaskInstanceImpl.setId(48L);
repository.add(sHiddenTaskInstanceImpl);
}
private SFlowNodeInstance buildAndAddNormalTask(final String taskName, final long rootProcessInstanceId, long processDefinitionId) {
=======
private SFlowNodeInstance buildAndAddNormalTask(final String taskName, final long rootProcessInstanceId) {
>>>>>>>
private SFlowNodeInstance buildAndAddNormalTask(final String taskName, final long rootProcessInstanceId, long processDefinitionId) {
<<<<<<<
.withDeleted(false).withStateId(4).withRootProcessInstanceId(rootProcessInstanceId).withProcessDefinition(processDefinitionId).build());
}
private SFlowNodeInstance buildAndAddDeletedTask() {
return repository.add(aUserTask().withName("deletedTask").withStateExecuting(false).withStable(true).withTerminal(false)
.withDeleted(true).withRootProcessInstanceId(ROOT_PROCESS_INSTANCE_ID_SUPERVISED_BY_JOHN_WITH_ONLY_KO_TASKS).build());
=======
.withRootProcessInstanceId(rootProcessInstanceId).build());
>>>>>>>
.withStateId(4).withRootProcessInstanceId(rootProcessInstanceId).withProcessDefinition(processDefinitionId).build()); |
<<<<<<<
=======
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
>>>>>>>
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
<<<<<<<
final String jobName = "aJobName";
=======
String jobName = "aJobName";
>>>>>>>
final String jobName = "aJobName";
<<<<<<<
final boolean deletionStatus = schedulerExecutor.delete(jobName);
=======
boolean deletionStatus = schedulerExecutor.delete(jobName);
>>>>>>>
final boolean deletionStatus = schedulerExecutor.delete(jobName);
<<<<<<<
=======
@Test(expected = SSchedulerException.class)
public void cannot_schedule_a_null_job() throws Exception {
Trigger trigger = mock(Trigger.class);
when(jobService.createJobDescriptor(any(SJobDescriptor.class), any(Long.class))).thenThrow(new SJobDescriptorCreationException(""));
schedulerService.schedule(null, trigger);
}
>>>>>>>
@Test(expected = SSchedulerException.class)
public void cannot_schedule_a_null_job() throws Exception {
Trigger trigger = mock(Trigger.class);
when(jobService.createJobDescriptor(any(SJobDescriptor.class), any(Long.class))).thenThrow(new SJobDescriptorCreationException(""));
schedulerService.schedule(null, trigger);
} |
<<<<<<<
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
=======
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyList;
import static org.mockito.Matchers.anyMap;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.*;
>>>>>>>
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyMap;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.*;
<<<<<<<
import org.bonitasoft.engine.resources.BARResourceType;
import org.bonitasoft.engine.resources.ProcessResourcesService;
import org.bonitasoft.engine.resources.SBARResource;
=======
import org.bonitasoft.engine.resources.BARResourceType;
import org.bonitasoft.engine.resources.ProcessResourcesService;
import org.bonitasoft.engine.xml.Parser;
import org.bonitasoft.engine.xml.ParserFactory;
>>>>>>>
import org.bonitasoft.engine.resources.BARResourceType;
import org.bonitasoft.engine.resources.ProcessResourcesService;
import org.bonitasoft.engine.resources.SBARResource;
<<<<<<<
@Captor
private ArgumentCaptor<UserFilterImplementationDescriptor> userFilterImplementationDescriptorArgumentCaptor;
=======
@Rule
public ExpectedException expectedException = ExpectedException.none();
>>>>>>>
@Captor
private ArgumentCaptor<UserFilterImplementationDescriptor> userFilterImplementationDescriptorArgumentCaptor;
@Rule
public ExpectedException expectedException = ExpectedException.none();
<<<<<<<
@Test
public void should_parse_user_filter_implementation_file_and_cache_it_when_loading_userfilters() throws Exception {
//given
byte[] userFilterImplContent = ("<connectorImplementation>\n" +
"\n" +
"\t<definitionId>user-filter-def</definitionId>\n" +
"\t<definitionVersion>1.0</definitionVersion>\n" +
"\t<implementationClassname>org.bonitasoft.user.filter.TestUserFilter</implementationClassname>\n" +
"\t<implementationId>user-filter-impl</implementationId>\n" +
"\t<implementationVersion>1.0</implementationVersion>\n" +
"\n" +
"\t<jarDependencies>\n" +
"\t\t<jarDependency>UserFilterDependency.jar</jarDependency>\n" +
"\t</jarDependencies>\n" +
"</connectorImplementation>\n").getBytes();
doReturn(Collections.singletonList(new SBARResource("my-user-filter.impl", BARResourceType.USER_FILTER, PROCESS_DEFINITION_ID, userFilterImplContent)))
.when(resourceService).get(eq(PROCESS_DEFINITION_ID), eq(BARResourceType.USER_FILTER), anyInt(), anyInt());
//when
userFilterService.loadUserFilters(PROCESS_DEFINITION_ID);
//then
verify(cacheService).store(eq("USER_FILTER"), eq(PROCESS_DEFINITION_ID + ":user-filter-def-1.0"),
userFilterImplementationDescriptorArgumentCaptor.capture());
UserFilterImplementationDescriptor userFilterImplementationDescriptor = userFilterImplementationDescriptorArgumentCaptor.getValue();
assertThat(userFilterImplementationDescriptor.getDefinitionId()).isEqualTo("user-filter-def");
assertThat(userFilterImplementationDescriptor.getDefinitionVersion()).isEqualTo("1.0");
assertThat(userFilterImplementationDescriptor.getImplementationClassName()).isEqualTo("org.bonitasoft.user.filter.TestUserFilter");
assertThat(userFilterImplementationDescriptor.getId()).isEqualTo("user-filter-impl");
assertThat(userFilterImplementationDescriptor.getVersion()).isEqualTo("1.0");
assertThat(userFilterImplementationDescriptor.getJarDependencies().getDependencies()).containsOnly("UserFilterDependency.jar");
}
=======
@Test
public void executeFilter_should_throw_a_SUserFilterExecutionException_when_receiving_SConnectorException_with_null_cause() throws Exception {
//given
UserFilterServiceImpl spyUserFilterService = spy(
new UserFilterServiceImpl(connectorExecutor, cacheService, expressionResolverService, parserFactory, logger, resourceService));
doReturn(userFilterImplementationDescriptor).when(cacheService).get(eq("USER_FILTER"), eq("" + PROCESS_DEFINITION_ID + ":filterId-version"));
doThrow(new SConnectorException("Test exception")).when(spyUserFilterService).executeFilterInClassloader(anyString(), anyMap(), (URLClassLoader) any(),
(SExpressionContext) any(), anyString());
//then
expectedException.expect(SUserFilterExecutionException.class);
expectedException.expectMessage("Test exception");
//when
spyUserFilterService.executeFilter(PROCESS_DEFINITION_ID, sUserFilterDefinition, Collections.<String, SExpression> emptyMap(),
new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader()), new SExpressionContext(), "actorName");
}
@Test
public void executeFilter_should_throw_a_SUserFilterExecutionException_when_receiving_SConnectorException_with_nonNull_cause() throws Exception {
//given
SConnectorException theException = mock(SConnectorException.class);
UserFilterServiceImpl spyUserFilterService = spy(
new UserFilterServiceImpl(connectorExecutor, cacheService, expressionResolverService, parserFactory, logger, resourceService));
doReturn(userFilterImplementationDescriptor).when(cacheService).get(eq("USER_FILTER"), eq("" + PROCESS_DEFINITION_ID + ":filterId-version"));
when(theException.getCause()).thenReturn(new RuntimeException(" The root cause"));
doThrow(theException).when(spyUserFilterService).executeFilterInClassloader(anyString(), anyMap(), (URLClassLoader) any(), (SExpressionContext) any(),
anyString());
//then
expectedException.expect(SUserFilterExecutionException.class);
expectedException.expectMessage("The root cause");
//when
spyUserFilterService.executeFilter(PROCESS_DEFINITION_ID, sUserFilterDefinition, Collections.<String, SExpression> emptyMap(),
new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader()), new SExpressionContext(), "actorName");
}
@Test
public void executeFilter_should_throw_a_SUserFilterExecutionException_when_receiving_SConnectorException_in_debug_mode() throws Exception {
//given
SConnectorException theException = mock(SConnectorException.class);
UserFilterServiceImpl spyUserFilterService = spy(
new UserFilterServiceImpl(connectorExecutor, cacheService, expressionResolverService, parserFactory, logger, resourceService));
doReturn(userFilterImplementationDescriptor).when(cacheService).get(eq("USER_FILTER"), eq("" + PROCESS_DEFINITION_ID + ":filterId-version"));
when(theException.getCause()).thenReturn(new RuntimeException(" The root cause"));
doThrow(theException).when(spyUserFilterService).executeFilterInClassloader(anyString(), anyMap(), (URLClassLoader) any(), (SExpressionContext) any(),
anyString());
when(logger.isLoggable((Class) any(), eq(TechnicalLogSeverity.DEBUG))).thenReturn(true);
//then
expectedException.expect(SUserFilterExecutionException.class);
expectedException.expectMessage("Current Thread ID : <");
//when
spyUserFilterService.executeFilter(PROCESS_DEFINITION_ID, sUserFilterDefinition, Collections.<String, SExpression> emptyMap(),
new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader()), new SExpressionContext(), "actorName");
}
@Test
public void buildDebugMessage_should_contain_all_the_debug_info() {
//when
String result = userFilterService.buildDebugMessage(45L, sUserFilterDefinition, new HashMap<String, SExpression>(),
new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader()), new SExpressionContext(), "an actor",
"an implementation class name", userFilterImplementationDescriptor);
//then
assertThat(result).contains("an actor");
assertThat(result).contains("an implementation class name");
assertThat(result).contains("45");
assertThat(result).contains(sUserFilterDefinition.toString());
assertThat(result).contains(userFilterImplementationDescriptor.toString());
assertThat(result).contains("RUNNABLE");
}
>>>>>>>
@Test
public void should_parse_user_filter_implementation_file_and_cache_it_when_loading_userfilters() throws Exception {
//given
byte[] userFilterImplContent = ("<connectorImplementation>\n" +
"\n" +
"\t<definitionId>user-filter-def</definitionId>\n" +
"\t<definitionVersion>1.0</definitionVersion>\n" +
"\t<implementationClassname>org.bonitasoft.user.filter.TestUserFilter</implementationClassname>\n" +
"\t<implementationId>user-filter-impl</implementationId>\n" +
"\t<implementationVersion>1.0</implementationVersion>\n" +
"\n" +
"\t<jarDependencies>\n" +
"\t\t<jarDependency>UserFilterDependency.jar</jarDependency>\n" +
"\t</jarDependencies>\n" +
"</connectorImplementation>\n").getBytes();
doReturn(Collections.singletonList(new SBARResource("my-user-filter.impl", BARResourceType.USER_FILTER, PROCESS_DEFINITION_ID, userFilterImplContent)))
.when(resourceService).get(eq(PROCESS_DEFINITION_ID), eq(BARResourceType.USER_FILTER), anyInt(), anyInt());
//when
userFilterService.loadUserFilters(PROCESS_DEFINITION_ID);
//then
verify(cacheService).store(eq("USER_FILTER"), eq(PROCESS_DEFINITION_ID + ":user-filter-def-1.0"),
userFilterImplementationDescriptorArgumentCaptor.capture());
UserFilterImplementationDescriptor userFilterImplementationDescriptor = userFilterImplementationDescriptorArgumentCaptor.getValue();
assertThat(userFilterImplementationDescriptor.getDefinitionId()).isEqualTo("user-filter-def");
assertThat(userFilterImplementationDescriptor.getDefinitionVersion()).isEqualTo("1.0");
assertThat(userFilterImplementationDescriptor.getImplementationClassName()).isEqualTo("org.bonitasoft.user.filter.TestUserFilter");
assertThat(userFilterImplementationDescriptor.getId()).isEqualTo("user-filter-impl");
assertThat(userFilterImplementationDescriptor.getVersion()).isEqualTo("1.0");
assertThat(userFilterImplementationDescriptor.getJarDependencies().getDependencies()).containsOnly("UserFilterDependency.jar");
}
public void executeFilter_should_throw_a_SUserFilterExecutionException_when_receiving_SConnectorException_with_null_cause() throws Exception {
//given
UserFilterServiceImpl spyUserFilterService = spy(
new UserFilterServiceImpl(connectorExecutor, cacheService, expressionResolverService, logger, resourceService));
doReturn(userFilterImplementationDescriptor).when(cacheService).get(eq("USER_FILTER"), eq("" + PROCESS_DEFINITION_ID + ":filterId-version"));
doThrow(new SConnectorException("Test exception")).when(spyUserFilterService).executeFilterInClassloader(anyString(), anyMap(), (URLClassLoader) any(),
(SExpressionContext) any(), anyString());
//then
expectedException.expect(SUserFilterExecutionException.class);
expectedException.expectMessage("Test exception");
//when
spyUserFilterService.executeFilter(PROCESS_DEFINITION_ID, sUserFilterDefinition, Collections.<String, SExpression> emptyMap(),
new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader()), new SExpressionContext(), "actorName");
}
@Test
public void executeFilter_should_throw_a_SUserFilterExecutionException_when_receiving_SConnectorException_with_nonNull_cause() throws Exception {
//given
SConnectorException theException = mock(SConnectorException.class);
UserFilterServiceImpl spyUserFilterService = spy(
new UserFilterServiceImpl(connectorExecutor, cacheService, expressionResolverService, logger, resourceService));
doReturn(userFilterImplementationDescriptor).when(cacheService).get(eq("USER_FILTER"), eq("" + PROCESS_DEFINITION_ID + ":filterId-version"));
when(theException.getCause()).thenReturn(new RuntimeException(" The root cause"));
doThrow(theException).when(spyUserFilterService).executeFilterInClassloader(anyString(), anyMap(), (URLClassLoader) any(), (SExpressionContext) any(),
anyString());
//then
expectedException.expect(SUserFilterExecutionException.class);
expectedException.expectMessage("The root cause");
//when
spyUserFilterService.executeFilter(PROCESS_DEFINITION_ID, sUserFilterDefinition, Collections.<String, SExpression> emptyMap(),
new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader()), new SExpressionContext(), "actorName");
}
@Test
public void executeFilter_should_throw_a_SUserFilterExecutionException_when_receiving_SConnectorException_in_debug_mode() throws Exception {
//given
SConnectorException theException = mock(SConnectorException.class);
UserFilterServiceImpl spyUserFilterService = spy(
new UserFilterServiceImpl(connectorExecutor, cacheService, expressionResolverService, logger, resourceService));
doReturn(userFilterImplementationDescriptor).when(cacheService).get(eq("USER_FILTER"), eq("" + PROCESS_DEFINITION_ID + ":filterId-version"));
when(theException.getCause()).thenReturn(new RuntimeException(" The root cause"));
doThrow(theException).when(spyUserFilterService).executeFilterInClassloader(anyString(), anyMap(), (URLClassLoader) any(), (SExpressionContext) any(),
anyString());
when(logger.isLoggable((Class) any(), eq(TechnicalLogSeverity.DEBUG))).thenReturn(true);
//then
expectedException.expect(SUserFilterExecutionException.class);
expectedException.expectMessage("Current Thread ID : <");
//when
spyUserFilterService.executeFilter(PROCESS_DEFINITION_ID, sUserFilterDefinition, Collections.<String, SExpression> emptyMap(),
new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader()), new SExpressionContext(), "actorName");
}
@Test
public void buildDebugMessage_should_contain_all_the_debug_info() {
//when
String result = userFilterService.buildDebugMessage(45L, sUserFilterDefinition, new HashMap<String, SExpression>(),
new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader()), new SExpressionContext(), "an actor",
"an implementation class name", userFilterImplementationDescriptor);
//then
assertThat(result).contains("an actor");
assertThat(result).contains("an implementation class name");
assertThat(result).contains("45");
assertThat(result).contains(sUserFilterDefinition.toString());
assertThat(result).contains(userFilterImplementationDescriptor.toString());
assertThat(result).contains("RUNNABLE");
} |
<<<<<<<
public Object lookup(final String name) throws NamingException {
// System.out.println(toString() + " ~~~~ lookup " + name + " contains ? " + dictionary.containsKey(name));
=======
public Object lookup(String name) throws NamingException {
>>>>>>>
public Object lookup(final String name) throws NamingException {
<<<<<<<
public void bind(final String name, final Object o) throws NamingException {
// System.out.println(toString() + " ~~~~ binding " + name + " with " + o + " already bound ? " + dictionary.containsKey(name));
=======
public void bind(String name, Object o) throws NamingException {
>>>>>>>
public void bind(final String name, final Object o) throws NamingException { |
<<<<<<<
// set input values of expression with connector result + provided input for this operation
final HashMap<String, Object> inputValues = new HashMap<String, Object>(operationInputValues);
inputValues.putAll(connectorResult.getResult());
expressionContext.setInputValues(inputValues);
// execute
final Long containerId = expressionContext.getContainerId();
=======
// set input values of expression with connector result + provided input for this operation
final HashMap<String, Object> inputValues = new HashMap<String, Object>(operationInputValues);
inputValues.putAll(connectorResult.getResult());
expressionContext.setInputValues(inputValues);
// execute
Long containerId = expressionContext.getContainerId();
>>>>>>>
// set input values of expression with connector result + provided input for this operation
final HashMap<String, Object> inputValues = new HashMap<String, Object>(operationInputValues);
inputValues.putAll(connectorResult.getResult());
expressionContext.setInputValues(inputValues);
// execute
final Long containerId = expressionContext.getContainerId();
<<<<<<<
// return the value of the data if it's an external data
for (final Operation operation : operations) {
=======
// return the value of the data if it's an external data
for (Operation operation : operations) {
>>>>>>>
// return the value of the data if it's an external data
for (final Operation operation : operations) {
<<<<<<<
=======
private class ExecuteFlowNode implements TransactionContent {
private final long userId;
private final ActivityInstanceService activityInstanceService;
private final long flownodeInstanceId;
private final ProcessExecutor processExecutor;
private final TechnicalLoggerService logger;
public ExecuteFlowNode(final long userId, final ActivityInstanceService activityInstanceService, final long flownodeInstanceId,
final ProcessExecutor processExecutor, final TechnicalLoggerService logger) {
this.userId = userId;
this.activityInstanceService = activityInstanceService;
this.flownodeInstanceId = flownodeInstanceId;
this.processExecutor = processExecutor;
this.logger = logger;
}
@Override
public void execute() throws SBonitaException {
final SessionInfos session = SessionInfos.getSessionInfos();
if (session != null) {
final long executerSubstituteUserId = session.getUserId();
final long executerUserId;
if (userId == 0) {
executerUserId = executerSubstituteUserId;
} else {
executerUserId = userId;
}
final SFlowNodeInstance flowNodeInstance = activityInstanceService.getFlowNodeInstance(flownodeInstanceId);
final boolean isFirstState = flowNodeInstance.getStateId() == 0;
// no need to handle failed state, all is in the same tx, if the node fail we just have an exception on client side + rollback
processExecutor
.executeFlowNode(flownodeInstanceId, null, null, flowNodeInstance.getParentProcessInstanceId(), executerUserId,
executerSubstituteUserId);
if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO) && !isFirstState /* don't log when create subtask */) {
final String message = LogMessageBuilder.buildExecuteTaskContextMessage(flowNodeInstance, session.getUsername(), executerUserId,
executerSubstituteUserId);
logger.log(getClass(), TechnicalLogSeverity.INFO, message);
}
addSystemCommentOnProcessInstanceWhenExecutingTaskFor(flowNodeInstance, executerUserId, executerSubstituteUserId);
}
}
}
>>>>>>> |
<<<<<<<
@Test
public void testLegacyMainMethodTests() throws Exception {
MainRunner.callMainIfExists(IntArrayList.class, "test", /*num=*/"500", /*seed=*/"939384");
}
=======
@Test
public void testOf() {
final IntArrayList l = IntArrayList.of(0, 1, 2);
assertEquals(IntArrayList.wrap(new int[] { 0, 1, 2 }), l);
}
>>>>>>>
@Test
public void testOf() {
final IntArrayList l = IntArrayList.of(0, 1, 2);
assertEquals(IntArrayList.wrap(new int[] { 0, 1, 2 }), l);
}
@Test
public void testLegacyMainMethodTests() throws Exception {
MainRunner.callMainIfExists(IntArrayList.class, "test", /*num=*/"500", /*seed=*/"939384");
} |
<<<<<<<
private final ThreadLocal<List<Callable<Void>>> beforeCommitCallables = new ThreadLocal<>();
private ThreadLocal<String> txLastBegin = new ThreadLocal<>();
=======
/**
* We maintain a list of Callables that must be executed just before the real commit (and before the beforeCompletion method is called), so that we ensure
* that Hibernate has not already flushed its session.
*/
private final ThreadLocal<List<Callable<Void>>> beforeCommitCallables = new ThreadLocal<List<Callable<Void>>>();
>>>>>>>
/**
* We maintain a list of Callables that must be executed just before the real commit (and before the beforeCompletion method is called), so that we ensure
* that Hibernate has not already flushed its session.
*/
private final ThreadLocal<List<Callable<Void>>> beforeCommitCallables = new ThreadLocal<>();
private ThreadLocal<String> txLastBegin = new ThreadLocal<>();
<<<<<<<
if (txContext.reentrantCounter() == 1) {
TransactionState txState = null;
try {
txState = getState();
} catch (STransactionException e) {
e.printStackTrace();
}
String message = "We do not support nested calls to the transaction service. Current state is: " + txState + ". ";
if (logger.isLoggable(getClass(), TechnicalLogSeverity.TRACE)) {
message += "Last begin made by: " + txLastBegin.get();
}
throw new STransactionCreationException(message);
=======
if (txContext.isTransactionActiveOnThread()) {
throw new STransactionCreationException("We do not support nested calls to the transaction service.");
>>>>>>>
if (txContext.isTransactionActiveOnThread()) {
TransactionState txState = null;
try {
txState = getState();
} catch (STransactionException e) {
e.printStackTrace();
}
String message = "We do not support nested calls to the transaction service. Current state is: " + txState + ". ";
if (logger.isLoggable(getClass(), TechnicalLogSeverity.TRACE)) {
message += "Last begin made by: " + txLastBegin.get();
}
throw new STransactionCreationException(message); |
<<<<<<<
private EntityManagerFactory entityManagerFactory;
@Override
public void start() {
final Map<String, Object> configOverrides = new HashMap<String, Object>();
configOverrides.put("hibernate.ejb.resource_scanner", InactiveScanner.class.getName());
entityManagerFactory = Persistence.createEntityManagerFactory("BDR", configOverrides);
Properties properties = toProperties(entityManagerFactory.getProperties());
Dialect dialect = Dialect.getDialect(properties);
try {
executeQueries(new SchemaGenerator(dialect,properties).generate());
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
private void executeQueries(final String... sqlQuerys) {
final EntityManager entityManager = getEntityManager();
for (final String sqlQuery : sqlQuerys) {
System.out.println(sqlQuery);
final Query query = entityManager.createNativeQuery(sqlQuery);
query.executeUpdate();
}
}
private Properties toProperties(Map<String, Object> propertiesAsMap) {
Properties properties = new Properties();
properties.putAll(propertiesAsMap);
return properties;
}
@Override
public void stop() {
if (entityManagerFactory != null) {
entityManagerFactory.close();
entityManagerFactory = null;
}
}
@Override
public <T> T find(final Class<T> entityClass, final Serializable primaryKey) throws BusinessDataNotFoundException {
final EntityManager em = getEntityManager();
final T entity = em.find(entityClass, primaryKey);
if (entity == null) {
throw new BusinessDataNotFoundException("Impossible to get data with id: " + primaryKey);
}
return entity;
}
@Override
public <T> T find(final Class<T> resultClass, final String qlString, final Map<String, Object> parameters) throws BusinessDataNotFoundException,
NonUniqueResultException {
final EntityManager em = getEntityManager();
final TypedQuery<T> query = em.createQuery(qlString, resultClass);
if (parameters != null) {
for (final Entry<String, Object> parameter : parameters.entrySet()) {
query.setParameter(parameter.getKey(), parameter.getValue());
}
}
try {
return query.getSingleResult();
} catch (final javax.persistence.NonUniqueResultException nure) {
throw new NonUniqueResultException(nure);
} catch (final NoResultException nre) {
throw new BusinessDataNotFoundException("Impossible to get data using query: " + qlString + " and parameters: " + parameters, nre);
}
}
private EntityManager getEntityManager() {
if (entityManagerFactory == null) {
throw new IllegalStateException("The BDR is not started");
}
final EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.joinTransaction();
return entityManager;
}
@Override
public void persist(final Object entity) {
if (entity == null) {
return;
}
final EntityManager em = getEntityManager();
em.persist(entity);
}
=======
private EntityManagerFactory entityManagerFactory;
private DependencyService dependencyService;
public JPABusinessDataRepositoryImpl(DependencyService dependencyService) {
this.dependencyService = dependencyService;
}
@Override
public void deploy(final byte[] bdrArchive,long tenantId) throws SBusinessDataRepositoryException {
byte[] transformedBdrArchive = null;
try {
transformedBdrArchive = transformBDRArchive(bdrArchive);
} catch (IOException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
} catch (TransformerException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
}
final SDependency sDependency = createSDependency(transformedBdrArchive);
try {
dependencyService.createDependency(sDependency);
} catch (SDependencyAlreadyExistsException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
} catch (SDependencyCreationException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
}
final SDependencyMapping sDependencyMapping = createDependencyMapping(tenantId, sDependency);
try {
dependencyService.createDependencyMapping(sDependencyMapping);
} catch (SDependencyException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
}
}
protected SDependencyMapping createDependencyMapping(long tenantId,
final SDependency sDependency) {
return BuilderFactory.get(SDependencyMappingBuilderFactory.class)
.createNewInstance(sDependency.getId(),tenantId , "tenant").done();
}
protected SDependency createSDependency(byte[] transformedBdrArchive) {
return BuilderFactory.get(SDependencyBuilderFactory.class).createNewInstance("BDR", "1.0", "BDR.jar", transformedBdrArchive).done();
}
protected byte[] transformBDRArchive(final byte[] bdrArchive) throws SBusinessDataRepositoryDeploymentException, IOException, TransformerException {
List<String> classNameList = null;
try {
classNameList = IOUtil.getClassNameList(bdrArchive);
} catch (IOException e) {
throw new SBonitaRuntimeException(e);
}
if (classNameList == null || classNameList.isEmpty()) {
throw new IllegalStateException("No entity found in bdr archive");
}
byte[] persistenceFileContent = getPersistenceFileContentFor(classNameList);
return IOUtil.addJarEntry(bdrArchive,"META-INF/persistence.xml",persistenceFileContent);
}
protected byte[] getPersistenceFileContentFor(final List<String> classNames) throws SBusinessDataRepositoryDeploymentException, IOException, TransformerException {
PersistenceUnitBuilder builder = new PersistenceUnitBuilder();
for(String classname : classNames){
builder.addClass(classname);
}
return IOUtil.toByteArray(builder.done());
}
@Override
public void start() {
final Map<String, Object> configOverrides = new HashMap<String, Object>();
configOverrides.put("hibernate.ejb.resource_scanner", InactiveScanner.class.getName());
entityManagerFactory = Persistence.createEntityManagerFactory("BDR", configOverrides);
}
@Override
public void stop() {
if (entityManagerFactory != null) {
entityManagerFactory.close();
entityManagerFactory = null;
}
}
@Override
public <T> T find(final Class<T> entityClass, final Serializable primaryKey) throws BusinessDataNotFoundException {
final EntityManager em = getEntityManager();
final T entity = em.find(entityClass, primaryKey);
if (entity == null) {
throw new BusinessDataNotFoundException("Impossible to get data with id: " + primaryKey);
}
return entity;
}
@Override
public <T> T find(final Class<T> resultClass, final String qlString, final Map<String, Object> parameters) throws BusinessDataNotFoundException,
NonUniqueResultException {
final EntityManager em = getEntityManager();
final TypedQuery<T> query = em.createQuery(qlString, resultClass);
if (parameters != null) {
for (final Entry<String, Object> parameter : parameters.entrySet()) {
query.setParameter(parameter.getKey(), parameter.getValue());
}
}
try {
return query.getSingleResult();
} catch (final javax.persistence.NonUniqueResultException nure) {
throw new NonUniqueResultException(nure);
} catch (final NoResultException nre) {
throw new BusinessDataNotFoundException("Impossible to get data using query: " + qlString + " and parameters: " + parameters, nre);
}
}
private EntityManager getEntityManager() {
if (entityManagerFactory == null) {
throw new IllegalStateException("The BDR is not started");
}
final EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.joinTransaction();
return entityManager;
}
@Override
public void persist(final Object entity) {
if (entity == null) {
return;
}
final EntityManager em = getEntityManager();
em.persist(entity);
}
>>>>>>>
private EntityManagerFactory entityManagerFactory;
private DependencyService dependencyService;
public JPABusinessDataRepositoryImpl(DependencyService dependencyService) {
this.dependencyService = dependencyService;
}
@Override
public void deploy(final byte[] bdrArchive,long tenantId) throws SBusinessDataRepositoryException {
byte[] transformedBdrArchive = null;
try {
transformedBdrArchive = transformBDRArchive(bdrArchive);
} catch (IOException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
} catch (TransformerException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
}
final SDependency sDependency = createSDependency(transformedBdrArchive);
try {
dependencyService.createDependency(sDependency);
} catch (SDependencyAlreadyExistsException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
} catch (SDependencyCreationException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
}
final SDependencyMapping sDependencyMapping = createDependencyMapping(tenantId, sDependency);
try {
dependencyService.createDependencyMapping(sDependencyMapping);
} catch (SDependencyException e) {
throw new SBusinessDataRepositoryDeploymentException(e);
}
}
protected SDependencyMapping createDependencyMapping(long tenantId,
final SDependency sDependency) {
return BuilderFactory.get(SDependencyMappingBuilderFactory.class)
.createNewInstance(sDependency.getId(),tenantId , "tenant").done();
}
protected SDependency createSDependency(byte[] transformedBdrArchive) {
return BuilderFactory.get(SDependencyBuilderFactory.class).createNewInstance("BDR", "1.0", "BDR.jar", transformedBdrArchive).done();
}
protected byte[] transformBDRArchive(final byte[] bdrArchive) throws SBusinessDataRepositoryDeploymentException, IOException, TransformerException {
List<String> classNameList = null;
try {
classNameList = IOUtil.getClassNameList(bdrArchive);
} catch (IOException e) {
throw new SBonitaRuntimeException(e);
}
if (classNameList == null || classNameList.isEmpty()) {
throw new IllegalStateException("No entity found in bdr archive");
}
byte[] persistenceFileContent = getPersistenceFileContentFor(classNameList);
return IOUtil.addJarEntry(bdrArchive,"META-INF/persistence.xml",persistenceFileContent);
}
protected byte[] getPersistenceFileContentFor(final List<String> classNames) throws SBusinessDataRepositoryDeploymentException, IOException, TransformerException {
PersistenceUnitBuilder builder = new PersistenceUnitBuilder();
for(String classname : classNames){
builder.addClass(classname);
}
return IOUtil.toByteArray(builder.done());
}
@Override
public void start() {
final Map<String, Object> configOverrides = new HashMap<String, Object>();
configOverrides.put("hibernate.ejb.resource_scanner", InactiveScanner.class.getName());
entityManagerFactory = Persistence.createEntityManagerFactory("BDR", configOverrides);
Properties properties = toProperties(entityManagerFactory.getProperties());
Dialect dialect = Dialect.getDialect(properties);
try {
executeQueries(new SchemaGenerator(dialect,properties).generate());
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
private void executeQueries(final String... sqlQuerys) {
final EntityManager entityManager = getEntityManager();
for (final String sqlQuery : sqlQuerys) {
System.out.println(sqlQuery);
final Query query = entityManager.createNativeQuery(sqlQuery);
query.executeUpdate();
}
}
private Properties toProperties(Map<String, Object> propertiesAsMap) {
Properties properties = new Properties();
properties.putAll(propertiesAsMap);
return properties;
}
@Override
public void stop() {
if (entityManagerFactory != null) {
entityManagerFactory.close();
entityManagerFactory = null;
}
}
@Override
public <T> T find(final Class<T> entityClass, final Serializable primaryKey) throws BusinessDataNotFoundException {
final EntityManager em = getEntityManager();
final T entity = em.find(entityClass, primaryKey);
if (entity == null) {
throw new BusinessDataNotFoundException("Impossible to get data with id: " + primaryKey);
}
return entity;
}
@Override
public <T> T find(final Class<T> resultClass, final String qlString, final Map<String, Object> parameters) throws BusinessDataNotFoundException,
NonUniqueResultException {
final EntityManager em = getEntityManager();
final TypedQuery<T> query = em.createQuery(qlString, resultClass);
if (parameters != null) {
for (final Entry<String, Object> parameter : parameters.entrySet()) {
query.setParameter(parameter.getKey(), parameter.getValue());
}
}
try {
return query.getSingleResult();
} catch (final javax.persistence.NonUniqueResultException nure) {
throw new NonUniqueResultException(nure);
} catch (final NoResultException nre) {
throw new BusinessDataNotFoundException("Impossible to get data using query: " + qlString + " and parameters: " + parameters, nre);
}
}
private EntityManager getEntityManager() {
if (entityManagerFactory == null) {
throw new IllegalStateException("The BDR is not started");
}
final EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.joinTransaction();
return entityManager;
}
@Override
public void persist(final Object entity) {
if (entity == null) {
return;
}
final EntityManager em = getEntityManager();
em.persist(entity);
} |
<<<<<<<
import org.bonitasoft.engine.execution.SIllegalStateTransition;
=======
import org.bonitasoft.engine.expression.exception.SExpressionEvaluationException;
>>>>>>>
import org.bonitasoft.engine.execution.SIllegalStateTransition;
import org.bonitasoft.engine.expression.exception.SExpressionEvaluationException;
<<<<<<<
private boolean mustNotPutInFailedState(final Throwable e) {
return e instanceof SFlowNodeNotFoundException
|| e instanceof SProcessInstanceNotFoundException
|| e instanceof SProcessDefinitionNotFoundException
|| isTransitionFromTerminalState(e);
}
boolean isTransitionFromTerminalState(Throwable t) {
if(!(t instanceof SIllegalStateTransition)) {
return false;
}
SIllegalStateTransition e = (SIllegalStateTransition) t;
return e.isTransitionFromTerminalState();
}
protected void logFailureCause(final Throwable e) {
=======
@Override
public void handleFailure(final Throwable e, final Map<String, Object> context) {
final TenantServiceAccessor tenantAccessor = getTenantAccessor();
final TechnicalLoggerService loggerService = tenantAccessor.getTechnicalLoggerService();
final Throwable cause = e.getCause();
if (e instanceof SFlowNodeNotFoundException || e instanceof SProcessInstanceNotFoundException || e instanceof SProcessDefinitionNotFoundException) {
logFailureCause(loggerService, e);
} else if (cause instanceof SFlowNodeNotFoundException || cause instanceof SProcessInstanceNotFoundException
|| cause instanceof SProcessDefinitionNotFoundException) {
logFailureCause(loggerService, cause);
} else {
// final Edge case we cannot manage
if (loggerService.isLoggable(getClass(), TechnicalLogSeverity.WARNING)) {
loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "The work [" + getDescription() + "] failed. The failure will be handled.");
}
// To do before log, because we want to set the context of the exception.
handleFailureWrappedWork(loggerService, e, context);
logException(loggerService, e);
}
}
private void logException(final TechnicalLoggerService loggerService, final Throwable e) {
if (loggerService.isLoggable(getClass(), TechnicalLogSeverity.DEBUG)) {
loggerService.log(getClass(), TechnicalLogSeverity.DEBUG, "Exception : " + e);
} else {
String message = e.getMessage();
if (message == null || message.isEmpty()) {
message = "No message";
}
loggerService.log(getClass(), TechnicalLogSeverity.WARNING, e.getClass().getName() + " : \"" + message + "\"");
}
}
private void handleFailureWrappedWork(final TechnicalLoggerService loggerService, final Throwable e, final Map<String, Object> context) {
try {
getWrappedWork().handleFailure(e, context);
} catch (final Throwable e1) {
loggerService.log(getClass(), TechnicalLogSeverity.ERROR, "Unexpected error while executing work [" + getDescription() + "]"
+ ". You may consider restarting the system. This will restart all works.", e);
loggerService.log(getClass(), TechnicalLogSeverity.ERROR, "Unable to handle the failure. ", e1);
logIncident(e, e1);
}
}
protected void logFailureCause(final TechnicalLoggerService loggerService, final Throwable e) {
>>>>>>>
@Override
public void handleFailure(final Throwable e, final Map<String, Object> context) {
final TenantServiceAccessor tenantAccessor = getTenantAccessor();
final TechnicalLoggerService loggerService = tenantAccessor.getTechnicalLoggerService();
final Throwable cause = e.getCause();
if (mustNotPutInFailedState(e)) {
logFailureCause(loggerService, e);
} else if (mustNotPutInFailedState(cause)) {
logFailureCause(loggerService, cause);
} else {
// final Edge case we cannot manage
if (loggerService.isLoggable(getClass(), TechnicalLogSeverity.WARNING)) {
loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "The work [" + getDescription() + "] failed. The failure will be handled.");
}
// To do before log, because we want to set the context of the exception.
handleFailureWrappedWork(loggerService, e, context);
logException(loggerService, e);
}
}
private void logException(final TechnicalLoggerService loggerService, final Throwable e) {
if (loggerService.isLoggable(getClass(), TechnicalLogSeverity.DEBUG)) {
loggerService.log(getClass(), TechnicalLogSeverity.DEBUG, "Exception : " + e);
} else {
String message = e.getMessage();
if (message == null || message.isEmpty()) {
message = "No message";
}
loggerService.log(getClass(), TechnicalLogSeverity.WARNING, e.getClass().getName() + " : \"" + message + "\"");
}
}
private void handleFailureWrappedWork(final TechnicalLoggerService loggerService, final Throwable e, final Map<String, Object> context) {
try {
getWrappedWork().handleFailure(e, context);
} catch (final Throwable e1) {
loggerService.log(getClass(), TechnicalLogSeverity.ERROR, "Unexpected error while executing work [" + getDescription() + "]"
+ ". You may consider restarting the system. This will restart all works.", e);
loggerService.log(getClass(), TechnicalLogSeverity.ERROR, "Unable to handle the failure. ", e1);
logIncident(e, e1);
}
}
private boolean mustNotPutInFailedState(final Throwable e) {
return e instanceof SFlowNodeNotFoundException
|| e instanceof SProcessInstanceNotFoundException
|| e instanceof SProcessDefinitionNotFoundException
|| isTransitionFromTerminalState(e);
}
boolean isTransitionFromTerminalState(final Throwable t) {
if (!(t instanceof SIllegalStateTransition)) {
return false;
}
SIllegalStateTransition e = (SIllegalStateTransition) t;
return e.isTransitionFromTerminalState();
}
protected void logFailureCause(final TechnicalLoggerService loggerService, final Throwable e) { |
<<<<<<<
import org.bonitasoft.engine.bpm.flownode.ArchivedUserTaskInstance;
import org.bonitasoft.engine.core.process.instance.model.STaskPriority;
import org.bonitasoft.engine.core.process.instance.model.archive.impl.SAUserTaskInstanceImpl;
=======
import org.bonitasoft.engine.bpm.document.Document;
import org.bonitasoft.engine.core.document.api.DocumentService;
import org.bonitasoft.engine.core.document.model.SDocument;
import org.bonitasoft.engine.core.document.model.SMappedDocument;
>>>>>>>
import org.bonitasoft.engine.bpm.flownode.ArchivedUserTaskInstance;
import org.bonitasoft.engine.core.process.instance.model.STaskPriority;
import org.bonitasoft.engine.core.process.instance.model.archive.impl.SAUserTaskInstanceImpl;
import org.bonitasoft.engine.bpm.document.Document;
import org.bonitasoft.engine.core.document.api.DocumentService;
import org.bonitasoft.engine.core.document.model.SDocument;
import org.bonitasoft.engine.core.document.model.SMappedDocument;
<<<<<<<
@Mock
private FlowNodeStateManager manager;
=======
>>>>>>>
@Mock
private FlowNodeStateManager manager; |
<<<<<<<
public BPMServicesBuilder(final Long tenantId) {
=======
public BPMServicesBuilder(final Long tenantid) {
// What is the parameter tenantId useful for ?
>>>>>>>
public BPMServicesBuilder(final Long tenantId) {
// What is the parameter tenantId useful for ?
<<<<<<<
=======
>>>>>>> |
<<<<<<<
} catch (final InterruptedException e) {
loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Error while stopping the connector executor thread pool", e);
=======
} catch (InterruptedException e) {
loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Error while stopping the connector executor thread pool.", e);
>>>>>>>
} catch (final InterruptedException e) {
loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Error while stopping the connector executor thread pool.", e);
<<<<<<<
public void pause() throws SBonitaException {
=======
public void pause() {
>>>>>>>
public void pause() throws SBonitaException { |
<<<<<<<
import org.hibernate.annotations.Type;
=======
>>>>>>>
import org.hibernate.annotations.Type; |
<<<<<<<
return deployAndEnableWithActor(builder.done(), delivery, john);
=======
final ProcessDefinition processDefinition = deployAndEnableProcessWithActor(builder.done(), delivery, john);
return processDefinition;
>>>>>>>
return deployAndEnableProcessWithActor(builder.done(), delivery, john); |
<<<<<<<
final List<AbstractSMappedDocument> allDocumentOfTheList = documentHelper.getAllDocumentOfTheList(processInstanceId, documentName);
=======
final List<SMappedDocument> allDocumentOfTheList = documentHelper
.getAllDocumentOfTheList(processInstanceId, documentName);
>>>>>>>
final List<AbstractSMappedDocument> allDocumentOfTheList = documentHelper
.getAllDocumentOfTheList(processInstanceId, documentName);
<<<<<<<
final SAActivityInstance instance = activityInstanceService.getMostRecentArchivedActivityInstance(activityInstanceId);
final AbstractSMappedDocument document = documentService.getMappedDocument(instance.getRootContainerId(), documentName, instance.getArchiveDate());
=======
final SAActivityInstance instance = activityInstanceService
.getMostRecentArchivedActivityInstance(activityInstanceId);
final SMappedDocument document = documentService.getMappedDocument(instance.getRootContainerId(),
documentName, instance.getArchiveDate());
>>>>>>>
final SAActivityInstance instance = activityInstanceService
.getMostRecentArchivedActivityInstance(activityInstanceId);
final AbstractSMappedDocument document = documentService.getMappedDocument(instance.getRootContainerId(),
documentName, instance.getArchiveDate());
<<<<<<<
final List<AbstractSMappedDocument> allDocumentOfTheList = documentHelper.getAllDocumentOfTheList(document.getProcessInstanceId(), document.getName());
=======
final List<SMappedDocument> allDocumentOfTheList = documentHelper
.getAllDocumentOfTheList(document.getProcessInstanceId(), document.getName());
>>>>>>>
final List<AbstractSMappedDocument> allDocumentOfTheList = documentHelper
.getAllDocumentOfTheList(document.getProcessInstanceId(), document.getName()); |
<<<<<<<
import org.bonitasoft.engine.core.process.instance.model.STaskPriority;
import org.bonitasoft.engine.core.process.instance.model.SUserTaskInstance;
=======
>>>>>>>
import org.bonitasoft.engine.core.process.instance.model.SUserTaskInstance;
<<<<<<<
* Create manual user task in DB by given information. This is create sub task for the given user task.
*
* @param userTaskId
* identifier of user task, the user task is the parent of the created manual user task
* @param name
* name of user task
* @param displayName
* @param userId
* identifier of user that the new created manual user task will be assigned to.
* @param description
* description of user task
* @param dueDate
* expected end date of the new created manual user task
* @return the new created manual user task object
* @throws SActivityCreationException
* @throws SFlowNodeNotFoundException
* @throws SFlowNodeReadException
*/
SManualTaskInstance createManualUserTask(long userTaskId, String name, long flowNodeDefinitionId, String displayName, long userId, String description,
long dueDate, STaskPriority priority) throws SActivityCreationException, SFlowNodeNotFoundException, SFlowNodeReadException;
/**
=======
>>>>>>>
<<<<<<<
* Returns the instance of the human task.
*
* @param humanTaskInstanceId
* the identifier of human task
* @return the instance of the human task
=======
* Get humanTaskInstance by its id
*
* @param activityInstanceId
* identifier of humanTaskInstance
* @return an SHumanTaskInstance object with id corresponding to the parameter
>>>>>>>
* Returns the instance of the human task.
*
* @param humanTaskInstanceId
* the identifier of human task
* @return the instance of the human task |
<<<<<<<
=======
final ProcessExecutor processExecutor = tenantAccessor.getProcessExecutor();
final ActivityInstanceService activityInstanceService = tenantAccessor.getActivityInstanceService();
final LockService lockService = tenantAccessor.getLockService();
final TechnicalLoggerService logger = tenantAccessor.getTechnicalLoggerService();
final TransactionContent transactionContent = new TransactionContent() {
@Override
public void execute() throws SBonitaException {
final SSession session = SessionInfos.getSession();
if (session != null) {
final long executerSubstituteUserId = session.getUserId();
final long executerUserId;
if (userId == 0) {
executerUserId = executerSubstituteUserId;
} else {
executerUserId = userId;
}
final SFlowNodeInstance flowNodeInstance = activityInstanceService.getFlowNodeInstance(flownodeInstanceId);
final boolean isFirstState = flowNodeInstance.getStateId() == 0;
// no need to handle failed state, all is in the same tx, if the node fail we just have an exception on client side + rollback
processExecutor
.executeFlowNode(flownodeInstanceId, null, null, flowNodeInstance.getParentProcessInstanceId(), executerUserId,
executerSubstituteUserId);
if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO) && !isFirstState /* don't log when create subtask */) {
final String message = LogMessageBuilder.buildExecuteTaskContextMessage(flowNodeInstance, session.getUserName(), executerUserId,
executerSubstituteUserId);
logger.log(getClass(), TechnicalLogSeverity.INFO, message);
}
>>>>>>>
<<<<<<<
final TransientDataService transientDataInstanceService) throws SDataInstanceException {
=======
final TransientDataService transientDataInstanceService)
throws SDataInstanceException {
>>>>>>>
final TransientDataService transientDataInstanceService) throws SDataInstanceException { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.