repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
sourcepole/jasperreports-wms-component
jasperreports-wms-component/src/main/java/com/sourcepole/jasperreports/wmsmap/ComponentsExtensionsRegistryFactory.java
// Path: jasperreports-wms-component/src/main/java/com/sourcepole/jasperreports/wmsmap/fill/WmsMapFillFactory.java // public class WmsMapFillFactory implements ComponentFillFactory { // // @Override // public FillComponent toFillComponent(Component component, // JRFillObjectFactory factory) { // WmsMapCo...
import java.util.Collections; import java.util.HashMap; import java.util.List; import net.sf.jasperreports.engine.JRPropertiesMap; import net.sf.jasperreports.engine.component.ComponentManager; import net.sf.jasperreports.engine.component.ComponentsBundle; import net.sf.jasperreports.engine.component.DefaultComponentXm...
else if (JRPptxExporter.PPTX_EXPORTER_KEY.equals(exporterKey)) { return WmsMapElementPptxHandler.getInstance(); } else if (JRRtfExporter.RTF_EXPORTER_KEY.equals(exporterKey)) { return WmsMapElementRtfHandler.getInstance(); } else if...
// Path: jasperreports-wms-component/src/main/java/com/sourcepole/jasperreports/wmsmap/fill/WmsMapFillFactory.java // public class WmsMapFillFactory implements ComponentFillFactory { // // @Override // public FillComponent toFillComponent(Component component, // JRFillObjectFactory factory) { // WmsMapCo...
wmsMapManager.setComponentFillFactory(new WmsMapFillFactory());
mfornos/humanize
humanize-emoji/src/test/java/humanize/emoji/TestEmoji.java
// Path: humanize-emoji/src/main/java/humanize/emoji/EmojiChar.java // public enum Vendor // { // DOCOMO("DoCoMo"), // KDDI("KDDI"), // SOFT_BANK("SoftBank"); // // private final String name; // // private Vendor(String name) // { // this.name = name; // } // // public String ...
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNull; import static org.testng.Assert.fail; import humanize.emoji.EmojiChar.Vendor; import java.util.Collection; import org.testng.annotations.Test;
EmojiChar japanFlag = Emoji.findByCodePoint(UTF16_COMPOUND_CP); assertNotNull(japanFlag, "Japan flag was not found"); } @Test public void testCodePointToRaw() { assertEquals(Emoji.codePointToString("2639"), SIMPLE_CP, "Simple face"); assertEquals(Emoji.codePointToString(...
// Path: humanize-emoji/src/main/java/humanize/emoji/EmojiChar.java // public enum Vendor // { // DOCOMO("DoCoMo"), // KDDI("KDDI"), // SOFT_BANK("SoftBank"); // // private final String name; // // private Vendor(String name) // { // this.name = name; // } // // public String ...
EmojiChar echar = Emoji.findByVendorCodePoint(Vendor.DOCOMO, "\uF9D7");
mfornos/humanize
humanize-slim/src/main/java/humanize/util/Parameters.java
// Path: humanize-slim/src/main/java/humanize/util/Constants.java // public static final String DEFAULT_SLUG_SEPARATOR = "-"; // // Path: humanize-slim/src/main/java/humanize/time/TimeMillis.java // public enum TimeMillis // { // SECOND(1000L), // MINUTE(60000L), // HOUR(3600000L), // DAY(86400000L), /...
import static humanize.util.Constants.DEFAULT_SLUG_SEPARATOR; import humanize.time.TimeMillis; import com.google.common.base.Preconditions;
/** * The interval of the pace in milliseconds. * * @see TimeMillis */ public long interval; private PaceParameters() { // } public void checkArguments() { Preconditions.checkArgument(plural != null, ...
// Path: humanize-slim/src/main/java/humanize/util/Constants.java // public static final String DEFAULT_SLUG_SEPARATOR = "-"; // // Path: humanize-slim/src/main/java/humanize/time/TimeMillis.java // public enum TimeMillis // { // SECOND(1000L), // MINUTE(60000L), // HOUR(3600000L), // DAY(86400000L), /...
public PaceParameters interval(TimeMillis interval)
mfornos/humanize
humanize-slim/src/main/java/humanize/util/Parameters.java
// Path: humanize-slim/src/main/java/humanize/util/Constants.java // public static final String DEFAULT_SLUG_SEPARATOR = "-"; // // Path: humanize-slim/src/main/java/humanize/time/TimeMillis.java // public enum TimeMillis // { // SECOND(1000L), // MINUTE(60000L), // HOUR(3600000L), // DAY(86400000L), /...
import static humanize.util.Constants.DEFAULT_SLUG_SEPARATOR; import humanize.time.TimeMillis; import com.google.common.base.Preconditions;
} /** * Parameterization for slugify calls. * */ public final static class SlugifyParams { /** * Builder method. * * @return a new slugify parameters instance */ public static SlugifyParams begin() { return new Slu...
// Path: humanize-slim/src/main/java/humanize/util/Constants.java // public static final String DEFAULT_SLUG_SEPARATOR = "-"; // // Path: humanize-slim/src/main/java/humanize/time/TimeMillis.java // public enum TimeMillis // { // SECOND(1000L), // MINUTE(60000L), // HOUR(3600000L), // DAY(86400000L), /...
this.separator = DEFAULT_SLUG_SEPARATOR;
mfornos/humanize
humanize-emoji/src/main/java/humanize/emoji/EmojiInterpolator.java
// Path: humanize-slim/src/main/java/humanize/text/util/InterpolationHelper.java // public static String interpolate(String text, Pattern pattern, Replacer replacer) // { // // Matcher matcher = pattern.matcher(text); // StringBuffer sb = new StringBuffer(); // // while (matcher.find()) // { // ...
import static humanize.text.util.InterpolationHelper.interpolate; import humanize.spi.MessageFormat; import humanize.text.util.Replacer; import humanize.text.util.UnicodeInterpolator; import java.util.regex.Pattern; import com.google.common.base.Preconditions; import com.google.common.base.Strings;
package humanize.emoji; /** * <p> * Sexy and easy text interpolation of Unicode emoji code points and aliases. * </p> * <h5>Examples:</h5> * * <pre> * EmojiInterpolator.interpolateAlias(&quot;&lt;img src=\&quot;imgs/{0}.png\&quot; title=\&quot;{1}\&quot; /&gt;&quot;, &quot;Hi :sparkles:!&quot;); * // == &q...
// Path: humanize-slim/src/main/java/humanize/text/util/InterpolationHelper.java // public static String interpolate(String text, Pattern pattern, Replacer replacer) // { // // Matcher matcher = pattern.matcher(text); // StringBuffer sb = new StringBuffer(); // // while (matcher.find()) // { // ...
public static UnicodeInterpolator createEmojiInterpolator(String pattern)
mfornos/humanize
humanize-emoji/src/main/java/humanize/emoji/EmojiInterpolator.java
// Path: humanize-slim/src/main/java/humanize/text/util/InterpolationHelper.java // public static String interpolate(String text, Pattern pattern, Replacer replacer) // { // // Matcher matcher = pattern.matcher(text); // StringBuffer sb = new StringBuffer(); // // while (matcher.find()) // { // ...
import static humanize.text.util.InterpolationHelper.interpolate; import humanize.spi.MessageFormat; import humanize.text.util.Replacer; import humanize.text.util.UnicodeInterpolator; import java.util.regex.Pattern; import com.google.common.base.Preconditions; import com.google.common.base.Strings;
super(pattern); } @Override public String replace(String alias) { // TODO better by 'de facto' standard aliases for compatibility? EmojiChar echar = Emoji.singleByAnnotations(alias); String code = echar == null ? Strings.nullToEmpty(alias)...
// Path: humanize-slim/src/main/java/humanize/text/util/InterpolationHelper.java // public static String interpolate(String text, Pattern pattern, Replacer replacer) // { // // Matcher matcher = pattern.matcher(text); // StringBuffer sb = new StringBuffer(); // // while (matcher.find()) // { // ...
private static class MessageFormatReplacer implements Replacer
mfornos/humanize
humanize-emoji/src/main/java/humanize/emoji/EmojiInterpolator.java
// Path: humanize-slim/src/main/java/humanize/text/util/InterpolationHelper.java // public static String interpolate(String text, Pattern pattern, Replacer replacer) // { // // Matcher matcher = pattern.matcher(text); // StringBuffer sb = new StringBuffer(); // // while (matcher.find()) // { // ...
import static humanize.text.util.InterpolationHelper.interpolate; import humanize.spi.MessageFormat; import humanize.text.util.Replacer; import humanize.text.util.UnicodeInterpolator; import java.util.regex.Pattern; import com.google.common.base.Preconditions; import com.google.common.base.Strings;
@Override public String replace(String alias) { // TODO better by 'de facto' standard aliases for compatibility? EmojiChar echar = Emoji.singleByAnnotations(alias); String code = echar == null ? Strings.nullToEmpty(alias) : echar.getCode().toLowerCase(); ...
// Path: humanize-slim/src/main/java/humanize/text/util/InterpolationHelper.java // public static String interpolate(String text, Pattern pattern, Replacer replacer) // { // // Matcher matcher = pattern.matcher(text); // StringBuffer sb = new StringBuffer(); // // while (matcher.find()) // { // ...
protected final MessageFormat msgFormat;
mfornos/humanize
humanize-taglib/src/main/java/org/apache/taglibs/standard/tag/common/fmt/NumberCallSupport.java
// Path: humanize-taglib/src/main/java/humanize/taglibs/util/Convert.java // public static Number asNumber(Object input) throws JspException // { // // if (input instanceof String) // { // try // { // String istr = (String) input; // return (istr.indexOf('.') != -1) ? Do...
import static humanize.taglibs.util.Convert.asNumber; import javax.servlet.jsp.JspException;
package org.apache.taglibs.standard.tag.common.fmt; public abstract class NumberCallSupport extends HumanizeSupport { private static final long serialVersionUID = 4926940370084394075L; private Object value; protected Number input; public void setValue(Object value) { this.value = val...
// Path: humanize-taglib/src/main/java/humanize/taglibs/util/Convert.java // public static Number asNumber(Object input) throws JspException // { // // if (input instanceof String) // { // try // { // String istr = (String) input; // return (istr.indexOf('.') != -1) ? Do...
this.input = asNumber(tmp);
mfornos/humanize
humanize-ucum/src/main/java/humanize/measure/MeasureFormatProvider.java
// Path: humanize-slim/src/main/java/humanize/spi/FormatProvider.java // public interface FormatProvider // { // // /** // * Gets the format factory. // * // * @return a {@link FormatFactory} instance // */ // FormatFactory getFactory(); // // /** // * Gets the format name that w...
import humanize.spi.FormatProvider; import humanize.text.FormatFactory; import java.text.Format; import java.text.NumberFormat; import java.util.Locale; import javax.measure.MeasureFormat; import javax.measure.unit.UnitFormat;
package humanize.measure; /** * <p> * Provides a JSR-275 measure formatter. Supports "standard" sub-format. * </p> * * Examples: * * <pre> * * // == &quot;100 kg&quot; * Humanize.format(&quot;{0, measure}&quot;, Measure.valueOf(100, SI.GRAM.times(1000))); * * Humanize.format(&quot;{0, measure, stand...
// Path: humanize-slim/src/main/java/humanize/spi/FormatProvider.java // public interface FormatProvider // { // // /** // * Gets the format factory. // * // * @return a {@link FormatFactory} instance // */ // FormatFactory getFactory(); // // /** // * Gets the format name that w...
public FormatFactory getFactory()
mfornos/humanize
humanize-icu/src/main/java/humanize/icu/spi/context/ICUContextFactory.java
// Path: humanize-slim/src/main/java/humanize/spi/context/Context.java // public interface Context // { // // String digitStrings(int index); // // String formatDate(int style, Date value); // // String formatDateTime(Date date); // // String formatDateTime(int dateStyle, int timeStyle, Date date); ...
import humanize.spi.context.Context; import humanize.spi.context.ContextFactory;
package humanize.icu.spi.context; /** * Default implementation of {@link ContextFactory}. Creates * {@link DefaultICUContext} instances. * * @author michaux * */ public class ICUContextFactory implements ContextFactory { @Override
// Path: humanize-slim/src/main/java/humanize/spi/context/Context.java // public interface Context // { // // String digitStrings(int index); // // String formatDate(int style, Date value); // // String formatDateTime(Date date); // // String formatDateTime(int dateStyle, int timeStyle, Date date); ...
public Context createContext()
mfornos/humanize
humanize-slim/src/test/java/humanize/text/TestMaskFormat.java
// Path: humanize-slim/src/main/java/humanize/spi/MessageFormat.java // public class MessageFormat extends ExtendedMessageFormat // { // // private static final long serialVersionUID = -5384364921909539710L; // // private final static Map<String, FormatFactory> formatFactories = loadFormatFactories(); // // ...
import humanize.spi.MessageFormat; import java.text.FieldPosition; import java.text.Format; import java.text.ParseException; import org.testng.Assert; import org.testng.annotations.Test;
} @Test public void maskParseTest() throws ParseException { Assert.assertEquals(MaskFormat.parse("", "hi"), "hi"); Assert.assertEquals(MaskFormat.parse((String) null, (String) null), null); Assert.assertEquals(MaskFormat.parse("____ ____ __", "1234 5678 90"), "1234567890"); ...
// Path: humanize-slim/src/main/java/humanize/spi/MessageFormat.java // public class MessageFormat extends ExtendedMessageFormat // { // // private static final long serialVersionUID = -5384364921909539710L; // // private final static Map<String, FormatFactory> formatFactories = loadFormatFactories(); // // ...
MessageFormat msg = new MessageFormat("Hello {0}");
mfornos/humanize
humanize-slim/src/test/java/humanize/text/UnicodeInterpolatorTest.java
// Path: humanize-slim/src/main/java/humanize/text/util/Replacer.java // public interface Replacer // { // // String replace(String replacement); // // } // // Path: humanize-slim/src/main/java/humanize/text/util/UnicodeInterpolator.java // public class UnicodeInterpolator extends UnicodeEscaper // { // priv...
import static org.testng.Assert.assertEquals; import humanize.text.util.Replacer; import humanize.text.util.UnicodeInterpolator; import org.testng.annotations.Test;
package humanize.text; public class UnicodeInterpolatorTest { @Test public void replaceTest() {
// Path: humanize-slim/src/main/java/humanize/text/util/Replacer.java // public interface Replacer // { // // String replace(String replacement); // // } // // Path: humanize-slim/src/main/java/humanize/text/util/UnicodeInterpolator.java // public class UnicodeInterpolator extends UnicodeEscaper // { // priv...
UnicodeInterpolator interpol = new UnicodeInterpolator(createTestReplacer());
mfornos/humanize
humanize-slim/src/test/java/humanize/text/UnicodeInterpolatorTest.java
// Path: humanize-slim/src/main/java/humanize/text/util/Replacer.java // public interface Replacer // { // // String replace(String replacement); // // } // // Path: humanize-slim/src/main/java/humanize/text/util/UnicodeInterpolator.java // public class UnicodeInterpolator extends UnicodeEscaper // { // priv...
import static org.testng.Assert.assertEquals; import humanize.text.util.Replacer; import humanize.text.util.UnicodeInterpolator; import org.testng.annotations.Test;
package humanize.text; public class UnicodeInterpolatorTest { @Test public void replaceTest() { UnicodeInterpolator interpol = new UnicodeInterpolator(createTestReplacer()); interpol.addRange(0x20a0, 0x32ff); assertEquals(interpol.escape("♦♦ Alakazam 123 ♦♦"), "xx Alakazam 123 xx...
// Path: humanize-slim/src/main/java/humanize/text/util/Replacer.java // public interface Replacer // { // // String replace(String replacement); // // } // // Path: humanize-slim/src/main/java/humanize/text/util/UnicodeInterpolator.java // public class UnicodeInterpolator extends UnicodeEscaper // { // priv...
private Replacer createTestReplacer()
mfornos/humanize
humanize-joda/src/main/java/humanize/time/joda/FormatTables.java
// Path: humanize-joda/src/main/java/humanize/time/joda/JodaTimeFormatProvider.java // public static class JodaDateTimeFormat extends JodaBaseFormat<DateTimeFormatter> // { // // private static final long serialVersionUID = -7080564879531103796L; // // public JodaDateTimeFormat(Method method) // { // ...
import humanize.time.joda.JodaTimeFormatProvider.JodaDateTimeFormat; import humanize.time.joda.JodaTimeFormatProvider.JodaPeriodFormat; import java.text.Format; import java.util.HashMap; import java.util.Map; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.ISODateTimeFormat; import org.joda.time...
package humanize.time.joda; /** * Table to find Joda time format variants by name. */ public final class FormatTables implements FormatNames { private static FormatTables instance; /** * Retrieves a variants map for a given format name. * * @param name * The format name ...
// Path: humanize-joda/src/main/java/humanize/time/joda/JodaTimeFormatProvider.java // public static class JodaDateTimeFormat extends JodaBaseFormat<DateTimeFormatter> // { // // private static final long serialVersionUID = -7080564879531103796L; // // public JodaDateTimeFormat(Method method) // { // ...
JodaDateTimeFormat shortDate = newDateTimeFormat("shortDate");
mfornos/humanize
humanize-joda/src/main/java/humanize/time/joda/FormatTables.java
// Path: humanize-joda/src/main/java/humanize/time/joda/JodaTimeFormatProvider.java // public static class JodaDateTimeFormat extends JodaBaseFormat<DateTimeFormatter> // { // // private static final long serialVersionUID = -7080564879531103796L; // // public JodaDateTimeFormat(Method method) // { // ...
import humanize.time.joda.JodaTimeFormatProvider.JodaDateTimeFormat; import humanize.time.joda.JodaTimeFormatProvider.JodaPeriodFormat; import java.text.Format; import java.util.HashMap; import java.util.Map; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.ISODateTimeFormat; import org.joda.time...
ipm.put(ISO_PERIOD_ALTERNATE, newISOPeriodFormat(ISO_PERIOD_ALTERNATE)); ipm.put(ISO_PERIOD_ALTERNATE_EXTENDED, newISOPeriodFormat("alternateExtended")); ipm.put(ISO_PERIOD_ALTERNATE_WITH_WEEKS, newISOPeriodFormat("alternateWithWeeks")); ipm.put(ISO_PERIOD_ALTERNATE_EXTENDED_WITH_WEEKS, ...
// Path: humanize-joda/src/main/java/humanize/time/joda/JodaTimeFormatProvider.java // public static class JodaDateTimeFormat extends JodaBaseFormat<DateTimeFormatter> // { // // private static final long serialVersionUID = -7080564879531103796L; // // public JodaDateTimeFormat(Method method) // { // ...
private JodaPeriodFormat newISOPeriodFormat(String name)
mfornos/humanize
humanize-icu/src/main/java/humanize/icu/spi/context/ICUContext.java
// Path: humanize-icu/src/main/java/humanize/icu/spi/MessageFormat.java // public class MessageFormat extends com.ibm.icu.text.MessageFormat // { // // private static final long serialVersionUID = -5384364921909539710L; // // public MessageFormat(String pattern) // { // // super(pattern); // // ...
import humanize.icu.spi.MessageFormat; import com.ibm.icu.text.CompactDecimalFormat.CompactStyle; import com.ibm.icu.text.DateFormat; import com.ibm.icu.text.DecimalFormat; import com.ibm.icu.text.DurationFormat; import com.ibm.icu.text.NumberFormat; import com.ibm.icu.util.ULocale;
package humanize.icu.spi.context; public interface ICUContext { String getBestPattern(String skeleton); NumberFormat getCompactDecimalFormat(); NumberFormat getCompactDecimalFormat(CompactStyle style); DecimalFormat getCurrencyFormat(); DateFormat getDateFormat(int style); DateForma...
// Path: humanize-icu/src/main/java/humanize/icu/spi/MessageFormat.java // public class MessageFormat extends com.ibm.icu.text.MessageFormat // { // // private static final long serialVersionUID = -5384364921909539710L; // // public MessageFormat(String pattern) // { // // super(pattern); // // ...
MessageFormat getMessageFormat();
mfornos/humanize
humanize-emoji/src/main/java/humanize/emoji/Emoji.java
// Path: humanize-emoji/src/main/java/humanize/emoji/EmojiChar.java // public enum Vendor // { // DOCOMO("DoCoMo"), // KDDI("KDDI"), // SOFT_BANK("SoftBank"); // // private final String name; // // private Vendor(String name) // { // this.name = name; // } // // public String ...
import humanize.emoji.EmojiChar.Vendor; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.ut...
* @param code * the Unicode code point * @return the corresponding emoji character or null if not found */ public static EmojiChar findByCodePoint(String code) { return getInstance()._findByCodePoint(code); } /** * Finds an emoji character by hexadecimal code...
// Path: humanize-emoji/src/main/java/humanize/emoji/EmojiChar.java // public enum Vendor // { // DOCOMO("DoCoMo"), // KDDI("KDDI"), // SOFT_BANK("SoftBank"); // // private final String name; // // private Vendor(String name) // { // this.name = name; // } // // public String ...
public static EmojiChar findByVendorCodePoint(Vendor vendor, String point)
mfornos/humanize
humanize-emoji/src/main/java/humanize/emoji/EmojiApi.java
// Path: humanize-emoji/src/main/java/humanize/emoji/EmojiInterpolator.java // public static UnicodeInterpolator createEmojiInterpolator(String pattern) // { // UnicodeInterpolator ui = new UnicodeInterpolator(new EmojiCodePointReplacer(pattern)); // ui.addRange(0x20a0, 0x32ff); // ui.addRange(0x1f000, 0x1f...
import static humanize.emoji.EmojiInterpolator.createEmojiInterpolator; import humanize.text.util.UnicodeInterpolator; import java.net.URL; import java.util.List; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.base.Strings;
* * @param text * The text to be interpolated * @return the text with all the Emoji characters replaced by its HTML image * tag */ public static String replaceUnicodeWithImages(String text) { return getInstance().interpolate(text); } /** * ...
// Path: humanize-emoji/src/main/java/humanize/emoji/EmojiInterpolator.java // public static UnicodeInterpolator createEmojiInterpolator(String pattern) // { // UnicodeInterpolator ui = new UnicodeInterpolator(new EmojiCodePointReplacer(pattern)); // ui.addRange(0x20a0, 0x32ff); // ui.addRange(0x1f000, 0x1f...
private UnicodeInterpolator interpolator;
mfornos/humanize
humanize-emoji/src/main/java/humanize/emoji/EmojiApi.java
// Path: humanize-emoji/src/main/java/humanize/emoji/EmojiInterpolator.java // public static UnicodeInterpolator createEmojiInterpolator(String pattern) // { // UnicodeInterpolator ui = new UnicodeInterpolator(new EmojiCodePointReplacer(pattern)); // ui.addRange(0x20a0, 0x32ff); // ui.addRange(0x1f000, 0x1f...
import static humanize.emoji.EmojiInterpolator.createEmojiInterpolator; import humanize.text.util.UnicodeInterpolator; import java.net.URL; import java.util.List; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.base.Strings;
} /** * Configures the extension for image interpolation methods. * * @param imageExt * The image extension. Defaults: "png" * @return the underlying EmojiApi instance for further chainning */ public EmojiApi imageExtension(String imageExt) { this.image...
// Path: humanize-emoji/src/main/java/humanize/emoji/EmojiInterpolator.java // public static UnicodeInterpolator createEmojiInterpolator(String pattern) // { // UnicodeInterpolator ui = new UnicodeInterpolator(new EmojiCodePointReplacer(pattern)); // ui.addRange(0x20a0, 0x32ff); // ui.addRange(0x1f000, 0x1f...
interpolator = createEmojiInterpolator(getImageFormat(assetsURL));
mfornos/humanize
humanize-slim/src/main/java/humanize/time/PrettyTimeFormat.java
// Path: humanize-slim/src/main/java/humanize/spi/FormatProvider.java // public interface FormatProvider // { // // /** // * Gets the format factory. // * // * @return a {@link FormatFactory} instance // */ // FormatFactory getFactory(); // // /** // * Gets the format name that w...
import humanize.spi.FormatProvider; import humanize.text.FormatFactory; import java.io.IOException; import java.io.ObjectInputStream; import java.text.FieldPosition; import java.text.Format; import java.text.ParsePosition; import java.util.Date; import java.util.List; import java.util.Locale; import org.ocpsoft.prettyt...
package humanize.time; /** * {@link Format} implementation for {@link PrettyTime}. * */ public class PrettyTimeFormat extends Format implements FormatProvider { private static final long serialVersionUID = -1398312177396430967L;
// Path: humanize-slim/src/main/java/humanize/spi/FormatProvider.java // public interface FormatProvider // { // // /** // * Gets the format factory. // * // * @return a {@link FormatFactory} instance // */ // FormatFactory getFactory(); // // /** // * Gets the format name that w...
public static FormatFactory factory()
mfornos/humanize
humanize-joda/src/main/java/humanize/time/joda/JodaTimeFormatProvider.java
// Path: humanize-slim/src/main/java/humanize/spi/FormatProvider.java // public interface FormatProvider // { // // /** // * Gets the format factory. // * // * @return a {@link FormatFactory} instance // */ // FormatFactory getFactory(); // // /** // * Gets the format name that w...
import humanize.spi.FormatProvider; import humanize.text.FormatFactory; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.text.FieldPosition; import java.text.Format; import java.text.ParseException; import java.text.ParsePosition; import java.util.Locale; import java.util...
package humanize.time.joda; /** * {@link FormatProvider} for Joda time. * */ public class JodaTimeFormatProvider implements FormatProvider { /** * Creates a factory for the specified format. * * @return FormatFactory instance */
// Path: humanize-slim/src/main/java/humanize/spi/FormatProvider.java // public interface FormatProvider // { // // /** // * Gets the format factory. // * // * @return a {@link FormatFactory} instance // */ // FormatFactory getFactory(); // // /** // * Gets the format name that w...
public static FormatFactory factory()
mfornos/humanize
humanize-slim/src/main/java/humanize/spi/cache/GuavaCacheProvider.java
// Path: humanize-slim/src/main/java/humanize/config/ConfigLoader.java // public class ConfigLoader // { // // private static final Properties DEFAULTS = new Properties(); // public static final String CACHE_BUILDER_SPEC = "cache.builder.spec"; // // static // { // DEFAULTS.setProperty(CACHE_B...
import humanize.config.ConfigLoader; import java.util.Locale; import java.util.Properties; import java.util.ResourceBundle; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.ca...
package humanize.spi.cache; /** * {@link CacheProvider} implementation that uses Guava caches as in memory * storage. * * @author mfornos * */ public class GuavaCacheProvider implements CacheProvider { private static final CacheBuilderSpec spec = initSpec(); private static CacheBuilderSpec initSpe...
// Path: humanize-slim/src/main/java/humanize/config/ConfigLoader.java // public class ConfigLoader // { // // private static final Properties DEFAULTS = new Properties(); // public static final String CACHE_BUILDER_SPEC = "cache.builder.spec"; // // static // { // DEFAULTS.setProperty(CACHE_B...
final Properties properties = ConfigLoader.loadProperties();
jawher/immanix
src/test/java/immanix/NamedStartElementMatcherTest.java
// Path: src/main/java/immanix/matchers/NamedStartElementMatcher.java // public class NamedStartElementMatcher extends BaseEventMatcher<StartElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the start element's name to match // */ // pub...
import immanix.matchers.NamedStartElementMatcher; import immanix.readers.ReplayEventReader; import org.junit.Test; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.uti...
package immanix; public class NamedStartElementMatcherTest { public static final String NS = "http://immanix.net/ns"; @Test public void testSuccessMatchOnLocalPartWithNoNsXml() throws Exception {
// Path: src/main/java/immanix/matchers/NamedStartElementMatcher.java // public class NamedStartElementMatcher extends BaseEventMatcher<StartElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the start element's name to match // */ // pub...
mustSucceed(new NamedStartElementMatcher("42"), Arrays.asList(se("42"), c("hi")));
jawher/immanix
src/test/java/immanix/NamedStartElementMatcherTest.java
// Path: src/main/java/immanix/matchers/NamedStartElementMatcher.java // public class NamedStartElementMatcher extends BaseEventMatcher<StartElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the start element's name to match // */ // pub...
import immanix.matchers.NamedStartElementMatcher; import immanix.readers.ReplayEventReader; import org.junit.Test; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.uti...
package immanix; public class NamedStartElementMatcherTest { public static final String NS = "http://immanix.net/ns"; @Test public void testSuccessMatchOnLocalPartWithNoNsXml() throws Exception {
// Path: src/main/java/immanix/matchers/NamedStartElementMatcher.java // public class NamedStartElementMatcher extends BaseEventMatcher<StartElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the start element's name to match // */ // pub...
mustSucceed(new NamedStartElementMatcher("42"), Arrays.asList(se("42"), c("hi")));
jawher/immanix
src/test/java/immanix/NamedStartElementMatcherTest.java
// Path: src/main/java/immanix/matchers/NamedStartElementMatcher.java // public class NamedStartElementMatcher extends BaseEventMatcher<StartElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the start element's name to match // */ // pub...
import immanix.matchers.NamedStartElementMatcher; import immanix.readers.ReplayEventReader; import org.junit.Test; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.uti...
package immanix; public class NamedStartElementMatcherTest { public static final String NS = "http://immanix.net/ns"; @Test public void testSuccessMatchOnLocalPartWithNoNsXml() throws Exception {
// Path: src/main/java/immanix/matchers/NamedStartElementMatcher.java // public class NamedStartElementMatcher extends BaseEventMatcher<StartElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the start element's name to match // */ // pub...
mustSucceed(new NamedStartElementMatcher("42"), Arrays.asList(se("42"), c("hi")));
jawher/immanix
src/test/java/immanix/NamedStartElementMatcherTest.java
// Path: src/main/java/immanix/matchers/NamedStartElementMatcher.java // public class NamedStartElementMatcher extends BaseEventMatcher<StartElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the start element's name to match // */ // pub...
import immanix.matchers.NamedStartElementMatcher; import immanix.readers.ReplayEventReader; import org.junit.Test; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.uti...
} @Test public void testFailureMatchBecauseOfNameWithNoNsXml() throws Exception { mustFail(new NamedStartElementMatcher("elem"), Arrays.<XMLEvent>asList(se("42"), c("chars"))); } @Test public void testFailureMatchBecauseOfNameWithNsXml() throws Exception { mustFail(new NamedSta...
// Path: src/main/java/immanix/matchers/NamedStartElementMatcher.java // public class NamedStartElementMatcher extends BaseEventMatcher<StartElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the start element's name to match // */ // pub...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/StartElementMatcherTest.java
// Path: src/main/java/immanix/matchers/StartElementMatcher.java // public class StartElementMatcher extends BaseEventMatcher<StartElement> { // // @Override // protected boolean accept(XMLEvent e) { // if (!e.isStartElement()) { // //System.out.println("failed to match <"); // } //...
import org.junit.Test; import immanix.matchers.StartElementMatcher; import immanix.readers.ReplayEventReader; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static immanix.utils.XMLEventsUtils...
package immanix; public class StartElementMatcherTest { @Test public void testSuccessMatch() throws Exception {
// Path: src/main/java/immanix/matchers/StartElementMatcher.java // public class StartElementMatcher extends BaseEventMatcher<StartElement> { // // @Override // protected boolean accept(XMLEvent e) { // if (!e.isStartElement()) { // //System.out.println("failed to match <"); // } //...
StartElementMatcher m = new StartElementMatcher();
jawher/immanix
src/test/java/immanix/StartElementMatcherTest.java
// Path: src/main/java/immanix/matchers/StartElementMatcher.java // public class StartElementMatcher extends BaseEventMatcher<StartElement> { // // @Override // protected boolean accept(XMLEvent e) { // if (!e.isStartElement()) { // //System.out.println("failed to match <"); // } //...
import org.junit.Test; import immanix.matchers.StartElementMatcher; import immanix.readers.ReplayEventReader; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static immanix.utils.XMLEventsUtils...
package immanix; public class StartElementMatcherTest { @Test public void testSuccessMatch() throws Exception { StartElementMatcher m = new StartElementMatcher();
// Path: src/main/java/immanix/matchers/StartElementMatcher.java // public class StartElementMatcher extends BaseEventMatcher<StartElement> { // // @Override // protected boolean accept(XMLEvent e) { // if (!e.isStartElement()) { // //System.out.println("failed to match <"); // } //...
List<XMLEvent> events = Arrays.asList(se("42"), c("hi"));
jawher/immanix
src/test/java/immanix/StartElementMatcherTest.java
// Path: src/main/java/immanix/matchers/StartElementMatcher.java // public class StartElementMatcher extends BaseEventMatcher<StartElement> { // // @Override // protected boolean accept(XMLEvent e) { // if (!e.isStartElement()) { // //System.out.println("failed to match <"); // } //...
import org.junit.Test; import immanix.matchers.StartElementMatcher; import immanix.readers.ReplayEventReader; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static immanix.utils.XMLEventsUtils...
package immanix; public class StartElementMatcherTest { @Test public void testSuccessMatch() throws Exception { StartElementMatcher m = new StartElementMatcher();
// Path: src/main/java/immanix/matchers/StartElementMatcher.java // public class StartElementMatcher extends BaseEventMatcher<StartElement> { // // @Override // protected boolean accept(XMLEvent e) { // if (!e.isStartElement()) { // //System.out.println("failed to match <"); // } //...
List<XMLEvent> events = Arrays.asList(se("42"), c("hi"));
jawher/immanix
src/test/java/immanix/StartElementMatcherTest.java
// Path: src/main/java/immanix/matchers/StartElementMatcher.java // public class StartElementMatcher extends BaseEventMatcher<StartElement> { // // @Override // protected boolean accept(XMLEvent e) { // if (!e.isStartElement()) { // //System.out.println("failed to match <"); // } //...
import org.junit.Test; import immanix.matchers.StartElementMatcher; import immanix.readers.ReplayEventReader; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static immanix.utils.XMLEventsUtils...
package immanix; public class StartElementMatcherTest { @Test public void testSuccessMatch() throws Exception { StartElementMatcher m = new StartElementMatcher(); List<XMLEvent> events = Arrays.asList(se("42"), c("hi"));
// Path: src/main/java/immanix/matchers/StartElementMatcher.java // public class StartElementMatcher extends BaseEventMatcher<StartElement> { // // @Override // protected boolean accept(XMLEvent e) { // if (!e.isStartElement()) { // //System.out.println("failed to match <"); // } //...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/UntilMatcherTest.java
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
import immanix.matchers.UntilMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.LatentPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.utils.XMLEventsUtils.se; ...
package immanix; public class UntilMatcherTest { @Test public void testSuccessMatch() throws Exception {
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
UntilMatcher<Object> m = new UntilMatcher<Object>(new LatentPacman(2));
jawher/immanix
src/test/java/immanix/UntilMatcherTest.java
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
import immanix.matchers.UntilMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.LatentPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.utils.XMLEventsUtils.se; ...
package immanix; public class UntilMatcherTest { @Test public void testSuccessMatch() throws Exception {
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
UntilMatcher<Object> m = new UntilMatcher<Object>(new LatentPacman(2));
jawher/immanix
src/test/java/immanix/UntilMatcherTest.java
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
import immanix.matchers.UntilMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.LatentPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.utils.XMLEventsUtils.se; ...
package immanix; public class UntilMatcherTest { @Test public void testSuccessMatch() throws Exception { UntilMatcher<Object> m = new UntilMatcher<Object>(new LatentPacman(2));
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
List<XMLEvent> events = Arrays.asList(se("42"), c("hi"), se("remains"));
jawher/immanix
src/test/java/immanix/UntilMatcherTest.java
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
import immanix.matchers.UntilMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.LatentPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.utils.XMLEventsUtils.se; ...
package immanix; public class UntilMatcherTest { @Test public void testSuccessMatch() throws Exception { UntilMatcher<Object> m = new UntilMatcher<Object>(new LatentPacman(2));
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
List<XMLEvent> events = Arrays.asList(se("42"), c("hi"), se("remains"));
jawher/immanix
src/test/java/immanix/UntilMatcherTest.java
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
import immanix.matchers.UntilMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.LatentPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static immanix.utils.XMLEventsUtils.se; ...
package immanix; public class UntilMatcherTest { @Test public void testSuccessMatch() throws Exception { UntilMatcher<Object> m = new UntilMatcher<Object>(new LatentPacman(2)); List<XMLEvent> events = Arrays.asList(se("42"), c("hi"), se("remains"));
// Path: src/main/java/immanix/matchers/UntilMatcher.java // public class UntilMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public UntilMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<T> mat...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/AtLeastButFiniteMatcherTest.java
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
import org.junit.Test; import immanix.matchers.AtLeastButFiniteMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static o...
package immanix; public class AtLeastButFiniteMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception {
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
StaxMatcher< Object> delegateMatcher = new FullPacman(6);
jawher/immanix
src/test/java/immanix/AtLeastButFiniteMatcherTest.java
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
import org.junit.Test; import immanix.matchers.AtLeastButFiniteMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static o...
package immanix; public class AtLeastButFiniteMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher< Object> delegateMatcher = new FullPacman(6); StaxMatcher<Object> spyDelegateMatcher = spy(delegateMatcher);
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
AtLeastButFiniteMatcher<Object> m = new AtLeastButFiniteMatcher<Object>(spyDelegateMatcher, 4);
jawher/immanix
src/test/java/immanix/AtLeastButFiniteMatcherTest.java
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
import org.junit.Test; import immanix.matchers.AtLeastButFiniteMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static o...
package immanix; public class AtLeastButFiniteMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher< Object> delegateMatcher = new FullPacman(6); StaxMatcher<Object> spyDelegateMatcher = spy(delegateMatcher); AtLeastButFiniteMatcher<O...
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
StaxMatcher<Object> delegateMatcher = new HungryPacman(3);
jawher/immanix
src/test/java/immanix/AtLeastButFiniteMatcherTest.java
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
import org.junit.Test; import immanix.matchers.AtLeastButFiniteMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static o...
package immanix; public class AtLeastButFiniteMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher< Object> delegateMatcher = new FullPacman(6); StaxMatcher<Object> spyDelegateMatcher = spy(delegateMatcher); AtLeastButFiniteMatcher<O...
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
List<XMLEvent> events = Arrays.<XMLEvent>asList(c("_1"), c("_2"), c("c"), c("d"), c("e"), c("f"));
jawher/immanix
src/test/java/immanix/AtLeastButFiniteMatcherTest.java
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
import org.junit.Test; import immanix.matchers.AtLeastButFiniteMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static o...
package immanix; public class AtLeastButFiniteMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher< Object> delegateMatcher = new FullPacman(6); StaxMatcher<Object> spyDelegateMatcher = spy(delegateMatcher); AtLeastButFiniteMatcher<O...
// Path: src/main/java/immanix/matchers/AtLeastButFiniteMatcher.java // public class AtLeastButFiniteMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtLeastButFiniteMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = ...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/NamedEndElementMatcherTest.java
// Path: src/main/java/immanix/matchers/NamedEndElementMatcher.java // public class NamedEndElementMatcher extends BaseEventMatcher<EndElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the end element's name to match // */ // public Name...
import immanix.matchers.NamedEndElementMatcher; import immanix.readers.ReplayEventReader; import org.junit.Test; import javax.xml.stream.events.EndElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.*; import static org.junit.Asser...
package immanix; public class NamedEndElementMatcherTest { public static final String NS = "http://immanix.net/ns"; @Test public void testSuccessMatchOnLocalPartWithNoNsXml() throws Exception {
// Path: src/main/java/immanix/matchers/NamedEndElementMatcher.java // public class NamedEndElementMatcher extends BaseEventMatcher<EndElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the end element's name to match // */ // public Name...
mustSucceed(new NamedEndElementMatcher("42"), Arrays.asList(ee("42"), c("hi")));
jawher/immanix
src/test/java/immanix/NamedEndElementMatcherTest.java
// Path: src/main/java/immanix/matchers/NamedEndElementMatcher.java // public class NamedEndElementMatcher extends BaseEventMatcher<EndElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the end element's name to match // */ // public Name...
import immanix.matchers.NamedEndElementMatcher; import immanix.readers.ReplayEventReader; import org.junit.Test; import javax.xml.stream.events.EndElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.*; import static org.junit.Asser...
@Test public void testFailureMatchBecauseOfDifferentNameWithNoNsXml() throws Exception { mustFail(new NamedEndElementMatcher("elem"), Arrays.<XMLEvent>asList(ee("42"), c("chars"))); } @Test public void testFailureMatchBecauseOfDifferentNameWithNsXml() throws Exception { mustFail(ne...
// Path: src/main/java/immanix/matchers/NamedEndElementMatcher.java // public class NamedEndElementMatcher extends BaseEventMatcher<EndElement> { // private final String namespaceURI; // private final String name; // // /** // * @param name the end element's name to match // */ // public Name...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/CharsMatcherTest.java
// Path: src/main/java/immanix/matchers/CharsMatcher.java // public class CharsMatcher extends BaseEventMatcher<String> { // // @Override // protected boolean accept(XMLEvent e) { // return e.isCharacters(); // } // // @Override // protected String process(XMLEvent e) { // return e...
import org.junit.Test; import immanix.matchers.CharsMatcher; import immanix.readers.ReplayEventReader; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static org.mockito.Mockito.spy; import static immanix.utils.XMLEventsUtils.*;
package immanix; public class CharsMatcherTest { @Test public void testSuccessMatch() throws Exception {
// Path: src/main/java/immanix/matchers/CharsMatcher.java // public class CharsMatcher extends BaseEventMatcher<String> { // // @Override // protected boolean accept(XMLEvent e) { // return e.isCharacters(); // } // // @Override // protected String process(XMLEvent e) { // return e...
CharsMatcher m = new CharsMatcher();
jawher/immanix
src/test/java/immanix/CharsMatcherTest.java
// Path: src/main/java/immanix/matchers/CharsMatcher.java // public class CharsMatcher extends BaseEventMatcher<String> { // // @Override // protected boolean accept(XMLEvent e) { // return e.isCharacters(); // } // // @Override // protected String process(XMLEvent e) { // return e...
import org.junit.Test; import immanix.matchers.CharsMatcher; import immanix.readers.ReplayEventReader; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static org.mockito.Mockito.spy; import static immanix.utils.XMLEventsUtils.*;
package immanix; public class CharsMatcherTest { @Test public void testSuccessMatch() throws Exception { CharsMatcher m = new CharsMatcher(); CharsMatcher sm = spy(m); List<XMLEvent> events = Arrays.asList(c("hi"), se("42"));
// Path: src/main/java/immanix/matchers/CharsMatcher.java // public class CharsMatcher extends BaseEventMatcher<String> { // // @Override // protected boolean accept(XMLEvent e) { // return e.isCharacters(); // } // // @Override // protected String process(XMLEvent e) { // return e...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/UntilButFiniteMatcherTest.java
// Path: src/main/java/immanix/matchers/UntilButFiniteMatcher.java // public class UntilButFiniteMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // private final int giveUpBarrier; // // public UntilButFiniteMatcher(StaxMatcher<T> delegate, int giveUpBarrier) { // this...
import immanix.matchers.UntilButFiniteMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.LatentPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.*; import static org.junit.Assert.*;
package immanix; public class UntilButFiniteMatcherTest { @Test public void testSuccessMatch() throws Exception {
// Path: src/main/java/immanix/matchers/UntilButFiniteMatcher.java // public class UntilButFiniteMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // private final int giveUpBarrier; // // public UntilButFiniteMatcher(StaxMatcher<T> delegate, int giveUpBarrier) { // this...
UntilButFiniteMatcher<Object> m = new UntilButFiniteMatcher<Object>(new LatentPacman(2), 10);
jawher/immanix
src/test/java/immanix/UntilButFiniteMatcherTest.java
// Path: src/main/java/immanix/matchers/UntilButFiniteMatcher.java // public class UntilButFiniteMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // private final int giveUpBarrier; // // public UntilButFiniteMatcher(StaxMatcher<T> delegate, int giveUpBarrier) { // this...
import immanix.matchers.UntilButFiniteMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.LatentPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.*; import static org.junit.Assert.*;
package immanix; public class UntilButFiniteMatcherTest { @Test public void testSuccessMatch() throws Exception {
// Path: src/main/java/immanix/matchers/UntilButFiniteMatcher.java // public class UntilButFiniteMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // private final int giveUpBarrier; // // public UntilButFiniteMatcher(StaxMatcher<T> delegate, int giveUpBarrier) { // this...
UntilButFiniteMatcher<Object> m = new UntilButFiniteMatcher<Object>(new LatentPacman(2), 10);
jawher/immanix
src/test/java/immanix/UntilButFiniteMatcherTest.java
// Path: src/main/java/immanix/matchers/UntilButFiniteMatcher.java // public class UntilButFiniteMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // private final int giveUpBarrier; // // public UntilButFiniteMatcher(StaxMatcher<T> delegate, int giveUpBarrier) { // this...
import immanix.matchers.UntilButFiniteMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.LatentPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static immanix.utils.XMLEventsUtils.*; import static org.junit.Assert.*;
package immanix; public class UntilButFiniteMatcherTest { @Test public void testSuccessMatch() throws Exception { UntilButFiniteMatcher<Object> m = new UntilButFiniteMatcher<Object>(new LatentPacman(2), 10); List<XMLEvent> events = Arrays.asList(se("42"), c("hi"), se("remains"));
// Path: src/main/java/immanix/matchers/UntilButFiniteMatcher.java // public class UntilButFiniteMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // private final int giveUpBarrier; // // public UntilButFiniteMatcher(StaxMatcher<T> delegate, int giveUpBarrier) { // this...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/EndElementMatcherTest.java
// Path: src/main/java/immanix/matchers/EndElementMatcher.java // public class EndElementMatcher extends BaseEventMatcher<EndElement> { // // @Override // protected boolean accept(XMLEvent e) { // return e.isEndElement(); // } // // @Override // protected EndElement process(XMLEvent e) { /...
import org.junit.Test; import immanix.matchers.EndElementMatcher; import immanix.readers.ReplayEventReader; import javax.xml.stream.events.EndElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static org.mockito.Mockito.spy; import ...
package immanix; public class EndElementMatcherTest { @Test public void testSuccessMatch() throws Exception {
// Path: src/main/java/immanix/matchers/EndElementMatcher.java // public class EndElementMatcher extends BaseEventMatcher<EndElement> { // // @Override // protected boolean accept(XMLEvent e) { // return e.isEndElement(); // } // // @Override // protected EndElement process(XMLEvent e) { /...
EndElementMatcher m = new EndElementMatcher();
jawher/immanix
src/test/java/immanix/EndElementMatcherTest.java
// Path: src/main/java/immanix/matchers/EndElementMatcher.java // public class EndElementMatcher extends BaseEventMatcher<EndElement> { // // @Override // protected boolean accept(XMLEvent e) { // return e.isEndElement(); // } // // @Override // protected EndElement process(XMLEvent e) { /...
import org.junit.Test; import immanix.matchers.EndElementMatcher; import immanix.readers.ReplayEventReader; import javax.xml.stream.events.EndElement; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.List; import static org.junit.Assert.*; import static org.mockito.Mockito.spy; import ...
package immanix; public class EndElementMatcherTest { @Test public void testSuccessMatch() throws Exception { EndElementMatcher m = new EndElementMatcher(); EndElementMatcher sm = spy(m); List<XMLEvent> events = Arrays.asList(ee("42"), c("hi"));
// Path: src/main/java/immanix/matchers/EndElementMatcher.java // public class EndElementMatcher extends BaseEventMatcher<EndElement> { // // @Override // protected boolean accept(XMLEvent e) { // return e.isEndElement(); // } // // @Override // protected EndElement process(XMLEvent e) { /...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/NTimesMatcherTest.java
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
import org.junit.Test; import immanix.matchers.NTimesMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
package immanix; public class NTimesMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.class); when(delegateMatcher.match(null)).thenReturn(MatcherResult.success(null, null, Collections.EMPTY_LIST))...
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
NTimesMatcher<Object> m = new NTimesMatcher<Object>(delegateMatcher, 4);
jawher/immanix
src/test/java/immanix/NTimesMatcherTest.java
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
import org.junit.Test; import immanix.matchers.NTimesMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
package immanix; public class NTimesMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.class); when(delegateMatcher.match(null)).thenReturn(MatcherResult.success(null, null, Collections.EMPTY_LIST))...
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
StaxMatcher<Object> delegateMatcher = new HungryPacman(4);
jawher/immanix
src/test/java/immanix/NTimesMatcherTest.java
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
import org.junit.Test; import immanix.matchers.NTimesMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
package immanix; public class NTimesMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.class); when(delegateMatcher.match(null)).thenReturn(MatcherResult.success(null, null, Collections.EMPTY_LIST))...
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
List<XMLEvent> events = Arrays.<XMLEvent>asList(c("_1"), c("_2"), c("c"), c("d"), c("e"), c("f"));
jawher/immanix
src/test/java/immanix/NTimesMatcherTest.java
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
import org.junit.Test; import immanix.matchers.NTimesMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
package immanix; public class NTimesMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.class); when(delegateMatcher.match(null)).thenReturn(MatcherResult.success(null, null, Collections.EMPTY_LIST))...
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/NTimesMatcherTest.java
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
import org.junit.Test; import immanix.matchers.NTimesMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
NTimesMatcher<Object> m = new NTimesMatcher<Object>(delegateMatcher, 3); NTimesMatcher<Object> sm = spy(m); List<XMLEvent> events = Arrays.<XMLEvent>asList(c("_1"), c("_2"), c("c"), c("d"), c("e"), c("f")); ReplayEventReader reader = new ReplayEventReader(events); MatcherResult<...
// Path: src/main/java/immanix/matchers/NTimesMatcher.java // public class NTimesMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private int n; // // public NTimesMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = n; // ...
StaxMatcher<Object> delegateMatcher = new FullPacman(4);
jawher/immanix
src/test/java/immanix/CondMatcherTest.java
// Path: src/main/java/immanix/matchers/CondMatcher.java // public abstract class CondMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public CondMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<...
import immanix.matchers.CondMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.HungryPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static org....
package immanix; public class CondMatcherTest { @Test public void testDelegateMatcherIsCalled() throws Exception { List<XMLEvent> events = Arrays.<XMLEvent>asList();
// Path: src/main/java/immanix/matchers/CondMatcher.java // public abstract class CondMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public CondMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/CondMatcherTest.java
// Path: src/main/java/immanix/matchers/CondMatcher.java // public abstract class CondMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public CondMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<...
import immanix.matchers.CondMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.HungryPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static org....
package immanix; public class CondMatcherTest { @Test public void testDelegateMatcherIsCalled() throws Exception { List<XMLEvent> events = Arrays.<XMLEvent>asList(); ReplayEventReader reader = new ReplayEventReader(events); StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.cla...
// Path: src/main/java/immanix/matchers/CondMatcher.java // public abstract class CondMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public CondMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<...
CondMatcher<Object> m = new CondMatcher<Object>(delegateMatcher) {
jawher/immanix
src/test/java/immanix/CondMatcherTest.java
// Path: src/main/java/immanix/matchers/CondMatcher.java // public abstract class CondMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public CondMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<...
import immanix.matchers.CondMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.HungryPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static org....
assertTrue(sm.match(null).isFailure()); } @Test public void testSuccessWhenValidateReturnsTrueCalled() throws Exception { List<XMLEvent> events = Arrays.<XMLEvent>asList(); ReplayEventReader reader = new ReplayEventReader(events); StaxMatcher<String> delegateMatcher = mock...
// Path: src/main/java/immanix/matchers/CondMatcher.java // public abstract class CondMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public CondMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<...
StaxMatcher<Object> delegateMatcher = new HungryPacman(4);
jawher/immanix
src/test/java/immanix/CondMatcherTest.java
// Path: src/main/java/immanix/matchers/CondMatcher.java // public abstract class CondMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public CondMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<...
import immanix.matchers.CondMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.HungryPacman; import org.junit.Test; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static immanix.utils.XMLEventsUtils.c; import static org....
public boolean validate(String data) { return true; } @Override public String conditionInEnglish() { return "Nothing"; } }; CondMatcher<String> sm = spy(m); assertFalse(sm.match(null).isFailure()); ...
// Path: src/main/java/immanix/matchers/CondMatcher.java // public abstract class CondMatcher<T> extends StaxMatcher<T> { // private final StaxMatcher<T> delegate; // // public CondMatcher(StaxMatcher<T> delegate) { // this.delegate = delegate; // } // // @Override // public MatcherResult<...
List<XMLEvent> events = Arrays.<XMLEvent>asList(c("_1"), c("_2"), c("c"), c("d"), c("e"), c("f"));
jawher/immanix
src/test/java/immanix/AtMostMatcherTest.java
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
import org.junit.Test; import immanix.matchers.AtMostMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
package immanix; public class AtMostMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.class); when(delegateMatcher.match(null)).thenReturn(MatcherResult.<Object>success("S", null, Collections.EMPTY...
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
AtMostMatcher<Object> m = new AtMostMatcher<Object>(delegateMatcher, 4);
jawher/immanix
src/test/java/immanix/AtMostMatcherTest.java
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
import org.junit.Test; import immanix.matchers.AtMostMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
package immanix; public class AtMostMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.class); when(delegateMatcher.match(null)).thenReturn(MatcherResult.<Object>success("S", null, Collections.EMPTY...
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
StaxMatcher<Object> delegateMatcher = new HungryPacman(4);
jawher/immanix
src/test/java/immanix/AtMostMatcherTest.java
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
import org.junit.Test; import immanix.matchers.AtMostMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
package immanix; public class AtMostMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.class); when(delegateMatcher.match(null)).thenReturn(MatcherResult.<Object>success("S", null, Collections.EMPTY...
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
List<XMLEvent> events = Arrays.<XMLEvent>asList(c("_1"), c("_2"), c("c"), c("d"), c("e"), c("f"));
jawher/immanix
src/test/java/immanix/AtMostMatcherTest.java
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
import org.junit.Test; import immanix.matchers.AtMostMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
package immanix; public class AtMostMatcherTest { @Test public void testDelegateMatcherIsCalledCorrectly() throws Exception { StaxMatcher<Object> delegateMatcher = mock(StaxMatcher.class); when(delegateMatcher.match(null)).thenReturn(MatcherResult.<Object>success("S", null, Collections.EMPTY...
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
ReplayEventReader reader = new ReplayEventReader(events);
jawher/immanix
src/test/java/immanix/AtMostMatcherTest.java
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
import org.junit.Test; import immanix.matchers.AtMostMatcher; import immanix.readers.ReplayEventReader; import immanix.utils.FullPacman; import immanix.utils.HungryPacman; import javax.xml.stream.events.XMLEvent; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.junit.Asser...
AtMostMatcher<Object> m = new AtMostMatcher<Object>(delegateMatcher, 3); AtMostMatcher<Object> sm = spy(m); List<XMLEvent> events = Arrays.<XMLEvent>asList(c("_1"), c("_2"), c("c"), c("d"), c("e"), c("f")); ReplayEventReader reader = new ReplayEventReader(events); MatcherResult<...
// Path: src/main/java/immanix/matchers/AtMostMatcher.java // public class AtMostMatcher<T> extends StaxMatcher<List<T>> { // private final StaxMatcher<T> delegate; // private final int n; // // public AtMostMatcher(StaxMatcher<T> delegate, int n) { // this.delegate = delegate; // this.n = ...
StaxMatcher<Object> delegateMatcher = new FullPacman(4);
emsouza/beanlib
core/src/main/java/net/sf/beanlib/spi/ChainedCustomBeanTransformer.java
// Path: core/src/main/java/net/sf/beanlib/PropertyInfo.java // public class PropertyInfo { // // private final String propertyName; // // private final Object fromBean; // // private final Object toBean; // // public PropertyInfo(String propertyName, Object fromBean, Object toBean) { // thi...
import java.util.ArrayList; import java.util.List; import net.sf.beanlib.PropertyInfo;
for (CustomBeanTransformerSpi.Factory f : customBeanTransformerFactories) { this.customTransformerFactories.add(f); } } } public Factory appendCustomerBeanTransformerFactory(CustomBeanTransformerSpi.Factory customBeanTransformerFactory) { ...
// Path: core/src/main/java/net/sf/beanlib/PropertyInfo.java // public class PropertyInfo { // // private final String propertyName; // // private final Object fromBean; // // private final Object toBean; // // public PropertyInfo(String propertyName, Object fromBean, Object toBean) { // thi...
public boolean isTransformable(Object from, Class<?> toClass, PropertyInfo propertyInfo) {
emsouza/beanlib
core/src/main/java/net/sf/beanlib/spi/DetailedPropertyFilter.java
// Path: core/src/main/java/net/sf/beanlib/provider/JavaBeanDetailedPropertyFilter.java // public class JavaBeanDetailedPropertyFilter implements DetailedPropertyFilter { // // @Override // public boolean propagate(String propertyName, Object fromBean, Method readerMethod, Object toBean, Method setterMethod) {...
import java.lang.reflect.Method; import net.sf.beanlib.provider.JavaBeanDetailedPropertyFilter;
/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: core/src/main/java/net/sf/beanlib/provider/JavaBeanDetailedPropertyFilter.java // public class JavaBeanDetailedPropertyFilter implements DetailedPropertyFilter { // // @Override // public boolean propagate(String propertyName, Object fromBean, Method readerMethod, Object toBean, Method setterMethod) {...
public static final DetailedPropertyFilter JAVABEAN_PROPAGATE = new JavaBeanDetailedPropertyFilter();
emsouza/beanlib
core/src/main/java/net/sf/beanlib/spi/CustomBeanTransformerSpi.java
// Path: core/src/main/java/net/sf/beanlib/PropertyInfo.java // public class PropertyInfo { // // private final String propertyName; // // private final Object fromBean; // // private final Object toBean; // // public PropertyInfo(String propertyName, Object fromBean, Object toBean) { // thi...
import net.sf.beanlib.PropertyInfo;
/* * Copyright 2007 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: core/src/main/java/net/sf/beanlib/PropertyInfo.java // public class PropertyInfo { // // private final String propertyName; // // private final Object fromBean; // // private final Object toBean; // // public PropertyInfo(String propertyName, Object fromBean, Object toBean) { // thi...
boolean isTransformable(Object from, Class<?> toClass, PropertyInfo propertyInfo);
emsouza/beanlib
hibernate/src/test/java/net/sf/beanlib/hibernate5/HibernateBeanReplicatorTestMap.java
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
import net.sf.beanlib.hibernate5.Hibernate5BeanReplicator; import net.sf.beanlib.spi.PropertyFilter; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import java.lang.reflect.Method; import java.util.Collections; import java.util.Iterato...
/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
FooWithMap toMap = new Hibernate5BeanReplicator().deepCopy(fooMap);
emsouza/beanlib
hibernate/src/test/java/net/sf/beanlib/hibernate5/HibernateBeanReplicatorTestMap.java
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
import net.sf.beanlib.hibernate5.Hibernate5BeanReplicator; import net.sf.beanlib.spi.PropertyFilter; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import java.lang.reflect.Method; import java.util.Collections; import java.util.Iterato...
public void copyMap() { FooWithMap fooMap = new FooWithMap(null); fooMap.addToMap("1", "a"); fooMap.addToMap("2", "b"); { FooWithMap toFooWithMap = new Hibernate5BeanReplicator().copy(fooMap); Map<Object, Object> toMap = toFooWithMap.getMap(); toM...
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
r.getHibernatePropertyFilter().withVetoer(new PropertyFilter() {
emsouza/beanlib
hibernate/src/test/java/elh/maayan/test/TestRep.java
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.lang.reflect.Method; import java.util.Collection; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.boot.Metadata; import org.hibernate.boot.Metadat...
// f.addSupplier(oracle); // f.addSupplier(mac); f.setAddress("main street"); this.session.save(f); this.id = f.getId(); this.session.flush(); beginTransaction.commit(); // this.session.connection().commit(); this.session.close(); } @Te...
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
final Hibernate5BeanReplicator r = new Hibernate5BeanReplicator();
emsouza/beanlib
hibernate/src/test/java/elh/maayan/test/TestRep.java
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.lang.reflect.Method; import java.util.Collection; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.boot.Metadata; import org.hibernate.boot.Metadat...
// f.addSupplier(mac); f.setAddress("main street"); this.session.save(f); this.id = f.getId(); this.session.flush(); beginTransaction.commit(); // this.session.connection().commit(); this.session.close(); } @Test public void load() throws E...
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
r.initPropertyFilter(new PropertyFilter() {
emsouza/beanlib
hibernate/src/test/java/net/sf/beanlib/hibernate5/HibernateBeanReplicatorTestCollection.java
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Set; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import net.sf.beanlib.hibernate5.Hibernate5BeanReplicator;
/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
A to = new Hibernate5BeanReplicator().deepCopy(from);
emsouza/beanlib
hibernate/src/test/java/net/sf/beanlib/provider/replicator/CalendarReplicatorTest.java
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.sameInstance; import static org.junit.Assert.assertThat; import java.util.Calendar; import org.junit.Test; import junit.framework.JUnit4TestAdapter; import net.sf.beanlib.hibernate5.Hibernate...
} @Override public boolean equals(Object obj) { if (obj instanceof CalendarBean) { CalendarBean that = (CalendarBean) obj; return calendar == null ? that.getCalendar() == null : calendar.equals(that.getCalendar()); } return fal...
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
CalendarBean to = new Hibernate5BeanReplicator().copy(from);
emsouza/beanlib
core/src/main/java/net/sf/beanlib/utils/BlobUtils.java
// Path: core/src/main/java/net/sf/beanlib/BeanlibException.java // public class BeanlibException extends RuntimeException { // // private static final long serialVersionUID = 1; // // public BeanlibException() {} // // public BeanlibException(String message) { // super(message); // } // // ...
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.sql.Blob; import java.sql.SQLException; import org.apache.commons.lang3.ArrayUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import net.sf.beanlib.BeanlibException;
/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: core/src/main/java/net/sf/beanlib/BeanlibException.java // public class BeanlibException extends RuntimeException { // // private static final long serialVersionUID = 1; // // public BeanlibException() {} // // public BeanlibException(String message) { // super(message); // } // // ...
throw new BeanlibException(e);
emsouza/beanlib
core/src/test/java/net/sf/beanlib/provider/BeanPopulatorTest.java
// Path: core/src/main/java/net/sf/beanlib/provider/collector/ProtectedSetterMethodCollector.java // public class ProtectedSetterMethodCollector implements BeanMethodCollector { // // @Override // public Method[] collect(Object bean) { // Class<?> beanClass = bean.getClass(); // // Get all meth...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import org.junit.Test; import junit.framework.JUnit4TestAdapter; import net.sf.beanlib.provider.col...
// Note this is different than if the default transformer is used. assertSame(from.getBar(), to.getBar()); } // Default transformer { Bar from = new Bar("from"); from.setBoo(true); from.setString("foo"); from.setBarString("b...
// Path: core/src/main/java/net/sf/beanlib/provider/collector/ProtectedSetterMethodCollector.java // public class ProtectedSetterMethodCollector implements BeanMethodCollector { // // @Override // public Method[] collect(Object bean) { // Class<?> beanClass = bean.getClass(); // // Get all meth...
new BeanPopulator(from, to).initSetterMethodCollector(new ProtectedSetterMethodCollector()).initTransformer(null).populate();
emsouza/beanlib
core/src/main/java/net/sf/beanlib/spi/BeanPopulatorBaseConfig.java
// Path: core/src/main/java/net/sf/beanlib/provider/collector/PublicSetterMethodCollector.java // public class PublicSetterMethodCollector implements BeanMethodCollector { // // @Override // public Method[] collect(Object bean) { // // Get all the public member methods of the class or interface, // ...
import net.sf.beanlib.provider.collector.PublicSetterMethodCollector; import net.sf.beanlib.provider.finder.PublicReaderMethodFinder;
/* * Copyright 2007 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: core/src/main/java/net/sf/beanlib/provider/collector/PublicSetterMethodCollector.java // public class PublicSetterMethodCollector implements BeanMethodCollector { // // @Override // public Method[] collect(Object bean) { // // Get all the public member methods of the class or interface, // ...
private BeanMethodFinder readerMethodFinder = new PublicReaderMethodFinder();
emsouza/beanlib
hibernate/src/test/java/net/sf/beanlib/hibernate5/HibernateBeanReplicatorTestComparator.java
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
import net.sf.beanlib.hibernate5.Hibernate5BeanReplicator; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotSame; import java.util.Comparator; import java.util.Map; import java.util.Set; import java.util.SortedMap; import java.util.Sorted...
/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
Set<String> toSet = new Hibernate5BeanReplicator().deepCopy(fromSet, Set.class);
emsouza/beanlib
core/src/main/java/net/sf/beanlib/spi/TrivialCustomBeanTransformerFactories.java
// Path: core/src/main/java/net/sf/beanlib/PropertyInfo.java // public class PropertyInfo { // // private final String propertyName; // // private final Object fromBean; // // private final Object toBean; // // public PropertyInfo(String propertyName, Object fromBean, Object toBean) { // thi...
import net.sf.beanlib.PropertyInfo;
/* * Copyright 2008 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: core/src/main/java/net/sf/beanlib/PropertyInfo.java // public class PropertyInfo { // // private final String propertyName; // // private final Object fromBean; // // private final Object toBean; // // public PropertyInfo(String propertyName, Object fromBean, Object toBean) { // thi...
public boolean isTransformable(Object from, Class<?> toClass, PropertyInfo propertyInfo) {
emsouza/beanlib
hibernate/src/main/java/net/sf/beanlib/hibernate/HibernatePropertyFilter.java
// Path: core/src/main/java/net/sf/beanlib/CollectionPropertyName.java // public class CollectionPropertyName<T> { // // public static final CollectionPropertyName<?>[] EMPTY_ARRAY = {}; // // private final Class<T> declaringClass; // // private final String collectionProperty; // // private final i...
import static net.sf.beanlib.utils.ClassUtils.fqcn; import static net.sf.beanlib.utils.ClassUtils.immutable; import static net.sf.beanlib.utils.ClassUtils.isJavaPackage; import java.lang.reflect.Method; import java.util.Collection; import java.util.Collections; import java.util.Map; import java.util.Set; import net.sf....
/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: core/src/main/java/net/sf/beanlib/CollectionPropertyName.java // public class CollectionPropertyName<T> { // // public static final CollectionPropertyName<?>[] EMPTY_ARRAY = {}; // // private final Class<T> declaringClass; // // private final String collectionProperty; // // private final i...
private Set<? extends CollectionPropertyName<?>> collectionPropertyNameSet;
emsouza/beanlib
core/src/main/java/net/sf/beanlib/spi/BeanPopulationExceptionHandlerAdapter.java
// Path: core/src/main/java/net/sf/beanlib/BeanlibException.java // public class BeanlibException extends RuntimeException { // // private static final long serialVersionUID = 1; // // public BeanlibException() {} // // public BeanlibException(String message) { // super(message); // } // // ...
import java.lang.reflect.Method; import org.slf4j.Logger; import net.sf.beanlib.BeanlibException;
/* * Copyright 2007 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: core/src/main/java/net/sf/beanlib/BeanlibException.java // public class BeanlibException extends RuntimeException { // // private static final long serialVersionUID = 1; // // public BeanlibException() {} // // public BeanlibException(String message) { // super(message); // } // // ...
throw new BeanlibException(t);
emsouza/beanlib
hibernate/src/test/java/net/sf/beanlib/hibernate5/HibernateBeanReplicatorTestMySet.java
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; import junit.framework.JUnit4TestAdapter; import net.sf.beanlib.hibernate5.Hibernate5BeanReplicator;
/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: hibernate/src/main/java/net/sf/beanlib/hibernate5/Hibernate5BeanReplicator.java // public class Hibernate5BeanReplicator extends HibernateBeanReplicator { // // /** // * By default, all properties will be included for replication. // */ // public Hibernate5BeanReplicator() { // super...
FooWithMySet toSet = new Hibernate5BeanReplicator().deepCopy(fooWithMySet);
emsouza/beanlib
core/src/main/java/net/sf/beanlib/provider/collector/OrderedMethodCollector.java
// Path: core/src/main/java/net/sf/beanlib/spi/BeanMethodCollector.java // public interface BeanMethodCollector { // // Method[] collect(Object bean); // // String getMethodPrefix(); // } // // Path: core/src/main/java/net/sf/beanlib/utils/ClassUtils.java // public enum ClassUtils { // ; // /** copie...
import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Map; import net.sf.beanlib.spi.BeanMethodCollector; import net.sf.beanlib.utils.ClassUtils;
/* * Copyright 2007 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: core/src/main/java/net/sf/beanlib/spi/BeanMethodCollector.java // public interface BeanMethodCollector { // // Method[] collect(Object bean); // // String getMethodPrefix(); // } // // Path: core/src/main/java/net/sf/beanlib/utils/ClassUtils.java // public enum ClassUtils { // ; // /** copie...
if (ClassUtils.immutable(paramType) || Date.class.isAssignableFrom(paramType)) {
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The re...
import static com.google.common.flogger.LazyArgs.lazy; import static com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog; import static java.util.concurrent.TimeUnit.NANOSECONDS; import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.stream.Collectors.joining; import static java.ut...
@Assisted URIish u) { gitManager = grm; this.permissionBackend = permissionBackend; pool = p; config = c; replConfig = rc; credentialsProvider = cpFactory.create(c.getName()); threadScoper = ts; projectName = d; uri = u; updateRefRetryCount = 0; maxUpdateRefRetries = po...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The re...
repLog.atInfo().log("Replication [%s] to %s was canceled", HexFormat.fromInt(id), getURI());
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The re...
import static com.google.common.flogger.LazyArgs.lazy; import static com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog; import static java.util.concurrent.TimeUnit.NANOSECONDS; import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.stream.Collectors.joining; import static java.ut...
public Set<String> getRefs() { return pushAllRefs ? Sets.newHashSet(ALL_REFS) : delta; } void addRefs(Set<String> refs) { if (!pushAllRefs) { for (String ref : refs) { addRef(ref); } } } Set<String> setStartedRefs(Set<String> startedRefs) { Set<String> notAttemptedRefs = ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The re...
RefPushResult.NOT_ATTEMPTED,
GerritCodeReview/plugins_replication
src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // public static class GitUpdateProcessing implements PushResultProcessing { // private static final FluentLogger logger = FluentLogger.forEnclosingClass(); // // private final EventDispatcher dispatcher; // // public G...
import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import com.google.gerrit.server.events.EventDispatcher; import com.google.gerrit.server.permissions.PermissionBackendException; import com.googlesourc...
// Copyright (C) 2013 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // public static class GitUpdateProcessing implements PushResultProcessing { // private static final FluentLogger logger = FluentLogger.forEnclosingClass(); // // private final EventDispatcher dispatcher; // // public G...
private GitUpdateProcessing gitUpdateProcessing;
GerritCodeReview/plugins_replication
src/test/java/com/googlesource/gerrit/plugins/replication/events/EventFieldsTest.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
import static org.junit.Assert.assertEquals; import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult; import java.net.URISyntaxException; import org.eclipse.jgit.transport.RemoteRefUpdate; import org.eclipse.jgit.transport.URIish; import org.junit.Test;
// Copyright (C) 2021 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
RefPushResult.SUCCEEDED,
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/DestinationsCollection.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfig.java // public static String replaceName(String in, String name, boolean keyIsOptional) { // String key = "${name}"; // int n = in.indexOf(key); // if (0 <= n) { // return in.substring(0, n) + name + in.substring(n +...
import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isGerrit; import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isGerritHttp; import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isSSH; import static com.googlesource.gerrit.plugins.replication.Replicati...
private final Provider<ReplicationQueue> replicationQueue; private volatile List<Destination> destinations; private boolean shuttingDown; public static class EventQueueNotEmptyException extends Exception { private static final long serialVersionUID = 1L; public EventQueueNotEmptyException(String error...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfig.java // public static String replaceName(String in, String name, boolean keyIsOptional) { // String key = "${name}"; // int n = in.indexOf(key); // if (0 <= n) { // return in.substring(0, n) + name + in.substring(n +...
Optional<String> remoteName, Project.NameKey projectName, FilterType filterType) {
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/DestinationsCollection.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfig.java // public static String replaceName(String in, String name, boolean keyIsOptional) { // String key = "${name}"; // int n = in.indexOf(key); // if (0 <= n) { // return in.substring(0, n) + name + in.substring(n +...
import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isGerrit; import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isGerritHttp; import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isSSH; import static com.googlesource.gerrit.plugins.replication.Replicati...
} @Override public Multimap<Destination, URIish> getURIs( Optional<String> remoteName, Project.NameKey projectName, FilterType filterType) { if (getAll(filterType).isEmpty()) { return ImmutableMultimap.of(); } SetMultimap<Destination, URIish> uris = HashMultimap.create(); for (Destin...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfig.java // public static String replaceName(String in, String name, boolean keyIsOptional) { // String key = "${name}"; // int n = in.indexOf(key); // if (0 <= n) { // return in.substring(0, n) + name + in.substring(n +...
repLog.atWarning().log("adminURL '%s' is invalid: %s", url, e.getMessage());
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/DestinationsCollection.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfig.java // public static String replaceName(String in, String name, boolean keyIsOptional) { // String key = "${name}"; // int n = in.indexOf(key); // if (0 <= n) { // return in.substring(0, n) + name + in.substring(n +...
import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isGerrit; import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isGerritHttp; import static com.googlesource.gerrit.plugins.replication.AdminApiFactory.isSSH; import static com.googlesource.gerrit.plugins.replication.Replicati...
return ImmutableMultimap.of(); } SetMultimap<Destination, URIish> uris = HashMultimap.create(); for (Destination config : getAll(filterType)) { if (filterType != FilterType.PROJECT_DELETION && !config.wouldPushProject(projectName)) { continue; } if (remoteName.isPresent() &...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfig.java // public static String replaceName(String in, String name, boolean keyIsOptional) { // String key = "${name}"; // int n = in.indexOf(key); // if (0 <= n) { // return in.substring(0, n) + name + in.substring(n +...
replaceName(uri.getPath(), projectName.get(), config.isSingleProjectMatch());
GerritCodeReview/plugins_replication
src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationStateTest.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult; import java.net.URISyntaxException; import org.eclipse...
// Copyright (C) 2013 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
"someProject", "someRef", uri, RefPushResult.SUCCEEDED, RemoteRefUpdate.Status.OK);
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/StartCommand.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // public static class CommandProcessing implements PushResultProcessing { // private WeakReference<StartCommand> sshCommand; // private AtomicBoolean hasError = new AtomicBoolean(); // // CommandProcessing(StartCommand ...
import com.google.gerrit.extensions.annotations.RequiresCapability; import com.google.gerrit.sshd.CommandMetaData; import com.google.gerrit.sshd.SshCommand; import com.google.inject.Inject; import com.googlesource.gerrit.plugins.replication.PushResultProcessing.CommandProcessing; import java.util.ArrayList; import java...
// Copyright (C) 2009 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // public static class CommandProcessing implements PushResultProcessing { // private WeakReference<StartCommand> sshCommand; // private AtomicBoolean hasError = new AtomicBoolean(); // // CommandProcessing(StartCommand ...
ReplicationState state = new ReplicationState(new CommandProcessing(this));
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/LocalFS.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME);
import static com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog; import com.google.gerrit.entities.Project; import java.io.File; import java.io.IOException; import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.RefUpdate; impor...
// Copyright (C) 2018 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // Path: src/main/java/com/googlesource/gerrit/plugins/replication/LocalFS.java import static com.googlesource.gerrit.plugins.replication...
repLog.atInfo().log("Created local repository: %s", uri);
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/DeleteProjectTask.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/events/ProjectDeletionState.java // public class ProjectDeletionStat...
import static com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog; import com.google.gerrit.entities.Project; import com.google.gerrit.extensions.registration.DynamicItem; import com.google.gerrit.server.ioutil.HexFormat; import com.google.gerrit.server.util.IdGenerator; import com.google.inject.Inject;...
// Copyright (C) 2018 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/events/ProjectDeletionState.java // public class ProjectDeletionStat...
URIish replicateURI, Project.NameKey project, ProjectDeletionState state);
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/DeleteProjectTask.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/events/ProjectDeletionState.java // public class ProjectDeletionStat...
import static com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog; import com.google.gerrit.entities.Project; import com.google.gerrit.extensions.registration.DynamicItem; import com.google.gerrit.server.ioutil.HexFormat; import com.google.gerrit.server.util.IdGenerator; import com.google.inject.Inject;...
private final URIish replicateURI; private final Project.NameKey project; private final ProjectDeletionState state; @Inject DeleteProjectTask( DynamicItem<AdminApiFactory> adminApiFactory, IdGenerator ig, @Assisted ProjectDeletionState state, @Assisted URIish replicateURI, @Assi...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/events/ProjectDeletionState.java // public class ProjectDeletionStat...
repLog.atWarning().log("Cannot delete project %s on remote site %s.", project, replicateURI);
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/Init.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java // static final int DEFAULT_REPLICATION_DELAY = 15; // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java // static final int DEFAULT_RESCHEDULE_DELAY = 3;
import static com.googlesource.gerrit.plugins.replication.DestinationConfiguration.DEFAULT_REPLICATION_DELAY; import static com.googlesource.gerrit.plugins.replication.DestinationConfiguration.DEFAULT_RESCHEDULE_DELAY; import com.google.common.base.Strings; import com.google.gerrit.extensions.annotations.PluginName; im...
// Copyright (C) 2017 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java // static final int DEFAULT_REPLICATION_DELAY = 15; // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java // static final int DEFAULT_RESCHEDULE_DELAY = 3; // Path: src/main/...
config.getInt("remote", name, "replicationDelay", DEFAULT_REPLICATION_DELAY);
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/Init.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java // static final int DEFAULT_REPLICATION_DELAY = 15; // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java // static final int DEFAULT_RESCHEDULE_DELAY = 3;
import static com.googlesource.gerrit.plugins.replication.DestinationConfiguration.DEFAULT_REPLICATION_DELAY; import static com.googlesource.gerrit.plugins.replication.DestinationConfiguration.DEFAULT_RESCHEDULE_DELAY; import com.google.common.base.Strings; import com.google.gerrit.extensions.annotations.PluginName; im...
// Copyright (C) 2017 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java // static final int DEFAULT_REPLICATION_DELAY = 15; // // Path: src/main/java/com/googlesource/gerrit/plugins/replication/DestinationConfiguration.java // static final int DEFAULT_RESCHEDULE_DELAY = 3; // Path: src/main/...
int delay = Math.max(replicationDelay, DEFAULT_RESCHEDULE_DELAY);
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
import com.google.common.flogger.FluentLogger; import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.server.events.EventDispatcher; import com.google.gerrit.server.events.RefEvent; import com.google.gerrit.server.permissions.PermissionBackendException; import com.googlesource.gerrit.plugins.rep...
// Copyright (C) 2013 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
RefPushResult status,
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
import com.google.common.flogger.FluentLogger; import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.server.events.EventDispatcher; import com.google.gerrit.server.events.RefEvent; import com.google.gerrit.server.permissions.PermissionBackendException; import com.googlesource.gerrit.plugins.rep...
if (command != null) { command.writeStdOutSync(message); } } @Override public void writeStdErr(String message) { StartCommand command = sshCommand.get(); if (command != null) { command.writeStdErrSync(message); } } } public static class GitUpdateProces...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
postEvent(new RefReplicatedEvent(project, ref, uri, status, refStatus));
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
import com.google.common.flogger.FluentLogger; import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.server.events.EventDispatcher; import com.google.gerrit.server.events.RefEvent; import com.google.gerrit.server.permissions.PermissionBackendException; import com.googlesource.gerrit.plugins.rep...
@Override public void writeStdErr(String message) { StartCommand command = sshCommand.get(); if (command != null) { command.writeStdErrSync(message); } } } public static class GitUpdateProcessing implements PushResultProcessing { private static final FluentLogger logger = ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java // public enum RefPushResult { // /** The ref was not successfully replicated. */ // FAILED, // // /** The ref is not configured to be replicated. */ // NOT_ATTEMPTED, // // /** The ref was successfully replicated. */ /...
postEvent(new RefReplicationDoneEvent(project, ref, nodesCount));
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfig.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME);
import static com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog; import com.google.common.base.Strings; import com.google.gerrit.extensions.annotations.PluginData; import com.google.gerrit.server.config.SitePaths; import com.google.inject.Inject; import java.io.IOException; import java.nio.file.Path; ...
// Copyright (C) 2013 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java // static final NamedFluentLogger repLog = NamedFluentLogger.forName(REPLICATION_LOG_NAME); // Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationFileBasedConfig.java import static com.googlesource.gerrit....
repLog.atSevere().withCause(e).log("Config file %s is invalid: %s", cfgPath, e.getMessage());
GerritCodeReview/plugins_replication
src/main/java/com/googlesource/gerrit/plugins/replication/events/RefReplicatedEvent.java
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // static String resolveNodeName(URIish uri) { // StringBuilder sb = new StringBuilder(); // if (uri.isRemote()) { // sb.append(uri.getHost()); // if (uri.getPort() != -1) { // sb.append(":"); // sb.appe...
import static com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName; import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult; import java.util.Objects; import org.eclipse.jgit.transport.RemoteRefUpdate; import org.eclipse.jgit.transport.RemoteRefUpdate.Status; import...
// Copyright (C) 2013 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java // static String resolveNodeName(URIish uri) { // StringBuilder sb = new StringBuilder(); // if (uri.isRemote()) { // sb.append(uri.getHost()); // if (uri.getPort() != -1) { // sb.append(":"); // sb.appe...
RefPushResult status,