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 |
|---|---|---|---|---|---|---|
realrolfje/anonimatron | src/main/java/com/rolfje/anonimatron/anonymizer/UUIDAnonymizer.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/StringSynonym.java
// public class StringSynonym implements Synonym {
// private String type;
// private String from;
// private String to;
// private boolean shortlived = false;
//
// public StringSynonym() {
// }
//
// public StringS... | import com.rolfje.anonimatron.synonyms.StringSynonym;
import com.rolfje.anonimatron.synonyms.Synonym;
import java.util.UUID; | package com.rolfje.anonimatron.anonymizer;
public class UUIDAnonymizer implements Anonymizer {
private static final String TYPE = "UUID";
@Override
public Synonym anonymize(Object from, int size, boolean shortlived) {
String to = getString(from, size); | // Path: src/main/java/com/rolfje/anonimatron/synonyms/StringSynonym.java
// public class StringSynonym implements Synonym {
// private String type;
// private String from;
// private String to;
// private boolean shortlived = false;
//
// public StringSynonym() {
// }
//
// public StringS... | return new StringSynonym( |
realrolfje/anonimatron | src/test/java/com/rolfje/anonimatron/anonymizer/CharacterStringPrefetchAnonymizerTest.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
//
// /**
// * Indicates if this Synonym is short-lived or transient, meaning that
// * it should not be stored in the synonyms file. Transient Synonyms
// * are not stored, need to be calculated each run tim... | import com.rolfje.anonimatron.synonyms.Synonym;
import junit.framework.TestCase;
import java.util.HashMap;
import java.util.Map; | package com.rolfje.anonimatron.anonymizer;
public class CharacterStringPrefetchAnonymizerTest extends TestCase {
CharacterStringPrefetchAnonymizer anonimyzer;
@Override
protected void setUp() throws Exception {
super.setUp();
anonimyzer = new CharacterStringPrefetchAnonymizer();
}
... | // Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
//
// /**
// * Indicates if this Synonym is short-lived or transient, meaning that
// * it should not be stored in the synonyms file. Transient Synonyms
// * are not stored, need to be calculated each run tim... | Synonym synonym = anonimyzer.anonymize(from, 5, false); |
realrolfje/anonimatron | src/test/java/com/rolfje/anonimatron/anonymizer/AbstractElevenProofAnonymizerTest.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
//
// /**
// * Indicates if this Synonym is short-lived or transient, meaning that
// * it should not be stored in the synonyms file. Transient Synonyms
// * are not stored, need to be calculated each run tim... | import com.rolfje.anonimatron.synonyms.Synonym;
import org.junit.Before;
import org.junit.Test;
import java.util.Map;
import static org.junit.Assert.*; | package com.rolfje.anonimatron.anonymizer;
public class AbstractElevenProofAnonymizerTest {
AbstractElevenProofAnonymizer testdummy;
@Before
public void setUp() {
testdummy = new AbstractElevenProofAnonymizer() {
@Override
public String getType() {
retu... | // Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
//
// /**
// * Indicates if this Synonym is short-lived or transient, meaning that
// * it should not be stored in the synonyms file. Transient Synonyms
// * are not stored, need to be calculated each run tim... | public Synonym anonymize(Object from, int size, boolean shortlived) { |
realrolfje/anonimatron | src/test/java/com/rolfje/anonimatron/anonymizer/DutchZipCodeAnonymizerTest.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
//
// /**
// * Indicates if this Synonym is short-lived or transient, meaning that
// * it should not be stored in the synonyms file. Transient Synonyms
// * are not stored, need to be calculated each run tim... | import com.rolfje.anonimatron.synonyms.Synonym;
import org.junit.Test;
import java.util.regex.Pattern;
import static org.junit.Assert.*;
| package com.rolfje.anonimatron.anonymizer;
/**
* Tests for {@link DutchZipCodeAnonymizer}.
*
* @author Erik-Berndt Scheper
*/
public class DutchZipCodeAnonymizerTest {
private DutchZipCodeAnonymizer anonymizer = new DutchZipCodeAnonymizer();
private Pattern pattern = Pattern.compile("[1-9]... | // Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
//
// /**
// * Indicates if this Synonym is short-lived or transient, meaning that
// * it should not be stored in the synonyms file. Transient Synonyms
// * are not stored, need to be calculated each run tim... | Synonym synonym = anonymizer.anonymize(from, size, false);
|
realrolfje/anonimatron | src/test/java/com/rolfje/anonimatron/anonymizer/CountryCodeAnonymizerTest.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
//
// /**
// * Indicates if this Synonym is short-lived or transient, meaning that
// * it should not be stored in the synonyms file. Transient Synonyms
// * are not stored, need to be calculated each run tim... | import com.rolfje.anonimatron.synonyms.Synonym;
import junit.framework.TestCase;
import java.util.*;
import static org.junit.Assert.assertNotEquals; | package com.rolfje.anonimatron.anonymizer;
public class CountryCodeAnonymizerTest extends TestCase {
private static final Set<String> ISO_3_COUNTRY_CODES = getISO3CountryCodes();
public void testAnonymize() {
testInternal(2, "EN");
testInternal(3, "NLD");
testInternal(4, "BLR");
... | // Path: src/main/java/com/rolfje/anonimatron/synonyms/Synonym.java
// public interface Synonym {
//
// /**
// * Indicates if this Synonym is short-lived or transient, meaning that
// * it should not be stored in the synonyms file. Transient Synonyms
// * are not stored, need to be calculated each run tim... | Synonym nld = countryCodeAnonymizer.anonymize(from, size, false); |
realrolfje/anonimatron | src/main/java/com/rolfje/anonimatron/anonymizer/SynonymCache.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/HashedFromSynonym.java
// public class HashedFromSynonym implements Synonym {
//
// private String from;
// private Object to;
// private String type;
// private boolean shortLived = false;
//
// public HashedFromSynonym() {
// }
//
// public HashedFromSy... | import com.rolfje.anonimatron.synonyms.HashedFromSynonym;
import com.rolfje.anonimatron.synonyms.Synonym;
import com.rolfje.anonimatron.synonyms.SynonymMapper;
import org.exolab.castor.mapping.MappingException;
import org.exolab.castor.xml.XMLException;
import java.io.File;
import java.io.IOException;
import java.util.... | package com.rolfje.anonimatron.anonymizer;
public class SynonymCache {
private Map<String, Map<Object, Synonym>> synonymCache = new HashMap<>();
private Hasher hasher;
private long size = 0;
public SynonymCache() {
}
/**
* Reads the synonyms from the specified file and (re-)initialize... | // Path: src/main/java/com/rolfje/anonimatron/synonyms/HashedFromSynonym.java
// public class HashedFromSynonym implements Synonym {
//
// private String from;
// private Object to;
// private String type;
// private boolean shortLived = false;
//
// public HashedFromSynonym() {
// }
//
// public HashedFromSy... | List<Synonym> synonymsFromFile = SynonymMapper |
realrolfje/anonimatron | src/main/java/com/rolfje/anonimatron/anonymizer/SynonymCache.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/HashedFromSynonym.java
// public class HashedFromSynonym implements Synonym {
//
// private String from;
// private Object to;
// private String type;
// private boolean shortLived = false;
//
// public HashedFromSynonym() {
// }
//
// public HashedFromSy... | import com.rolfje.anonimatron.synonyms.HashedFromSynonym;
import com.rolfje.anonimatron.synonyms.Synonym;
import com.rolfje.anonimatron.synonyms.SynonymMapper;
import org.exolab.castor.mapping.MappingException;
import org.exolab.castor.xml.XMLException;
import java.io.File;
import java.io.IOException;
import java.util.... | */
public void toFile(File synonymXMLfile) throws XMLException, IOException, MappingException {
List<Synonym> allSynonyms = new ArrayList<>();
// Flatten the type -> From -> Synonym map.
Collection<Map<Object, Synonym>> allObjectMaps = synonymCache.values();
for (Map<Object, Sy... | // Path: src/main/java/com/rolfje/anonimatron/synonyms/HashedFromSynonym.java
// public class HashedFromSynonym implements Synonym {
//
// private String from;
// private Object to;
// private String type;
// private boolean shortLived = false;
//
// public HashedFromSynonym() {
// }
//
// public HashedFromSy... | Synonym hashed = new HashedFromSynonym(hasher, synonym); |
realrolfje/anonimatron | src/main/java/com/rolfje/anonimatron/anonymizer/DutchBankAccountAnononymizer.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/StringSynonym.java
// public class StringSynonym implements Synonym {
// private String type;
// private String from;
// private String to;
// private boolean shortlived = false;
//
// public StringSynonym() {
// }
//
// public StringS... | import com.rolfje.anonimatron.synonyms.StringSynonym;
import com.rolfje.anonimatron.synonyms.Synonym;
import org.apache.log4j.Logger;
import java.security.SecureRandom; | package com.rolfje.anonimatron.anonymizer;
/**
* Generates valid Dutch Bank Account number with the same length as the given
* number.
* <p>
* A Dutch Bank Account Number is passes the "11 proof" if it is 9 digits long.
* If it is less than 9 digits, there is no way to check the validity of the
* number.
* <p... | // Path: src/main/java/com/rolfje/anonimatron/synonyms/StringSynonym.java
// public class StringSynonym implements Synonym {
// private String type;
// private String from;
// private String to;
// private boolean shortlived = false;
//
// public StringSynonym() {
// }
//
// public StringS... | public Synonym anonymize(Object from, int size, boolean shortlived) { |
realrolfje/anonimatron | src/main/java/com/rolfje/anonimatron/anonymizer/DutchBankAccountAnononymizer.java | // Path: src/main/java/com/rolfje/anonimatron/synonyms/StringSynonym.java
// public class StringSynonym implements Synonym {
// private String type;
// private String from;
// private String to;
// private boolean shortlived = false;
//
// public StringSynonym() {
// }
//
// public StringS... | import com.rolfje.anonimatron.synonyms.StringSynonym;
import com.rolfje.anonimatron.synonyms.Synonym;
import org.apache.log4j.Logger;
import java.security.SecureRandom; | package com.rolfje.anonimatron.anonymizer;
/**
* Generates valid Dutch Bank Account number with the same length as the given
* number.
* <p>
* A Dutch Bank Account Number is passes the "11 proof" if it is 9 digits long.
* If it is less than 9 digits, there is no way to check the validity of the
* number.
* <p... | // Path: src/main/java/com/rolfje/anonimatron/synonyms/StringSynonym.java
// public class StringSynonym implements Synonym {
// private String type;
// private String from;
// private String to;
// private boolean shortlived = false;
//
// public StringSynonym() {
// }
//
// public StringS... | return new StringSynonym( |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/io/ParagraphTest.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import java.io.BufferedWr... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | JCas cas = ArgUtils.readCas(f); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/reader/XmiToTextReader.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import org.apache.uima.util.CasCreationUtils;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Collection;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.core.api.segmentati... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | String id = ArgUtils.getID(f); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/discourse/pdtbparser/PDTBDiscourseAnnotator.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/core/api/discourse/DiscourseDumpWriter.java
// public class DiscourseDumpWriter
// extends JCasAnnotator_ImplBase
// {
// /**
// * Output file. If multiple CASes as processed, their contents are concatenated into this file.
// * When this file is set... | import de.tudarmstadt.ukp.dkpro.core.api.discourse.DiscourseDumpWriter;
import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import de.tudarmstadt.ukp.dkpro.core.di... | int begin =
arg1.getBegin() < arg2.getBegin() ? arg1.getBegin() : arg2.getBegin();
int end = arg1.getEnd() > arg2.getEnd() ? arg1.getEnd() : arg2.getEnd();
discourseRelation.setBegin(begin);
discourseRelation.se... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/core/api/discourse/DiscourseDumpWriter.java
// public class DiscourseDumpWriter
// extends JCasAnnotator_ImplBase
// {
// /**
// * Output file. If multiple CASes as processed, their contents are concatenated into this file.
// * When this file is set... | DiscourseDumpWriter.debugRelation(discourseRelation); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/reader/ClaimSentenceReader.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import org.apache.uima.resource.ResourceInitializationException;
import java.io.IOException;
import java.util.Collection;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData;
import de.tudarmstadt.ukp.dkpro.core.api.segm... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | if (ArgUtils.isClaim(s, jcas)) { |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/tc/core/io/CustomFoldDimensionBundle2.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.lab.task.Dimension;
import de.tudarmstadt.ukp.dkpro.lab.task.impl.DynamicDimension;
import de.tudarmstadt.ukp.dkpro.lab.task.impl.FoldDimensionBundle;
import java.io.BufferedReader;
import java.io.FileReader;... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | String currentID = ArgUtils.getID((String)path); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/experiments/utils/ExperimentUtils.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.google.common.collect.Table;
import com.google.common.collect.TreeBasedTable;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.tc.weka.report.WekaClassificationRe... | if (subFolder.getName().contains("TestTask")) {
FileUtils
.copyFile(new File(subFolder.getAbsoluteFile() + "/id2outcome.txt"),
new File(resultFilePath + "/" + ExperimentUtils.OUTCOME_PATH
... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | ArgUtils.writeFile(resultFilePath + "/Results.txt", results); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/statistics/ClaimSentenceDist.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;
import java.io.File;
import j... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | JCas cas = ArgUtils.readCas(f); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/PunctuationSequenceUFE.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/utils/PunctuationSequenceMetaCollector.java
// public class PunctuationSequenceMetaCollector extends FreqDistBasedMetaCollector {
//
// public static final String PARAM_PUNCTUATION_SEQUENCE_FD_FILE = "punctSequen... | import org.apache.uima.resource.ResourceSpecifier;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.features.syntactic.utils.PunctuationSequenceMetaCollector;
import de.tudarmstadt.ukp.dkpro.core.api.frequency.u... | @Override
public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationException {
if (!super.initialize(aSpecifier, aAdditionalParams)) {
return false;
}
FrequencyDistribution<String> trainingFD;
try {
... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/utils/PunctuationSequenceMetaCollector.java
// public class PunctuationSequenceMetaCollector extends FreqDistBasedMetaCollector {
//
// public static final String PARAM_PUNCTUATION_SEQUENCE_FD_FILE = "punctSequen... | String unitSequence = PunctuationSequenceMetaCollector.createPunctuationSequence(text); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/utils/PunctuationSequenceMetaCollector.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/PunctuationSequenceUFE.java
// public class PunctuationSequenceUFE extends FeatureExtractorResource_ImplBase implements ClassificationUnitFeatureExtractor, MetaDependent {
//
// public static final String FN_PUNCTUATIO... | import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.features.syntactic.PunctuationSequenceUFE;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence;
import de.tudarmstadt.ukp.dkpro.... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/PunctuationSequenceUFE.java
// public class PunctuationSequenceUFE extends FeatureExtractorResource_ImplBase implements ClassificationUnitFeatureExtractor, MetaDependent {
//
// public static final String FN_PUNCTUATIO... | mapping.put(PunctuationSequenceUFE.PARAM_PUNCTUATION_SEQUENCE_FD_FILE, PARAM_PUNCTUATION_SEQUENCE_FD_FILE); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/structural/FirstComponentInParagraph.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/FeatureUtils.java
// public class FeatureUtils {
//
// /**
// * Returns a covering paragraph of an argument component
// * @param classificationUnit
// * @return
// */
// public static Paragraph getCoveringParagraph(Anno... | import java.util.Collection;
import java.util.List;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.features.FeatureUtils;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence;
import de.tudarmstadt.ukp.dkpro.tc.api.exc... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/FeatureUtils.java
// public class FeatureUtils {
//
// /**
// * Returns a covering paragraph of an argument component
// * @param classificationUnit
// * @return
// */
// public static Paragraph getCoveringParagraph(Anno... | Paragraph para = FeatureUtils.getCoveringParagraph(classificationUnit); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/tc/core/io/CustomFoldDimensionBundle.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.lab.task.Dimension;
import de.tudarmstadt.ukp.dkpro.lab.task.impl.DynamicDimension;
import de.tudarmstadt.ukp.dkpro.lab.task.impl.FoldDimensionBundle;
import java.io.BufferedReader;
import java.io.FileReader;... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | String currentID = ArgUtils.getID((String)path); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/reader/SentenceClaimOutcomeMultiplier.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence;
import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader;
import de.tudarmstadt.ukp.dkpro.core.io.xmi... | catch (CASException e) {
throw new AnalysisEngineProcessException("Exception while creating JCas", null, e);
}
// Set new ids and URIs for copied cases.
// The counting variable keeps track of how many new CAS objects are created from the
// original CAS, a CAS relat... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | if (ArgUtils.isClaim(s, copyJCas)) { |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/statistics/ClaimExamplesExplorer.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import org.apache.uima.jcas.JCas;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.*;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.argumentation.io.writer.ArgumentDumpWriter;
import de.tudarmstadt.ukp.dkpro.co... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | if (ArgUtils.isClaim(sentence, aJCas)) { |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/structural/LastComponentInParagraph.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/FeatureUtils.java
// public class FeatureUtils {
//
// /**
// * Returns a covering paragraph of an argument component
// * @param classificationUnit
// * @return
// */
// public static Paragraph getCoveringParagraph(Anno... | import java.util.Collection;
import java.util.List;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.features.FeatureUtils;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence;
import de.tudarmstadt.ukp.dkpro.tc.api.exc... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/FeatureUtils.java
// public class FeatureUtils {
//
// /**
// * Returns a covering paragraph of an argument component
// * @param classificationUnit
// * @return
// */
// public static Paragraph getCoveringParagraph(Anno... | Paragraph para = FeatureUtils.getCoveringParagraph(classificationUnit); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearUtils.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearTestTask.java
// public static final double EPISILON_DEFAULT = 0.01;
//
// Path: src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearTestTask.java
// public static final double PARAM_C_DEFAULT = 1.0;
| import de.bwaldvogel.liblinear.SolverType;
import org.apache.commons.logging.LogFactory;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import static de.tudarmstadt.ukp.dkpro.tc.ml.liblinear.LiblinearTestTask.EPISILON_DEFAULT;
import static de.tudarmstadt.ukp.dkpro.tc.ml.liblinear.LiblinearTestTask.P... | break;
case "11":
type = SolverType.L2R_L2LOSS_SVR;
break;
case "12":
type = SolverType.L2R_L2LOSS_SVR_DUAL;
break;
case "13":
type = SolverType.L2R_L1L... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearTestTask.java
// public static final double EPISILON_DEFAULT = 0.01;
//
// Path: src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearTestTask.java
// public static final double PARAM_C_DEFAULT = 1.0;
// Path: src/main/java/de/tudarm... | return PARAM_C_DEFAULT; |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearUtils.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearTestTask.java
// public static final double EPISILON_DEFAULT = 0.01;
//
// Path: src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearTestTask.java
// public static final double PARAM_C_DEFAULT = 1.0;
| import de.bwaldvogel.liblinear.SolverType;
import org.apache.commons.logging.LogFactory;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import static de.tudarmstadt.ukp.dkpro.tc.ml.liblinear.LiblinearTestTask.EPISILON_DEFAULT;
import static de.tudarmstadt.ukp.dkpro.tc.ml.liblinear.LiblinearTestTask.P... | for (int i = 0; i < classificationArguments.size(); i++) {
String e = classificationArguments.get(i);
if (e.equals("-c")) {
if (i + 1 >= classificationArguments.size()) {
throw new IllegalArgumentException(
"Found parameter ... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearTestTask.java
// public static final double EPISILON_DEFAULT = 0.01;
//
// Path: src/main/java/de/tudarmstadt/ukp/dkpro/tc/ml/liblinear/LiblinearTestTask.java
// public static final double PARAM_C_DEFAULT = 1.0;
// Path: src/main/java/de/tudarm... | return EPISILON_DEFAULT; |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/DependencyTriples.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/utils/DependencyTriplesMC.java
// public class DependencyTriplesMC extends FreqDistBasedMetaCollector {
//
// // public static final String DEPENDENCIES_FD_KEY = "depTripleFdFile.ser";
// // @ConfigurationParameter(na... | import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.resource.ResourceSpecifier;
import java.io.File;
import java.util.*;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.features.syntactic.utils.DependencyTriplesMC;
import de.tudarmsta... | trainingFD = new FrequencyDistribution<String>();
trainingFD.load(new File(depTripleFdFile));
} catch (Exception e) {
throw new ResourceInitializationException(e);
}
topKDeps = new FrequencyDistribution<String>();
if (numberOfDependencyTriples... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/features/syntactic/utils/DependencyTriplesMC.java
// public class DependencyTriplesMC extends FreqDistBasedMetaCollector {
//
// // public static final String DEPENDENCIES_FD_KEY = "depTripleFdFile.ser";
// // @ConfigurationParameter(na... | metaCollectorClasses.add(DependencyTriplesMC.class); |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/io/SentenceOutput.java | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.utils.ArgUtils;
import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import org.apache.uima.fit.util.... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | // Path: src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/utils/ArgUtils.java
// public class ArgUtils {
//
//
// public static String getID(String s) {
// String[] tmp = s.split("/");
// return tmp[tmp.length-1].replace(".xmi","").replace(".bin", "");
// }
//
//
// public static Str... | JCas cas = ArgUtils.readCas(f); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | import org.jetbrains.annotations.NotNull;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import static net.javacrumbs.jsonunit.core.internal.ArrayUtils.toBoolList;
import static net.javacrumbs.jsonunit.core.internal.ArrayUtils.toDoubleList;
... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | return new ArrayNode(toIntList((int[]) object), this); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | import org.jetbrains.annotations.NotNull;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import static net.javacrumbs.jsonunit.core.internal.ArrayUtils.toBoolList;
import static net.javacrumbs.jsonunit.core.internal.ArrayUtils.toDoubleList;
... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | return new ArrayNode(toDoubleList((double[]) object), this); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | import org.jetbrains.annotations.NotNull;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import static net.javacrumbs.jsonunit.core.internal.ArrayUtils.toBoolList;
import static net.javacrumbs.jsonunit.core.internal.ArrayUtils.toDoubleList;
... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | return new ArrayNode(toBoolList((boolean[]) object), this); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Converter.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ClassUtils.java
// static boolean isClassPresent(String className) {
// try {
// ClassUtils.class.getClassLoader().loadClass(className);
// return true;
// } catch (Throwable e) {
// return false;
// }
// }
| import java.util.ArrayList;
import java.util.List;
import static net.javacrumbs.jsonunit.core.internal.ClassUtils.isClassPresent; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ClassUtils.java
// static boolean isClassPresent(String className) {
// try {
// ClassUtils.class.getClassLoader().loadClass(className);
// return true;
// } catch (Throwable e) {
// return false;
// }
// }
... | isClassPresent("com.fasterxml.jackson.databind.ObjectMapper") && |
lukas-krecan/JsonUnit | json-unit-json-path/src/test/java/net/javacrumbs/jsonunit/jsonpath/InternalJsonPathUtilsTest.java | // Path: json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/InternalJsonPathUtils.java
// static String fromBracketNotation(String path) {
// return path
// .replace("['", ".")
// .replace("']", "");
// }
| import org.junit.jupiter.api.Test;
import static net.javacrumbs.jsonunit.jsonpath.InternalJsonPathUtils.fromBracketNotation;
import static org.assertj.core.api.Assertions.assertThat; | package net.javacrumbs.jsonunit.jsonpath;
class InternalJsonPathUtilsTest {
@Test
void shouldConvertFromBracketNotation() { | // Path: json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/InternalJsonPathUtils.java
// static String fromBracketNotation(String path) {
// return path
// .replace("['", ".")
// .replace("']", "");
// }
// Path: json-unit-json-path/src/test/java/net/javacrumbs/jsonunit/jsonpath/I... | assertThat(fromBracketNotation("$['tool']['jsonpath'][2]")).isEqualTo("$.tool.jsonpath[2]"); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/MoshiNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static void closeQuietly(final Reader resourceReader) {
// if (resourceReader != null) {
// try {
// resourceReader.close();
// } catch (IOException ignored) {
// }
// }
// }
//
// Path... | import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;
import java.io.IOException;
import java.io.Reader;
import java.math.BigDecimal;
import java.math.RoundingMode;
import static net.javacrumbs.jsonunit.core.internal.Utils.closeQuietly;
import static net.javacrumbs.jsonunit.core.internal.Utils.toReade... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static void closeQuietly(final Reader resourceReader) {
// if (resourceReader != null) {
// try {
// resourceReader.close();
// } catch (IOException ignored) {
// }
// }
// }
//
// Path... | throw newParseException(label, toReader(source), e); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/MoshiNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static void closeQuietly(final Reader resourceReader) {
// if (resourceReader != null) {
// try {
// resourceReader.close();
// } catch (IOException ignored) {
// }
// }
// }
//
// Path... | import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;
import java.io.IOException;
import java.io.Reader;
import java.math.BigDecimal;
import java.math.RoundingMode;
import static net.javacrumbs.jsonunit.core.internal.Utils.closeQuietly;
import static net.javacrumbs.jsonunit.core.internal.Utils.toReade... | @Override
protected Node doConvertValue(Object source) {
return newNode(source);
}
@Override
protected Node nullNode() {
return newNode(null);
}
@Override
protected Node readValue(String source, String label, boolean lenient) {
try {
JsonAdapter<Obje... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static void closeQuietly(final Reader resourceReader) {
// if (resourceReader != null) {
// try {
// resourceReader.close();
// } catch (IOException ignored) {
// }
// }
// }
//
// Path... | closeQuietly(value); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Jackson2NodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/providers/Jackson2ObjectMapperProvider.java
// public interface Jackson2ObjectMapperProvider {
// /**
// * Provides ObjectMapper
// * @param lenient Lenient parsing is used for parsing the expected JSON value
// * @return customized Object... | import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.NullNode;
import net.javacrumbs.jsonunit.providers.Jackson2ObjectMapperProvider;
import java.io.IOException;
import java.io.Reader;... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/providers/Jackson2ObjectMapperProvider.java
// public interface Jackson2ObjectMapperProvider {
// /**
// * Provides ObjectMapper
// * @param lenient Lenient parsing is used for parsing the expected JSON value
// * @return customized Object... | closeQuietly(value); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ExceptionUtils.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ClassUtils.java
// static boolean isClassPresent(String className) {
// try {
// ClassUtils.class.getClassLoader().loadClass(className);
// return true;
// } catch (Throwable e) {
// return false;
// }
// }
| import java.util.List;
import static net.javacrumbs.jsonunit.core.internal.ClassUtils.isClassPresent; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ClassUtils.java
// static boolean isClassPresent(String className) {
// try {
// ClassUtils.class.getClassLoader().loadClass(className);
// return true;
// } catch (Throwable e) {
// return false;
// }
// }
... | = isClassPresent("org.opentest4j.AssertionFailedError") ? new Opentest4jExceptionFactory() : new BasicExceptionFactory(); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Node.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// static String prettyPrint(Map<String, Object> map) {
// StringBuilder builder = new StringBuilder();
// builder.append("{");
// Iterator<Entry<String, Object>> entries = map.entrySet().stream().sorted(comparingByKe... | import java.math.BigDecimal;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.prettyPrint; | public Object getValue() {
return null;
}
@Override
public void ___do_not_implement_this_interface_seriously() {}
@Override
public String toString() {
return "<missing>";
}
};
interface ValueExtractor {
Object getValue(Nod... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// static String prettyPrint(Map<String, Object> map) {
// StringBuilder builder = new StringBuilder();
// builder.append("{");
// Iterator<Entry<String, Object>> entries = map.entrySet().stream().sorted(comparingByKe... | return prettyPrint(this); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonOrgNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java
// static abstract class NodeSkeleton extends AbstractNode {
// @Override
// public Node element(int index) {
// return MISSING_NODE;
// }
//
// @Override
// public Iterator<KeyValue> fields(... | import net.javacrumbs.jsonunit.core.internal.GenericNodeBuilder.NodeSkeleton;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.Reader;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import static net.javacrum... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java
// static abstract class NodeSkeleton extends AbstractNode {
// @Override
// public Node element(int index) {
// return MISSING_NODE;
// }
//
// @Override
// public Iterator<KeyValue> fields(... | closeQuietly(value); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonOrgNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java
// static abstract class NodeSkeleton extends AbstractNode {
// @Override
// public Node element(int index) {
// return MISSING_NODE;
// }
//
// @Override
// public Iterator<KeyValue> fields(... | import net.javacrumbs.jsonunit.core.internal.GenericNodeBuilder.NodeSkeleton;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.Reader;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import static net.javacrum... | }
}
private static Node newNode(Object object) {
if (object instanceof JSONObject) {
return new JSONObjectNode((JSONObject) object);
} else if (object instanceof Number) {
return new GenericNodeBuilder.NumberNode((Number) object);
} else if (object instan... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GenericNodeBuilder.java
// static abstract class NodeSkeleton extends AbstractNode {
// @Override
// public Node element(int index) {
// return MISSING_NODE;
// }
//
// @Override
// public Iterator<KeyValue> fields(... | private static final class JSONArrayNode extends NodeSkeleton { |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/JsonUtilsTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static java.util.Collections.singletonMap;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.convertToJson;
import static net.javacrumbs.jsonunit.core.intern... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | assertEquals(STRING, convertToJson("\"a\"", "x").getNodeType()); |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/JsonUtilsTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static java.util.Collections.singletonMap;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.convertToJson;
import static net.javacrumbs.jsonunit.core.intern... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | assertEquals(STRING, valueToNode("a").getNodeType()); |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/JsonUtilsTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static java.util.Collections.singletonMap;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.convertToJson;
import static net.javacrumbs.jsonunit.core.intern... | assertEquals(NUMBER, convertToJson("1.0", "x").getNodeType());
assertEquals(OBJECT, convertToJson("{\"a\":1}", "x").getNodeType());
assertEquals(ARRAY, convertToJson("[1 ,2, 3]", "x").getNodeType());
assertEquals(BOOLEAN, convertToJson("true", "x").getNodeType());
assertEquals(BO... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | assertEquals("1", quoteIfNeeded("1")); |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/JsonUtilsTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static java.util.Collections.singletonMap;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.convertToJson;
import static net.javacrumbs.jsonunit.core.intern... | assertEquals(NUMBER, valueToNode(1.0).getNodeType());
assertEquals(STRING, valueToNode("1.0").getNodeType());
assertEquals(OBJECT, valueToNode(singletonMap("a", 1)).getNodeType());
assertEquals(ARRAY, valueToNode(new int[]{1 ,2, 3}).getNodeType());
assertEquals(STRING, valueToNod... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | Node startNode = getNode(mapper.readTree("{\"test\":{\"value\":1}}"), ""); |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/JsonUtilsTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static java.util.Collections.singletonMap;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.convertToJson;
import static net.javacrumbs.jsonunit.core.intern... | }
@Test
void testGetStartNodeArraysRootComplex() throws IOException {
Node startNode = getNode(mapper.readTree("[{\"values\":[1,2]}, {\"values\":[3,4]}]"), "[1].values[1]");
assertEquals(4, startNode.decimalValue().intValue());
}
@Test
void testGetStartNodeArraysConvoluted() th... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | assertTrue(nodeExists(json, "test")); |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/JsonUtilsTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.math.BigDecimal;
import static java.util.Collections.singletonMap;
import static net.javacrumbs.jsonunit.core.internal.JsonUtils.convertToJson;
import static net.javacrumbs.jsonunit.core.intern... | void testGetStartNodeArraysConvoluted() throws IOException {
Node startNode = getNode(mapper.readTree("{\"test\":[{\"values\":[1,2]}, {\"values\":[3,4]}]}"), "test.[1].values.[1]");
assertEquals(4, startNode.decimalValue().intValue());
}
@Test
void testGetStartNodeArraysRoot() throws IO... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Node convertToJson(Object source, String label) {
// return convertToJson(source, label, false);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public s... | assertFalse(nodeAbsent(json, Path.create("test"), false)); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/GsonNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static void closeQuietly(final Reader resourceReader) {
// if (resourceReader != null) {
// try {
// resourceReader.close();
// } catch (IOException ignored) {
// }
// }
// }
| import static net.javacrumbs.jsonunit.core.internal.Utils.closeQuietly;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonIOException;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static void closeQuietly(final Reader resourceReader) {
// if (resourceReader != null) {
// try {
// resourceReader.close();
// } catch (IOException ignored) {
// }
// }
// }
// Path: ... | closeQuietly(value); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/AbstractNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static class JsonStringReader extends StringReader {
// private final String string;
//
// public JsonStringReader(@NotNull String s) {
// super(s);
// this.string = s;
// }
//
// public String ge... | import net.javacrumbs.jsonunit.core.internal.Utils.JsonStringReader;
import org.jetbrains.annotations.NotNull;
import java.io.Reader;
import java.math.BigDecimal;
import static net.javacrumbs.jsonunit.core.internal.Utils.closeQuietly;
import static net.javacrumbs.jsonunit.core.internal.Utils.toReader; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static class JsonStringReader extends StringReader {
// private final String string;
//
// public JsonStringReader(@NotNull String s) {
// super(s);
// this.string = s;
// }
//
// public String ge... | closeQuietly((Reader) source); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/AbstractNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static class JsonStringReader extends StringReader {
// private final String string;
//
// public JsonStringReader(@NotNull String s) {
// super(s);
// this.string = s;
// }
//
// public String ge... | import net.javacrumbs.jsonunit.core.internal.Utils.JsonStringReader;
import org.jetbrains.annotations.NotNull;
import java.io.Reader;
import java.math.BigDecimal;
import static net.javacrumbs.jsonunit.core.internal.Utils.closeQuietly;
import static net.javacrumbs.jsonunit.core.internal.Utils.toReader; | try {
return readValue((Reader) source, label, lenient);
} finally {
closeQuietly((Reader) source);
}
} else {
return convertValue(source);
}
}
@Override
public Node valueToNode(Object source) {
if (sour... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static class JsonStringReader extends StringReader {
// private final String string;
//
// public JsonStringReader(@NotNull String s) {
// super(s);
// this.string = s;
// }
//
// public String ge... | if (value instanceof JsonStringReader) { |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/AbstractNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static class JsonStringReader extends StringReader {
// private final String string;
//
// public JsonStringReader(@NotNull String s) {
// super(s);
// this.string = s;
// }
//
// public String ge... | import net.javacrumbs.jsonunit.core.internal.Utils.JsonStringReader;
import org.jetbrains.annotations.NotNull;
import java.io.Reader;
import java.math.BigDecimal;
import static net.javacrumbs.jsonunit.core.internal.Utils.closeQuietly;
import static net.javacrumbs.jsonunit.core.internal.Utils.toReader; | return nullNode();
} else {
return convertValue(source);
}
}
final Node convertValue(Object source) {
if (source instanceof BigDecimal) {
return new GenericNodeBuilder.NumberNode((Number) source);
} else {
return doConvertValue(sou... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static class JsonStringReader extends StringReader {
// private final String string;
//
// public JsonStringReader(@NotNull String s) {
// super(s);
// this.string = s;
// }
//
// public String ge... | return readValue(toReader(source), label, lenient); |
lukas-krecan/JsonUnit | json-unit-spring/src/test/java/net/javacrumbs/jsonunit/spring/testit/ClientTest.java | // Path: json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/JsonUnitRequestMatchers.java
// @NotNull
// public static JsonUnitRequestMatchers json() {
// return new JsonUnitRequestMatchers(Path.root(), Configuration.empty());
// }
| import org.junit.jupiter.api.Test;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.web.client.RestTemplate;
import static net.javacrumbs.jsonunit.spring.JsonUnitRequestMatchers.json;
impor... | /**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless requir... | // Path: json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/JsonUnitRequestMatchers.java
// @NotNull
// public static JsonUnitRequestMatchers json() {
// return new JsonUnitRequestMatchers(Path.root(), Configuration.empty());
// }
// Path: json-unit-spring/src/test/java/net/javacrumbs/jsonunit/spring/t... | private final String json = "{\"test\": 1}"; |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/PathOptionMatcher.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | import net.javacrumbs.jsonunit.core.Option;
import java.util.Collection;
import java.util.stream.Stream; | package net.javacrumbs.jsonunit.core.internal;
class PathOptionMatcher {
private final PathMatcher pathMatcher; | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | private final Option option; |
lukas-krecan/JsonUnit | tests/test-jackson2-config/src/test/java/net/javacrumbs/jsonunit/test/jackson2config/Jackson2ConfigTest.java | // Path: json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java
// public static void assertJsonEquals(Object expected, Object actual) {
// assertJsonEquals(expected, actual, configuration);
// }
//
// Path: json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonAssertions.java
// @NotNull
//... | import org.junit.jupiter.api.Test;
import java.time.Instant;
import static net.javacrumbs.jsonunit.JsonAssert.assertJsonEquals;
import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java
// public static void assertJsonEquals(Object expected, Object actual) {
// assertJsonEquals(expected, actual, configuration);
// }
//
// Path: json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonAssertions.java
// @NotNull
//... | assertThatJson(new Bean()).isEqualTo("{time:'2019-01-11T18:12:00Z'}"); |
lukas-krecan/JsonUnit | tests/test-jackson2-config/src/test/java/net/javacrumbs/jsonunit/test/jackson2config/Jackson2ConfigTest.java | // Path: json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java
// public static void assertJsonEquals(Object expected, Object actual) {
// assertJsonEquals(expected, actual, configuration);
// }
//
// Path: json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonAssertions.java
// @NotNull
//... | import org.junit.jupiter.api.Test;
import java.time.Instant;
import static net.javacrumbs.jsonunit.JsonAssert.assertJsonEquals;
import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java
// public static void assertJsonEquals(Object expected, Object actual) {
// assertJsonEquals(expected, actual, configuration);
// }
//
// Path: json-unit-assertj/src/main/java/net/javacrumbs/jsonunit/assertj/JsonAssertions.java
// @NotNull
//... | assertJsonEquals(s, s); |
lukas-krecan/JsonUnit | tests/test-junit4/src/test/java/net/javacrumbs/jsonunit/test/junit4/JUnit4Test.java | // Path: json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java
// public static void assertJsonEquals(Object expected, Object actual) {
// assertJsonEquals(expected, actual, configuration);
// }
| import org.junit.Test;
import static net.javacrumbs.jsonunit.JsonAssert.assertJsonEquals;
import static org.assertj.core.api.Assertions.assertThatThrownBy; | package net.javacrumbs.jsonunit.test.junit4;
public class JUnit4Test {
@Test
public void testComplexErrors() { | // Path: json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java
// public static void assertJsonEquals(Object expected, Object actual) {
// assertJsonEquals(expected, actual, configuration);
// }
// Path: tests/test-junit4/src/test/java/net/javacrumbs/jsonunit/test/junit4/JUnit4Test.java
import org.junit... | assertThatThrownBy(() -> assertJsonEquals("{\n" + |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/PathOption.java
// public class PathOption {
// private final List<String> paths;
// private final Set<Option> options;
//
// /**
// * True if this option is included, false if excluded.
// */
// private final boolean... | import net.javacrumbs.jsonunit.core.internal.PathOption;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set; | private PathsParam(String... paths) {
this.paths = Arrays.asList(paths);
}
List<String> getPaths() {
return paths;
}
Configuration apply(Configuration configuration, ApplicableForPath action) {
return action.applyForPaths(configuration, this)... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/PathOption.java
// public class PathOption {
// private final List<String> paths;
// private final Set<Option> options;
//
// /**
// * True if this option is included, false if excluded.
// */
// private final boolean... | return configuration.addPathOption(new PathOption(pathsParam.getPaths(), options, included)); |
lukas-krecan/JsonUnit | tests/test-no-hamcrest/src/test/java/net/javacrumbs/jsonunit/test/nohamcrest/NoHamcrestTest.java | // Path: json-unit-fluent/src/main/java/net/javacrumbs/jsonunit/fluent/JsonFluentAssert.java
// public static ConfigurableJsonFluentAssert assertThatJson(Object json) {
// return new ConfigurableJsonFluentAssert(convertToJson(json, ACTUAL), getPathPrefix(json));
// }
| import org.junit.jupiter.api.Test;
import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-fluent/src/main/java/net/javacrumbs/jsonunit/fluent/JsonFluentAssert.java
// public static ConfigurableJsonFluentAssert assertThatJson(Object json) {
// return new ConfigurableJsonFluentAssert(convertToJson(json, ACTUAL), getPathPrefix(json));
// }
// Path: tests/test-no-hamcrest/src/test/java/... | assertThatJson("{\"a\":1}").isEqualTo("{a: 1}"); |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/ConverterTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ClassUtils.java
// static boolean isClassPresent(String className) {
// try {
// ClassUtils.class.getClassLoader().loadClass(className);
// return true;
// } catch (Throwable e) {
// return false;
// }
// }
/... | import com.fasterxml.jackson.databind.node.BooleanNode;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collections;
import static net.javacrumbs.jsonunit.core.internal.ClassUtils.isClassPresent;
import static net.javacrumbs.jsonunit.core.internal.Converter.LIBRARIES_PROPERTY_NAME;
import s... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ClassUtils.java
// static boolean isClassPresent(String className) {
// try {
// ClassUtils.class.getClassLoader().loadClass(className);
// return true;
// } catch (Throwable e) {
// return false;
// }
// }
/... | System.setProperty(LIBRARIES_PROPERTY_NAME,"gson"); |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/ConverterTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ClassUtils.java
// static boolean isClassPresent(String className) {
// try {
// ClassUtils.class.getClassLoader().loadClass(className);
// return true;
// } catch (Throwable e) {
// return false;
// }
// }
/... | import com.fasterxml.jackson.databind.node.BooleanNode;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collections;
import static net.javacrumbs.jsonunit.core.internal.ClassUtils.isClassPresent;
import static net.javacrumbs.jsonunit.core.internal.Converter.LIBRARIES_PROPERTY_NAME;
import s... | void shouldUseOnlyFactorySpecifiedBySystemProperty() {
System.setProperty(LIBRARIES_PROPERTY_NAME,"gson");
Converter converter = Converter.createDefaultConverter();
assertThat(converter.getFactories()).extracting("class").containsExactly(GsonNodeFactory.class);
System.setProperty(LIB... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ClassUtils.java
// static boolean isClassPresent(String className) {
// try {
// ClassUtils.class.getClassLoader().loadClass(className);
// return true;
// } catch (Throwable e) {
// return false;
// }
// }
/... | assertTrue(isClassPresent("java.lang.String")); |
lukas-krecan/JsonUnit | tests/test-base/src/main/java/net/javacrumbs/jsonunit/test/base/RecordingDifferenceListener.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/listener/Difference.java
// public interface Difference {
// enum Type {EXTRA, MISSING, DIFFERENT}
//
// /**
// * Path to the difference
// */
// String getActualPath();
//
// /**
// * Path to the expected element (may b... | import net.javacrumbs.jsonunit.core.listener.Difference;
import net.javacrumbs.jsonunit.core.listener.DifferenceContext;
import net.javacrumbs.jsonunit.core.listener.DifferenceListener;
import java.util.ArrayList;
import java.util.List; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/listener/Difference.java
// public interface Difference {
// enum Type {EXTRA, MISSING, DIFFERENT}
//
// /**
// * Path to the difference
// */
// String getActualPath();
//
// /**
// * Path to the expected element (may b... | public void diff(Difference difference, DifferenceContext context) { |
lukas-krecan/JsonUnit | json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/JsonPathAdapter.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | import com.jayway.jsonpath.EvaluationListener;
import com.jayway.jsonpath.PathNotFoundException;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import static com.jayway.jsonpath.Configuration.defaultConfiguration;
import static net.javacrumbs.jsonunit.core.internal.JsonUtil... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | String normalizedPath = fromBracketNotation(path); |
lukas-krecan/JsonUnit | json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/JsonPathAdapter.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | import com.jayway.jsonpath.EvaluationListener;
import com.jayway.jsonpath.PathNotFoundException;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import static com.jayway.jsonpath.Configuration.defaultConfiguration;
import static net.javacrumbs.jsonunit.core.internal.JsonUtil... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | Object value = readValue(defaultConfiguration().addEvaluationListeners(recordingListener), json, path); |
lukas-krecan/JsonUnit | json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/JsonPathAdapter.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | import com.jayway.jsonpath.EvaluationListener;
import com.jayway.jsonpath.PathNotFoundException;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import static com.jayway.jsonpath.Configuration.defaultConfiguration;
import static net.javacrumbs.jsonunit.core.internal.JsonUtil... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | return jsonSource(wrapDeserializedObject(value), normalizedPath, recordingListener.getMatchingPaths()); |
lukas-krecan/JsonUnit | json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/JsonPathAdapter.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | import com.jayway.jsonpath.EvaluationListener;
import com.jayway.jsonpath.PathNotFoundException;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import static com.jayway.jsonpath.Configuration.defaultConfiguration;
import static net.javacrumbs.jsonunit.core.internal.JsonUtil... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | return jsonSource(wrapDeserializedObject(value), normalizedPath, recordingListener.getMatchingPaths()); |
lukas-krecan/JsonUnit | json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/JsonPathAdapter.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | import com.jayway.jsonpath.EvaluationListener;
import com.jayway.jsonpath.PathNotFoundException;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import static com.jayway.jsonpath.Configuration.defaultConfiguration;
import static net.javacrumbs.jsonunit.core.internal.JsonUtil... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// public static Object jsonSource(Object json, String pathPrefix) {
// return jsonSource(json, pathPrefix, emptyList());
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java
// ... | return jsonSource(missingNode(), normalizedPath); |
lukas-krecan/JsonUnit | json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/NodeFactoryTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static Reader toReader(String string) {
// return new JsonStringReader(string);
// }
| import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import static java.math.BigDecimal.ONE;
import st... | assertEquals(Node.NodeType.OBJECT, node.getNodeType());
Node root = node.get("root");
assertEquals(Node.NodeType.OBJECT, root.getNodeType());
Node a = root.get("a");
assertEquals(Node.NodeType.NUMBER, a.getNodeType());
assertEquals(ONE, a.decimalValue());
Node ... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/Utils.java
// static Reader toReader(String string) {
// return new JsonStringReader(string);
// }
// Path: json-unit-core/src/test/java/net/javacrumbs/jsonunit/core/internal/NodeFactoryTest.java
import static org.junit.Assert.assertTrue;... | return factory.readValue(toReader(value), "label", false); |
lukas-krecan/JsonUnit | tests/test-json-path/src/test/java/net/javacrumbs/jsonunit/test/jsonpath/JsonPathTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | import net.javacrumbs.jsonunit.core.Option;
import org.junit.jupiter.api.Test;
import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
import static net.javacrumbs.jsonunit.jsonpath.JsonPathAdapter.inPath;
import static org.assertj.core.api.Assertions.assertThatThrownBy; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | assertThatJson(inPath(json, "$.store.book[*].author")) |
lukas-krecan/JsonUnit | tests/test-json-path/src/test/java/net/javacrumbs/jsonunit/test/jsonpath/JsonPathTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | import net.javacrumbs.jsonunit.core.Option;
import org.junit.jupiter.api.Test;
import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
import static net.javacrumbs.jsonunit.jsonpath.JsonPathAdapter.inPath;
import static org.assertj.core.api.Assertions.assertThatThrownBy; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | assertThatJson(inPath(json, "$.store.book[*].author")) |
lukas-krecan/JsonUnit | tests/test-json-path/src/test/java/net/javacrumbs/jsonunit/test/jsonpath/JsonPathTest.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | import net.javacrumbs.jsonunit.core.Option;
import org.junit.jupiter.api.Test;
import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
import static net.javacrumbs.jsonunit.jsonpath.JsonPathAdapter.inPath;
import static org.assertj.core.api.Assertions.assertThatThrownBy; | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | .when(Option.IGNORING_ARRAY_ORDER) |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ExceptionFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ExceptionUtils.java
// static String formatDifferences(String message, Differences differences) {
// return formatDifferences(message, differences.getDifferences());
// }
| import org.opentest4j.AssertionFailedError;
import org.opentest4j.MultipleFailuresError;
import java.util.Collections;
import java.util.List;
import static java.util.stream.Collectors.toList;
import static net.javacrumbs.jsonunit.core.internal.ExceptionUtils.formatDifferences; | package net.javacrumbs.jsonunit.core.internal;
interface ExceptionFactory {
AssertionError createException(String message, Differences diffs);
}
class BasicExceptionFactory implements ExceptionFactory {
@Override
public AssertionError createException(String message, Differences diffs) {
return ... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ExceptionUtils.java
// static String formatDifferences(String message, Differences differences) {
// return formatDifferences(message, differences.getDifferences());
// }
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/... | super(formatDifferences(message, differences)); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Configuration.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java
// public interface ApplicableForPath {
// @NotNull
// Configuration applyForPaths(@NotNull Configuration configuration, @NotNull PathsParam pathsParam);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonun... | import java.util.Set;
import static java.util.Arrays.asList;
import net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath;
import net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam;
import net.javacrumbs.jsonunit.core.internal.Options;
import net.javacrumbs.jsonunit.core.internal.PathOption;
import ne... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java
// public interface ApplicableForPath {
// @NotNull
// Configuration applyForPaths(@NotNull Configuration configuration, @NotNull PathsParam pathsParam);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonun... | private static final Configuration EMPTY_CONFIGURATION = new Configuration(null, Options.empty(), DEFAULT_IGNORE_PLACEHOLDER, Matchers.empty(), Collections.emptySet(), DUMMY_LISTENER, Collections.emptyList()); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Configuration.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java
// public interface ApplicableForPath {
// @NotNull
// Configuration applyForPaths(@NotNull Configuration configuration, @NotNull PathsParam pathsParam);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonun... | import java.util.Set;
import static java.util.Arrays.asList;
import net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath;
import net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam;
import net.javacrumbs.jsonunit.core.internal.Options;
import net.javacrumbs.jsonunit.core.internal.PathOption;
import ne... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java
// public interface ApplicableForPath {
// @NotNull
// Configuration applyForPaths(@NotNull Configuration configuration, @NotNull PathsParam pathsParam);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonun... | private final List<PathOption> pathOptions; |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Configuration.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java
// public interface ApplicableForPath {
// @NotNull
// Configuration applyForPaths(@NotNull Configuration configuration, @NotNull PathsParam pathsParam);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonun... | import java.util.Set;
import static java.util.Arrays.asList;
import net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath;
import net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam;
import net.javacrumbs.jsonunit.core.internal.Options;
import net.javacrumbs.jsonunit.core.internal.PathOption;
import ne... | *
* @param first
* @param next
* @return
*/
@NotNull
public Configuration withOptions(@NotNull Option first, @NotNull Option... next) {
return new Configuration(tolerance, options.with(first, next), ignorePlaceholder, matchers, pathsToBeIgnored, differenceListener, pathOptions);... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java
// public interface ApplicableForPath {
// @NotNull
// Configuration applyForPaths(@NotNull Configuration configuration, @NotNull PathsParam pathsParam);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonun... | public final Configuration when(@NotNull PathsParam object, @NotNull ApplicableForPath... actions) { |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Configuration.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java
// public interface ApplicableForPath {
// @NotNull
// Configuration applyForPaths(@NotNull Configuration configuration, @NotNull PathsParam pathsParam);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonun... | import java.util.Set;
import static java.util.Arrays.asList;
import net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath;
import net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam;
import net.javacrumbs.jsonunit.core.internal.Options;
import net.javacrumbs.jsonunit.core.internal.PathOption;
import ne... | *
* @param first
* @param next
* @return
*/
@NotNull
public Configuration withOptions(@NotNull Option first, @NotNull Option... next) {
return new Configuration(tolerance, options.with(first, next), ignorePlaceholder, matchers, pathsToBeIgnored, differenceListener, pathOptions);... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/ConfigurationWhen.java
// public interface ApplicableForPath {
// @NotNull
// Configuration applyForPaths(@NotNull Configuration configuration, @NotNull PathsParam pathsParam);
// }
//
// Path: json-unit-core/src/main/java/net/javacrumbs/jsonun... | public final Configuration when(@NotNull PathsParam object, @NotNull ApplicableForPath... actions) { |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/PathOption.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | import net.javacrumbs.jsonunit.core.Option;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Set; | package net.javacrumbs.jsonunit.core.internal;
public class PathOption {
private final List<String> paths; | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/Option.java
// public enum Option {
// /**
// * Treats null nodes in actual value as absent. In other words
// * if you expect {"test":{"a":1}} this {"test":{"a":1, "b": null}} will pass the test.
// * When using within {@link Configu... | private final Set<Option> options; |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JohnzonNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | import org.apache.johnzon.core.JsonLongImpl;
import org.apache.johnzon.mapper.Mapper;
import org.apache.johnzon.mapper.MapperBuilder;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonNumber;
import javax.json.JsonObject;
import javax.json.JsonReader;
import javax.json.JsonString;
import javax.... | /**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless requir... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | return newNode(mapper.toStructure(toIntList((int[]) source))); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JohnzonNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | import org.apache.johnzon.core.JsonLongImpl;
import org.apache.johnzon.mapper.Mapper;
import org.apache.johnzon.mapper.MapperBuilder;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonNumber;
import javax.json.JsonObject;
import javax.json.JsonReader;
import javax.json.JsonString;
import javax.... | /**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless requir... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | return newNode(mapper.toStructure(toDoubleList((double[]) source))); |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JohnzonNodeFactory.java | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | import org.apache.johnzon.core.JsonLongImpl;
import org.apache.johnzon.mapper.Mapper;
import org.apache.johnzon.mapper.MapperBuilder;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonNumber;
import javax.json.JsonObject;
import javax.json.JsonReader;
import javax.json.JsonString;
import javax.... | /**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless requir... | // Path: json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/ArrayUtils.java
// static List<Boolean> toBoolList(boolean[] source) {
// List<Boolean> result = new ArrayList<>(source.length);
// for (boolean value : source) {
// result.add(value);
// }
// return result;
// }
//
// ... | return newNode(mapper.toStructure(toBoolList((boolean[]) source))); |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/client/block/tile/RenderGravestone.java | // Path: java/com/countrygamer/pvz/block/tile/TileEntityGravestone.java
// public class TileEntityGravestone extends TileEntity {
// public int facing = -1;
// public int type = 0;
// public ResourceLocation[] typeTexture = { Resources.gravestone,
// Resources.gravestoneReg, Resources.gravestoneFootball,
// Re... | import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import com.countrygamer.pvz.block.tile.TileEntityGravestone;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; | package com.countrygamer.pvz.client.block.tile;
public class RenderGravestone extends TileEntitySpecialRenderer
{
private ModelGravestone aModel;
public RenderGravestone()
{
this.aModel = new ModelGravestone();
}
@SideOnly(Side.CLIENT) | // Path: java/com/countrygamer/pvz/block/tile/TileEntityGravestone.java
// public class TileEntityGravestone extends TileEntity {
// public int facing = -1;
// public int type = 0;
// public ResourceLocation[] typeTexture = { Resources.gravestone,
// Resources.gravestoneReg, Resources.gravestoneFootball,
// Re... | public void renderAModelAt(TileEntityGravestone tileEnt, double x, double y, double z, float f) { |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/entities/mobs/plants/EntityShroomShooterBase.java | // Path: java/com/countrygamer/pvz/entities/projectiles/EntityShroomPod.java
// public class EntityShroomPod extends EntityPodBase
// {
// public EntityShroomPod(World world)
// {
// super(world);
// }
// public EntityShroomPod(World world, EntityLivingBase entLiv) {
// super(world, entLiv);
// }
// ... | import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.ai.EntityAIArrowAttack;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.... | }
public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f)
{
if (entitySelect(this.worldObj) != null) {
EntityThrowable ent = entitySelect(this.worldObj);
double toX = entitylivingbase.posX - this.posX;
float percentToMouth = 0.5F;
double toY = entityliving... | // Path: java/com/countrygamer/pvz/entities/projectiles/EntityShroomPod.java
// public class EntityShroomPod extends EntityPodBase
// {
// public EntityShroomPod(World world)
// {
// super(world);
// }
// public EntityShroomPod(World world, EntityLivingBase entLiv) {
// super(world, entLiv);
// }
// ... | ent = new EntityShroomPod(world, this); |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/client/render/RenderWalnut.java | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityWalnut.java
// public class EntityWalnut extends EntityPlantBase {
// public EntityWalnut(World par1World) {
// super(par1World, new ItemStack(PvZ.sunlight, 1, 0));
// }
//
// protected void applyEntityAttributes() {
// super.applyEntityAttributes();... | import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
import com.countrygamer.pvz.entities.mobs.plants.EntityWalnut;
import com.countrygamer.pvz.lib.... | package com.countrygamer.pvz.client.render;
@SideOnly(Side.CLIENT)
public class RenderWalnut extends RenderLiving
{
protected ModelWalnut model;
@SideOnly(Side.CLIENT)
public RenderWalnut(ModelBase par1ModelBase, float par2)
{
super(par1ModelBase, par2);
this.model = ((ModelWalnut)this.mainModel);
... | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityWalnut.java
// public class EntityWalnut extends EntityPlantBase {
// public EntityWalnut(World par1World) {
// super(par1World, new ItemStack(PvZ.sunlight, 1, 0));
// }
//
// protected void applyEntityAttributes() {
// super.applyEntityAttributes();... | public void renderWalnut(EntityWalnut entity, double par2, double par4, double par6, float par8, float par9) { |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/client/gui/GuiGuide.java | // Path: java/com/countrygamer/pvz/items/ItemGuideBook.java
// public class ItemGuideBook extends ItemBase {
// public ItemGuideBook(String modid, String name) {
// super(modid, name);
// }
//
// public ItemStack onItemRightClick(ItemStack itemStack, World world,
// EntityPlayer player) {
// if (world.isRemo... | import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.countrygamer.core.Base.client.gui.GuiButtonArrow;
import com.countrygamer.core.Base.client.gui.GuiButtonArrow.ButtonType;
import com.countrygamer.pvz... | package com.countrygamer.pvz.client.gui;
public class GuiGuide extends GuiScreen {
private static final ResourceLocation book = new ResourceLocation( | // Path: java/com/countrygamer/pvz/items/ItemGuideBook.java
// public class ItemGuideBook extends ItemBase {
// public ItemGuideBook(String modid, String name) {
// super(modid, name);
// }
//
// public ItemStack onItemRightClick(ItemStack itemStack, World world,
// EntityPlayer player) {
// if (world.isRemo... | Reference.MOD_ID, "textures/gui/book1.png"); |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/client/gui/GuiGuide.java | // Path: java/com/countrygamer/pvz/items/ItemGuideBook.java
// public class ItemGuideBook extends ItemBase {
// public ItemGuideBook(String modid, String name) {
// super(modid, name);
// }
//
// public ItemStack onItemRightClick(ItemStack itemStack, World world,
// EntityPlayer player) {
// if (world.isRemo... | import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.countrygamer.core.Base.client.gui.GuiButtonArrow;
import com.countrygamer.core.Base.client.gui.GuiButtonArrow.ButtonType;
import com.countrygamer.pvz... | package com.countrygamer.pvz.client.gui;
public class GuiGuide extends GuiScreen {
private static final ResourceLocation book = new ResourceLocation(
Reference.MOD_ID, "textures/gui/book1.png");
private int bookImageWidth = 256;
private int bookImageHeight = 256;
private int page = 0;
private int totalPage... | // Path: java/com/countrygamer/pvz/items/ItemGuideBook.java
// public class ItemGuideBook extends ItemBase {
// public ItemGuideBook(String modid, String name) {
// super(modid, name);
// }
//
// public ItemStack onItemRightClick(ItemStack itemStack, World world,
// EntityPlayer player) {
// if (world.isRemo... | public ItemGuideBook itemBook; |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/block/BlockChlorophyllBowl.java | // Path: java/com/countrygamer/pvz/block/tile/TileEntityChlorophyllBowl.java
// public class TileEntityChlorophyllBowl extends TileEntityInventoryBase {
//
// public int delayControl = 1200 * PvZ.sunlightTimer;
// public int delay = this.delayControl;
//
// public int sunlightHeld = 0;
//
// public TileEntityChl... | import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
... | package com.countrygamer.pvz.block;
public class BlockChlorophyllBowl extends BlockContainerBase {
Random random = new Random();
public BlockChlorophyllBowl(Material mat, String modid, String name,
Class<? extends TileEntity> tileEntityClass) {
super(mat, modid, name, tileEntityClass);
setBlockBounds(0.0F... | // Path: java/com/countrygamer/pvz/block/tile/TileEntityChlorophyllBowl.java
// public class TileEntityChlorophyllBowl extends TileEntityInventoryBase {
//
// public int delayControl = 1200 * PvZ.sunlightTimer;
// public int delay = this.delayControl;
//
// public int sunlightHeld = 0;
//
// public TileEntityChl... | TileEntityChlorophyllBowl tileentitychest = (TileEntityChlorophyllBowl) par1World |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/client/render/RenderPuffShroom.java | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityPuffShroom.java
// public class EntityPuffShroom extends EntityShroomShooterBase {
// public EntityPuffShroom(World world) {
// super(world, new ItemStack(PvZ.nightPlants, 1, 0));
// }
//
// protected void applyEntityAttributes() {
// super.applyEnti... | import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
import com.countrygamer.pvz.entities.mobs.plants.EntityPuffShroom;
import com.countrygamer.pvz.... | package com.countrygamer.pvz.client.render;
@SideOnly(Side.CLIENT)
public class RenderPuffShroom extends RenderLiving
{
protected ModelPuffShroom model; | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityPuffShroom.java
// public class EntityPuffShroom extends EntityShroomShooterBase {
// public EntityPuffShroom(World world) {
// super(world, new ItemStack(PvZ.nightPlants, 1, 0));
// }
//
// protected void applyEntityAttributes() {
// super.applyEnti... | private static ResourceLocation field_110887_f = Resources.puffShroomMob_0; |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/client/render/RenderPuffShroom.java | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityPuffShroom.java
// public class EntityPuffShroom extends EntityShroomShooterBase {
// public EntityPuffShroom(World world) {
// super(world, new ItemStack(PvZ.nightPlants, 1, 0));
// }
//
// protected void applyEntityAttributes() {
// super.applyEnti... | import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
import com.countrygamer.pvz.entities.mobs.plants.EntityPuffShroom;
import com.countrygamer.pvz.... | package com.countrygamer.pvz.client.render;
@SideOnly(Side.CLIENT)
public class RenderPuffShroom extends RenderLiving
{
protected ModelPuffShroom model;
private static ResourceLocation field_110887_f = Resources.puffShroomMob_0;
@SideOnly(Side.CLIENT)
public RenderPuffShroom(ModelBase par1ModelBase, float ... | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityPuffShroom.java
// public class EntityPuffShroom extends EntityShroomShooterBase {
// public EntityPuffShroom(World world) {
// super(world, new ItemStack(PvZ.nightPlants, 1, 0));
// }
//
// protected void applyEntityAttributes() {
// super.applyEnti... | public void renderPuffShroom(EntityPuffShroom entity, double par2, double par4, double par6, float par8, float par9) { |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/client/render/RenderScaredyShroom.java | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityScaredyShroom.java
// public class EntityScaredyShroom extends EntityShroomShooterBase {
// public EntityScaredyShroom(World world) {
// super(world, new ItemStack(PvZ.nightPlants, 1, 1));
// }
//
// public void dropFewItems(boolean par1, int par2) {
/... | import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
import com.countrygamer.pvz.entities.mobs.plants.EntityScaredyShroom;
import com.countrygamer.p... | package com.countrygamer.pvz.client.render;
@SideOnly(Side.CLIENT)
public class RenderScaredyShroom extends RenderLiving
{
protected ModelScaredyShroom model;
@SideOnly(Side.CLIENT)
public RenderScaredyShroom(ModelBase par1ModelBase, float par2)
{
super(par1ModelBase, par2);
this.model = ((ModelSca... | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityScaredyShroom.java
// public class EntityScaredyShroom extends EntityShroomShooterBase {
// public EntityScaredyShroom(World world) {
// super(world, new ItemStack(PvZ.nightPlants, 1, 1));
// }
//
// public void dropFewItems(boolean par1, int par2) {
/... | public void renderScaredyShroom(EntityScaredyShroom entity, double par2, double par4, double par6, float par8, float par9) { |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/client/render/RenderScaredyShroom.java | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityScaredyShroom.java
// public class EntityScaredyShroom extends EntityShroomShooterBase {
// public EntityScaredyShroom(World world) {
// super(world, new ItemStack(PvZ.nightPlants, 1, 1));
// }
//
// public void dropFewItems(boolean par1, int par2) {
/... | import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;
import com.countrygamer.pvz.entities.mobs.plants.EntityScaredyShroom;
import com.countrygamer.p... | package com.countrygamer.pvz.client.render;
@SideOnly(Side.CLIENT)
public class RenderScaredyShroom extends RenderLiving
{
protected ModelScaredyShroom model;
@SideOnly(Side.CLIENT)
public RenderScaredyShroom(ModelBase par1ModelBase, float par2)
{
super(par1ModelBase, par2);
this.model = ((ModelSca... | // Path: java/com/countrygamer/pvz/entities/mobs/plants/EntityScaredyShroom.java
// public class EntityScaredyShroom extends EntityShroomShooterBase {
// public EntityScaredyShroom(World world) {
// super(world, new ItemStack(PvZ.nightPlants, 1, 1));
// }
//
// public void dropFewItems(boolean par1, int par2) {
/... | return Resources.scaredyShroomMob_0; |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/entities/mobs/plants/EntityShroomBase.java | // Path: java/com/countrygamer/pvz/lib/Resources.java
// public class Resources {
// public static final ResourceLocation chlorophyllBowl = new ResourceLocation(
// Reference.MOD_ID, "textures/entities/blocks/bowlfilled.png");
//
// public static final ResourceLocation gravestone = new ResourceLocation(
// Ref... | import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import com.countrygamer.pvz.lib.Resources; | package com.countrygamer.pvz.entities.mobs.plants;
public class EntityShroomBase extends EntityPlantBase
{
public ResourceLocation rl_0;
public ResourceLocation rl_1; | // Path: java/com/countrygamer/pvz/lib/Resources.java
// public class Resources {
// public static final ResourceLocation chlorophyllBowl = new ResourceLocation(
// Reference.MOD_ID, "textures/entities/blocks/bowlfilled.png");
//
// public static final ResourceLocation gravestone = new ResourceLocation(
// Ref... | public ResourceLocation renderRL = Resources.puffShroomMob_0; |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/ParticleEffects.java | // Path: java/com/countrygamer/pvz/entities/projectiles/EntityPodPop.java
// public class EntityPodPop extends EntityFX
// {
// float reddustParticleScale;
//
// public EntityPodPop(World par1World, double par2, double par4, double par6, float par8, float par9, float par10)
// {
// this(par1World, par2, par4... | import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.world.World;
import com.countrygamer.pvz.entities.projectiles.EntityPodPop;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly... | private static TextureManager renderEngine = mc.renderEngine;
public static EntityFX spawnParticle(String particleName, double par2, double par4, double par6, double par8, double par10, double par12)
{
if ((mc != null) && (mc.renderViewEntity != null) && (mc.effectRenderer != null))
{
int var14 = m... | // Path: java/com/countrygamer/pvz/entities/projectiles/EntityPodPop.java
// public class EntityPodPop extends EntityFX
// {
// float reddustParticleScale;
//
// public EntityPodPop(World par1World, double par2, double par4, double par6, float par8, float par9, float par10)
// {
// this(par1World, par2, par4... | var21 = new EntityPodPop(theWorld, par2, par4, par6, (float)par8, (float)par10, (float)par12); |
bmatthews68/inmemdb-maven-plugin | src/main/java/com/btmatthews/maven/plugins/inmemdb/ldr/AbstractLoader.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Loader.java
// public interface Loader {
//
// /**
// * The message key for the error reported when a source file cannot be read.
// */
// String CANNOT_READ_SOURCE_FILE = "cannot_read_source_file";
//
// /**
// * The messa... | import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Locale;
import com.btmatthews.maven.plugins.inmemdb.Loader;
import com.btmatthews.maven.plugins.inmemdb.Source;
import com.btmat... | /*
* Copyright 2011-2012 Brian Matthews
*
* 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/btmatthews/maven/plugins/inmemdb/Loader.java
// public interface Loader {
//
// /**
// * The message key for the error reported when a source file cannot be read.
// */
// String CANNOT_READ_SOURCE_FILE = "cannot_read_source_file";
//
// /**
// * The messa... | protected boolean hasValidContent(final Logger logger, final Source source) {
|
bmatthews68/inmemdb-maven-plugin | src/test/java/com/btmatthews/maven/plugins/inmemdb/test/TestH2Database.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/db/h2/H2Database.java
// public final class H2Database extends AbstractSQLDatabase {
//
// /**
// * The connection protocol for in-memory H2 databases.
// */
// private static final String PROTOCOL = "h2:tcp://localhost:{0,number,#}/mem:";
/... | import com.btmatthews.maven.plugins.inmemdb.db.h2.H2Database;
import com.btmatthews.utils.monitor.Server; | /*
* Copyright 2011-2012 Brian Matthews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/db/h2/H2Database.java
// public final class H2Database extends AbstractSQLDatabase {
//
// /**
// * The connection protocol for in-memory H2 databases.
// */
// private static final String PROTOCOL = "h2:tcp://localhost:{0,number,#}/mem:";
/... | return new H2Database(); |
bmatthews68/inmemdb-maven-plugin | src/test/java/com/btmatthews/maven/plugins/inmemdb/test/AbstractTestDatabase.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | import static org.mockito.MockitoAnnotations.initMocks;
import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.mojo.DataSet;
import com.btmatthews.maven.plugins.inmemdb.mojo.Script;
import com.btmatthews.utils.monitor.Logger;
import com.btmatthews.utils.monitor.Server;
import ... | /*
* Copyright 2011-2012 Brian Matthews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | final Script source = new Script(); |
bmatthews68/inmemdb-maven-plugin | src/test/java/com/btmatthews/maven/plugins/inmemdb/test/AbstractTestDatabase.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | import static org.mockito.MockitoAnnotations.initMocks;
import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.mojo.DataSet;
import com.btmatthews.maven.plugins.inmemdb.mojo.Script;
import com.btmatthews.utils.monitor.Logger;
import com.btmatthews.utils.monitor.Server;
import ... | /*
* Copyright 2011-2012 Brian Matthews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | ((Database)database).load(logger, source); |
bmatthews68/inmemdb-maven-plugin | src/test/java/com/btmatthews/maven/plugins/inmemdb/test/AbstractTestDatabase.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | import static org.mockito.MockitoAnnotations.initMocks;
import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.mojo.DataSet;
import com.btmatthews.maven.plugins.inmemdb.mojo.Script;
import com.btmatthews.utils.monitor.Logger;
import com.btmatthews.utils.monitor.Server;
import ... | }
/**
* Verify than an exception is thrown when {@code null} is passed as
* the source file.
*/
@Test
public void testLoadNull() throws MojoFailureException {
((Database)database).load(logger, null);
}
/**
* Verify than an exception is thrown when the source file is... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | final DataSet source = new DataSet(); |
bmatthews68/inmemdb-maven-plugin | src/main/java/com/btmatthews/maven/plugins/inmemdb/ldr/dbunit/DBUnitXLSLoader.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
//
// /**
// * Get the source file that contains the DDL/DML script or DBUnit data set.
// *
// * @return The source file.
// */
// String getSourceFile();
//
// /**
// * Determine... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import com.btmatthews.maven.plugins.inmemdb.Source;
import org.dbunit.dataset.DataSetException;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.excel.XlsDataSet; | /*
* Copyright 2011-2012 Brian Matthews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
//
// /**
// * Get the source file that contains the DDL/DML script or DBUnit data set.
// *
// * @return The source file.
// */
// String getSourceFile();
//
// /**
// * Determine... | protected IDataSet loadDataSet(final Source source) throws DataSetException, |
bmatthews68/inmemdb-maven-plugin | src/main/java/com/btmatthews/maven/plugins/inmemdb/mojo/RunMojo.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.Source;
import com.btmatthews.utils.monitor.Logger;
import com.btmatthews.utils.monitor.Server;
import com.btmatthews.utils.monitor.mojo.AbstractRunMojo;
import org.apache.maven.plugin.MojoFailureException;
import org.apac... | /*
* Copyright 2011-2012 Brian Matthews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | private List<? extends Source> sources; |
bmatthews68/inmemdb-maven-plugin | src/main/java/com/btmatthews/maven/plugins/inmemdb/mojo/RunMojo.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.Source;
import com.btmatthews.utils.monitor.Logger;
import com.btmatthews.utils.monitor.Server;
import com.btmatthews.utils.monitor.mojo.AbstractRunMojo;
import org.apache.maven.plugin.MojoFailureException;
import org.apac... | if (port != null) {
config.put("port", port);
}
if (password == null) {
config.put("password", "");
} else {
config.put("password", password);
}
if (attributes != null) {
config.put("attributes", attributes);
}
... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
//
// /**
// * Find the loader that supports the source file and use it to load the data
// * into or execute the script against the database.
// *
// * @param logger Used to report er... | ((Database) server).load(this, source); |
bmatthews68/inmemdb-maven-plugin | src/main/java/com/btmatthews/maven/plugins/inmemdb/ldr/dbunit/DBUnitCSVLoader.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
//
// /**
// * Get the source file that contains the DDL/DML script or DBUnit data set.
// *
// * @return The source file.
// */
// String getSourceFile();
//
// /**
// * Determine... | import org.dbunit.dataset.datatype.DataType;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import com.btmatthews.maven.plugins.inmemdb.Source;
import org.dbunit.dataset.CachedDataSet;
import org.dbunit.dataset.Column;
import org.dbunit.dataset.DataSetException;
import org.... | /*
* Copyright 2011-2012 Brian Matthews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
//
// /**
// * Get the source file that contains the DDL/DML script or DBUnit data set.
// *
// * @return The source file.
// */
// String getSourceFile();
//
// /**
// * Determine... | protected IDataSet loadDataSet(final Source source) throws DataSetException, |
bmatthews68/inmemdb-maven-plugin | src/main/java/com/btmatthews/maven/plugins/inmemdb/ldr/dbunit/DBUnitFlatXMLLoader.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
//
// /**
// * Get the source file that contains the DDL/DML script or DBUnit data set.
// *
// * @return The source file.
// */
// String getSourceFile();
//
// /**
// * Determine... | import java.io.File;
import java.io.IOException;
import java.net.URL;
import com.btmatthews.maven.plugins.inmemdb.Source;
import org.dbunit.dataset.DataSetException;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.xml.FlatXmlDataSetBuilder; | /*
* Copyright 2011-2012 Brian Matthews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
//
// /**
// * Get the source file that contains the DDL/DML script or DBUnit data set.
// *
// * @return The source file.
// */
// String getSourceFile();
//
// /**
// * Determine... | protected IDataSet loadDataSet(final Source source) throws DataSetException, |
bmatthews68/inmemdb-maven-plugin | src/test/java/com/btmatthews/maven/plugins/inmemdb/test/TestDatabaseFactory.java | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/db/derby/DerbyDatabaseFactory.java
// public final class DerbyDatabaseFactory implements ServerFactory {
//
// /**
// * Get the name of the server created by this server factory.
// *
// * @return Always returns {@code derby}.
// */
//... | import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.MockitoAnnotations.initMocks;
import com.btmatthews.maven.plugins.inmemdb.db.derby.DerbyDatabaseFactory;
import com.btmatthews.maven.plugins.inmemdb.db.h2.H2Datab... | /*
* Copyright 2011-2012 Brian Matthews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | // Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/db/derby/DerbyDatabaseFactory.java
// public final class DerbyDatabaseFactory implements ServerFactory {
//
// /**
// * Get the name of the server created by this server factory.
// *
// * @return Always returns {@code derby}.
// */
//... | assertTrue(factory instanceof DerbyDatabaseFactory); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.