conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
private final HttpProperties httpProperties;
private final ConfigurableServletWebServerFactory serverFactory;
=======
>>>>>>>
private final ConfigurableServletWebServerFactory serverFactory;
<<<<<<<
public ServletWebServerInitializer(ServerProperties serverProperties, HttpProperties httpProperties,
WebMvcProperties webMvcProperties, ResourceProperties resourceProperties, ConfigurableServletWebServerFactory serverFactory) {
=======
public ServletWebServerInitializer(ServerProperties serverProperties, WebMvcProperties webMvcProperties, ResourceProperties resourceProperties) {
>>>>>>>
public ServletWebServerInitializer(ServerProperties serverProperties, WebMvcProperties webMvcProperties, ResourceProperties resourceProperties, ConfigurableServletWebServerFactory serverFactory) { |
<<<<<<<
// TODO: Revert cache version before publishing app update in cache.json
private static final int BUNDLED_CACHE_VERSION = 1;
=======
// TODO: Revert cache version before publishing app update (same goes for cache.json)
private static final int BUNDLED_CACHE_VERSION = 3;
>>>>>>>
private static final int BUNDLED_CACHE_VERSION = 1;
<<<<<<<
Timber.d("Bundled cache is current.");
=======
LogHelper.d(TAG, "Bundled cache is current or newer.");
>>>>>>>
Timber.d("Bundled cache is current or newer."); |
<<<<<<<
import me.devsaki.hentoid.database.DatabaseMaintenance;
=======
import me.devsaki.hentoid.database.HentoidDB;
import me.devsaki.hentoid.database.domains.Content;
>>>>>>>
import me.devsaki.hentoid.database.HentoidDB;
import me.devsaki.hentoid.database.domains.Content;
import me.devsaki.hentoid.database.DatabaseMaintenance;
<<<<<<<
=======
/**
* Clean up and upgrade database
*/
private void performDatabaseHousekeeping() {
HentoidDB db = HentoidDB.getInstance(this);
Timber.d("Content item(s) count: %s", db.countContentEntries());
// Perform technical data updates that need to be done before app launches
UpgradeTo(BuildConfig.VERSION_CODE, db);
// Launch a service that will perform non-structural DB housekeeping tasks
Intent intent = DatabaseMaintenanceService.makeIntent(this);
startService(intent);
}
/**
* Handles complex DB version updates at startup
*
* @param versionCode Current app version
* @param db Hentoid DB
*/
@SuppressWarnings("deprecation")
private void UpgradeTo(int versionCode, HentoidDB db) {
if (versionCode > 43) // Update all "storage_folder" fields in CONTENT table (mandatory)
{
List<Content> contents = db.selectContentEmptyFolder();
if (contents != null && contents.size() > 0) {
for (int i = 0; i < contents.size(); i++) {
Content content = contents.get(i);
content.setStorageFolder("/" + content.getSite().getDescription() + "/" + content.getOldUniqueSiteId()); // This line must use deprecated code, as it migrates it to newest version
db.updateContentStorageFolder(content);
}
}
}
if (versionCode > 59) // Migrate the old download queue (books in DOWNLOADING or PAUSED status) in the queue table
{
// Gets books that should be in the queue but aren't
List<Integer> contentToMigrate = db.selectContentsForQueueMigration();
if (contentToMigrate.size() > 0) {
// Gets last index of the queue
List<Pair<Integer, Integer>> queue = db.selectQueue();
int lastIndex = 1;
if (queue.size() > 0) {
lastIndex = queue.get(queue.size() - 1).second + 1;
}
for (int i : contentToMigrate) {
db.insertQueue(i, lastIndex++);
}
}
}
}
>>>>>>>
/**
* Clean up and upgrade database
*/
private void performDatabaseHousekeeping() {
HentoidDB db = HentoidDB.getInstance(this);
Timber.d("Content item(s) count: %s", db.countContentEntries());
// Perform technical data updates that need to be done before app launches
UpgradeTo(BuildConfig.VERSION_CODE, db);
// Launch a service that will perform non-structural DB housekeeping tasks
Intent intent = DatabaseMaintenanceService.makeIntent(this);
startService(intent);
}
/**
* Handles complex DB version updates at startup
*
* @param versionCode Current app version
* @param db Hentoid DB
*/
@SuppressWarnings("deprecation")
private void UpgradeTo(int versionCode, HentoidDB db) {
if (versionCode > 43) // Update all "storage_folder" fields in CONTENT table (mandatory)
{
List<Content> contents = db.selectContentEmptyFolder();
if (contents != null && contents.size() > 0) {
for (int i = 0; i < contents.size(); i++) {
Content content = contents.get(i);
content.setStorageFolder("/" + content.getSite().getDescription() + "/" + content.getOldUniqueSiteId()); // This line must use deprecated code, as it migrates it to newest version
db.updateContentStorageFolder(content);
}
}
}
if (versionCode > 59) // Migrate the old download queue (books in DOWNLOADING or PAUSED status) in the queue table
{
// Gets books that should be in the queue but aren't
List<Integer> contentToMigrate = db.selectContentsForQueueMigration();
if (contentToMigrate.size() > 0) {
// Gets last index of the queue
List<Pair<Integer, Integer>> queue = db.selectQueue();
int lastIndex = 1;
if (queue.size() > 0) {
lastIndex = queue.get(queue.size() - 1).second + 1;
}
for (int i : contentToMigrate) {
db.insertQueue(i, lastIndex++);
}
}
}
} |
<<<<<<<
private static Content importJson(@NonNull Context context, @NonNull DocumentFile folder) throws JSONParseException {
//DocumentFile json = folder.findFile(Consts.JSON_FILE_NAME_V2); // (v2) JSON file format
DocumentFile json = FileHelper.findFile(context, folder, Consts.JSON_FILE_NAME_V2); // (v2) JSON file format
if (json != null && json.exists()) return importJsonV2(json);
=======
private static Content importJson(File folder) throws ParseException {
File json = new File(folder, Consts.JSON_FILE_NAME_V2); // (v2) JSON file format
if (json.exists()) return importJsonV2(json);
>>>>>>>
private static Content importJson(@NonNull Context context, @NonNull DocumentFile folder) throws ParseException {
//DocumentFile json = folder.findFile(Consts.JSON_FILE_NAME_V2); // (v2) JSON file format
DocumentFile json = FileHelper.findFile(context, folder, Consts.JSON_FILE_NAME_V2); // (v2) JSON file format
if (json != null && json.exists()) return importJsonV2(json);
<<<<<<<
private static Content importJsonLegacy(DocumentFile json) throws JSONParseException {
=======
private static Content importJsonLegacy(File json) throws ParseException {
>>>>>>>
private static Content importJsonLegacy(DocumentFile json) throws ParseException {
<<<<<<<
private static Content importJsonV1(DocumentFile json) throws JSONParseException {
=======
private static Content importJsonV1(File json) throws ParseException {
>>>>>>>
private static Content importJsonV1(DocumentFile json) throws ParseException {
<<<<<<<
private static Content importJsonV2(DocumentFile json) throws JSONParseException {
=======
private static Content importJsonV2(File json) throws ParseException {
>>>>>>>
private static Content importJsonV2(DocumentFile json) throws ParseException { |
<<<<<<<
List<ContentItem> content = Stream.of(result).map(c -> new ContentItem(c, touchHelper, ContentItem.ViewType.ERRORS, null)).toList();
FastAdapterDiffUtil.INSTANCE.set(itemAdapter, content);
new Handler().postDelayed(this::differEndCallback, 150);
=======
List<ContentItem> content = Stream.of(result).map(c -> new ContentItem(c, touchHelper, ContentItem.ViewType.ERRORS)).toList();
// When viewing books and going back (which triggers a book update without any impact on visuals),
// diff calculations ignore certain items and desynch the "real" list from the one manipulated by selectExtension
// => use a plain ItemAdapter.set for now (and live with the occasional blinking)
//FastAdapterDiffUtil.INSTANCE.set(itemAdapter, content);
itemAdapter.set(content);
new Handler(Looper.getMainLooper()).postDelayed(this::differEndCallback, 150);
>>>>>>>
List<ContentItem> content = Stream.of(result).map(c -> new ContentItem(c, touchHelper, ContentItem.ViewType.ERRORS, null)).toList();
// When viewing books and going back (which triggers a book update without any impact on visuals),
// diff calculations ignore certain items and desynch the "real" list from the one manipulated by selectExtension
// => use a plain ItemAdapter.set for now (and live with the occasional blinking)
//FastAdapterDiffUtil.INSTANCE.set(itemAdapter, content);
itemAdapter.set(content);
new Handler(Looper.getMainLooper()).postDelayed(this::differEndCallback, 150); |
<<<<<<<
=======
import javax.annotation.Nonnull;
import io.reactivex.Completable;
>>>>>>>
import javax.annotation.Nonnull;
import io.reactivex.Completable;
<<<<<<<
import static com.annimon.stream.Collectors.toList;
=======
import static android.os.Build.VERSION_CODES.LOLLIPOP;
>>>>>>>
import static android.os.Build.VERSION_CODES.LOLLIPOP;
import static com.annimon.stream.Collectors.toList;
<<<<<<<
public void loadFromSearchParams(long contentId, @NonNull Bundle bundle) {
loadedContentId = contentId;
searchManager = new ContentSearchManager(collectionDao);
=======
public void loadFromSearchParams(long contentId, @Nonnull Bundle bundle) {
// Technical
ContentSearchManager searchManager = new ContentSearchManager(collectionDao);
>>>>>>>
public void loadFromSearchParams(long contentId, @NonNull Bundle bundle) {
// Technical
ContentSearchManager searchManager = new ContentSearchManager(collectionDao);
<<<<<<<
Content content = img.content.getTarget();
if (!content.getJsonUri().isEmpty()) ContentHelper.updateJson(context, content);
else ContentHelper.createJson(context, content);
=======
Content theContent = img.content.getTarget();
if (!theContent.getJsonUri().isEmpty()) ContentHelper.updateJson(context, theContent);
else ContentHelper.createJson(theContent);
>>>>>>>
Content theContent = img.content.getTarget();
if (!theContent.getJsonUri().isEmpty()) ContentHelper.updateJson(context, theContent);
else ContentHelper.createJson(context, theContent);
<<<<<<<
// Load new content
List<DocumentFile> pictureFiles = ContentHelper.getPictureFilesFromContent(getApplication(), theContent); // TODO test performance => only use when no images set, or when no URIs on know images ?
if (!pictureFiles.isEmpty()) {
List<ImageFile> imageFiles;
if (null == theContent.getImageFiles() || theContent.getImageFiles().isEmpty()) {
imageFiles = new ArrayList<>();
saveFilesToImageList(pictureFiles, imageFiles, theContent);
} else {
imageFiles = new ArrayList<>(theContent.getImageFiles());
matchFilesToImageList(pictureFiles, imageFiles);
}
setImages(imageFiles);
if (Preferences.isViewerResumeLastLeft()) {
setStartingIndex(theContent.getLastReadPageIndex());
} else {
setStartingIndex(0);
}
// Cache JSON and record 1 more view for the new content
compositeDisposable.add(
Single.fromCallable(() -> postLoadProcessing(getApplication().getApplicationContext(), theContent))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
v -> {
},
Timber::e
)
);
} else {
ToastUtil.toast(R.string.no_images);
}
=======
// Observe the content's images
// NB : It has to be dynamic to be updated when viewing a book from the queue screen
if (currentImageSource != null) images.removeSource(currentImageSource);
currentImageSource = collectionDao.getDownloadedImagesFromContent(theContent.getId());
images.addSource(currentImageSource, imgs -> setImages(theContent, imgs));
>>>>>>>
// Observe the content's images
// NB : It has to be dynamic to be updated when viewing a book from the queue screen
if (currentImageSource != null) images.removeSource(currentImageSource);
currentImageSource = collectionDao.getDownloadedImagesFromContent(theContent.getId());
images.addSource(currentImageSource, imgs -> setImages(theContent, imgs));
<<<<<<<
private void saveFilesToImageList(List<DocumentFile> files, @NonNull List<ImageFile> images, @NonNull Content content) {
int order = 0;
=======
private List<ImageFile> filesToImageList(@NonNull File[] files) {
List<ImageFile> result = new ArrayList<>();
int order = 1;
>>>>>>>
private List<ImageFile> filesToImageList(@NonNull File[] files) {
List<ImageFile> result = new ArrayList<>();
int order = 1;
<<<<<<<
List<DocumentFile> fileList = Stream.of(files).filter(f -> f != null).sortBy(DocumentFile::getName).collect(toList());
for (DocumentFile f : fileList) {
order++;
=======
List<File> fileList = Stream.of(files).sortBy(File::getName).toList();
for (File f : fileList) {
>>>>>>>
List<DocumentFile> fileList = Stream.of(files).filter(f -> f != null).sortBy(DocumentFile::getName).toList();
for (DocumentFile f : fileList) {
<<<<<<<
img.setName(name).setOrder(order).setUrl("").setStatus(StatusContent.DOWNLOADED).setFileUri(f.getUri().toString());
images.add(img);
=======
img.setName(name).setOrder(order++).setUrl("").setStatus(StatusContent.DOWNLOADED).setAbsolutePath(f.getAbsolutePath());
result.add(img);
>>>>>>>
img.setName(name).setOrder(order++).setUrl("").setStatus(StatusContent.DOWNLOADED).setFileUri(f.getUri().toString());
result.add(img);
<<<<<<<
private Content postLoadProcessing(@NonNull Context context, @NonNull Content content) {
cacheJson(context, content);
return ContentHelper.updateContentReads(context, content);
=======
private Content postLoadProcessing(@Nonnull Content content) {
cacheJson(content);
return content;
>>>>>>>
private Content postLoadProcessing(@NonNull Context context, @NonNull Content content) {
cacheJson(context, content);
return ContentHelper.updateContentReads(context, content); |
<<<<<<<
private List<ImageFile> images = new ArrayList<>();
// To preload images before they appear on screen with CustomSubsamplingScaleImageView
=======
// To preload images before they appear on screen with SubsamplingScaleImageView
>>>>>>>
// To preload images before they appear on screen with CustomSubsamplingScaleImageView
<<<<<<<
ImageFile img = images.get(position);
String extension = FileHelper.getExtension(img.getAbsolutePath());
=======
ImageFile img = getImageAt(position);
if (null == img) return TYPE_OTHER;
>>>>>>>
ImageFile img = getImageAt(position);
if (null == img) return TYPE_OTHER;
String extension = FileHelper.getExtension(img.getAbsolutePath()); |
<<<<<<<
import java.util.Date;
=======
import java.util.HashMap;
import java.util.HashSet;
>>>>>>>
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
<<<<<<<
import me.devsaki.hentoid.adapters.ContentAdapter.ContentsWipedListener;
import me.devsaki.hentoid.collection.CollectionAccessor;
import me.devsaki.hentoid.collection.mikan.MikanAccessor;
import me.devsaki.hentoid.database.DatabaseAccessor;
import me.devsaki.hentoid.database.domains.Attribute;
=======
import me.devsaki.hentoid.adapters.ContentAdapter.ContentRemovedListener;
import me.devsaki.hentoid.database.SearchContent;
import me.devsaki.hentoid.database.SearchContent.ContentListener;
>>>>>>>
import me.devsaki.hentoid.adapters.ContentAdapter.ContentRemovedListener;
import me.devsaki.hentoid.collection.CollectionAccessor;
import me.devsaki.hentoid.collection.mikan.MikanAccessor;
import me.devsaki.hentoid.database.DatabaseAccessor;
import me.devsaki.hentoid.database.domains.Attribute;
<<<<<<<
ContentsWipedListener, ItemSelectListener, AttributeListener {
=======
ContentRemovedListener, ItemSelectListener {
>>>>>>>
ContentRemovedListener, ItemSelectListener, AttributeListener {
<<<<<<<
private int bookSortOrder;
// Attributes sort order
private int attributesSortOrder;
// Last collection refresh date
private Date lastCollectionRefresh;
=======
private int order;
>>>>>>>
private int bookSortOrder;
// Attributes sort order
private int attributesSortOrder;
<<<<<<<
// Mode : show library or show Mikan search
private int mode = MODE_LIBRARY;
// Collection accessor (DB or external, depending on mode)
private CollectionAccessor collectionAccessor;
=======
// Total count of book in entire selected/queried collection (Adapter is in charge of updating it)
private int mTotalSelectedCount = -1; // -1 = uninitialized (no query done yet)
// Total count of book in entire collection (Adapter is in charge of updating it)
private int mTotalCount = -1; // -1 = uninitialized (no query done yet)
>>>>>>>
// Mode : show library or show Mikan search
private int mode = MODE_LIBRARY;
// Collection accessor (DB or external, depending on mode)
private CollectionAccessor collectionAccessor;
// Total count of book in entire selected/queried collection (Adapter is in charge of updating it)
private int mTotalSelectedCount = -1; // -1 = uninitialized (no query done yet)
// Total count of book in entire collection (Adapter is in charge of updating it)
private int mTotalCount = -1; // -1 = uninitialized (no query done yet)
<<<<<<<
private void defaultLoad() {
if (MODE_LIBRARY == mode) {
if (Helper.permissionsCheck(getActivity(), ConstsImport.RQST_STORAGE_PERMISSION, true)) {
boolean shouldUpdate = queryPrefs();
if (shouldUpdate || -1 == mAdapter.getTotalCount()) update();
if (ContentQueueManager.getInstance().getDownloadCount() > 0) showReloadToolTip();
showToolbar(true);
} else {
Timber.d("Storage permission denied!");
if (storagePermissionChecked) {
resetApp();
}
storagePermissionChecked = true;
=======
private void loadLibrary() {
if (Helper.permissionsCheck(getActivity(), ConstsImport.RQST_STORAGE_PERMISSION, true)) {
boolean shouldUpdate = queryPrefs();
if (shouldUpdate || -1 == mTotalSelectedCount) update(); // If prefs changes detected or first run (-1 = uninitialized)
if (ContentQueueManager.getInstance().getDownloadCount() > 0) showReloadToolTip();
showToolbar(true);
} else {
Timber.d("Storage permission denied!");
if (storagePermissionChecked) {
resetApp();
>>>>>>>
private void defaultLoad() {
if (MODE_LIBRARY == mode) {
if (Helper.permissionsCheck(getActivity(), ConstsImport.RQST_STORAGE_PERMISSION, true)) {
boolean shouldUpdate = queryPrefs();
if (shouldUpdate || -1 == mTotalSelectedCount) update(); // If prefs changes detected or first run (-1 = uninitialized)
if (ContentQueueManager.getInstance().getDownloadCount() > 0) showReloadToolTip();
showToolbar(true);
} else {
Timber.d("Storage permission denied!");
if (storagePermissionChecked) {
resetApp();
}
storagePermissionChecked = true;
<<<<<<<
protected abstract void displayResults(List<Content> results, int totalContent);
=======
protected abstract void displayResults(List<Content> results, int totalSelectedContent);
>>>>>>>
protected abstract void displayResults(List<Content> results, int totalSelectedContent);
<<<<<<<
public void onContentReady(List<Content> results, int totalContent) {
Timber.d("Content results have loaded : %s results; %s total count", results.size(), totalContent);
isLoaded = true;
if (isSearchMode() && isNewContentAvailable)
{
newContentToolTip.setVisibility(View.GONE);
isNewContentAvailable = false;
}
=======
public void onContentReady(boolean success, List<Content> results, int totalSelectedContent, int totalContent) {
if (success) {
Timber.d("Content results have loaded : %s results; %s total selected count, %s total count", results.size(), totalSelectedContent, totalContent);
isLoaded = true;
>>>>>>>
public void onContentReady(List<Content> results, int totalSelectedContent, int totalContent) {
Timber.d("Content results have loaded : %s results; %s total selected count, %s total count", results.size(), totalSelectedContent, totalContent);
isLoaded = true;
if (isSearchMode() && isNewContentAvailable)
{
newContentToolTip.setVisibility(View.GONE);
isNewContentAvailable = false;
} |
<<<<<<<
=======
import android.os.Build;
import android.os.Environment;
>>>>>>>
import android.os.Build;
import android.os.Environment;
<<<<<<<
static InputStream getInputStream(@NonNull final File target) throws IOException {
return FileUtils.openInputStream(target);
}
static InputStream getInputStream(@NonNull final DocumentFile target) throws IOException {
=======
public static InputStream getInputStream(@NonNull final File target) throws IOException {
>>>>>>>
public static InputStream getInputStream(@NonNull final File target) throws IOException {
return FileUtils.openInputStream(target);
}
static InputStream getInputStream(@NonNull final DocumentFile target) throws IOException {
<<<<<<<
=======
// Please don't delete this method!
// I need some way to trace actions when working with SD card features - Robb
public static void createFileWithMsg(@NonNull String file, String msg) {
try {
FileHelper.saveBinaryInFile(new File(getDefaultDir(HentoidApp.getInstance(), ""), file + ".txt"), (null == msg) ? "NULL".getBytes() : msg.getBytes());
Timber.i(">>file %s -> %s", file, msg);
} catch (Exception e) {
e.printStackTrace();
}
}
@Nullable
public static DocumentFile getDocumentFile(@NonNull final File file, final boolean isDirectory) {
return FileUtil.getDocumentFile(file, isDirectory);
}
>>>>>>>
public static void shareFile(final @NonNull Context context, final @NonNull DocumentFile f, final @NonNull String title) {
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/*");
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, title);
sharingIntent.putExtra(Intent.EXTRA_STREAM, f.getUri());
context.startActivity(Intent.createChooser(sharingIntent, context.getString(R.string.send_to)));
}
public static List<DocumentFile> listFiles(@NonNull DocumentFile parent, FileFilter filter) {
List<DocumentFile> result = new ArrayList<>();
DocumentFile[] files = parent.listFiles();
if (filter != null)
for (DocumentFile file : files)
if (filter.accept(file)) result.add(file);
return result;
}
public static List<DocumentFile> listFolders(@NonNull Context context, @NonNull DocumentFile parent) {
return FileUtil.listFolders(context, parent, null);
}
@Nullable
public static DocumentFile findFolder(@NonNull Context context, @NonNull DocumentFile parent, @NonNull String subfolderName) {
//List<DocumentFile> result = listFiles(parent, f -> f.isDirectory() && f.getName() != null && f.getName().equalsIgnoreCase(subfolderName));
List<DocumentFile> result = FileUtil.listFolders(context, parent, subfolderName);
if (!result.isEmpty()) return result.get(0);
else return null;
}
@Nullable
public static DocumentFile findFile(@NonNull Context context, @NonNull DocumentFile parent, @NonNull String fileName) {
//List<DocumentFile> result = listFiles(parent, f -> f.isFile() && f.getName() != null && f.getName().equalsIgnoreCase(fileName));
List<DocumentFile> result = FileUtil.listFiles(context, parent, fileName);
if (!result.isEmpty()) return result.get(0);
else return null;
}
@Nullable
public static DocumentFile findDocumentFile(@NonNull Context context, @NonNull DocumentFile parent, @NonNull String documentFileName) {
//List<DocumentFile> result = listFiles(parent, f -> f.isFile() && f.getName() != null && f.getName().equalsIgnoreCase(fileName));
List<DocumentFile> result = FileUtil.listDocumentFiles(context, parent, documentFileName);
if (!result.isEmpty()) return result.get(0);
else return null;
}
// Please don't delete this method!
// I need some way to trace actions when working with SD card features - Robb
public static void createFileWithMsg(@NonNull String file, String msg) {
try {
FileHelper.saveBinaryInFile(new File(getDefaultDir(HentoidApp.getInstance(), ""), file + ".txt"), (null == msg) ? "NULL".getBytes() : msg.getBytes());
Timber.i(">>file %s -> %s", file, msg);
} catch (Exception e) {
e.printStackTrace();
}
}
@Nullable
public static DocumentFile getDocumentFile(@NonNull final File file, final boolean isDirectory) {
return FileUtil.getDocumentFile(file, isDirectory);
}
<<<<<<<
public static void shareFile(final @NonNull Context context, final @NonNull DocumentFile f, final @NonNull String title) {
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/*");
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, title);
sharingIntent.putExtra(Intent.EXTRA_STREAM, f.getUri());
context.startActivity(Intent.createChooser(sharingIntent, context.getString(R.string.send_to)));
}
public static List<DocumentFile> listFiles(@NonNull DocumentFile parent, FileFilter filter) {
List<DocumentFile> result = new ArrayList<>();
DocumentFile[] files = parent.listFiles();
if (filter != null)
for (DocumentFile file : files)
if (filter.accept(file)) result.add(file);
return result;
}
public static List<DocumentFile> listFolders(@NonNull Context context, @NonNull DocumentFile parent) {
return FileUtil.listFolders(context, parent, null);
}
@Nullable
public static DocumentFile findFolder(@NonNull Context context, @NonNull DocumentFile parent, @NonNull String subfolderName) {
//List<DocumentFile> result = listFiles(parent, f -> f.isDirectory() && f.getName() != null && f.getName().equalsIgnoreCase(subfolderName));
List<DocumentFile> result = FileUtil.listFolders(context, parent, subfolderName);
if (!result.isEmpty()) return result.get(0);
else return null;
}
@Nullable
public static DocumentFile findFile(@NonNull Context context, @NonNull DocumentFile parent, @NonNull String fileName) {
//List<DocumentFile> result = listFiles(parent, f -> f.isFile() && f.getName() != null && f.getName().equalsIgnoreCase(fileName));
List<DocumentFile> result = FileUtil.listFiles(context, parent, fileName);
if (!result.isEmpty()) return result.get(0);
else return null;
}
@Nullable
public static DocumentFile findDocumentFile(@NonNull Context context, @NonNull DocumentFile parent, @NonNull String documentFileName) {
//List<DocumentFile> result = listFiles(parent, f -> f.isFile() && f.getName() != null && f.getName().equalsIgnoreCase(fileName));
List<DocumentFile> result = FileUtil.listDocumentFiles(context, parent, documentFileName);
if (!result.isEmpty()) return result.get(0);
else return null;
}
=======
private static int findSequencePosition(byte[] data, int initialPos, byte[] sequence, int limit) {
// int BUFFER_SIZE = 64;
// byte[] readBuffer = new byte[BUFFER_SIZE];
int remainingBytes;
// int bytesToRead;
// int dataPos = 0;
int iSequence = 0;
if (initialPos < 0 || initialPos > data.length) return -1;
remainingBytes = (limit > 0) ? Math.min(data.length - initialPos, limit) : data.length;
// while (remainingBytes > 0) {
// bytesToRead = Math.min(remainingBytes, BUFFER_SIZE);
// System.arraycopy(data, dataPos, readBuffer, 0, bytesToRead);
// dataPos += bytesToRead;
// stream.Read(readBuffer, 0, bytesToRead);
for (int i = initialPos; i < remainingBytes; i++) {
if (sequence[iSequence] == data[i]) iSequence++;
else if (iSequence > 0) iSequence = 0;
if (sequence.length == iSequence) return i - sequence.length;
}
// remainingBytes -= bytesToRead;
// }
// Target sequence not found
return -1;
}
public static void copy(@NonNull File src, @NonNull File dst) throws IOException {
try (InputStream in = new FileInputStream(src)) {
try (OutputStream out = new FileOutputStream(dst)) {
copy(in, out);
}
}
}
public static void copy(@NonNull InputStream in, @NonNull OutputStream out) throws IOException {
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
out.flush();
}
public static File getDownloadsFolder() {
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
}
public static OutputStream openNewDownloadOutputStream(@NonNull final String fileName) throws IOException {
// TODO implement when targetSDK = 29
/*
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
return openNewDownloadOutputStreamQ(fileName, mimeType)
} else {*/
return openNewDownloadOutputStreamLegacy(fileName);
//}
}
private static OutputStream openNewDownloadOutputStreamLegacy(@NonNull final String fileName) throws IOException {
File downloadsFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
if (null == downloadsFolder) throw new IOException("Downloads folder not found");
File target = new File(downloadsFolder, fileName);
if (!target.exists() && !target.createNewFile())
throw new IOException("Could not create new file in downloads folder");
return FileUtil.getOutputStream(target);
}
@TargetApi(29)
private static OutputStream openNewDownloadOutputStreamQ(@NonNull final String fileName, @NonNull final String mimeType) throws IOException {
// TODO implement when targetSDK = 29
// https://gitlab.com/commonsguy/download-wrangler/blob/master/app/src/main/java/com/commonsware/android/download/DownloadRepository.kt
return null;
}
>>>>>>>
private static int findSequencePosition(byte[] data, int initialPos, byte[] sequence, int limit) {
// int BUFFER_SIZE = 64;
// byte[] readBuffer = new byte[BUFFER_SIZE];
int remainingBytes;
// int bytesToRead;
// int dataPos = 0;
int iSequence = 0;
if (initialPos < 0 || initialPos > data.length) return -1;
remainingBytes = (limit > 0) ? Math.min(data.length - initialPos, limit) : data.length;
// while (remainingBytes > 0) {
// bytesToRead = Math.min(remainingBytes, BUFFER_SIZE);
// System.arraycopy(data, dataPos, readBuffer, 0, bytesToRead);
// dataPos += bytesToRead;
// stream.Read(readBuffer, 0, bytesToRead);
for (int i = initialPos; i < remainingBytes; i++) {
if (sequence[iSequence] == data[i]) iSequence++;
else if (iSequence > 0) iSequence = 0;
if (sequence.length == iSequence) return i - sequence.length;
}
// remainingBytes -= bytesToRead;
// }
// Target sequence not found
return -1;
}
public static void copy(@NonNull File src, @NonNull File dst) throws IOException {
try (InputStream in = new FileInputStream(src)) {
try (OutputStream out = new FileOutputStream(dst)) {
copy(in, out);
}
}
}
public static void copy(@NonNull InputStream in, @NonNull OutputStream out) throws IOException {
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
out.flush();
}
public static File getDownloadsFolder() {
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
}
public static OutputStream openNewDownloadOutputStream(@NonNull final String fileName) throws IOException {
// TODO implement when targetSDK = 29
/*
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
return openNewDownloadOutputStreamQ(fileName, mimeType)
} else {*/
return openNewDownloadOutputStreamLegacy(fileName);
//}
}
private static OutputStream openNewDownloadOutputStreamLegacy(@NonNull final String fileName) throws IOException {
File downloadsFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
if (null == downloadsFolder) throw new IOException("Downloads folder not found");
File target = new File(downloadsFolder, fileName);
if (!target.exists() && !target.createNewFile())
throw new IOException("Could not create new file in downloads folder");
return FileUtil.getOutputStream(target);
}
@TargetApi(29)
private static OutputStream openNewDownloadOutputStreamQ(@NonNull final String fileName, @NonNull final String mimeType) throws IOException {
// TODO implement when targetSDK = 29
// https://gitlab.com/commonsguy/download-wrangler/blob/master/app/src/main/java/com/commonsware/android/download/DownloadRepository.kt
return null;
} |
<<<<<<<
import me.devsaki.hentoid.database.enums.Site;
import me.devsaki.hentoid.parser.HitomiParser;
import me.devsaki.hentoid.util.AndroidHelper;
import me.devsaki.hentoid.util.ConstantsPreferences;
=======
import me.devsaki.hentoid.enums.Site;
import me.devsaki.hentoid.parsers.HitomiParser;
>>>>>>>
import me.devsaki.hentoid.enums.Site;
import me.devsaki.hentoid.parsers.HitomiParser;
import me.devsaki.hentoid.util.AndroidHelper;
import me.devsaki.hentoid.util.ConstantsPreferences; |
<<<<<<<
public ContentAdapter(Context cxt, ItemSelectListener listener, Comparator<Content> comparator) {
this.cxt = cxt;
=======
public ContentAdapter(Context context, List<Content> contents, ItemSelectListener listener) {
this.context = context;
this.contents = contents;
>>>>>>>
public ContentAdapter(Context cxt, ItemSelectListener listener, Comparator<Content> comparator) {
this.context = cxt;
<<<<<<<
public void onBindViewHolder(final ViewHolder holder, final int pos) {
if (holder instanceof ProgressViewHolder) {
((ProgressViewHolder) holder).progressBar.setIndeterminate(true);
} else if (mSortedList.size() > 0 && pos < mSortedList.size()) {
final Content content = mSortedList.get(pos);
// Initializes the ViewHolder that contains the books
updateLayoutVisibility((ContentHolder) holder, content, pos);
populateLayout((ContentHolder) holder, content, pos);
attachOnClickListeners((ContentHolder) holder, content, pos);
}
=======
public void onBindViewHolder(ContentHolder holder, final int pos) {
Content content = contents.get(pos);
updateLayoutVisibility(holder, content, pos);
populateLayout(holder, content, pos);
attachOnClickListeners(holder, content, pos);
>>>>>>>
public void onBindViewHolder(ContentHolder holder, final int pos) {
Content content = mSortedList.get(pos);
// Initializes the ViewHolder that contains the booksupdateLayoutVisibility( holder, content, pos);
populateLayout( holder, content, pos);
attachOnClickListeners( holder, content, pos);
<<<<<<<
Helper.toast(cxt, R.string.add_to_queue);
remove(item);
=======
Helper.toast(context, R.string.add_to_queue);
removeItem(item);
notifyDataSetChanged();
>>>>>>>
Helper.toast(context, R.string.add_to_queue);
remove(item);
<<<<<<<
public void remove(List<Content> contents) {
mSortedList.beginBatchedUpdates();
for (Content content : contents) {
mSortedList.remove(content);
}
mSortedList.endBatchedUpdates();
=======
Helper.toast(context, "Selected items have been deleted.");
>>>>>>>
public void remove(List<Content> contents) {
mSortedList.beginBatchedUpdates();
for (Content content : contents) {
mSortedList.remove(content);
}
mSortedList.endBatchedUpdates();
<<<<<<<
private static class ProgressViewHolder extends RecyclerView.ViewHolder {
final ProgressBar progressBar;
ProgressViewHolder(View itemView) {
super(itemView);
progressBar = (ProgressBar) itemView.findViewById(R.id.loadingProgress);
}
}
private final SortedList<Content> mSortedList = new SortedList<>(Content.class, new SortedList.Callback<Content>() {
@Override
public int compare(Content a, Content b) {
return mComparator.compare(a, b);
}
@Override
public void onInserted(int position, int count) {
notifyItemRangeInserted(position, count);
}
@Override
public void onRemoved(int position, int count) {
notifyItemRangeRemoved(position, count);
}
@Override
public void onMoved(int fromPosition, int toPosition) {
notifyItemMoved(fromPosition, toPosition);
}
@Override
public void onChanged(int position, int count) {
notifyItemRangeChanged(position, count);
}
@Override
public boolean areContentsTheSame(Content oldItem, Content newItem) {
return oldItem.equals(newItem);
}
@Override
public boolean areItemsTheSame(Content item1, Content item2) {
return item1.getId() == item2.getId();
}
});
=======
>>>>>>>
private static class ProgressViewHolder extends RecyclerView.ViewHolder {
final ProgressBar progressBar;
ProgressViewHolder(View itemView) {
super(itemView);
progressBar = (ProgressBar) itemView.findViewById(R.id.loadingProgress);
}
}
private final SortedList<Content> mSortedList = new SortedList<>(Content.class, new SortedList.Callback<Content>() {
@Override
public int compare(Content a, Content b) {
return mComparator.compare(a, b);
}
@Override
public void onInserted(int position, int count) {
notifyItemRangeInserted(position, count);
}
@Override
public void onRemoved(int position, int count) {
notifyItemRangeRemoved(position, count);
}
@Override
public void onMoved(int fromPosition, int toPosition) {
notifyItemMoved(fromPosition, toPosition);
}
@Override
public void onChanged(int position, int count) {
notifyItemRangeChanged(position, count);
}
@Override
public boolean areContentsTheSame(Content oldItem, Content newItem) {
return oldItem.equals(newItem);
}
@Override
public boolean areItemsTheSame(Content item1, Content item2) {
return item1.getId() == item2.getId();
}
}); |
<<<<<<<
import android.os.Build;
=======
import android.content.pm.PackageManager;
>>>>>>>
import android.os.Build;
import android.content.pm.PackageManager;
<<<<<<<
Timber.d("Content item(s) count: %s", db.getContentCount());
=======
LogHelper.d(TAG, "Content item(s) count: " + db.getContentCount());
>>>>>>>
Timber.d("Content item(s) count: %s", db.getContentCount()); |
<<<<<<<
Timber.d("Opening: %s from: %s", content.getTitle(), getContentDownloadDir(cxt, content));
=======
// File dir = getContentDownloadDir(cxt, content);
String settingDir = getRoot();
File dir = new File(settingDir, content.getStorageFolder());
LogHelper.d(TAG, "Opening: " + content.getTitle() + " from: " + dir);
>>>>>>>
Timber.d("Opening: %s from: %s", content.getTitle(), getContentDownloadDir(cxt, content));
// File dir = getContentDownloadDir(cxt, content);
String settingDir = getRoot();
File dir = new File(settingDir, content.getStorageFolder());
LogHelper.d(TAG, "Opening: " + content.getTitle() + " from: " + dir); |
<<<<<<<
/**
* Get the map id
*
* @return the map id
*/
=======
public MapMeta() {}
public MapMeta(int id) {
this.mapId = id;
}
>>>>>>>
public MapMeta() {}
public MapMeta(int id) {
this.mapId = id;
}
/**
* Get the map id
*
* @return the map id
*/ |
<<<<<<<
public StatementInterface getStatement(int position);
/**
* Check if there is a statement at the given position.
*
* @param position
* Index of statement
* @return Whether or not there is a statement at the given position.
*/
public boolean hasStatement(int position);
=======
public Statement getStatement(int position);
>>>>>>>
public Statement getStatement(int position);
/**
* Check if there is a statement at the given position.
*
* @param position
* Index of statement
* @return Whether or not there is a statement at the given position.
*/
public boolean hasStatement(int position); |
<<<<<<<
public TestChromosome() {
//#TODO steenbuck similar logic is repeated in TestSuiteChromosomeFactory
if (test_factory == null) {
test_factory = DefaultTestFactory.getInstance();
}
}
=======
>>>>>>>
<<<<<<<
if (getLastExecutionResult() != null) {
c.setLastExecutionResult(this.lastExecutionResult); //.clone(); // TODO: Clone?
c.getLastExecutionResult().test = c.test;
}
=======
>>>>>>>
<<<<<<<
try {
changed = mutationConcolic();
} catch(Exception exc) {
logger.info("Encountered exception when trying to use concolic mutation.", exc.getMessage());
logger.debug("Detailed exception trace: ", exc);
}
=======
//logger.info("Test before concolic: " + test.toCode());
changed = mutationConcolic();
//logger.info("Test after concolic: " + test.toCode());
>>>>>>>
try {
changed = mutationConcolic();
} catch(Exception exc) {
logger.info("Encountered exception when trying to use concolic mutation.", exc.getMessage());
logger.debug("Detailed exception trace: ", exc);
} |
<<<<<<<
=======
import java.util.List;
>>>>>>>
import java.util.List;
<<<<<<<
ArrayReference otherArray = new ArrayReference(newTestCase, type,
array_length);
otherArray.setArrayLength(array_length);
newTestCase.getStatement(getStPosition() + offset).setRetval(otherArray);
=======
ArrayReference otherArray = new ArrayReference(newTestCase, type, lengths);
>>>>>>>
ArrayReference otherArray = new ArrayReference(newTestCase, type, lengths);
newTestCase.getStatement(getStPosition() + offset).setRetval(otherArray);
<<<<<<<
ArrayReference otherArray = new ArrayReference(newTestCase, type,
array_length);
otherArray.setArrayLength(array_length);
newTestCase.getStatement(getStPosition() + offset).setRetval(otherArray);
=======
ArrayReference otherArray = new ArrayReference(newTestCase, type, lengths);
>>>>>>>
ArrayReference otherArray = new ArrayReference(newTestCase, type, lengths);
newTestCase.getStatement(getStPosition() + offset).setRetval(otherArray); |
<<<<<<<
private static Logger logger = LoggerFactory.getLogger(VariableReferenceImpl.class);
=======
private int distance = 0;
protected static Logger logger = LoggerFactory.getLogger(VariableReferenceImpl.class);
>>>>>>>
private int distance = 0;
private static Logger logger = LoggerFactory.getLogger(VariableReferenceImpl.class);
<<<<<<<
protected final TestCase testCase;
protected final PassiveChangeListener<Void> changeListener = new PassiveChangeListener<Void>();
protected Integer stPosition;
=======
protected TestCase testCase;
>>>>>>>
protected TestCase testCase;
protected final PassiveChangeListener<Void> changeListener = new PassiveChangeListener<Void>();
protected Integer stPosition; |
<<<<<<<
CONCURRENCY, LCSAJ, DEFUSE, PATH, BRANCH, MUTATION, COMP_LCSAJ_BRANCH, STATEMENT, ANALYZE, DATA
=======
CONCURRENCY, LCSAJ, DEFUSE, ALLDEFS, PATH, BRANCH, MUTATION, COMP_LCSAJ_BRANCH, STATEMENT, ANALYZE
>>>>>>>
CONCURRENCY, LCSAJ, DEFUSE, ALLDEFS, PATH, BRANCH, MUTATION, COMP_LCSAJ_BRANCH, STATEMENT, ANALYZE, DATA
<<<<<<<
=======
String propertiesFile = System.getProperty(PROPERTIES_FILE, "evosuite-files"
+ File.separator + "evosuite.properties");
>>>>>>> |
<<<<<<<
protected StatementInterface statement;
/** Assertion Comment */
protected String comment;
=======
protected Statement statement;
>>>>>>>
protected Statement statement;
/** Assertion Comment */
protected String comment; |
<<<<<<<
import org.evosuite.ga.metaheuristics.mosa.DynaMOSA;
import org.evosuite.ga.metaheuristics.OnePlusOneEA;
import org.evosuite.ga.metaheuristics.StandardGA;
import org.evosuite.ga.metaheuristics.MonotonicGA;
=======
>>>>>>>
import org.evosuite.ga.metaheuristics.mosa.DynaMOSA;
<<<<<<<
case DYNAMOSA:
logger.info("Chosen search algorithm: DynaMOSA");
return new DynaMOSA<TestSuiteChromosome>(factory);
=======
case ONEPLUSLAMBDALAMBDAGA:
logger.info("Chosen search algorithm: 1 + (lambda, lambda)GA");
{
OnePlusLambdaLambdaGA<TestSuiteChromosome> ga = new OnePlusLambdaLambdaGA<TestSuiteChromosome>(factory);
return ga;
}
case MIO:
logger.info("Chosen search algorithm: MIO");
{
MIO<TestSuiteChromosome> ga = new MIO<TestSuiteChromosome>(factory);
return ga;
}
case STANDARDCHEMICALREACTION:
logger.info("Chosen search algorithm: Standard Chemical Reaction Optimization");
{
StandardChemicalReaction<TestSuiteChromosome> ga = new StandardChemicalReaction<TestSuiteChromosome>(factory);
return ga;
}
>>>>>>>
case DYNAMOSA:
logger.info("Chosen search algorithm: DynaMOSA");
return new DynaMOSA<TestSuiteChromosome>(factory);
case ONEPLUSLAMBDALAMBDAGA:
logger.info("Chosen search algorithm: 1 + (lambda, lambda)GA");
{
OnePlusLambdaLambdaGA<TestSuiteChromosome> ga = new OnePlusLambdaLambdaGA<TestSuiteChromosome>(factory);
return ga;
}
case MIO:
logger.info("Chosen search algorithm: MIO");
{
MIO<TestSuiteChromosome> ga = new MIO<TestSuiteChromosome>(factory);
return ga;
}
case STANDARDCHEMICALREACTION:
logger.info("Chosen search algorithm: Standard Chemical Reaction Optimization");
{
StandardChemicalReaction<TestSuiteChromosome> ga = new StandardChemicalReaction<TestSuiteChromosome>(factory);
return ga;
} |
<<<<<<<
import org.evosuite.ga.metaheuristics.mosa.DynaMOSA;
=======
import org.evosuite.ga.metaheuristics.mulambda.MuLambdaEA;
import org.evosuite.ga.metaheuristics.mulambda.MuPlusLambdaEA;
import org.evosuite.ga.metaheuristics.mulambda.OnePlusLambdaLambdaGA;
import org.evosuite.ga.metaheuristics.mulambda.OnePlusOneEA;
>>>>>>>
import org.evosuite.ga.metaheuristics.mosa.DynaMOSA;
import org.evosuite.ga.metaheuristics.mulambda.MuLambdaEA;
import org.evosuite.ga.metaheuristics.mulambda.MuPlusLambdaEA;
import org.evosuite.ga.metaheuristics.mulambda.OnePlusLambdaLambdaGA;
import org.evosuite.ga.metaheuristics.mulambda.OnePlusOneEA;
<<<<<<<
case DYNAMOSA:
logger.info("Chosen search algorithm: DynaMOSA");
return new DynaMOSA<TestSuiteChromosome>(factory);
case ONEPLUSLAMBDALAMBDAGA:
=======
case ONE_PLUS_LAMBDA_LAMBDA_GA:
>>>>>>>
case DYNAMOSA:
logger.info("Chosen search algorithm: DynaMOSA");
return new DynaMOSA<TestSuiteChromosome>(factory);
case ONE_PLUS_LAMBDA_LAMBDA_GA: |
<<<<<<<
import org.evosuite.ga.localsearch.BranchCoverageMap;
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.ga.metaheuristics.MuPlusLambdaGA;
import org.evosuite.ga.metaheuristics.NSGAII;
import org.evosuite.ga.metaheuristics.OnePlusOneEA;
import org.evosuite.ga.metaheuristics.RandomSearch;
import org.evosuite.ga.metaheuristics.StandardGA;
import org.evosuite.ga.metaheuristics.SteadyStateGA;
import org.evosuite.ga.operators.crossover.CoverageCrossOver;
import org.evosuite.ga.operators.crossover.CrossOverFunction;
import org.evosuite.ga.operators.crossover.SinglePointCrossOver;
import org.evosuite.ga.operators.crossover.SinglePointFixedCrossOver;
import org.evosuite.ga.operators.crossover.SinglePointRelativeCrossOver;
import org.evosuite.ga.operators.selection.BinaryTournamentSelectionCrowdedComparison;
import org.evosuite.ga.operators.selection.FitnessProportionateSelection;
import org.evosuite.ga.operators.selection.RankSelection;
import org.evosuite.ga.operators.selection.SelectionFunction;
import org.evosuite.ga.operators.selection.TournamentSelection;
import org.evosuite.ga.populationlimit.IndividualPopulationLimit;
import org.evosuite.ga.populationlimit.PopulationLimit;
import org.evosuite.ga.populationlimit.SizePopulationLimit;
=======
import org.evosuite.ga.TournamentSelection;
>>>>>>>
import org.evosuite.ga.localsearch.BranchCoverageMap;
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.ga.metaheuristics.MuPlusLambdaGA;
import org.evosuite.ga.metaheuristics.NSGAII;
import org.evosuite.ga.metaheuristics.OnePlusOneEA;
import org.evosuite.ga.metaheuristics.RandomSearch;
import org.evosuite.ga.metaheuristics.StandardGA;
import org.evosuite.ga.metaheuristics.SteadyStateGA;
import org.evosuite.ga.operators.crossover.CoverageCrossOver;
import org.evosuite.ga.operators.crossover.CrossOverFunction;
import org.evosuite.ga.operators.crossover.SinglePointCrossOver;
import org.evosuite.ga.operators.crossover.SinglePointFixedCrossOver;
import org.evosuite.ga.operators.crossover.SinglePointRelativeCrossOver;
import org.evosuite.ga.operators.selection.BinaryTournamentSelectionCrowdedComparison;
import org.evosuite.ga.operators.selection.FitnessProportionateSelection;
import org.evosuite.ga.operators.selection.RankSelection;
import org.evosuite.ga.operators.selection.SelectionFunction;
import org.evosuite.ga.operators.selection.TournamentSelection;
import org.evosuite.ga.populationlimit.IndividualPopulationLimit;
import org.evosuite.ga.populationlimit.PopulationLimit;
import org.evosuite.ga.populationlimit.SizePopulationLimit;
<<<<<<<
import org.evosuite.utils.ArrayUtil;
import org.evosuite.utils.ClassPathHandler;
=======
>>>>>>>
import org.evosuite.utils.ArrayUtil;
<<<<<<<
LoggingUtils.getEvoLogger().info("* Compiling and checking tests");
int i = 0;
for (TestSuiteChromosome test : tests) {
//List<TestCase> testCases = tests.getTests();
List<TestCase> testCases = test.getTests();
if (Properties.JUNIT_TESTS) {
if (Properties.JUNIT_CHECK && JUnitAnalyzer.isJavaCompilerAvailable()) {
LoggingUtils.getEvoLogger().info(" - Compiling and checking test " + i);
JUnitAnalyzer.removeTestsThatDoNotCompile(testCases);
boolean unstable = false;
int numUnstable = 0;
numUnstable = JUnitAnalyzer.handleTestsThatAreUnstable(testCases);
unstable = numUnstable > 0;
//second passage on reverse order, this is to spot dependencies among tests
if (testCases.size() > 1) {
Collections.reverse(testCases);
numUnstable += JUnitAnalyzer.handleTestsThatAreUnstable(testCases);
unstable = (numUnstable > 0) || unstable;
}
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.HadUnstableTests,unstable);
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.NumUnstableTests,numUnstable);
}
else {
logger.error("No Java compiler is available. Are you running with the JDK?");
}
}
test.clearTests();
for (TestCase testCase : testCases)
test.addTest(testCase);
i++;
}
=======
List<TestCase> testCases = tests.getTests();
>>>>>>>
LoggingUtils.getEvoLogger().info("* Compiling and checking tests");
int i = 0;
for (TestSuiteChromosome test : tests) {
//List<TestCase> testCases = tests.getTests();
List<TestCase> testCases = test.getTests();
if (Properties.JUNIT_TESTS) {
if (Properties.JUNIT_CHECK && JUnitAnalyzer.isJavaCompilerAvailable()) {
LoggingUtils.getEvoLogger().info(" - Compiling and checking test " + i);
JUnitAnalyzer.removeTestsThatDoNotCompile(testCases);
boolean unstable = false;
int numUnstable = 0;
numUnstable = JUnitAnalyzer.handleTestsThatAreUnstable(testCases);
unstable = numUnstable > 0;
//second passage on reverse order, this is to spot dependencies among tests
if (testCases.size() > 1) {
Collections.reverse(testCases);
numUnstable += JUnitAnalyzer.handleTestsThatAreUnstable(testCases);
unstable = (numUnstable > 0) || unstable;
}
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.HadUnstableTests,unstable);
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.NumUnstableTests,numUnstable);
}
else {
logger.error("No Java compiler is available. Are you running with the JDK?");
}
}
test.clearTests();
for (TestCase testCase : testCases)
test.addTest(testCase);
i++;
}
for (TestSuiteChromosome test : tests) {
// check still on original
//assert !Properties.JUNIT_TESTS || JUnitAnalyzer.verifyCompilationAndExecution(tests.getTests()); // FIXME: remove me
assert !Properties.JUNIT_TESTS || JUnitAnalyzer.verifyCompilationAndExecution(test.getTests()); //check still on original
}
writeObjectPool(tests);
/*
* PUTGeneralizer generalizer = new PUTGeneralizer(); for (TestCase test
* : tests) { generalizer.generalize(test); // ParameterizedTestCase put
* = new ParameterizedTestCase(test); }
*/
//return testCases; // FIXME: remove me
return tests;
}
/**
* <p>
* If Properties.JUNIT_TESTS is set, this method writes the given test cases
* to the default directory Properties.TEST_DIR.
*
* <p>
* The name of the test will be equal to the SUT followed by the given
* suffix
*
* @param tests
* a {@link java.util.List} object.
*/
public static TestGenerationResult writeJUnitTestsAndCreateResult(List<TestCase> tests, String suffix) {
<<<<<<<
+ " statements, best individual(s) has(have) fitness: "
//+ best.getFitness()); // FIXME: remove me
+ ga.toString());
=======
+ " statements, best individual has fitness "
+ best.getFitness());
double fitness = best.getFitness();
>>>>>>>
+ " statements, best individual(s) has(have) fitness: "
//+ best.getFitness()); // FIXME: remove me
+ ga.toString());
<<<<<<<
//CoverageAnalysis.analyzeCoverage(best, Properties.CRITERION); // FIXME: remove me?
//CoverageAnalysis.analyzeCoverage(bests.get(0), Properties.CRITERION); // FIXME: remove me contains
for (Properties.Criterion pc : Properties.CRITERION)
CoverageAnalysis.analyzeCoverage(bests.get(0), pc);
=======
CoverageAnalysis.analyzeCoverage(best, Properties.CRITERION);
>>>>>>>
//CoverageAnalysis.analyzeCoverage(best, Properties.CRITERION); // FIXME: remove me?
//CoverageAnalysis.analyzeCoverage(bests.get(0), Properties.CRITERION); // FIXME: remove me contains
for (Properties.Criterion pc : Properties.CRITERION)
CoverageAnalysis.analyzeCoverage(bests.get(0), pc);
<<<<<<<
//statistics.minimized(best); // FIXME: remove me?
statistics.minimized(bests.get(0)); // FIXME: can this be executed with MOO?
LoggingUtils.getEvoLogger().info("* Generated " + /*best*/number_of_test_cases // FIXME
=======
statistics.minimized(best);
LoggingUtils.getEvoLogger().info("* Generated " + best.size()
>>>>>>>
//statistics.minimized(best); // FIXME: remove me?
statistics.minimized(bests.get(0)); // FIXME: can this be executed with MOO?
LoggingUtils.getEvoLogger().info("* Generated " + /*best*/number_of_test_cases // FIXME
<<<<<<<
+ NumberFormat.getPercentInstance().format(/*best*/coverage)); // FIXME
=======
+ NumberFormat.getPercentInstance().format(best.getCoverage()));
>>>>>>>
+ NumberFormat.getPercentInstance().format(/*best*/coverage)); // FIXME
<<<<<<<
public static List<TestSuiteFitnessFunction> getFitnessFunction() {
List<TestSuiteFitnessFunction> ffs = new ArrayList<TestSuiteFitnessFunction>();
//ffs.add(getFitnessFunction(Properties.CRITERION));
//ffs.add(getFitnessFunction(Criterion.AMBIGUITY)); // FIXME: remove me
//ffs.add(getFitnessFunction(Criterion.BRANCH)); // FIXME: remove me
// ----
if (Properties.CRITERION.length == 0)
ffs.add(getFitnessFunction(Criterion.BRANCH));
else {
for (int i = 0; i < Properties.CRITERION.length; i++)
ffs.add(getFitnessFunction(Properties.CRITERION[i]));
}
return ffs;
=======
public static TestSuiteFitnessFunction getFitnessFunction() {
return getFitnessFunction(Properties.CRITERION);
>>>>>>>
public static List<TestSuiteFitnessFunction> getFitnessFunction() {
List<TestSuiteFitnessFunction> ffs = new ArrayList<TestSuiteFitnessFunction>();
//ffs.add(getFitnessFunction(Properties.CRITERION));
//ffs.add(getFitnessFunction(Criterion.AMBIGUITY)); // FIXME: remove me
//ffs.add(getFitnessFunction(Criterion.BRANCH)); // FIXME: remove me
// ----
if (Properties.CRITERION.length == 0)
ffs.add(getFitnessFunction(Criterion.BRANCH));
else {
for (int i = 0; i < Properties.CRITERION.length; i++)
ffs.add(getFitnessFunction(Properties.CRITERION[i]));
}
return ffs;
<<<<<<<
public static List<TestFitnessFactory<? extends TestFitnessFunction>> getFitnessFactory() {
List<TestFitnessFactory<? extends TestFitnessFunction>> goalsFactory = new ArrayList<TestFitnessFactory<? extends TestFitnessFunction>>();
//goalsFactory.add(getFitnessFactory(Properties.CRITERION));
//goalsFactory.add(getFitnessFactory(Criterion.AMBIGUITY)); // FIXME: remove me
//goalsFactory.add(getFitnessFactory(Criterion.BRANCH)); // FIXME: remove me
// ----
if (Properties.CRITERION.length == 0)
goalsFactory.add(getFitnessFactory(Criterion.BRANCH));
else {
for (int i = 0; i < Properties.CRITERION.length; i++)
goalsFactory.add(getFitnessFactory(Properties.CRITERION[i]));
}
return goalsFactory;
=======
public static TestFitnessFactory<? extends TestFitnessFunction> getFitnessFactory() {
return getFitnessFactory(Properties.CRITERION);
>>>>>>>
public static List<TestFitnessFactory<? extends TestFitnessFunction>> getFitnessFactory() {
List<TestFitnessFactory<? extends TestFitnessFunction>> goalsFactory = new ArrayList<TestFitnessFactory<? extends TestFitnessFunction>>();
//goalsFactory.add(getFitnessFactory(Properties.CRITERION));
//goalsFactory.add(getFitnessFactory(Criterion.AMBIGUITY)); // FIXME: remove me
//goalsFactory.add(getFitnessFactory(Criterion.BRANCH)); // FIXME: remove me
// ----
if (Properties.CRITERION.length == 0)
goalsFactory.add(getFitnessFactory(Criterion.BRANCH));
else {
for (int i = 0; i < Properties.CRITERION.length; i++)
goalsFactory.add(getFitnessFactory(Properties.CRITERION[i]));
}
return goalsFactory; |
<<<<<<<
/**
*/
=======
>>>>>>> |
<<<<<<<
import java.util.Set;
import org.evosuite.Properties;
import org.evosuite.Properties.Strategy;
import org.evosuite.TestGenerationContext;
import org.evosuite.testcase.CodeUnderTestException;
import org.evosuite.testcase.ExecutionObserver;
import org.evosuite.testcase.ExecutionTracer;
import org.evosuite.testcase.MethodStatement;
import org.evosuite.testcase.Scope;
import org.evosuite.testcase.StatementInterface;
import org.evosuite.testcase.VariableReference;
=======
import org.evosuite.testcase.statements.Statement;
import org.evosuite.testcase.variable.VariableReference;
import org.evosuite.testcase.execution.CodeUnderTestException;
import org.evosuite.testcase.execution.ExecutionObserver;
import org.evosuite.testcase.execution.ExecutionTracer;
import org.evosuite.testcase.execution.Scope;
>>>>>>>
import java.util.Set;
import org.evosuite.testcase.statements.Statement;
import org.evosuite.testcase.variable.VariableReference;
import org.evosuite.testcase.execution.CodeUnderTestException;
import org.evosuite.testcase.execution.ExecutionObserver;
import org.evosuite.testcase.execution.ExecutionTracer;
import org.evosuite.testcase.execution.Scope;
import org.evosuite.Properties;
import org.evosuite.Properties.Strategy;
import org.evosuite.TestGenerationContext;
import org.evosuite.testcase.ExecutionObserver;
import org.evosuite.testcase.MethodStatement;
<<<<<<<
protected void visitDependencies(StatementInterface statement, Scope scope) {
Set<VariableReference> dependencies = currentTest.getDependencies(statement.getReturnValue());
if(Properties.isRegression()){
if (!hasCUT(statement, dependencies)){
return;
}
}
for (VariableReference var : dependencies) {
=======
protected void visitDependencies(Statement statement, Scope scope) {
for (VariableReference var : currentTest.getDependencies(statement.getReturnValue())) {
>>>>>>>
protected void visitDependencies(Statement statement, Scope scope) {
Set<VariableReference> dependencies = currentTest.getDependencies(statement.getReturnValue());
if(Properties.isRegression()){
if (!hasCUT(statement, dependencies)){
return;
}
}
for (VariableReference var : dependencies) {
<<<<<<<
protected void visitReturnValue(StatementInterface statement, Scope scope) {
if(Properties.isRegression()){
Set<VariableReference> dependencies = currentTest.getDependencies(statement.getReturnValue());
if (!hasCUT(statement, dependencies)){
return;
}
}
if (!statement.getReturnClass().equals(void.class)) {
try {
visit(statement, scope, statement.getReturnValue());
} catch (CodeUnderTestException e) {
// ignore
}
=======
protected void visitReturnValue(Statement statement, Scope scope) {
if (statement.getReturnClass().equals(void.class))
return;
// No need to assert anything about values just assigned
if(statement.isAssignmentStatement())
return;
try {
visit(statement, scope, statement.getReturnValue());
} catch (CodeUnderTestException e) {
// ignore
>>>>>>>
protected void visitReturnValue(Statement statement, Scope scope) {
if(Properties.isRegression()){
Set<VariableReference> dependencies = currentTest.getDependencies(statement.getReturnValue());
if (!hasCUT(statement, dependencies)){
return;
}
}
if (statement.getReturnClass().equals(void.class))
return;
// No need to assert anything about values just assigned
if(statement.isAssignmentStatement())
return;
try {
visit(statement, scope, statement.getReturnValue());
} catch (CodeUnderTestException e) {
// ignore |
<<<<<<<
=======
/**
* Exception to handle the case when a mutation fails
*
*/
static class MutationFailedException extends Exception {
private static final long serialVersionUID = 1667810363133452317L;
};
/**
* only used for testing/debugging
*/
protected Chromosome(){
}
>>>>>>>
/**
* only used for testing/debugging
*/
protected Chromosome(){
} |
<<<<<<<
import org.evosuite.testcase.AbstractTestChromosome;
import org.evosuite.testcase.ExecutableChromosome;
import org.evosuite.testsuite.AbstractTestSuiteChromosome;
=======
import org.evosuite.testcase.TestChromosome;
import org.evosuite.testsuite.TestSuiteChromosome;
>>>>>>>
import org.evosuite.testcase.AbstractTestChromosome;
import org.evosuite.testsuite.AbstractTestSuiteChromosome;
import org.evosuite.testcase.TestChromosome;
import org.evosuite.testsuite.TestSuiteChromosome;
<<<<<<<
public double getFitness(T suite)
=======
public double getFitness(TestSuiteChromosome suite)
>>>>>>>
public double getFitness(TestSuiteChromosome suite)
<<<<<<<
for (E ec : suite.getTestChromosomes()) {
=======
for (TestChromosome ec : suite.getTestChromosomes()) {
>>>>>>>
for (TestChromosome ec : suite.getTestChromosomes()) { |
<<<<<<<
// addClass(Type.getObjectType(classNode.name));
=======
>>>>>>>
<<<<<<<
/*
* for (Type type : parameterClasses) { addClass(type); }
*/
=======
>>>>>>>
<<<<<<<
Class<?> clazz = TestGenerationContext.getClassLoader()
.loadClass(className);
addDependencyClass(clazz);
=======
Class<?> clazz = TestGenerationContext.getClassLoader().loadClass(className);
boolean added = addDependencyClass(clazz);
if(!added){
blackList.add(className);
}
>>>>>>>
Class<?> clazz = TestGenerationContext.getClassLoader().loadClass(className);
boolean added = addDependencyClass(clazz);
if(!added){
blackList.add(className);
}
<<<<<<<
/*
* Collections.sort(subs, new Comparator<String>() {
*
* @Override public int compare(String class1, String class2) { String[] packages1 = class1.split("."); String[] packages2 =
* class2.split(".");
*
* return 0; }
*
* });
*/
=======
>>>>>>>
<<<<<<<
logger.info("Error loading inner class: " + icn.innerName
+ ", " + icn.name + "," + icn.outerName + ": " + t);
=======
logger.error("Problem for "+Properties.TARGET_CLASS+". Error loading inner class: " + icn.innerName + ", "
+ icn.name + "," + icn.outerName + ": " + t);
>>>>>>>
logger.error("Problem for "+Properties.TARGET_CLASS+". Error loading inner class: " + icn.innerName + ", "
+ icn.name + "," + icn.outerName + ": " + t);
<<<<<<<
/*
* if (clazz.getSuperclass() != null) { // constructors.addAll(getConstructors(clazz.getSuperclass())); for (Constructor<?> c :
* getConstructors(clazz.getSuperclass())) { helper.put(org.objectweb.asm.Type.getConstructorDescriptor(c), c); } } for (Class<?> in :
* clazz.getInterfaces()) { for (Constructor<?> c : getConstructors(in)) { helper.put(org.objectweb.asm.Type.getConstructorDescriptor(c), c);
* } // constructors.addAll(getConstructors(in)); }
*/
// for(Constructor c : clazz.getConstructors()) {
// constructors.add(c);
// }
=======
>>>>>>>
<<<<<<<
// constructors.add(c);
helper.put(org.objectweb.asm.Type.getConstructorDescriptor(c),
c);
=======
helper.put(org.objectweb.asm.Type.getConstructorDescriptor(c), c);
>>>>>>>
helper.put(org.objectweb.asm.Type.getConstructorDescriptor(c), c);
<<<<<<<
/*
* for (Method m : helper.values()) { String name = m.getName() + "|" + org.objectweb.asm.Type.getMethodDescriptor(m);
*
* methods.add(m); }
*/
=======
>>>>>>>
<<<<<<<
if (Modifier.isPrivate(c.getModifiers())) // &&
// !(Modifier.isProtected(c.getModifiers())))
=======
if (Modifier.isPrivate(c.getModifiers()))
>>>>>>>
if (Modifier.isPrivate(c.getModifiers()))
<<<<<<<
/*
* if(Modifier.isProtected(f.getModifiers())) return true;
*/
/*
* if(!(Modifier.isPrivate(f.getModifiers()))) // && !(Modifier.isProtected(f.getModifiers()))) return true;
*/
=======
>>>>>>>
<<<<<<<
if (Modifier.isPublic(m.getModifiers())) // ||
// Modifier.isProtected(m.getModifiers()))
=======
if (Modifier.isPublic(m.getModifiers()))
>>>>>>>
if (Modifier.isPublic(m.getModifiers()))
<<<<<<<
&& !Modifier.isPublic(c.getDeclaringClass().getModifiers()))
// && !Modifier.isStatic(c.getDeclaringClass().getModifiers()))
=======
&& !Modifier.isPublic(c.getDeclaringClass().getModifiers()))
>>>>>>>
&& !Modifier.isPublic(c.getDeclaringClass().getModifiers()))
<<<<<<<
if (canUse(constructor)) {
cluster.addGenerator(new GenericClass(clazz), constructor);
addDependencies(constructor);
logger.debug("Keeping track of "
+ constructor.getDeclaringClass().getName()
+ "."
+ constructor.getName()
+ org.objectweb.asm.Type
.getConstructorDescriptor(constructor));
} else {
logger.debug("Constructor cannot be used: " + constructor);
=======
>>>>>>>
<<<<<<<
Class<?> subClazz = Class.forName(subClass, false,
TestGenerationContext.getClassLoader());
// Class<?> subClazz = Class.forName(subClass);
=======
Class<?> subClazz = Class.forName(subClass,
false,
TestGenerationContext.getClassLoader());
>>>>>>>
Class<?> subClazz = Class.forName(subClass,
false,
TestGenerationContext.getClassLoader());
<<<<<<<
// if (Modifier.isAbstract(subClazz.getModifiers()))
// continue;
=======
>>>>>>> |
<<<<<<<
@Test
public void testRegexMatchesTrue() {
List<Constraint<?>> constraints = new ArrayList<Constraint<?>>();
String var1 = "test";
String const2 = "TEST";
StringVariable strVar = new StringVariable("test1", var1);
StringConstant strConst = new StringConstant(const2);
StringBinaryComparison strComp = new StringBinaryComparison(strVar,
Operator.PATTERNMATCHES, strConst, 0L);
constraints.add(new StringConstraint(strComp, Comparator.NE,
new IntegerConstant(0)));
ConstraintSolver skr = new ConstraintSolver();
Map<String, Object> result = skr.solve(constraints);
assertNotNull(result);
assertNotNull(result.get("test1"));
assertTrue(result.get("test1").toString().matches(const2));
}
@Test
public void testRegexMatchesFalse() {
List<Constraint<?>> constraints = new ArrayList<Constraint<?>>();
String var1 = "test";
String const2 = "TEST";
StringVariable strVar = new StringVariable("test1", var1);
StringConstant strConst = new StringConstant(const2);
StringBinaryComparison strComp = new StringBinaryComparison(strVar,
Operator.PATTERNMATCHES, strConst, 0L);
constraints.add(new StringConstraint(strComp, Comparator.EQ,
new IntegerConstant(0)));
ConstraintSolver skr = new ConstraintSolver();
Map<String, Object> result = skr.solve(constraints);
assertNotNull(result);
assertNotNull(result.get("test1"));
assertFalse("Result should not match TEST: "+result.get("test1").toString(), result.get("test1").toString().matches(const2));
}
=======
@Test
public void testIndexOfC() {
String var1value = "D<E\u001E";
StringVariable var1 = new StringVariable("var1", var1value);
IntegerConstant colon_code = new IntegerConstant(35);
IntegerConstant numeral_code = new IntegerConstant(58);
IntegerConstant minus_one = new IntegerConstant(-1);
StringBinaryToIntegerExpression index_of_colon = new StringBinaryToIntegerExpression(
var1, Operator.INDEXOFC, colon_code, -1L);
StringBinaryToIntegerExpression index_of_numeral = new StringBinaryToIntegerExpression(
var1, Operator.INDEXOFC, numeral_code, -1L);
IntegerConstraint constr1 = new IntegerConstraint(index_of_colon,Comparator.EQ, minus_one);
IntegerConstraint constr2 = new IntegerConstraint(index_of_numeral,Comparator.NE, minus_one);
List<Constraint<?>> constraints = new ArrayList<Constraint<?>>();
constraints.add(constr1);
constraints.add(constr2);
ConstraintSolver solver = new ConstraintSolver();
Map<String, Object> solution = solver.solve(constraints);
assertNotNull(solution);
}
>>>>>>>
@Test
public void testRegexMatchesTrue() {
List<Constraint<?>> constraints = new ArrayList<Constraint<?>>();
String var1 = "test";
String const2 = "TEST";
StringVariable strVar = new StringVariable("test1", var1);
StringConstant strConst = new StringConstant(const2);
StringBinaryComparison strComp = new StringBinaryComparison(strVar,
Operator.PATTERNMATCHES, strConst, 0L);
constraints.add(new StringConstraint(strComp, Comparator.NE,
new IntegerConstant(0)));
ConstraintSolver skr = new ConstraintSolver();
Map<String, Object> result = skr.solve(constraints);
assertNotNull(result);
assertNotNull(result.get("test1"));
assertTrue(result.get("test1").toString().matches(const2));
}
@Test
public void testIndexOfC() {
String var1value = "D<E\u001E";
StringVariable var1 = new StringVariable("var1", var1value);
IntegerConstant colon_code = new IntegerConstant(35);
IntegerConstant numeral_code = new IntegerConstant(58);
IntegerConstant minus_one = new IntegerConstant(-1);
StringBinaryToIntegerExpression index_of_colon = new StringBinaryToIntegerExpression(
var1, Operator.INDEXOFC, colon_code, -1L);
StringBinaryToIntegerExpression index_of_numeral = new StringBinaryToIntegerExpression(
var1, Operator.INDEXOFC, numeral_code, -1L);
IntegerConstraint constr1 = new IntegerConstraint(index_of_colon,Comparator.EQ, minus_one);
IntegerConstraint constr2 = new IntegerConstraint(index_of_numeral,Comparator.NE, minus_one);
List<Constraint<?>> constraints = new ArrayList<Constraint<?>>();
constraints.add(constr1);
constraints.add(constr2);
ConstraintSolver solver = new ConstraintSolver();
Map<String, Object> solution = solver.solve(constraints);
assertNotNull(solution);
}
@Test
public void testRegexMatchesFalse() {
List<Constraint<?>> constraints = new ArrayList<Constraint<?>>();
String var1 = "test";
String const2 = "TEST";
StringVariable strVar = new StringVariable("test1", var1);
StringConstant strConst = new StringConstant(const2);
StringBinaryComparison strComp = new StringBinaryComparison(strVar,
Operator.PATTERNMATCHES, strConst, 0L);
constraints.add(new StringConstraint(strComp, Comparator.EQ,
new IntegerConstant(0)));
ConstraintSolver skr = new ConstraintSolver();
Map<String, Object> result = skr.solve(constraints);
assertNotNull(result);
assertNotNull(result.get("test1"));
assertFalse("Result should not match TEST: "+result.get("test1").toString(), result.get("test1").toString().matches(const2));
} |
<<<<<<<
if (Properties.CRITERION.equals("defuse")) {
=======
// TODO line_trace ?
if(Properties.CRITERION.equals("defuse")) {
>>>>>>>
// TODO line_trace ?
if (Properties.CRITERION.equals("defuse")) {
<<<<<<<
* Returns a copy of this trace where all MethodCall-information associated
* with duCounters outside the range of the given duCounterStart and end is
* removed from the finished_calls-traces
=======
* Returns a copy of this trace where all MethodCall-information
* associated with duCounters outside the range of the given duCounter-Start and -End
* is removed from the finished_calls-traces
>>>>>>>
* Returns a copy of this trace where all MethodCall-information associated
* with duCounters outside the range of the given duCounter-Start and -End
* is removed from the finished_calls-traces
<<<<<<<
=======
/*
>>>>>>>
/*
<<<<<<<
// FIX you only have to cut out the other branch-trace-information, if
// the use comes after the overwriting definition
=======
>>>>>>>
<<<<<<<
=======
*/
>>>>>>>
*/
<<<<<<<
// check if call is for the method of targetUse
if (!call.method_name.equals(targetUse.toString())) {
=======
// check if call is for the method of targetDU
if(!call.method_name.equals(targetDU.getMethodName())){
>>>>>>>
// check if call is for the method of targetDU
if (!call.method_name.equals(targetDU.getMethodName())) {
<<<<<<<
for (int i = 0; i < call.defuse_counter_trace.size(); i++) {
int currentDUCounter = call.defuse_counter_trace.get(0);
=======
for(int i = 0;i<call.defuse_counter_trace.size();i++) {
int currentDUCounter = call.defuse_counter_trace.get(i);
>>>>>>>
for (int i = 0; i < call.defuse_counter_trace.size(); i++) {
int currentDUCounter = call.defuse_counter_trace.get(i);
<<<<<<<
if (currentDUCounter < duCounterStart || currentDUCounter > duCounterEnd
|| currentBranchBytecode == targetUseBranchBytecode)
=======
if(currentDUCounter<duCounterStart || currentDUCounter > duCounterEnd)
>>>>>>>
if (currentDUCounter < duCounterStart || currentDUCounter > duCounterEnd)
<<<<<<<
ArrayList<Integer> removableIndices) {
=======
ArrayList<Integer> removableIndices) {
// TODO: line_trace?
//check if call is sane
if(!(call.true_distance_trace.size() == call.false_distance_trace.size()
&& call.false_distance_trace.size() == call.defuse_counter_trace.size()
&& call.defuse_counter_trace.size() == call.branch_trace.size()))
throw new IllegalStateException("insane MethodCall: traces should all be of equal size");
>>>>>>>
ArrayList<Integer> removableIndices) {
// TODO: line_trace?
//check if call is sane
if (!(call.true_distance_trace.size() == call.false_distance_trace.size()
&& call.false_distance_trace.size() == call.defuse_counter_trace.size() && call.defuse_counter_trace.size() == call.branch_trace.size()))
throw new IllegalStateException(
"insane MethodCall: traces should all be of equal size");
<<<<<<<
for (String var : passedDefinitions.keySet()) {
r.append(" for variable: " + var + ": ");
for (Integer objectID : passedDefinitions.get(var).keySet()) {
if (passedDefinitions.get(var).keySet().size() > 1)
r.append("\n\ton object " + objectID + ": ");
r.append(toDefUseTraceInformation(var, objectID));
=======
for(String var : passedDefinitions.keySet()) {
r.append(" for variable: "+var+": ");
for(Integer objectId : passedDefinitions.get(var).keySet()) {
if(passedDefinitions.get(var).keySet().size()>1)
r.append("\n\ton object "+objectId+": ");
r.append(toDefUseTraceInformation(var, objectId));
>>>>>>>
for (String var : passedDefinitions.keySet()) {
r.append(" for variable: " + var + ": ");
for (Integer objectId : passedDefinitions.get(var).keySet()) {
if (passedDefinitions.get(var).keySet().size() > 1)
r.append("\n\ton object " + objectId + ": ");
r.append(toDefUseTraceInformation(var, objectId));
<<<<<<<
for (Integer duPos : passedDefinitions.get(var).get(objectID).keySet())
duTrace[duPos] = "Def " + passedDefinitions.get(var).get(objectID).get(duPos);
if (passedUses.get(var) != null && passedUses.get(var).get(objectID) != null)
for (Integer duPos : passedUses.get(var).get(objectID).keySet())
duTrace[duPos] = "Use " + passedUses.get(var).get(objectID).get(duPos);
=======
for(Integer duPos : passedDefinitions.get(var).get(objectId).keySet())
duTrace[duPos] = "("+duPos+":Def "+passedDefinitions.get(var).get(objectId).get(duPos)+")";
if(passedUses.get(var) != null && passedUses.get(var).get(objectId) != null)
for(Integer duPos : passedUses.get(var).get(objectId).keySet())
duTrace[duPos] = "("+duPos+":Use "+passedUses.get(var).get(objectId).get(duPos)+")";
>>>>>>>
for (Integer duPos : passedDefinitions.get(var).get(objectId).keySet())
duTrace[duPos] = "(" + duPos + ":Def "
+ passedDefinitions.get(var).get(objectId).get(duPos) + ")";
if (passedUses.get(var) != null && passedUses.get(var).get(objectId) != null)
for (Integer duPos : passedUses.get(var).get(objectId).keySet())
duTrace[duPos] = "(" + duPos + ":Use "
+ passedUses.get(var).get(objectId).get(duPos) + ")"; |
<<<<<<<
public void testGatherClassNoAnonymous(){
Collection<String> classes = ResourceList.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).getAllClasses(
=======
public void testGatherClassNoInternal(){
Collection<String> classes = ResourceList.getAllClasses(
>>>>>>>
public void testGatherClassNoInternal(){
Collection<String> classes = ResourceList.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).getAllClasses(
<<<<<<<
@Test
public void testGatherClassWithAnonymous(){
Collection<String> classes = ResourceList.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).getAllClasses(
ClassPathHandler.getInstance().getTargetProjectClasspath(), basePrefix, true);
Assert.assertTrue(classes.contains(Foo.class.getName()));
Assert.assertTrue(""+Arrays.toString(classes.toArray()),classes.contains(Foo.InternalFooClass.class.getName()));
}
=======
>>>>>>> |
<<<<<<<
=======
import org.evosuite.setup.TestClusterGenerator;
import org.evosuite.symbolic.DSEStats;
>>>>>>>
import org.evosuite.symbolic.DSEStats; |
<<<<<<<
private static void gatherStatistics() {
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.Predicates, BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).getBranchCounter());
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.CoveredBranchesBitString, (BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).getBranchCounter()) * 2);
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.Total_Branches, (BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).getBranchCounter()) * 2);
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.Branchless_Methods, BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).getBranchlessMethods().size());
ClientServices.getInstance().getClientNode().trackOutputVariable(RuntimeVariable.Total_Methods, CFGMethodAdapter.getNumMethods(TestGenerationContext.getInstance().getClassLoaderForSUT()));
=======
>>>>>>> |
<<<<<<<
=======
/** Different models of neighbourhoods in the Cellular GA **/
public enum CGA_Models{
ONE_DIMENSION,
LINEAR_FIVE,
COMPACT_NINE,
COMPACT_THIRTEEN
}
/** Constant <code>NEIGHBORHOOD_MODEL</code> */
@Parameter(key = "neighborhood_model", group = "Search Algorithm", description = "The model of neighborhood used in case of CGA. L5 is default")
public static CGA_Models MODEL = CGA_Models.LINEAR_FIVE;
/** Constant <code>RANDOM_SEED</code> */
>>>>>>>
/** Different models of neighbourhoods in the Cellular GA **/
public enum CGA_Models{
ONE_DIMENSION,
LINEAR_FIVE,
COMPACT_NINE,
COMPACT_THIRTEEN
}
@Parameter(key = "neighborhood_model", group = "Search Algorithm", description = "The model of neighborhood used in case of CGA. L5 is default")
public static CGA_Models MODEL = CGA_Models.LINEAR_FIVE;
<<<<<<<
=======
@Parameter(key = "breeder_truncation", group = "Search Algorithm", description = "Percentage of population to use for breeding in breeder GA")
@DoubleValue(min = 0.01, max = 1.0)
public static double TRUNCATION_RATE = 0.5;
/** Constant <code>NUMBER_OF_MUTATIONS=1</code> */
>>>>>>>
@Parameter(key = "breeder_truncation", group = "Search Algorithm", description = "Percentage of population to use for breeding in breeder GA")
@DoubleValue(min = 0.01, max = 1.0)
public static double TRUNCATION_RATE = 0.5; |
<<<<<<<
import org.objectweb.asm.tree.LdcInsnNode;
=======
import org.objectweb.asm.tree.LabelNode;
>>>>>>>
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.LabelNode;
<<<<<<<
if (instruction.isActualBranch())
BranchPool.getInstance(classLoader).registerAsBranch(instruction);
=======
instructionMap.get(className).get(methodName).add(instruction);
logger.debug("Registering instruction "+instruction);
List<BytecodeInstruction> instructions = instructionMap.get(className).get(methodName);
if(instructions.size() > 1) {
BytecodeInstruction previous = instructions.get(instructions.size() - 2);
if(previous.isLabel()) {
LabelNode ln = (LabelNode)previous.asmNode;
if (ln.getLabel() instanceof AnnotatedLabel) {
AnnotatedLabel aLabel = (AnnotatedLabel) ln.getLabel();
if(aLabel.isStartTag()) {
if(aLabel.shouldIgnore()) {
logger.debug("Ignoring artificial branch: "+instruction);
return;
}
}
}
}
}
if (instruction.isActualBranch()) {
BranchPool.registerAsBranch(instruction);
}
>>>>>>>
instructionMap.get(className).get(methodName).add(instruction);
logger.debug("Registering instruction "+instruction);
List<BytecodeInstruction> instructions = instructionMap.get(className).get(methodName);
if(instructions.size() > 1) {
BytecodeInstruction previous = instructions.get(instructions.size() - 2);
if(previous.isLabel()) {
LabelNode ln = (LabelNode)previous.asmNode;
if (ln.getLabel() instanceof AnnotatedLabel) {
AnnotatedLabel aLabel = (AnnotatedLabel) ln.getLabel();
if(aLabel.isStartTag()) {
if(aLabel.shouldIgnore()) {
logger.debug("Ignoring artificial branch: "+instruction);
return;
}
}
}
}
}
if (instruction.isActualBranch()) {
BranchPool.getInstance(classLoader).registerAsBranch(instruction);
} |
<<<<<<<
private static Logger logger = Logger.getLogger(ConcurrencyTracer.class);
private List<SchedulingDecisionTuple> seen;
=======
private static Logger logger = LoggerFactory.getLogger(ConcurrencyTracer.class);
>>>>>>>
private static Logger logger = LoggerFactory.getLogger(ConcurrencyTracer.class);
//private List<SchedulingDecisionTuple> seen;
<<<<<<<
private boolean noNull(){
for(SchedulingDecisionTuple t : seen){
try{
assert(t!=null);
}catch(Throwable e){
logger.fatal("oh nooo", e);
=======
private boolean noNull() {
for (SchedulingDecisionTuple t : seen) {
try {
assert (t != null);
} catch (Throwable e) {
logger.error("oh nooo", e);
>>>>>>>
private boolean noNull(){
for(SchedulingDecisionTuple t : seen){
try{
assert(t!=null);
}catch(Throwable e){
logger.error("oh nooo", e);
<<<<<<<
public List<SchedulingDecisionTuple> getTrace(){
assert(seen!=null);
assert(noNull());
=======
public List<SchedulingDecisionTuple> getTrace() {
assert (seen != null);
assert (noNull());
>>>>>>>
public List<SchedulingDecisionTuple> getTrace(){
assert(seen!=null);
assert(noNull());
<<<<<<<
=======
>>>>>>>
<<<<<<<
private static int test(List<SchedulingDecisionTuple> goal, List<SchedulingDecisionTuple> run){
if(goal.size()>run.size()){
=======
private static int test(List<SchedulingDecisionTuple> goal,
List<SchedulingDecisionTuple> run) {
if (goal.size() > run.size()) {
>>>>>>>
private static int test(List<SchedulingDecisionTuple> goal, List<SchedulingDecisionTuple> run){
if(goal.size()>run.size()){
<<<<<<<
if(goal.size()==1){
if(run.contains(goal.get(0))){
=======
if (goal.size() == 1) {
if (run.contains(goal.get(0))) {
>>>>>>>
if(goal.size()==1){
if(run.contains(goal.get(0))){
<<<<<<<
class searchState{
public Integer pos=1;
public Integer cost=0;
boolean finished=false;
=======
class searchState {
public Integer pos = 1;
public Integer cost = 0;
boolean finished = false;
>>>>>>>
class searchState{
public Integer pos=1;
public Integer cost=0;
boolean finished=false;
<<<<<<<
for(SchedulingDecisionTuple observedElement : run){
//test all already created search states
for(searchState currentSearchState : states){
=======
for (SchedulingDecisionTuple t : run) {
for (searchState s : states) {
>>>>>>>
for(SchedulingDecisionTuple observedElement : run){
//test all already created search states
for(searchState currentSearchState : states){
<<<<<<<
if(!currentSearchState.finished && goal.get(currentSearchState.pos).equals(observedElement)){
currentSearchState.pos++;
if(currentSearchState.pos==goal.size()){
currentSearchState.finished=true;
if(currentSearchState.cost==0){
=======
if (!s.finished && goal.get(s.pos).equals(t)) {
s.pos++;
if (s.pos == goal.size()) {
s.finished = true;
if (s.cost == 0)
>>>>>>>
if(!currentSearchState.finished && goal.get(currentSearchState.pos).equals(observedElement)){
currentSearchState.pos++;
if(currentSearchState.pos==goal.size()){
currentSearchState.finished=true;
if(currentSearchState.cost==0){
<<<<<<<
=======
>>>>>>> |
<<<<<<<
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.testsuite.SearchStatistics;
=======
import org.evosuite.ga.GeneticAlgorithm;
import org.evosuite.statistics.OutputVariable;
import org.evosuite.statistics.RuntimeVariable;
import org.evosuite.statistics.backend.DebugStatisticsBackend;
>>>>>>>
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.statistics.OutputVariable;
import org.evosuite.statistics.RuntimeVariable;
import org.evosuite.statistics.backend.DebugStatisticsBackend; |
<<<<<<<
import java.io.IOException;
=======
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
>>>>>>>
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
<<<<<<<
import org.evosuite.regression.RegressionSearchListener;
import org.evosuite.regression.RegressionSuiteFitness;
import org.evosuite.regression.RegressionTestChromosome;
=======
>>>>>>>
import org.evosuite.regression.RegressionSearchListener;
import org.evosuite.regression.RegressionTestChromosome;
<<<<<<<
import org.evosuite.utils.Utils;
=======
import org.objectweb.asm.Opcodes;
>>>>>>>
import org.evosuite.utils.Utils;
import org.objectweb.asm.Opcodes; |
<<<<<<<
checkTimeout();
=======
if (tracer.killSwitch) {
logger.info("Raising TimeoutException as kill switch is active - passedLine");
throw new TestCaseExecutor.TimeoutExceeded();
}
if (Properties.DYNAMIC_SEEDING) {
ConstantPoolManager.getInstance().addDynamicConstant(val1);
ConstantPoolManager.getInstance().addDynamicConstant(val2);
};
>>>>>>>
checkTimeout();
if (Properties.DYNAMIC_SEEDING) {
ConstantPoolManager.getInstance().addDynamicConstant(val1);
ConstantPoolManager.getInstance().addDynamicConstant(val2);
}; |
<<<<<<<
import org.evosuite.testcase.AbstractTestChromosome;
import org.evosuite.testcase.ExecutableChromosome;
=======
>>>>>>>
import org.evosuite.testcase.AbstractTestChromosome;
<<<<<<<
protected final Map<String, TestFitnessFunction<?>> methodCoverageMap = new LinkedHashMap<>();
=======
protected final Map<String, TestFitnessFunction> methodCoverageMap = new LinkedHashMap<>();
>>>>>>>
protected final Map<String, TestFitnessFunction> methodCoverageMap = new LinkedHashMap<>();
<<<<<<<
public double getFitness(T suite) {
=======
public double getFitness(TestSuiteChromosome suite) {
>>>>>>>
public double getFitness(TestSuiteChromosome suite) {
<<<<<<<
protected void printStatusMessages(T suite,
=======
protected void printStatusMessages(TestSuiteChromosome suite,
>>>>>>>
protected void printStatusMessages(TestSuiteChromosome suite, |
<<<<<<<
/**
* Set to a random value
*/
public abstract void randomize();
=======
@Override
public AccessibleObject getAccessibleObject() {
return null;
}
@Override
public boolean isAssignmentStatement() {
return false;
}
>>>>>>>
/**
* Set to a random value
*/
public abstract void randomize();
@Override
public AccessibleObject getAccessibleObject() {
return null;
}
@Override
public boolean isAssignmentStatement() {
return false;
} |
<<<<<<<
import org.evosuite.utils.ClassPathHandler;
=======
import org.evosuite.statistics.SearchStatistics.RuntimeVariable;
>>>>>>>
import org.evosuite.utils.ClassPathHandler;
import org.evosuite.statistics.SearchStatistics.RuntimeVariable; |
<<<<<<<
STANDARDGA, MONOTONICGA, ONEPLUSONEEA, MUPLUSLAMBDAEA, STEADYSTATEGA, RANDOM, NSGAII, MOSA, DYNAMOSA, SPEA2, ONEPLUSLAMBDALAMBDAGA, BREEDERGA, CELLULARGA, MIO, STANDARDCHEMICALREACTION
=======
STANDARDGA, MONOTONICGA, ONEPLUSONEEA, MUPLUSLAMBDAEA, STEADYSTATEGA, RANDOM, NSGAII, MOSA, LIPS, SPEA2, ONEPLUSLAMBDALAMBDAGA, BREEDERGA, CELLULARGA, MIO, STANDARDCHEMICALREACTION
>>>>>>>
STANDARDGA, MONOTONICGA, ONEPLUSONEEA, MUPLUSLAMBDAEA, STEADYSTATEGA, RANDOM, NSGAII, MOSA, DYNAMOSA, LIPS, SPEA2, ONEPLUSLAMBDALAMBDAGA, BREEDERGA, CELLULARGA, MIO, STANDARDCHEMICALREACTION |
<<<<<<<
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.testsuite.SearchStatistics;
=======
import org.evosuite.ga.GeneticAlgorithm;
import org.evosuite.statistics.OutputVariable;
import org.evosuite.statistics.RuntimeVariable;
import org.evosuite.statistics.backend.DebugStatisticsBackend;
>>>>>>>
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.statistics.OutputVariable;
import org.evosuite.statistics.RuntimeVariable;
import org.evosuite.statistics.backend.DebugStatisticsBackend; |
<<<<<<<
import dr.evomodel.continuous.RestrictedPartials;
import dr.evomodel.continuous.RestrictedPartialsModel;
import dr.evomodel.treedatalikelihood.*;
=======
import dr.evomodel.treedatalikelihood.BufferIndexHelper;
import dr.evomodel.treedatalikelihood.DataLikelihoodDelegate;
import dr.evomodel.treedatalikelihood.TreeDataLikelihood;
import dr.evomodel.treedatalikelihood.TreeTraversal;
>>>>>>>
import dr.evomodel.continuous.RestrictedPartials;
import dr.evomodel.continuous.RestrictedPartialsModel;
import dr.evomodel.treedatalikelihood.*;
<<<<<<<
likelihoodDelegate.restrictedPartialsList,
true);
=======
true,
likelihoodDelegate.allowSingular);
}
public static ContinuousDataLikelihoodDelegate createWithMissingData(ContinuousDataLikelihoodDelegate likelihoodDelegate) {
if (!(likelihoodDelegate.dataModel instanceof ContinuousTraitDataModel)) {
throw new IllegalArgumentException("Not yet implemented");
}
List<Integer> originalMissingIndices = ((ContinuousTraitDataModel) likelihoodDelegate.dataModel).getOriginalMissingIndices();
if (originalMissingIndices.size() == 0) {
throw new IllegalArgumentException("ContinuousDataLikelihoodDelegate has no missing traits");
}
ContinuousTraitPartialsProvider newDataModel = new ContinuousTraitDataModel(((ContinuousTraitDataModel) likelihoodDelegate.dataModel).getName(),
likelihoodDelegate.dataModel.getParameter(),
((ContinuousTraitDataModel) likelihoodDelegate.dataModel).getOriginalMissingIndices(),
true,
likelihoodDelegate.getTraitDim(), PrecisionType.FULL);
ContinuousDataLikelihoodDelegate newDelegate = new ContinuousDataLikelihoodDelegate(likelihoodDelegate.tree,
likelihoodDelegate.diffusionModel,
newDataModel,
likelihoodDelegate.rootPrior,
likelihoodDelegate.rateTransformation,
likelihoodDelegate.rateModel,
false,
likelihoodDelegate.allowSingular);
return newDelegate;
>>>>>>>
likelihoodDelegate.restrictedPartialsList,
true,
likelihoodDelegate.allowSingular);
}
public static ContinuousDataLikelihoodDelegate createWithMissingData(ContinuousDataLikelihoodDelegate likelihoodDelegate) {
if (!(likelihoodDelegate.dataModel instanceof ContinuousTraitDataModel)) {
throw new IllegalArgumentException("Not yet implemented");
}
List<Integer> originalMissingIndices = ((ContinuousTraitDataModel) likelihoodDelegate.dataModel).getOriginalMissingIndices();
if (originalMissingIndices.size() == 0) {
throw new IllegalArgumentException("ContinuousDataLikelihoodDelegate has no missing traits");
}
ContinuousTraitPartialsProvider newDataModel = new ContinuousTraitDataModel(((ContinuousTraitDataModel) likelihoodDelegate.dataModel).getName(),
likelihoodDelegate.dataModel.getParameter(),
((ContinuousTraitDataModel) likelihoodDelegate.dataModel).getOriginalMissingIndices(),
true,
likelihoodDelegate.getTraitDim(), PrecisionType.FULL);
ContinuousDataLikelihoodDelegate newDelegate = new ContinuousDataLikelihoodDelegate(likelihoodDelegate.tree,
likelihoodDelegate.diffusionModel,
newDataModel,
likelihoodDelegate.rootPrior,
likelihoodDelegate.rateTransformation,
likelihoodDelegate.rateModel,
likelihoodDelegate.restrictedPartialsList,
false,
likelihoodDelegate.allowSingular);
return newDelegate; |
<<<<<<<
public void testSimplePLM(){
Properties.P_FUNCTIONAL_MOCKING = 0.5; //any value above 0
Properties.FUNCTIONAL_MOCKING_PERCENT = 0.0;
do100percentLineTest(SimpleFM_PackageMethod.class);
}
@Test
public void testSimplePLMwithReturn(){
Properties.P_FUNCTIONAL_MOCKING = 0.5; //any value above 0
Properties.FUNCTIONAL_MOCKING_PERCENT = 0.0;
do100percentLineTest(SimpleFM_PackageMethodWithReturn.class);
}
@Test
=======
public void testSimpleGenericReturn(){
Properties.P_FUNCTIONAL_MOCKING = 0.5; //any value above 0
Properties.FUNCTIONAL_MOCKING_PERCENT = 0.0;
do100percentLineTest(SimpleFM_GenericReturn.class);
}
@Test
>>>>>>>
public void testSimpleGenericReturn(){
Properties.P_FUNCTIONAL_MOCKING = 0.5; //any value above 0
Properties.FUNCTIONAL_MOCKING_PERCENT = 0.0;
do100percentLineTest(SimpleFM_GenericReturn.class);
}
@Test
public void testSimplePLM(){
Properties.P_FUNCTIONAL_MOCKING = 0.5; //any value above 0
Properties.FUNCTIONAL_MOCKING_PERCENT = 0.0;
do100percentLineTest(SimpleFM_PackageMethod.class);
}
@Test
public void testSimplePLMwithReturn(){
Properties.P_FUNCTIONAL_MOCKING = 0.5; //any value above 0
Properties.FUNCTIONAL_MOCKING_PERCENT = 0.0;
do100percentLineTest(SimpleFM_PackageMethodWithReturn.class);
}
@Test |
<<<<<<<
Injector.reset();
DSEStatistics.clear();
=======
DSEStats.clear();
>>>>>>>
DSEStatistics.clear(); |
<<<<<<<
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.testsuite.SearchStatistics;
=======
import org.evosuite.ga.GeneticAlgorithm;
import org.evosuite.statistics.OutputVariable;
import org.evosuite.statistics.RuntimeVariable;
import org.evosuite.statistics.backend.DebugStatisticsBackend;
>>>>>>>
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.statistics.OutputVariable;
import org.evosuite.statistics.RuntimeVariable;
import org.evosuite.statistics.backend.DebugStatisticsBackend; |
<<<<<<<
import org.evosuite.TestGenerationContext;
=======
import org.evosuite.Properties;
>>>>>>>
import org.evosuite.TestGenerationContext;
import org.evosuite.Properties;
<<<<<<<
for (String className : BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).knownClasses()) {
=======
for (String className : BranchPool.knownClasses()) {
//when limitToCUT== true, if not the class under test of a inner/anonymous class, continue
if(limitToCUT && !isCUT(className)) continue;
//when limitToCUT==false, consider all classes, but excludes libraries ones according the INSTRUMENT_LIBRARIES property
if(!limitToCUT && (!Properties.INSTRUMENT_LIBRARIES && !DependencyAnalysis.isTargetProject(className))) continue;
>>>>>>>
for (String className : BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).knownClasses()) {
//when limitToCUT== true, if not the class under test of a inner/anonymous class, continue
if(limitToCUT && !isCUT(className)) continue;
//when limitToCUT==false, consider all classes, but excludes libraries ones according the INSTRUMENT_LIBRARIES property
if(!limitToCUT && (!Properties.INSTRUMENT_LIBRARIES && !DependencyAnalysis.isTargetProject(className))) continue;
<<<<<<<
for (Branch b : BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).retrieveBranchesInMethod(className,
methodName)) {
if (!(b.getInstruction().isForcedBranch() || LCSAJPool
.isLCSAJBranch(b))) {
=======
for (Branch b : BranchPool.retrieveBranchesInMethod(className, methodName)) {
if (!(b.getInstruction().isForcedBranch())) {
>>>>>>>
for (Branch b : BranchPool.getInstance(TestGenerationContext.getInstance().getClassLoaderForSUT()).retrieveBranchesInMethod(className,
methodName)) {
if (!(b.getInstruction().isForcedBranch())) { |
<<<<<<<
import org.evosuite.sandbox.Sandbox;
import org.evosuite.utils.ArrayUtil;
=======
import org.evosuite.classpath.ClassPathHandler;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.setup.DependencyAnalysis;
>>>>>>>
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.utils.ArrayUtil; |
<<<<<<<
logger.warn("The class "+name+" is not on the classpath"); //only log once
=======
/*
* Note: can't really have "warn" here, as the SUT can use the classloader,
* and try to load garbage (eg random string generated as test data) that
* would fill the logs
*/
logger.debug("The class "+name+" is not on the classapath"); //only log once
>>>>>>>
/*
* Note: can't really have "warn" here, as the SUT can use the classloader,
* and try to load garbage (eg random string generated as test data) that
* would fill the logs
*/
logger.debug("The class "+name+" is not on the classpath"); //only log once |
<<<<<<<
//import org.jgrapht.alg.FloydWarshallShortestPaths;
import org.jgrapht.graph.DefaultDirectedGraph;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.DirectedMultigraph;
=======
>>>>>>>
<<<<<<<
import de.unisb.cs.st.evosuite.Properties;
import de.unisb.cs.st.evosuite.cfg.ControlFlowGraph;
import de.unisb.cs.st.evosuite.cfg.FloydWarshall;
import de.unisb.cs.st.evosuite.cfg.CFGGenerator.CFGVertex;
=======
>>>>>>>
<<<<<<<
private Map<String, Map <String, ControlFlowGraph > > graphs;
private Map<String, Map <String, ControlFlowGraph > > completeGraphs;
private Map<String, Map <String, Double > > diameters;
=======
>>>>>>>
<<<<<<<
public void addCFG(String classname, String methodname, DirectedMultigraph<CFGVertex, DefaultEdge> graph) {
if(!graphs.containsKey(classname)) {
graphs.put(classname, new HashMap<String, ControlFlowGraph >());
diameters.put(classname, new HashMap<String, Double>());
}
Map<String, ControlFlowGraph > methods = graphs.get(classname);
logger.debug("Added CFG for class "+classname+" and method "+methodname);
methods.put(methodname, new ControlFlowGraph(graph));
FloydWarshall<CFGVertex,DefaultEdge> f = new FloydWarshall<CFGVertex,DefaultEdge>(graph);
diameters.get(classname).put(methodname, f.getDiameter());
logger.debug("Calculated diameter for "+classname+": "+f.getDiameter());
}
public void addCompleteCFG(String classname, String methodname, DefaultDirectedGraph<CFGVertex, DefaultEdge> graph) {
if(!completeGraphs.containsKey(classname)) {
completeGraphs.put(classname, new HashMap<String, ControlFlowGraph >());
}
Map<String, ControlFlowGraph > methods = completeGraphs.get(classname);
logger.debug("Added complete CFG for class "+classname+" and method "+methodname);
methods.put(methodname, new ControlFlowGraph(graph));
}
public ControlFlowGraph getCompleteCFG(String classname, String methodname) {
return completeGraphs.get(classname).get(methodname);
}
public ControlFlowGraph getCFG(String classname, String methodname) {
return graphs.get(classname).get(methodname);
}
=======
>>>>>>> |
<<<<<<<
import org.evosuite.testcase.AbstractTestFactory;
import org.evosuite.testcase.AssignmentStatement;
=======
>>>>>>>
import org.evosuite.testcase.AssignmentStatement;
<<<<<<<
import org.evosuite.testcase.DefaultTestFactory;
import org.evosuite.testcase.FieldReference;
=======
>>>>>>>
import org.evosuite.testcase.FieldReference;
<<<<<<<
import org.evosuite.testcase.VariableReference;
=======
import org.evosuite.testcase.TestFactory;
>>>>>>>
import org.evosuite.testcase.TestFactory;
import org.evosuite.testcase.VariableReference; |
<<<<<<<
copy.objectPool.addAll(objectPool);
=======
if(returnValues != null)
copy.returnValues = new HashMap<MethodStatement, Object>(returnValues);
>>>>>>>
copy.objectPool.addAll(objectPool);
if(returnValues != null)
copy.returnValues = new HashMap<MethodStatement, Object>(returnValues); |
<<<<<<<
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.testsuite.SearchStatistics;
=======
import org.evosuite.ga.GeneticAlgorithm;
import org.evosuite.statistics.OutputVariable;
import org.evosuite.statistics.RuntimeVariable;
import org.evosuite.statistics.backend.DebugStatisticsBackend;
//import org.evosuite.testsuite.SearchStatistics;
>>>>>>>
import org.evosuite.ga.metaheuristics.GeneticAlgorithm;
import org.evosuite.statistics.OutputVariable;
import org.evosuite.statistics.RuntimeVariable;
import org.evosuite.statistics.backend.DebugStatisticsBackend;
//import org.evosuite.testsuite.SearchStatistics; |
<<<<<<<
import org.evosuite.TestGenerationContext;
=======
import org.evosuite.coverage.archive.TestsArchive;
>>>>>>>
import org.evosuite.TestGenerationContext;
import org.evosuite.coverage.archive.TestsArchive;
<<<<<<<
totalMethods = CFGMethodAdapter.getNumMethodsPrefix(classLoader, prefix);
totalBranches = BranchPool.getInstance(classLoader).getBranchCountForPrefix(prefix);
numBranchlessMethods = BranchPool.getInstance(classLoader).getNumBranchlessMethodsPrefix(prefix);
branchlessMethods = BranchPool.getInstance(classLoader).getBranchlessMethodsPrefix(prefix);
branchesId = BranchPool.getInstance(classLoader).getBranchIdsForPrefix(prefix);
methods = CFGMethodAdapter.getMethods(classLoader, prefix);
=======
totalMethods = CFGMethodAdapter.getNumMethodsPrefix(prefix);
totalBranches = BranchPool.getBranchCountForPrefix(prefix);
numBranchlessMethods = BranchPool.getNumBranchlessMethodsPrefix(prefix);
branchlessMethods = BranchPool.getBranchlessMethodsPrefix(prefix);
methods = CFGMethodAdapter.getMethodsPrefix(prefix);
>>>>>>>
totalMethods = CFGMethodAdapter.getNumMethodsPrefix(classLoader, prefix);
totalBranches = BranchPool.getInstance(classLoader).getBranchCountForPrefix(prefix);
numBranchlessMethods = BranchPool.getInstance(classLoader).getNumBranchlessMethodsPrefix(prefix);
branchlessMethods = BranchPool.getInstance(classLoader).getBranchlessMethodsPrefix(prefix);
methods = CFGMethodAdapter.getMethods(classLoader, prefix);
<<<<<<<
totalMethods = CFGMethodAdapter.getNumMethodsPrefix(classLoader, prefix);
totalBranches = BranchPool.getInstance(classLoader).getBranchCountForPrefix(prefix);
numBranchlessMethods = BranchPool.getInstance(classLoader).getNumBranchlessMethodsPrefix(prefix);
branchlessMethods = BranchPool.getInstance(classLoader).getBranchlessMethodsPrefix(prefix);
branchesId = BranchPool.getInstance(classLoader).getBranchIdsForPrefix(prefix);
methods = CFGMethodAdapter.getMethodsPrefix(classLoader, prefix);
=======
totalMethods = CFGMethodAdapter.getNumMethodsPrefix(prefix);
totalBranches = BranchPool.getBranchCountForPrefix(prefix);
numBranchlessMethods = BranchPool.getNumBranchlessMethodsPrefix(prefix);
branchlessMethods = BranchPool.getBranchlessMethodsPrefix(prefix);
methods = CFGMethodAdapter.getMethodsPrefix(prefix);
>>>>>>>
totalMethods = CFGMethodAdapter.getNumMethodsPrefix(classLoader, prefix);
totalBranches = BranchPool.getInstance(classLoader).getBranchCountForPrefix(prefix);
numBranchlessMethods = BranchPool.getInstance(classLoader).getNumBranchlessMethodsPrefix(prefix);
branchlessMethods = BranchPool.getInstance(classLoader).getBranchlessMethodsPrefix(prefix);
methods = CFGMethodAdapter.getMethodsPrefix(classLoader, prefix);
<<<<<<<
Statement statement = null;
if(result.test.hasStatement(exceptionPosition))
statement = result.test.getStatement(exceptionPosition);
=======
// TODO: Not sure why that can happen
if(exceptionPosition >= result.test.size())
continue;
Statement statement = result.test.getStatement(exceptionPosition);
>>>>>>>
// TODO: Not sure why that can happen
if(exceptionPosition >= result.test.size())
continue;
Statement statement = null;
if(result.test.hasStatement(exceptionPosition))
statement = result.test.getStatement(exceptionPosition);
<<<<<<<
else {
suite.setCoverage(this, 1.0);
totalCovered = (double) coverage / (double) totalGoals;
}
=======
else
suite.setCoverage(this, 1);
>>>>>>>
else {
suite.setCoverage(this, 1);
totalCovered = (double) coverage / (double) totalGoals;
} |
<<<<<<<
switch (strategy) {
case EVOSUITE:
cmdLine.add("-Dstrategy=EvoSuite");
break;
case ONEBRANCH:
cmdLine.add("-Dstrategy=OneBranch");
break;
case RANDOM:
cmdLine.add("-Dstrategy=Random");
break;
case RANDOM_FIXED:
cmdLine.add("-Dstrategy=Random_Fixed");
break;
case REGRESSION:
cmdLine.add("-Dstrategy=Regression");
break;
case ENTBUG:
cmdLine.add("-Dstrategy=EntBug");
break;
case MOSUITE:
cmdLine.add("-Dstrategy=MOSuite");
break;
case DSE:
cmdLine.add("-Dstrategy=DSE");
break;
case NOVELTY:
cmdLine.add("-Dstrategy=Novelty");
break;
default:
throw new RuntimeException("Unsupported strategy: " + strategy);
}
=======
switch (strategy) {
case EVOSUITE:
cmdLine.add("-Dstrategy=EvoSuite");
break;
case ONEBRANCH:
cmdLine.add("-Dstrategy=OneBranch");
break;
case RANDOM:
cmdLine.add("-Dstrategy=Random");
break;
case RANDOM_FIXED:
cmdLine.add("-Dstrategy=Random_Fixed");
break;
case REGRESSION:
cmdLine.add("-Dstrategy=Regression");
break;
case ENTBUG:
cmdLine.add("-Dstrategy=EntBug");
break;
case MOSUITE:
cmdLine.add("-Dstrategy=MOSuite");
// Set up defaults for MOSA if not specified by user
boolean algorithmSet = false;
boolean selectionSet = false;
for (String arg : args) {
if (arg.startsWith("-Dalgorithm")) {
algorithmSet = true;
}
if (arg.startsWith("-Dselection_function")) {
selectionSet = true;
}
}
if(!selectionSet) {
cmdLine.add("-Dselection_function=RANK_CROWD_DISTANCE_TOURNAMENT");
}
if(!algorithmSet) {
cmdLine.add("-Dalgorithm=MOSA");
}
break;
case DSE:
cmdLine.add("-Dstrategy=DSE");
break;
case NOVELTY:
cmdLine.add("-Dstrategy=Novelty");
break;
default:
throw new RuntimeException("Unsupported strategy: " + strategy);
}
cmdLine.add("-DTARGET_CLASS=" + target);
if (Properties.PROJECT_PREFIX != null) {
cmdLine.add("-DPROJECT_PREFIX=" + Properties.PROJECT_PREFIX);
}
cmdLine.add(ClientProcess.class.getName());
/*
* TODO: here we start the client with several properties that are set through -D. These properties are not visible to the master process (ie
* this process), when we access the Properties file. At the moment, we only need few parameters, so we can hack them
*/
Properties.getInstance();// should force the load, just to be sure
Properties.TARGET_CLASS = target;
Properties.PROCESS_COMMUNICATION_PORT = port;
/*
* FIXME: refactor, and double-check if indeed correct
*
* The use of "assertions" in the client is pretty tricky, as those properties need to be transformed into JVM options before starting the
* client. Furthermore, the properties in the property file might be overwritten from the commands coming from shell
*/
String definedEAforClient = null;
String definedEAforSUT = null;
final String DISABLE_ASSERTIONS_EVO = "-da:"+PackageInfo.getEvoSuitePackage()+"...";
final String ENABLE_ASSERTIONS_EVO = "-ea:"+PackageInfo.getEvoSuitePackage()+"...";
final String DISABLE_ASSERTIONS_SUT = "-da:" + Properties.PROJECT_PREFIX + "...";
final String ENABLE_ASSERTIONS_SUT = "-ea:" + Properties.PROJECT_PREFIX + "...";
for (String s : cmdLine) {
// first check client
if (s.startsWith("-Denable_asserts_for_evosuite")) {
if (s.endsWith("false")) {
definedEAforClient = DISABLE_ASSERTIONS_EVO;
} else if (s.endsWith("true")) {
definedEAforClient = ENABLE_ASSERTIONS_EVO;
}
}
// then check SUT
if (s.startsWith("-Denable_asserts_for_sut")) {
if (s.endsWith("false")) {
definedEAforSUT = DISABLE_ASSERTIONS_SUT;
} else if (s.endsWith("true")) {
definedEAforSUT = ENABLE_ASSERTIONS_SUT;
}
}
}
/*
* the assertions might not be defined in the command line, but they might be in the property file, or just use default values. NOTE: if those
* are defined in the command line, then they overwrite whatever we had in the conf file
*/
if (definedEAforSUT == null) {
if (Properties.ENABLE_ASSERTS_FOR_SUT) {
definedEAforSUT = ENABLE_ASSERTIONS_SUT;
} else {
definedEAforSUT = DISABLE_ASSERTIONS_SUT;
}
}
if (definedEAforClient == null) {
if (Properties.ENABLE_ASSERTS_FOR_EVOSUITE) {
definedEAforClient = ENABLE_ASSERTIONS_EVO;
} else {
definedEAforClient = DISABLE_ASSERTIONS_EVO;
}
}
/*
* We add them in first position, after the java command To avoid confusion, we only add them if they are enabled. NOTE: this might have side
* effects "if" in the future we have something like a generic "-ea"
*/
if (definedEAforClient.equals(ENABLE_ASSERTIONS_EVO)) {
cmdLine.add(1, definedEAforClient);
}
if (definedEAforSUT.equals(ENABLE_ASSERTIONS_SUT)) {
cmdLine.add(1, definedEAforSUT);
}
LoggingUtils logUtils = new LoggingUtils();
>>>>>>>
switch (strategy) {
case EVOSUITE:
cmdLine.add("-Dstrategy=EvoSuite");
break;
case ONEBRANCH:
cmdLine.add("-Dstrategy=OneBranch");
break;
case RANDOM:
cmdLine.add("-Dstrategy=Random");
break;
case RANDOM_FIXED:
cmdLine.add("-Dstrategy=Random_Fixed");
break;
case REGRESSION:
cmdLine.add("-Dstrategy=Regression");
break;
case ENTBUG:
cmdLine.add("-Dstrategy=EntBug");
break;
case MOSUITE:
cmdLine.add("-Dstrategy=MOSuite");
// Set up defaults for MOSA if not specified by user
boolean algorithmSet = false;
boolean selectionSet = false;
for (String arg : args) {
if (arg.startsWith("-Dalgorithm")) {
algorithmSet = true;
}
if (arg.startsWith("-Dselection_function")) {
selectionSet = true;
}
}
if(!selectionSet) {
cmdLine.add("-Dselection_function=RANK_CROWD_DISTANCE_TOURNAMENT");
}
if(!algorithmSet) {
cmdLine.add("-Dalgorithm=MOSA");
}
break;
case DSE:
cmdLine.add("-Dstrategy=DSE");
break;
case NOVELTY:
cmdLine.add("-Dstrategy=Novelty");
break;
default:
throw new RuntimeException("Unsupported strategy: " + strategy);
} |
<<<<<<<
=======
import org.evosuite.graphs.cfg.CFGMethodAdapter;
import org.evosuite.instrumentation.InstrumentingClassLoader;
import org.evosuite.rmi.ClientServices;
>>>>>>>
<<<<<<<
protected StoppingCondition getStoppingCondition() {
return StoppingConditionFactory.getStoppingCondition(Properties.STOPPING_CONDITION);
=======
protected StoppingCondition<TestSuiteChromosome> getStoppingCondition() {
switch (Properties.STOPPING_CONDITION) {
case MAXGENERATIONS:
return new MaxGenerationStoppingCondition<>();
case MAXFITNESSEVALUATIONS:
return new MaxFitnessEvaluationsStoppingCondition<>();
case MAXTIME:
return new MaxTimeStoppingCondition<>();
case MAXTESTS:
return new MaxTestsStoppingCondition<>();
case MAXSTATEMENTS:
return new MaxStatementsStoppingCondition<>();
default:
return new MaxGenerationStoppingCondition<>();
}
>>>>>>>
protected StoppingCondition<TestSuiteChromosome> getStoppingCondition() {
return StoppingConditionFactory.getStoppingCondition(Properties.STOPPING_CONDITION); |
<<<<<<<
final AttributedList<Path> list = new FileidDriveListService(session, fileid, file).list(file.getParent(), new DisabledListProgressListener());
final Path found = list.filter(new NullFilter<>()).find(new SimplePathPredicate(file));
=======
final AttributedList<Path> list = new FileidDriveListService(session, new DriveFileidProvider(session), file).list(file.getParent(), new DisabledListProgressListener());
final Path found = list.find(new SimplePathPredicate(file));
>>>>>>>
final AttributedList<Path> list = new FileidDriveListService(session, fileid, file).list(file.getParent(), new DisabledListProgressListener());
final Path found = list.find(new SimplePathPredicate(file)); |
<<<<<<<
if(type == AclPermission.class) {
return (T) new VaultRegistryAclPermission(session, (AclPermission) proxy, this);
}
=======
if(type == UnixPermission.class) {
return (T) new VaultRegistryUnixPermission(session, (UnixPermission) proxy, this);
}
>>>>>>>
if(type == UnixPermission.class) {
return (T) new VaultRegistryUnixPermission(session, (UnixPermission) proxy, this);
}
if(type == AclPermission.class) {
return (T) new VaultRegistryAclPermission(session, (AclPermission) proxy, this);
} |
<<<<<<<
import ch.cyberduck.core.HostKeyCallback;
import ch.cyberduck.core.HostParser;
import ch.cyberduck.core.HostUrlProvider;
=======
>>>>>>>
import ch.cyberduck.core.HostKeyCallback;
import ch.cyberduck.core.HostUrlProvider;
<<<<<<<
import java.net.UnknownHostException;
=======
import java.net.URI;
>>>>>>>
import java.net.URI;
import java.net.UnknownHostException;
<<<<<<<
@Override
public void progress(final Integer seconds) {
if(log.isInfoEnabled()) {
log.info(MessageFormat.format(LocaleFactory.localizedString("Retry again in {0}", "Status"),
new RemainingPeriodFormatter().format(seconds)));
}
=======
}
if(json.has("server")) {
if(PreferencesFactory.get().getBoolean("brick.pairing.hostname.configure")) {
host.setHostname(URI.create(json.getAsJsonPrimitive("server").getAsString()).getHost());
>>>>>>>
@Override
public void progress(final Integer seconds) {
if(log.isInfoEnabled()) {
log.info(MessageFormat.format(LocaleFactory.localizedString("Retry again in {0}", "Status"),
new RemainingPeriodFormatter().format(seconds)));
} |
<<<<<<<
if(session.isPosixFilesystem()) {
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
final Path workdir = new LocalHomeFinderFeature(session).find();
final Path target = new Path(workdir, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
new LocalTouchFeature(session).touch(target, new TransferStatus());
final Path link = new Path(workdir, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file, AbstractPath.Type.symboliclink));
new LocalSymlinkFeature(session).symlink(link, target.getName());
assertTrue(new LocalFindFeature(session).find(link));
assertEquals(EnumSet.of(Path.Type.file, AbstractPath.Type.symboliclink),
new LocalListService(session).list(workdir, new DisabledListProgressListener()).get(link).getType());
new LocalDeleteFeature(session).delete(Collections.singletonList(link), new DisabledLoginCallback(), new Delete.DisabledCallback());
assertFalse(new LocalFindFeature(session).find(link));
assertTrue(new LocalFindFeature(session).find(target));
new LocalDeleteFeature(session).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
session.close();
}
=======
assumeTrue(session.isPosixFilesystem());
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback());
session.login(Proxy.DIRECT, new DisabledPasswordStore(), new DisabledLoginCallback(), new DisabledCancelCallback());
final Path workdir = new LocalHomeFinderFeature(session).find();
final Path target = new Path(workdir, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
new LocalTouchFeature(session).touch(target, new TransferStatus());
final Path link = new Path(workdir, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file, AbstractPath.Type.symboliclink));
new LocalSymlinkFeature(session).symlink(link, target.getName());
assertTrue(new LocalFindFeature(session).find(link));
assertEquals(EnumSet.of(Path.Type.file, AbstractPath.Type.symboliclink),
new LocalListService(session).list(workdir, new DisabledListProgressListener()).get(link).getType());
new LocalDeleteFeature(session).delete(Collections.singletonList(link), new DisabledLoginCallback(), new Delete.DisabledCallback());
assertFalse(new LocalFindFeature(session).find(link));
assertTrue(new LocalFindFeature(session).find(target));
new LocalDeleteFeature(session).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
session.close();
>>>>>>>
assumeTrue(session.isPosixFilesystem());
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
final Path workdir = new LocalHomeFinderFeature(session).find();
final Path target = new Path(workdir, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
new LocalTouchFeature(session).touch(target, new TransferStatus());
final Path link = new Path(workdir, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file, AbstractPath.Type.symboliclink));
new LocalSymlinkFeature(session).symlink(link, target.getName());
assertTrue(new LocalFindFeature(session).find(link));
assertEquals(EnumSet.of(Path.Type.file, AbstractPath.Type.symboliclink),
new LocalListService(session).list(workdir, new DisabledListProgressListener()).get(link).getType());
new LocalDeleteFeature(session).delete(Collections.singletonList(link), new DisabledLoginCallback(), new Delete.DisabledCallback());
assertFalse(new LocalFindFeature(session).find(link));
assertTrue(new LocalFindFeature(session).find(target));
new LocalDeleteFeature(session).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
session.close(); |
<<<<<<<
import org.n52.sos.ds.hibernate.dao.FeatureOfInterestDAO;
=======
import org.n52.sos.ds.hibernate.dao.DaoFactory;
>>>>>>>
import org.n52.sos.ds.hibernate.dao.FeatureOfInterestDAO;
import org.n52.sos.ds.hibernate.dao.DaoFactory;
<<<<<<<
List<String> featureOfInterestIdentifiers, AbstractObservationRequest request, LocalizedProducer<OwsServiceProvider> serviceProvider, Locale language, String pdf, Session session) {
super(request, language, serviceProvider, pdf, session);
=======
List<String> featureOfInterestIdentifiers,
AbstractObservationRequest request,
LocalizedProducer<OwsServiceProvider> serviceProvider,
Locale language,
DaoFactory daoFactory,
Session session) {
super(request, language, serviceProvider, daoFactory, session);
>>>>>>>
List<String> featureOfInterestIdentifiers,
AbstractObservationRequest request,
LocalizedProducer<OwsServiceProvider> serviceProvider,
Locale language,
String pdf,
DaoFactory daoFactory,
Session session) {
super(request, language, serviceProvider, pdf, daoFactory, session); |
<<<<<<<
dict.setStringForKey(this.getUuid(), "UUID");
if(size != null) {
dict.setStringForKey(String.valueOf(size), "Size");
}
if(transferred != null) {
dict.setStringForKey(String.valueOf(transferred), "Current");
}
=======
dict.setStringForKey(uuid, "UUID");
dict.setStringForKey(String.valueOf(this.getSize()), "Size");
dict.setStringForKey(String.valueOf(this.getTransferred()), "Current");
>>>>>>>
dict.setStringForKey(uuid, "UUID");
if(size != null) {
dict.setStringForKey(String.valueOf(size), "Size");
}
if(transferred != null) {
dict.setStringForKey(String.valueOf(transferred), "Current");
} |
<<<<<<<
new DbxUserFilesRequests(session.getClient()).move(file.getAbsolute(), renamed.getAbsolute());
// Copy original file attributes
return new Path(renamed.getParent(), renamed.getName(), renamed.getType(), new PathAttributes(file.attributes()));
=======
new DbxUserFilesRequests(session.getClient()).moveV2(file.getAbsolute(), renamed.getAbsolute());
return renamed;
>>>>>>>
new DbxUserFilesRequests(session.getClient()).moveV2(file.getAbsolute(), renamed.getAbsolute());
// Copy original file attributes
return new Path(renamed.getParent(), renamed.getName(), renamed.getType(), new PathAttributes(file.attributes())); |
<<<<<<<
final Path target = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback());
=======
final Path target = new Path(room, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
>>>>>>>
final Path target = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
<<<<<<<
final Path target = new Path(room2, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback());
=======
final Path target = new Path(room2, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
>>>>>>>
final Path target = new Path(room2, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
<<<<<<<
final Path target = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback());
=======
final Path target = new Path(room, UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
>>>>>>>
final Path target = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
new SDSMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
<<<<<<<
final Path test = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback());
=======
final Path test = new Path(room, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, new Path(room, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
>>>>>>>
final Path test = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
new SDSMoveFeature(session).move(test, new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback()); |
<<<<<<<
protocols.append("\t").append(String.format("%s://<container>/<key>", p.isBundled() ? p.getIdentifier() : p.getProvider()));
=======
case onedrive:
protocols.append("\t").append(String.format("%s://<container>/<key>", getScheme(p)));
>>>>>>>
protocols.append("\t").append(String.format("%s://<container>/<key>", getScheme(p))); |
<<<<<<<
import ch.cyberduck.core.proxy.Proxy;
=======
import ch.cyberduck.core.proxy.ProxyFinder;
import ch.cyberduck.core.shared.DelegatingSchedulerFeature;
>>>>>>>
import ch.cyberduck.core.proxy.Proxy;
import ch.cyberduck.core.shared.DelegatingSchedulerFeature; |
<<<<<<<
new HubicProtocol(),
new DropboxProtocol(),
new OneDriveProtocol()
=======
new DropboxProtocol(),
new HubicProtocol()
>>>>>>>
new HubicProtocol(),
new DropboxProtocol(),
new DropboxProtocol(),
new OneDriveProtocol() |
<<<<<<<
image = applyImageTransforms(data, image, data.xResolution, data.yResolution);
//applyBulbMask(data, graphics, data.xResolution, data.yResolution);
//WILBUR
//applyImageTransforms(data, image, data.xResolution, data.yResolution);
=======
applyBulbMask(data, graphics, data.xResolution, data.yResolution);
//Start the exposure timer
logger.info("ExposureStart:{}", ()->Log4jTimer.completeTimer(EXPOSURE_TIMER));
>>>>>>>
image = applyImageTransforms(data, image, data.xResolution, data.yResolution);
//applyBulbMask(data, graphics, data.xResolution, data.yResolution);
//Start the exposure timer
logger.info("ExposureStart:{}", ()->Log4jTimer.completeTimer(EXPOSURE_TIMER)); |
<<<<<<<
public class Constants {
=======
public final class Constants {
// public static final String BASE_URL = "http://gank.avosapps.com/api/";
>>>>>>>
public final class Constants { |
<<<<<<<
private Realm realm;
private String mType;
private boolean mIsCollections;
=======
private final Realm realm;
private final String mType;
>>>>>>>
private final Realm realm;
private final String mType;
private boolean mIsCollections; |
<<<<<<<
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%>
=======
<%_ } _%>
<%_ if (authenticationType !== 'oauth2' && (databaseType === 'sql' || databaseType === 'mongodb')) { _%>
>>>>>>>
<%_ } _%>
<%_ if (authenticationType !== 'oauth2' && (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase')) { _%>
<<<<<<<
public UserService(UserRepository userRepository, PasswordEncoder passwordEncoder<% if (enableSocialSignIn) { %>, SocialService socialService<% } %><% if (databaseType === 'sql' && authenticationType === 'oauth2') { %>, JdbcTokenStore jdbcTokenStore<% } %><% if (searchEngine === 'elasticsearch') { %>, UserSearchRepository userSearchRepository<% } %><% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %><% if (authenticationType === 'session') { %>, PersistentTokenRepository persistentTokenRepository<% } %>, AuthorityRepository authorityRepository<% } %><% if (cacheManagerIsAvailable === true) { %>, CacheManager cacheManager<% } %>) {
=======
public UserService(UserRepository userRepository<% if (authenticationType !== 'oauth2') { %>, PasswordEncoder passwordEncoder<% } %><% if (enableSocialSignIn) { %>, SocialService socialService<% } %><% if (searchEngine === 'elasticsearch') { %>, UserSearchRepository userSearchRepository<% } %><% if (databaseType === 'sql' || databaseType === 'mongodb') { %><% if (authenticationType === 'session') { %>, PersistentTokenRepository persistentTokenRepository<% } %>, AuthorityRepository authorityRepository<% } %><% if (cacheManagerIsAvailable === true) { %>, CacheManager cacheManager<% } %>) {
>>>>>>>
public UserService(UserRepository userRepository<% if (authenticationType !== 'oauth2') { %>, PasswordEncoder passwordEncoder<% } %><% if (enableSocialSignIn) { %>, SocialService socialService<% } %><% if (searchEngine === 'elasticsearch') { %>, UserSearchRepository userSearchRepository<% } %><% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %><% if (authenticationType === 'session') { %>, PersistentTokenRepository persistentTokenRepository<% } %>, AuthorityRepository authorityRepository<% } %><% if (cacheManagerIsAvailable === true) { %>, CacheManager cacheManager<% } %>) {
<<<<<<<
public User createUser(String login, String password, String firstName, String lastName, String email<% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %>,
String imageUrl<% } %>, String langKey) {
=======
public User registerUser(ManagedUserVM userDTO) {
>>>>>>>
public User registerUser(ManagedUserVM userDTO) {
<<<<<<<
newUser.setFirstName(firstName);
newUser.setLastName(lastName);
newUser.setEmail(email);
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%>
newUser.setImageUrl(imageUrl);
=======
newUser.setFirstName(userDTO.getFirstName());
newUser.setLastName(userDTO.getLastName());
newUser.setEmail(userDTO.getEmail());
<%_ if (databaseType === 'sql' || databaseType === 'mongodb') { _%>
newUser.setImageUrl(userDTO.getImageUrl());
>>>>>>>
newUser.setFirstName(userDTO.getFirstName());
newUser.setLastName(userDTO.getLastName());
newUser.setEmail(userDTO.getEmail());
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%>
newUser.setImageUrl(userDTO.getImageUrl());
<<<<<<<
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%>
=======
<%_ if (authenticationType !== 'oauth2' && (databaseType === 'sql' || databaseType === 'mongodb')) { _%>
>>>>>>>
<%_ if (authenticationType !== 'oauth2' && (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase')) { _%> |
<<<<<<<
import <%=packageName%>.web.rest.vm.ManagedUserVM;
import <%=packageName%>.web.rest.util.HeaderUtil;<% } %><% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %>
import <%=packageName%>.web.rest.util.PaginationUtil;<% } %>
=======
import <%=packageName%>.web.rest.util.HeaderUtil;
<%_ } _%>
<%_ if (databaseType === 'sql' || databaseType === 'mongodb') { _%>
import <%=packageName%>.web.rest.util.PaginationUtil;
<%_ } _%>
>>>>>>>
import <%=packageName%>.web.rest.util.HeaderUtil;
<%_ } _%>
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%>
import <%=packageName%>.web.rest.util.PaginationUtil;
<%_ } _%>
<<<<<<<
import org.slf4j.LoggerFactory;<% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %>
=======
import org.slf4j.LoggerFactory;
<%_ if (databaseType === 'sql' || databaseType === 'mongodb') { _%>
>>>>>>>
import org.slf4j.LoggerFactory;
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%>
<<<<<<<
@Timed<% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %>
public ResponseEntity<List<UserDTO>> getAllUsers(@ApiParam Pageable pageable) {
=======
@Timed
<%_ if (databaseType === 'sql' || databaseType === 'mongodb') { _%>
public ResponseEntity<List<UserDTO>> getAllUsers(Pageable pageable) {
>>>>>>>
@Timed
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%>
public ResponseEntity<List<UserDTO>> getAllUsers(Pageable pageable) { |
<<<<<<<
import org.springframework.boot.autoconfigure.SpringBootApplication;
<%_ if (clusteredHttpSession === 'hazelcast') { _%>
import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
<%_ } _%>
=======
>>>>>>>
import org.springframework.boot.autoconfigure.SpringBootApplication;
<<<<<<<
@SpringBootApplication
=======
@EnableAutoConfiguration(exclude = {MetricFilterAutoConfiguration.class, MetricRepositoryAutoConfiguration.class<% if (applicationType === 'gateway') { %>, MetricsDropwizardAutoConfiguration.class<% } %>})
>>>>>>>
@SpringBootApplication |
<<<<<<<
public ManagedUserVM(<% if (databaseType === 'sql') { %>Long<% } else { %>String<% } %> id, String login, String password, String firstName, String lastName,
String email, boolean activated<% if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { %>, String imageUrl<% } %>, String langKey,
<% if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { %>String createdBy, Instant createdDate, String lastModifiedBy, Instant lastModifiedDate,
=======
public ManagedUserVM(<% if (databaseType === 'mongodb' || databaseType === 'cassandra') { %>String<% } else { %>Long<% } %> id, String login, <% if (authenticationType !== 'oauth2') { %>String password, <% } %>String firstName, String lastName,
String email, boolean activated<% if (databaseType === 'mongodb' || databaseType === 'sql') { %>, String imageUrl<% } %>, String langKey,
<% if (databaseType === 'mongodb' || databaseType === 'sql') { %>String createdBy, Instant createdDate, String lastModifiedBy, Instant lastModifiedDate,
>>>>>>>
public ManagedUserVM(<% if (databaseType === 'sql') { %>Long<% } else { %>String<% } %> id, String login, <% if (authenticationType !== 'oauth2') { %>String password, <% } %>String firstName, String lastName,
String email, boolean activated<% if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { %>, String imageUrl<% } %>, String langKey,
<% if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { %>String createdBy, Instant createdDate, String lastModifiedBy, Instant lastModifiedDate,
<<<<<<<
super(id, login, firstName, lastName, email, activated<% if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { %>, imageUrl<% } %>, langKey,
<% if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { %>createdBy, createdDate, lastModifiedBy, lastModifiedDate, <% } %>authorities);
=======
super(id, login, firstName, lastName, email, activated<% if (databaseType === 'mongodb' || databaseType === 'sql') { %>, imageUrl<% } %>, langKey,
<% if (databaseType === 'mongodb' || databaseType === 'sql') { %>createdBy, createdDate, lastModifiedBy, lastModifiedDate, <% } %>authorities);
<%_ if (authenticationType !== 'oauth2') { _%>
>>>>>>>
super(id, login, firstName, lastName, email, activated<% if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { %>, imageUrl<% } %>, langKey,
<% if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { %>createdBy, createdDate, lastModifiedBy, lastModifiedDate, <% } %>authorities);
<%_ if (authenticationType !== 'oauth2') { _%> |
<<<<<<<
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static <%= entityClass %> createEntity(<% if (databaseType == 'sql') { %>EntityManager em<% } %>) {
<%= entityClass %> <%= entityInstance %> = new <%= entityClass %>();
<%_ for (idx in fields) { _%>
=======
@Before
public void initTest() {<% if (databaseType == 'mongodb' || databaseType == 'cassandra') { %>
<%= entityInstance %>Repository.deleteAll();<% } if (searchEngine == 'elasticsearch') { %>
<%= entityInstance %>SearchRepository.deleteAll();<% } %>
<%_ if (fluentMethods) { _%>
<%= entityInstance %> = new <%= entityClass %>()<% for (idx in fields) { %>
.<%= fields[idx].fieldName %>(<%='DEFAULT_' + fields[idx].fieldNameUnderscored.toUpperCase()%>)<% if ((fields[idx].fieldType == 'byte[]' || fields[idx].fieldType === 'ByteBuffer') && fields[idx].fieldTypeBlobContent != 'text') { %>
.<%= fields[idx].fieldName %>ContentType(<%='DEFAULT_' + fields[idx].fieldNameUnderscored.toUpperCase()%>_CONTENT_TYPE)<% } %><% } %>;
<%_ } else { _%>
<%= entityInstance %> = new <%= entityClass %>();
<%_ for (idx in fields) { _%>
>>>>>>>
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static <%= entityClass %> createEntity(<% if (databaseType == 'sql') { %>EntityManager em<% } %>) {
<%= entityClass %> <%= entityInstance %> = new <%= entityClass %>();
<%_ if (fluentMethods) { _%>
<%= entityInstance %> = new <%= entityClass %>()<% for (idx in fields) { %>
.<%= fields[idx].fieldName %>(<%='DEFAULT_' + fields[idx].fieldNameUnderscored.toUpperCase()%>)<% if ((fields[idx].fieldType == 'byte[]' || fields[idx].fieldType === 'ByteBuffer') && fields[idx].fieldTypeBlobContent != 'text') { %>
.<%= fields[idx].fieldName %>ContentType(<%='DEFAULT_' + fields[idx].fieldNameUnderscored.toUpperCase()%>_CONTENT_TYPE)<% } %><% } %>;
<%_ } else { _%>
<%= entityInstance %> = new <%= entityClass %>();
<%_ for (idx in fields) { _%>
<<<<<<<
<%= entityClass %> updated<%= entityClass %> = <%= entityInstance %>Repository.findOne(<%= entityInstance %>.getId());
<%_ for (idx in fields) { _%>
=======
<%_ if (fluentMethods) { _%>
<%= entityClass %> updated<%= entityClass %> = new <%= entityClass %>()<% for (idx in fields) { %>
.<%= fields[idx].fieldName %>(<%='UPDATED_' + fields[idx].fieldNameUnderscored.toUpperCase()%>)<% if ((fields[idx].fieldType == 'byte[]' || fields[idx].fieldType === 'ByteBuffer') && fields[idx].fieldTypeBlobContent != 'text') { %>
.<%= fields[idx].fieldName %>ContentType(<%='UPDATED_' + fields[idx].fieldNameUnderscored.toUpperCase()%>_CONTENT_TYPE)<% } %><% } %>;
<%_ } else { _%>
<%= entityClass %> updated<%= entityClass %> = new <%= entityClass %>();
<%_ for (idx in fields) { _%>
>>>>>>>
<%= entityClass %> updated<%= entityClass %> = <%= entityInstance %>Repository.findOne(<%= entityInstance %>.getId());
<%_ if (fluentMethods) { _%>
updated<%= entityClass %><% for (idx in fields) { %>
.<%= fields[idx].fieldName %>(<%='UPDATED_' + fields[idx].fieldNameUnderscored.toUpperCase()%>)<% if ((fields[idx].fieldType == 'byte[]' || fields[idx].fieldType === 'ByteBuffer') && fields[idx].fieldTypeBlobContent != 'text') { %>
.<%= fields[idx].fieldName %>ContentType(<%='UPDATED_' + fields[idx].fieldNameUnderscored.toUpperCase()%>_CONTENT_TYPE)<% } %><% } %>;
<%_ } else { _%>
<%_ for (idx in fields) { _%> |
<<<<<<<
http
//.addFilterAfter(new CsrfCookieGeneratorFilter(), CsrfFilter.class) // See https://github.com/jhipster/generator-jhipster/issues/965
=======
http<% if (authenticationType == 'cookie') { %>
.addFilterAfter(new CsrfCookieGeneratorFilter(), CsrfFilter.class)<% } %>
>>>>>>>
http<% if (authenticationType == 'session') { %>
//.addFilterAfter(new CsrfCookieGeneratorFilter(), CsrfFilter.class) // See https://github.com/jhipster/generator-jhipster/issues/965<% } %>
<<<<<<<
.deleteCookies("JSESSIONID"<% if (clusteredHttpSession == 'hazelcast') { %>, "hazelcast.sessionId"<% } %>)
.permitAll()
.and()
.csrf()
.disable() // See https://github.com/jhipster/generator-jhipster/issues/965
=======
.deleteCookies("JSESSIONID", "hazelcast.sessionId", "CSRF-TOKEN")
.permitAll()<% } %>
.and()<% if (authenticationType == 'xauth') { %>
.csrf()
.disable()<% } %>
>>>>>>>
.deleteCookies("JSESSIONID"<% if (clusteredHttpSession == 'hazelcast') { %>, "hazelcast.sessionId"<% } %>)
.permitAll()<% } %>
.and()
.csrf()
.disable() // See https://github.com/jhipster/generator-jhipster/issues/965 |
<<<<<<<
import org.slf4j.LoggerFactory;<% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %>
=======
import org.slf4j.LoggerFactory;
<%_ if (cacheManagerIsAvailable === true) { _%>
import org.springframework.cache.CacheManager;
<%_ } _%>
<%_ if (databaseType === 'sql' || databaseType === 'mongodb') { _%>
>>>>>>>
import org.slf4j.LoggerFactory;
<%_ if (cacheManagerIsAvailable === true) { _%>
import org.springframework.cache.CacheManager;
<%_ } _%>
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%>
<<<<<<<
public UserService(UserRepository userRepository, PasswordEncoder passwordEncoder<% if (enableSocialSignIn) { %>, SocialService socialService<% } %><% if (databaseType === 'sql' && authenticationType === 'oauth2') { %>, JdbcTokenStore jdbcTokenStore<% } %><% if (searchEngine === 'elasticsearch') { %>, UserSearchRepository userSearchRepository<% } %><% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %><% if (authenticationType === 'session') { %>, PersistentTokenRepository persistentTokenRepository<% } %>, AuthorityRepository authorityRepository<% } %>) {
=======
private final CacheManager cacheManager;
<%_ } _%>
public UserService(UserRepository userRepository, PasswordEncoder passwordEncoder<% if (enableSocialSignIn) { %>, SocialService socialService<% } %><% if (databaseType === 'sql' && authenticationType === 'oauth2') { %>, JdbcTokenStore jdbcTokenStore<% } %><% if (searchEngine === 'elasticsearch') { %>, UserSearchRepository userSearchRepository<% } %><% if (databaseType === 'sql' || databaseType === 'mongodb') { %><% if (authenticationType === 'session') { %>, PersistentTokenRepository persistentTokenRepository<% } %>, AuthorityRepository authorityRepository<% } %><% if (cacheManagerIsAvailable === true) { %>, CacheManager cacheManager<% } %>) {
>>>>>>>
private final CacheManager cacheManager;
<%_ } _%>
public UserService(UserRepository userRepository, PasswordEncoder passwordEncoder<% if (enableSocialSignIn) { %>, SocialService socialService<% } %><% if (databaseType === 'sql' && authenticationType === 'oauth2') { %>, JdbcTokenStore jdbcTokenStore<% } %><% if (searchEngine === 'elasticsearch') { %>, UserSearchRepository userSearchRepository<% } %><% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %><% if (authenticationType === 'session') { %>, PersistentTokenRepository persistentTokenRepository<% } %>, AuthorityRepository authorityRepository<% } %><% if (cacheManagerIsAvailable === true) { %>, CacheManager cacheManager<% } %>) {
<<<<<<<
}<% } %><% if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { %>
=======
}
<%_ } _%>
<%_ if (databaseType === 'sql' || databaseType === 'mongodb') { _%>
>>>>>>>
}
<%_ } _%>
<%_ if (databaseType === 'sql' || databaseType === 'mongodb' || databaseType === 'couchbase') { _%> |
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
<<<<<<<
"<%= nativeLanguage %>", // langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%>
=======
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'sql') { _%>
>>>>>>>
Constants.DEFAULT_LANGUAGE,// langKey
<%_ if (databaseType === 'mongodb' || databaseType === 'couchbase' || databaseType === 'sql') { _%> |
<<<<<<<
// public static void safeSolveSymmPosDef(DenseMatrix64F A,
// WrappedVector b,
// WrappedVector x) {
// final int dim = b.getDim();
//
// assert (A.getNumRows() == dim && A.getNumCols() == dim);
//
// final DenseMatrix64F B = wrap(b.getBuffer(), b.getOffset(), dim, 1);
// final DenseMatrix64F X = new DenseMatrix64F(dim, 1);
//
// safeSolveSymmPosDef(A, B, X);
//
//
// for (int row = 0; row < dim; ++row) {
// x.set(row, X.unsafe_get(row, 0));
// }
// }
//
// public static void safeSolveSymmPosDef(DenseMatrix64F A, DenseMatrix64F B, DenseMatrix64F X) {
//
// final int finiteCount = countFiniteNonZeroDiagonals(A);
//
// InversionResult result;
// if (finiteCount == 0) {
// Arrays.fill(X.getData(), 0);
// } else {
// LinearSolver<DenseMatrix64F> solver = LinearSolverFactory.symmPosDef(A.getNumCols());
// DenseMatrix64F Abis = new DenseMatrix64F(A);
// if(solver.setA(Abis)) {
// solver.solve(B, X);
// } else {
// LinearSolver<DenseMatrix64F> solverSVD = LinearSolverFactory.pseudoInverse(true);
// solverSVD.setA(A);
// solverSVD.solve(B, X);
// }
// }
// }
public static InversionResult safeInvert(ReadableMatrix source, WritableMatrix destination, boolean getDeterminant) {
=======
public static InversionResult safeInvert(DenseMatrix64F source, DenseMatrix64F destination, boolean getDeterminant) {
>>>>>>>
// public static void safeSolveSymmPosDef(DenseMatrix64F A,
// WrappedVector b,
// WrappedVector x) {
// final int dim = b.getDim();
//
// assert (A.getNumRows() == dim && A.getNumCols() == dim);
//
// final DenseMatrix64F B = wrap(b.getBuffer(), b.getOffset(), dim, 1);
// final DenseMatrix64F X = new DenseMatrix64F(dim, 1);
//
// safeSolveSymmPosDef(A, B, X);
//
//
// for (int row = 0; row < dim; ++row) {
// x.set(row, X.unsafe_get(row, 0));
// }
// }
//
// public static void safeSolveSymmPosDef(DenseMatrix64F A, DenseMatrix64F B, DenseMatrix64F X) {
//
// final int finiteCount = countFiniteNonZeroDiagonals(A);
//
// InversionResult result;
// if (finiteCount == 0) {
// Arrays.fill(X.getData(), 0);
// } else {
// LinearSolver<DenseMatrix64F> solver = LinearSolverFactory.symmPosDef(A.getNumCols());
// DenseMatrix64F Abis = new DenseMatrix64F(A);
// if(solver.setA(Abis)) {
// solver.solve(B, X);
// } else {
// LinearSolver<DenseMatrix64F> solverSVD = LinearSolverFactory.pseudoInverse(true);
// solverSVD.setA(A);
// solverSVD.solve(B, X);
// }
// }
// }
public static InversionResult safeInvert(DenseMatrix64F source, DenseMatrix64F destination, boolean getDeterminant) {
<<<<<<<
return new InversionResult(FULLY_OBSERVED, dim, logDet, true);
}
=======
final DenseMatrix64F inverseSubSource = new DenseMatrix64F(finiteCount, finiteCount);
if (getDeterminant) {
det = invertAndGetDeterminant(subSource, inverseSubSource);
} else {
CommonOps.invert(subSource, inverseSubSource);
}
scatterRowsAndColumns(inverseSubSource, destination, finiteIndices, finiteIndices, true);
>>>>>>>
final DenseMatrix64F inverseSubSource = new DenseMatrix64F(finiteCount, finiteCount);
if (getDeterminant) {
logDet = invertAndGetDeterminant(subSource, inverseSubSource, true);
} else {
CommonOps.invert(subSource, inverseSubSource);
}
scatterRowsAndColumns(inverseSubSource, destination, finiteIndices, finiteIndices, true);
<<<<<<<
final int finiteCount = countFiniteNonZeroDiagonals(source);
double logDet = 0;
=======
final PermutationIndices permutationIndices = new PermutationIndices(source);
final int finiteNonZeroCount = permutationIndices.getNumberOfNonZeroFiniteDiagonals();
double det = 0;
>>>>>>>
final PermutationIndices permutationIndices = new PermutationIndices(source);
final int finiteNonZeroCount = permutationIndices.getNumberOfNonZeroFiniteDiagonals();
double logDet = 0;
<<<<<<<
return new InversionResult(PARTIALLY_OBSERVED, finiteCount, logDet, true);
=======
for (int i = 0; i < zeroIndices.length; i++) {
int index = zeroIndices[i];
destination.set(index, index, Double.POSITIVE_INFINITY);
}
return new InversionResult(PARTIALLY_OBSERVED, finiteNonZeroCount, det);
>>>>>>>
for (int i = 0; i < zeroIndices.length; i++) {
int index = zeroIndices[i];
destination.set(index, index, Double.POSITIVE_INFINITY);
}
return new InversionResult(PARTIALLY_OBSERVED, finiteNonZeroCount, logDet, true); |
<<<<<<<
public static final String PREMIUM_VIDEO_URL2 = "http://video.wikia.com/wiki/File:Frozen_-_Olaf%27s_Summer_Song";
public static final String PREMIUM_VIDEO_NAME2 = "Frozen - Olaf's Summer Song";
private VideoContent() {
}
=======
public static final String
PREMIUM_VIDEO_URL =
"http://video.wikia.com/wiki/File:Batman_-_Following";
public static final String PREMIUM_VIDEO_NAME = "Batman - Following";
public static final String
PREMIUM_VIDEO_URL2 =
"http://video.wikia.com/wiki/File:Frozen_-_Olaf%27s_Summer_Song";
public static final String PREMIUM_VIDEO_NAME2 = "Frozen - Olaf's Summer Song";
>>>>>>>
public static final String
PREMIUM_VIDEO_URL =
"http://video.wikia.com/wiki/File:Batman_-_Following";
public static final String PREMIUM_VIDEO_NAME = "Batman - Following";
public static final String
PREMIUM_VIDEO_URL2 =
"http://video.wikia.com/wiki/File:Frozen_-_Olaf%27s_Summer_Song";
public static final String PREMIUM_VIDEO_NAME2 = "Frozen - Olaf's Summer Song";
private VideoContent() {
} |
<<<<<<<
testCategory = "Ca";
=======
testCategory = "ca";
categorySearchStr = "abcd";
>>>>>>>
testCategory = "Ca";
categorySearchStr = "abcd";
<<<<<<<
@Test(
groups = {"VECategoryTests", "VECategoryTests_005", "VEAddCategory"}
)
public void VECategoryTests_005_AddNewCategoryWithSortKey() {
String testCategory2 = "Newstuff";
String sortKey = "testkey";
ArrayList<String> categoryWithSortKeyWikiTexts = new ArrayList<>();
categoryWithSortKeyWikiTexts.add("[[Category:" + testCategory2 + "|" + sortKey + "]]");
String articleName2 = PageContent.articleNamePrefix + base.getTimeStamp();
VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName2, wikiURL);
VisualEditorOptionsDialog optionsDialog =
(VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
optionsDialog.addCategory(testCategory2);
optionsDialog.addSortKeyToCategory(testCategory2, sortKey);
ve = optionsDialog.clickApplyChangesButton();
VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges();
reviewDialog.verifyAddedDiffs(categoryWithSortKeyWikiTexts);
saveDialog = reviewDialog.clickReturnToSaveFormButton();
ArticlePageObject article = saveDialog.savePage();
article.verifyVEPublishComplete();
}
=======
@Test(
groups = {"VECategoryTests", "VECategoryTests_003", "VEAddCategory"}
)
public void VECategoryTests_003_NewCategorySuggestions() {
VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName, wikiURL);
VisualEditorOptionsDialog optionsDialog =
(VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
optionsDialog.verifyLinkSuggestions(categorySearchStr, CategoryResultType.NEW);
}
@Test(
groups = {"VECategoryTests", "VECategoryTests_004", "VEAddCategory"}
)
public void VECategoryTests_004_MatchingCategorySuggestions() {
VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName, wikiURL);
VisualEditorOptionsDialog optionsDialog =
(VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
optionsDialog.verifyLinkSuggestions(categorySearchStr, CategoryResultType.MATCHING);
}
>>>>>>>
@Test(
groups = {"VECategoryTests", "VECategoryTests_003", "VEAddCategory"}
)
public void VECategoryTests_003_NewCategorySuggestions() {
VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName, wikiURL);
VisualEditorOptionsDialog optionsDialog =
(VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
optionsDialog.verifyLinkSuggestions(categorySearchStr, CategoryResultType.NEW);
}
@Test(
groups = {"VECategoryTests", "VECategoryTests_004", "VEAddCategory"}
)
public void VECategoryTests_004_MatchingCategorySuggestions() {
VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName, wikiURL);
VisualEditorOptionsDialog optionsDialog =
(VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
optionsDialog.verifyLinkSuggestions(categorySearchStr, CategoryResultType.MATCHING);
}
@Test(
groups = {"VECategoryTests", "VECategoryTests_005", "VEAddCategory"}
)
public void VECategoryTests_005_AddNewCategoryWithSortKey() {
String testCategory2 = "Newstuff";
String sortKey = "testkey";
ArrayList<String> categoryWithSortKeyWikiTexts = new ArrayList<>();
categoryWithSortKeyWikiTexts.add("[[Category:" + testCategory2 + "|" + sortKey + "]]");
String articleName2 = PageContent.articleNamePrefix + base.getTimeStamp();
VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName2, wikiURL);
VisualEditorOptionsDialog optionsDialog =
(VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
optionsDialog.addCategory(testCategory2);
optionsDialog.addSortKeyToCategory(testCategory2, sortKey);
ve = optionsDialog.clickApplyChangesButton();
VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges();
reviewDialog.verifyAddedDiffs(categoryWithSortKeyWikiTexts);
saveDialog = reviewDialog.clickReturnToSaveFormButton();
ArticlePageObject article = saveDialog.savePage();
article.verifyVEPublishComplete();
} |
<<<<<<<
=======
import com.wikia.webdriver.Common.ContentPatterns.ApiActions;
import com.wikia.webdriver.Common.ContentPatterns.URLsContent;
import com.wikia.webdriver.Common.DriverProvider.DriverProvider;
import com.wikia.webdriver.Common.Logging.PageObjectLogging;
import com.wikia.webdriver.Common.Properties.Properties;
import com.wikia.webdriver.PageObjectsFactory.PageObject.Special.Login.SpecialUserLoginPageObject;
>>>>>>>
import com.wikia.webdriver.Common.ContentPatterns.ApiActions;
import com.wikia.webdriver.Common.ContentPatterns.URLsContent;
import com.wikia.webdriver.Common.DriverProvider.DriverProvider;
import com.wikia.webdriver.Common.Logging.PageObjectLogging;
import com.wikia.webdriver.Common.Properties.Properties;
import com.wikia.webdriver.PageObjectsFactory.PageObject.Special.Login.SpecialUserLoginPageObject;
<<<<<<<
<<<<<<< HEAD
*
=======
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
>>>>>>>
*
<<<<<<<
<<<<<<< HEAD
*
=======
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
>>>>>>>
*
<<<<<<<
<<<<<<< HEAD
*
=======
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
>>>>>>>
*
<<<<<<<
<<<<<<< HEAD
*
=======
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
>>>>>>>
*
<<<<<<<
*
<<<<<<< HEAD
=======
* @param element Webelement to be scrolled to
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
*
* @param element Webelement to be scrolled to
>>>>>>>
*
* @param element Webelement to be scrolled to
<<<<<<<
*
<<<<<<< HEAD
* @author Michal Nowierski
=======
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
*
>>>>>>>
*
<<<<<<<
*
<<<<<<< HEAD
=======
* @param elem1_location Location of WebElement (getLocation method)
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
*
* @param elem1_location Location of WebElement (getLocation method)
>>>>>>>
*
* @param elem1_location Location of WebElement (getLocation method)
<<<<<<<
*
<<<<<<< HEAD
=======
* @param IframeElemBy By selector of element to be hovered over
* @param IFrame IFrame where the element exists
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
*
* @param IframeElemBy By selector of element to be hovered over
* @param IFrame IFrame where the element exists
>>>>>>>
*
* @param IframeElemBy By selector of element to be hovered over
* @param IFrame IFrame where the element exists
<<<<<<<
*
<<<<<<< HEAD
=======
* @param x horrizontal move
* @param y vertical move
>>>>>>> a3f7d27... DAR-289: Added and changed selenium tests for DAR-136
=======
*
* @param x horrizontal move
* @param y vertical move
>>>>>>>
*
* @param x horrizontal move
* @param y vertical move
<<<<<<<
// does
// not contain full
// information,
// in such situation
// xmlResponseArr.length <
// 11
i++;
=======
// does
// not contain full
// information,
// in such situation
// xmlResponseArr.length <
// 11
>>>>>>>
// does
// not contain full
// information,
// in such situation
// xmlResponseArr.length <
// 11
<<<<<<<
public static void waitForWindow(String windowName, String comment){
=======
public static void waitForWindow(String windowName, String comment) {
>>>>>>>
public static void waitForWindow(String windowName, String comment) {
<<<<<<<
public static String resetForgotPasswordTime(String userName){
=======
public static String resetForgotPasswordTime(String userName) {
>>>>>>>
public static String resetForgotPasswordTime(String userName) { |
<<<<<<<
public static final String wikiDir = "wiki/";
public static final String wikiaDir = "Wikia";
=======
public static String WIKI_DIR = "wiki/";
public static String WIKIA_DIR = "Wikia";
>>>>>>>
public static final String WIKI_DIR = "wiki/";
public static final String WIKIA_DIR = "Wikia";
<<<<<<<
public static final String VideoGamesHubUrl = "/Video_Games";
public static final String EntertainmentHubUrl = "/Entertainment";
public static final String LifestyleHubUrl = "/Lifestyle";
=======
public static String VIDEOGAMES_HUB_URL = "/Video_Games";
public static String ENTERTAINMENT_HUB_URL = "/Entertainment";
public static String LIFESTYLE_HUB_URL = "/Lifestyle";
>>>>>>>
public static final String VIDEOGAMES_HUB_URL = "/Video_Games";
public static final String ENTERTAINMENT_HUB_URL = "/Entertainment";
public static final String LIFESTYLE_HUB_URL = "/Lifestyle";
<<<<<<<
public static final String fileNameSpace = "File:";
public static final String fileName001 = "Grammy_Muppet_Critics";
public static final String fileName002 = "New_Batman_Year_One_Clip";
=======
public static String FILE_NAMESPACE = "File:";
public static String FILENAME_001 = "Grammy_Muppet_Critics";
public static String FILENAME_002 = "New_Batman_Year_One_Clip";
>>>>>>>
public static final String FILE_NAMESPACE = "File:";
public static final String FILENAME_001 = "Grammy_Muppet_Critics";
public static final String FILENAME_002 = "New_Batman_Year_One_Clip";
<<<<<<<
public static final String historyAction = "action=history";
=======
public static String ACTION_HISTORY = "action=history";
>>>>>>>
public static final String ACTION_HISTORY = "action=history";
<<<<<<<
public static final String translatableLanguage = "uselang=qqx";
=======
public static String TRANSLATABLE_LANGUAGE = "uselang=qqx";
>>>>>>>
public static final String TRANSLATABLE_LANGUAGE = "uselang=qqx";
<<<<<<<
public static final String facebookDomain = "facebook.com";
public static final String twitterDomain = "twitter.com";
public static final String googleDomain = "accounts.google.com";
public static final String redditDomain = "reddit.com";
public static final String stumpleUponDomain = "stumbleupon.com";
=======
public static String FACEBOOK_DOMAIN = "facebook.com";
public static String TWITTER_DOMAIN = "twitter.com";
public static String GOOGLE_DOMAIN = "accounts.google.com";
public static String REDDIT_DOMAIN = "reddit.com";
public static String STUMPLEUPON_DOMAIN = "stumbleupon.com";
>>>>>>>
public static final String FACEBOOK_DOMAIN = "facebook.com";
public static final String TWITTER_DOMAIN = "twitter.com";
public static final String GOOGLE_DOMAIN = "accounts.google.com";
public static final String REDDIT_DOMAIN = "reddit.com";
public static final String STUMPLEUPON_DOMAIN = "stumbleupon.com";
<<<<<<<
public static final String facebookMainPage = "http://www.facebook.com/";
public static final String facebookSettingsPage = "http://www.facebook.com/settings";
public static final String facebookSettingsAppTab = "tab=applications";
public static final String facebookWikiaAppID = "112328095453510";
public static final String facebookWikiaDevAppID = "116800565037587";
=======
public static String FACEBOOK_MAINPAGE = "http://www.facebook.com/";
public static String FACEBOOK_SETTINGSPAGE = "http://www.facebook.com/settings";
public static String FACEBOOK_SETTINGS_APP_TAB = "tab=applications";
public static String FACEBOOK_WIKIA_APP_ID = "112328095453510";
public static String FACEBOOK_WIKIA_APP_DEV_ID = "116800565037587";
>>>>>>>
public static final String FACEBOOK_MAINPAGE = "http://www.facebook.com/";
public static final String FACEBOOK_SETTINGSPAGE = "http://www.facebook.com/settings";
public static final String FACEBOOK_SETTINGS_APP_TAB = "tab=applications";
public static final String FACEBOOK_WIKIA_APP_ID = "112328095453510";
public static final String FACEBOOK_WIKIA_APP_DEV_ID = "116800565037587";
<<<<<<<
public static final String avatarGeneric = "150px-Avatar.jpg";
=======
public static String AVATAR_GENERIC = "150px-Avatar.jpg";
>>>>>>>
public static final String AVATAR_GENERIC = "150px-Avatar.jpg";
<<<<<<<
public static final String embedMapEditPage = "wiki/EmbedMap?action=edit";
=======
public static final String EMBEDED_MAP_EDITPAGE = "wiki/EmbedMap?action=edit";
>>>>>>>
public static final String EMBEDED_MAP_EDITPAGE = "wiki/EmbedMap?action=edit"; |
<<<<<<<
public void SpecialVideos_001_Provider() {
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("review");
=======
public void SpecialVideos_001_Provider_qaart_518() {
>>>>>>>
public void SpecialVideos_001_Provider_qaart_518() {
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("review"); |
<<<<<<<
@Test
@Execute(onWikia = "mercuryautomationtesting")
public void VKWidgetTest_002_areLoaded() {
VKWidgetPageObject vkWidget = new VKWidgetPageObject(driver);
vkWidget
.create(2)
.navigate(wikiURL);
Assertion.assertTrue(
vkWidget.areLoadedOnOasis(),
MercuryMessages.INVISIBLE_MSG
);
}
=======
@Test(groups = "VKWidgetTest_003")
@Execute(onWikia = "mercuryautomationtesting")
public void VKWidgetTest_003_isErrorPresent() {
VKWidgetPageObject vkWidget = new VKWidgetPageObject(driver);
vkWidget.createIncorrectAndNavigate(wikiURL);
Assertion.assertTrue(vkWidget.isErrorPresent(), MercuryMessages.INVISIBLE_MSG);
}
>>>>>>>
@Test
@Execute(onWikia = "mercuryautomationtesting")
public void VKWidgetTest_002_areLoaded() {
VKWidgetPageObject vkWidget = new VKWidgetPageObject(driver);
vkWidget
.create(2)
.navigate(wikiURL);
Assertion.assertTrue(
vkWidget.areLoadedOnOasis(),
MercuryMessages.INVISIBLE_MSG
);
}
@Test(groups = "VKWidgetTest_003")
@Execute(onWikia = "mercuryautomationtesting")
public void VKWidgetTest_003_isErrorPresent() {
VKWidgetPageObject vkWidget = new VKWidgetPageObject(driver);
vkWidget.createIncorrectAndNavigate(wikiURL);
Assertion.assertTrue(vkWidget.isErrorPresent(), MercuryMessages.INVISIBLE_MSG);
} |
<<<<<<<
private String getArticleName() {
return executeScriptRet(WikiaGlobalVariables.wgPageName);
}
public void verifyArticleName(String targetText) {
Assertion.assertStringContains(getArticleName(), targetText);
PageObjectLogging.log(
"verifyArticleName",
"The article shows " + targetText,
true
);
}
=======
public void verifyNumberOfTop1kWikis(Integer numberOfWikis){
String pattern = "List of wikis with matched criteria ("+numberOfWikis+")";
waitForElementByElement(headerWhereIsMyExtensionPage);
PageObjectLogging.log(
"verifyNumberOfTop1kWikis",
"Verification of top 1k wikis",
true,
driver
);
Assertion.assertStringContains(pattern, headerWhereIsMyExtensionPage.getText());
}
>>>>>>>
private String getArticleName() {
return executeScriptRet(WikiaGlobalVariables.wgPageName);
}
public void verifyArticleName(String targetText) {
Assertion.assertStringContains(getArticleName(), targetText);
PageObjectLogging.log(
"verifyArticleName",
"The article shows " + targetText,
true
);
}
public void verifyNumberOfTop1kWikis(Integer numberOfWikis){
String pattern = "List of wikis with matched criteria ("+numberOfWikis+")";
waitForElementByElement(headerWhereIsMyExtensionPage);
PageObjectLogging.log(
"verifyNumberOfTop1kWikis",
"Verification of top 1k wikis",
true,
driver
);
Assertion.assertStringContains(pattern, headerWhereIsMyExtensionPage.getText());
} |
<<<<<<<
public enum ImageSize {
WIDTH,
HEIGHT
}
=======
public enum Transclusion {
INLINE("span[typeof='mw:Transclusion']"),
BLOCKED("div[typeof='mw:Transclusion']");
private String cssSelector;
private Transclusion(String cssSelector) {
this.cssSelector = cssSelector;
}
public String getCssSelector() {
return cssSelector;
}
}
>>>>>>>
public enum ImageSize {
WIDTH,
HEIGHT
}
public enum Transclusion {
INLINE("span[typeof='mw:Transclusion']"),
BLOCKED("div[typeof='mw:Transclusion']");
private String cssSelector;
private Transclusion(String cssSelector) {
this.cssSelector = cssSelector;
}
public String getCssSelector() {
return cssSelector;
}
} |
<<<<<<<
=======
@FindBy(css="button.close.wikia-chiclet-button")
protected WebElement closeModalButton;
@FindBy(css="#ca-ve-edit")
protected WebElement veEditButton;
@FindBy(css="body.ve")
protected WebElement veMode;
@FindBy(css=".editsection>a")
protected List<WebElement> sectionEditButtons;
>>>>>>>
@FindBy(css="#ca-ve-edit")
protected WebElement veEditButton;
@FindBy(css="body.ve")
protected WebElement veMode;
@FindBy(css=".editsection>a")
protected List<WebElement> sectionEditButtons;
<<<<<<<
public ArticlePageObject openLightboxArticle(String wikiURL) {
getUrl(wikiURL + URLsContent.lightboxSelenium);
return new ArticlePageObject(driver);
}
=======
public VisualEditorPageObject openNewArticleEditModeVisual(String wikiURL) {
getUrl(
urlBuilder.appendQueryStringToURL(
wikiURL + URLsContent.wikiDir + getNameForArticle(),
URLsContent.actionVisualEditParameter
)
);
return new VisualEditorPageObject(driver);
}
public VisualEditorPageObject openNewArticleEditModeVisualWithRedlink(String wikiURL) {
getUrl(
urlBuilder.appendQueryStringToURL(
urlBuilder.appendQueryStringToURL(
wikiURL + URLsContent.wikiDir + getNameForArticle(),
URLsContent.actionVisualEditParameter
),
URLsContent.redLink
)
);
return new VisualEditorPageObject(driver);
}
>>>>>>>
public VisualEditorPageObject openNewArticleEditModeVisual(String wikiURL) {
getUrl(
urlBuilder.appendQueryStringToURL(
wikiURL + URLsContent.wikiDir + getNameForArticle(),
URLsContent.actionVisualEditParameter
)
);
return new VisualEditorPageObject(driver);
}
public VisualEditorPageObject openNewArticleEditModeVisualWithRedlink(String wikiURL) {
getUrl(
urlBuilder.appendQueryStringToURL(
urlBuilder.appendQueryStringToURL(
wikiURL + URLsContent.wikiDir + getNameForArticle(),
URLsContent.actionVisualEditParameter
),
URLsContent.redLink
)
);
return new VisualEditorPageObject(driver);
} |
<<<<<<<
=======
private static String wikiaDomain;
private static String geoEdgeCountry;
>>>>>>>
private static String geoEdgeCountry; |
<<<<<<<
@RelatedIssue(issueID = "MAIN-4191")
=======
Credentials credentials = Configuration.getCredentials();
>>>>>>>
@RelatedIssue(issueID = "MAIN-4191")
<<<<<<<
new ArticlePageObject(driver).openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
VisualEditModePageObject visualEditMode =
new VisualEditModePageObject(driver).goToArticleDefaultContentEditPage(wikiURL,
articleTitle);
=======
String wikiURL = urlBuilder.getUrlForWiki("mobileregressiontesting");
WikiBasePageObject base = new WikiBasePageObject(driver);
base.logInCookie(credentials.userName, credentials.password, wikiURL);
base.openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
VisualEditModePageObject
visualEditMode =
base.goToArticleDefaultContentEditPage(wikiURL, articleTitle);
>>>>>>>
String wikiURL = urlBuilder.getUrlForWiki("mobileregressiontesting");
new ArticlePageObject(driver).openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
VisualEditModePageObject visualEditMode =
new VisualEditModePageObject(driver).goToArticleDefaultContentEditPage(wikiURL,
articleTitle);
<<<<<<<
new ArticlePageObject(driver).openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
VisualEditModePageObject visualEditMode =
new VisualEditModePageObject(driver).goToArticleDefaultContentEditPage(wikiURL,
articleTitle);
=======
String wikiURL = urlBuilder.getUrlForWiki("mobileregressiontesting");
WikiBasePageObject base = new WikiBasePageObject(driver);
base.logInCookie(credentials.userName, credentials.password, wikiURL);
base.openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
VisualEditModePageObject
visualEditMode =
base.goToArticleDefaultContentEditPage(wikiURL, articleTitle);
>>>>>>>
String wikiURL = urlBuilder.getUrlForWiki("mobileregressiontesting");
new ArticlePageObject(driver).openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
VisualEditModePageObject visualEditMode =
new VisualEditModePageObject(driver).goToArticleDefaultContentEditPage(wikiURL,
articleTitle);
<<<<<<<
new ArticlePageObject(driver).openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
VisualEditModePageObject visualEditMode =
new VisualEditModePageObject(driver).goToArticleDefaultContentEditPage(wikiURL,
articleTitle);
VetAddVideoComponentObject vetAddingVideo =
=======
String wikiURL = urlBuilder.getUrlForWiki("mobileregressiontesting");
WikiBasePageObject base = new WikiBasePageObject(driver);
base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
base.openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
VisualEditModePageObject
visualEditMode =
base.goToArticleDefaultContentEditPage(wikiURL, articleTitle);
VetAddVideoComponentObject
vetAddingVideo =
>>>>>>>
String wikiURL = urlBuilder.getUrlForWiki("mobileregressiontesting");
new ArticlePageObject(driver).openRandomArticle(wikiURL);
String articleTitle = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
VisualEditModePageObject visualEditMode =
new VisualEditModePageObject(driver).goToArticleDefaultContentEditPage(wikiURL,
articleTitle);
VetAddVideoComponentObject vetAddingVideo = |
<<<<<<<
//Preview url prefix
public static String previewPrefix = "http://preview";
=======
>>>>>>>
<<<<<<<
public static final String specialPreferences = "wiki/Special:Preferences";
=======
public static final String specialCreateBlogPage = "wiki/Special:CreateBlogPage";
public static final String specialPreferences = "wiki/Special:Preferences";
public static final String specialAdminDashboard = "wiki/Special:AdminDashboard";
public static final String specialCSS = "wiki/Special:CSS";
public static final String specialRandom = "wiki/Special:Random";
public static final String specialFollow = "wiki/Special:Following";
public static final String specialForum = "wiki/Special:Forum";
public static final String specialThemeDesigner = "wiki/Special:ThemeDesigner";
public static final String specialWikiActivity = "wiki/Special:WikiActivity";
public static final String specialEditAccount = "wiki/Special:EditAccount";
public static final String userMessageWall = "wiki/Message_Wall:";
public static final String specialMultiWikiFinderPage = "wiki/Special:Multiwikifinder";
public static final String logout = "wiki/Special:UserLogout?noexternals=1";
//Urls for mobile
public static final String mobileTestMainPage = "wiki/Mobileregressiontesting_Wiki";
public static final String articleSections = "wiki/Sections";
public static final String articleModal = "wiki/Modal";
public static final String articleComments = "wiki/Article_comments";
public static final String categoryPmg = "wiki/Category:PMG";
public static final String articleTopbar = "wiki/Topbar";
//Mediawiki Urls
public static final String mediaWikiCss = "MediaWiki:Wikia.css";
>>>>>>>
public static final String specialCreateBlogPage = "wiki/Special:CreateBlogPage";
public static final String specialPreferences = "wiki/Special:Preferences";
public static final String specialAdminDashboard = "wiki/Special:AdminDashboard";
public static final String specialCSS = "wiki/Special:CSS";
public static final String specialRandom = "wiki/Special:Random";
public static final String specialFollow = "wiki/Special:Following";
public static final String specialForum = "wiki/Special:Forum";
public static final String specialThemeDesigner = "wiki/Special:ThemeDesigner";
public static final String specialWikiActivity = "wiki/Special:WikiActivity";
public static final String specialEditAccount = "wiki/Special:EditAccount";
public static final String userMessageWall = "wiki/Message_Wall:";
public static final String specialMultiWikiFinderPage = "wiki/Special:Multiwikifinder";
public static final String logout = "wiki/Special:UserLogout?noexternals=1";
//Urls for mobile
public static final String mobileTestMainPage = "wiki/Mobileregressiontesting_Wiki";
public static final String articleSections = "wiki/Sections";
public static final String articleModal = "wiki/Modal";
public static final String articleComments = "wiki/Article_comments";
public static final String categoryPmg = "wiki/Category:PMG";
public static final String articleTopbar = "wiki/Topbar";
//Mediawiki Urls
public static final String mediaWikiCss = "MediaWiki:Wikia.css";
<<<<<<<
public static final String blogList = "wiki/Blog:%listName%";
=======
public static final String blogList = "wiki/Blog:%listName%/";
public static final String blogNameSpace = "wiki/User_blog:%userName%/";
// Mediawiki template url
public static final String templateNs = "Template";
public static final String templateUrl = "wiki/" + templateNs + ":%name%";
>>>>>>>
public static final String blogList = "wiki/Blog:%listName%/";
public static final String blogNameSpace = "wiki/User_blog:%userName%/";
// Mediawiki template url
public static final String templateNs = "Template";
public static final String templateUrl = "wiki/" + templateNs + ":%name%";
<<<<<<<
public static String buildUrl(String url, String parameter) {
String temp;
if (url.contains("?")) {
temp = url + "&" + parameter;
return temp;
} else {
temp = url + "?" + parameter;
return temp;
}
}
=======
>>>>>>>
<<<<<<<
public static String articleName002 = "TestVid002";
public static String articleName003 = "TestVid003";
public static String articleName004 = "TestVid004";
public static String intraWikiSearchPage = "wiki/Special:Search";
//query strings
public static String disableMessages = "uselang=qqx";
=======
public static String articleName002 = "TestVid003";
//External sites
public static String facebookDomain = "facebook.com";
public static String twitterDomain = "twitter.com";
public static String googleDomain = "accounts.google.com";
public static String redditDomain = "reddit.com";
public static String stumpleUponDomain = "stumbleupon.com";
>>>>>>>
public static String articleName002 = "TestVid002";
public static String articleName003 = "TestVid003";
public static String articleName004 = "TestVid004";
public static String intraWikiSearchPage = "wiki/Special:Search";
//query strings
public static String disableMessages = "uselang=qqx";
//External sites
public static String facebookDomain = "facebook.com";
public static String twitterDomain = "twitter.com";
public static String googleDomain = "accounts.google.com";
public static String redditDomain = "reddit.com";
public static String stumpleUponDomain = "stumbleupon.com"; |
<<<<<<<
import com.wikia.webdriver.common.core.annotations.ExecuteAs;
import com.wikia.webdriver.common.core.annotations.User;
=======
import org.testng.annotations.Test;
>>>>>>>
import org.testng.annotations.Test;
import com.wikia.webdriver.common.core.annotations.ExecuteAs;
import com.wikia.webdriver.common.core.annotations.User;
<<<<<<<
@Test(groups = {"Toolbar"})
public class ShareToolbarTests extends NewTestTemplateBeforeClass {
=======
public class ShareToolbarTests extends NewTestTemplate {
>>>>>>>
@Test(groups = {"Toolbar"})
public class ShareToolbarTests extends NewTestTemplate {
<<<<<<<
//SecurityError: Blocked a frame with origin "http://mediawiki119.wikia.com" from accessing a cross-origin frame.
@Test(enabled = false, groups = {"ShareToolbar003"})
=======
// SecurityError: Blocked a frame with origin "http://mediawiki119.wikia.com" from accessing a
// cross-origin frame.
@Test(enabled = false, groups = {"ShareToolbar003", "Toolbar"})
>>>>>>>
// SecurityError: Blocked a frame with origin "http://mediawiki119.wikia.com" from accessing a
// cross-origin frame.
@Test(enabled = false, groups = {"ShareToolbar003"}) |
<<<<<<<
import com.wikia.webdriver.common.core.configuration.Configuration;
=======
import com.wikia.webdriver.common.core.annotations.RelatedIssue;
>>>>>>>
import com.wikia.webdriver.common.core.annotations.RelatedIssue;
import com.wikia.webdriver.common.core.configuration.Configuration; |
<<<<<<<
private double getEffectiveDimension(int iBuffer) {
return partials[iBuffer * dimPartial + effectiveDimensionOffset];
}
@SuppressWarnings("unused")
private void setEffectiveDimension(int iBuffer, double effDim) {
partials[iBuffer * dimPartial + effectiveDimensionOffset] = effDim;
}
=======
private int getEffectiveDimension(int iBuffer) {
return partialsDimData[iBuffer];
}
private void setEffectiveDimension(int iBuffer, int effDim) {
partialsDimData[iBuffer] = effDim;
}
@Override
public void setPostOrderPartial(int bufferIndex, final double[] partial) {
super.setPostOrderPartial(bufferIndex, partial);
int effDim = 0;
for (int i = 0; i < dimTrait; i++) {
if (partial[dimTrait + i * (dimTrait + 1)] != 0) ++effDim;
}
partialsDimData[bufferIndex] = effDim;
}
>>>>>>>
private double getEffectiveDimension(int iBuffer) {
return partials[iBuffer * dimPartial + effectiveDimensionOffset];
}
@SuppressWarnings("unused")
private void setEffectiveDimension(int iBuffer, double effDim) {
partials[iBuffer * dimPartial + effectiveDimensionOffset] = effDim;
}
<<<<<<<
double effectiveDimension = getEffectiveDimension(iBuffer) + getEffectiveDimension(jBuffer);
remainder += -effectiveDimension * LOG_SQRT_2_PI;
=======
int dimensionChange = getEffectiveDimension(iBuffer) + getEffectiveDimension(jBuffer);
// int dimensionChange = ci.getEffectiveDimension() + cj.getEffectiveDimension()
// - ck.getEffectiveDimension();
//
// setEffectiveDimension(kBuffer, ck.getEffectiveDimension());
remainder += -dimensionChange * LOG_SQRT_2_PI;
>>>>>>>
double effectiveDimension = getEffectiveDimension(iBuffer) + getEffectiveDimension(jBuffer);
remainder += -effectiveDimension * LOG_SQRT_2_PI;
<<<<<<<
=======
// double detk = 0;
>>>>>>>
<<<<<<<
=======
// System.err.println("k status: " + ck);
>>>>>>>
<<<<<<<
assert !allZeroOrInfinite(Vip) : "Zero-length branch on data is not allowed.";
ci = safeInvert2(Vip, Pip, getDeterminant);
=======
assert !allZeroOrInfinite(Vip) : "Zero-length branch on data is not allowed.";
ci = safeInvert2(Vip, Pip, getDeterminant);
>>>>>>>
assert !allZeroOrInfinite(Vip) : "Zero-length branch on data is not allowed.";
ci = safeInvert2(Vip, Pip, getDeterminant);
<<<<<<<
final DenseMatrix64F tmp1 = matrix0;
CommonOps.add(Pi, Pdi, tmp1);
final DenseMatrix64F tmp2 = new DenseMatrix64F(dimTrait, dimTrait);
safeInvert2(tmp1, tmp2, false);
CommonOps.mult(tmp2, Pi, tmp1);
idMinusA(tmp1);
if (getDeterminant && getEffectiveDimension(iBuffer) == 0) ci = safeDeterminant(tmp1, false);
CommonOps.mult(Pi, tmp1, Pip);
if (getDeterminant && getEffectiveDimension(iBuffer) > 0) ci = safeDeterminant(Pip, false);
=======
final DenseMatrix64F tmp1 = matrix0;
// CommonOps.add(Pi, 1.0 / vi, Pd, PiPlusPd); // TODO Fix
CommonOps.add(Pi, Pdi, tmp1);
final DenseMatrix64F tmp2 = new DenseMatrix64F(dimTrait, dimTrait);
safeInvert2(tmp1, tmp2, false);
CommonOps.mult(tmp2, Pi, tmp1);
idMinusA(tmp1);
if (getDeterminant && getEffectiveDimension(iBuffer) == 0) ci = safeDeterminant(tmp1, false);
CommonOps.mult(Pi, tmp1, Pip);
if (getDeterminant && getEffectiveDimension(iBuffer) > 0) ci = safeDeterminant(Pip, false);
>>>>>>>
final DenseMatrix64F tmp1 = matrix0;
CommonOps.add(Pi, Pdi, tmp1);
final DenseMatrix64F tmp2 = new DenseMatrix64F(dimTrait, dimTrait);
safeInvert2(tmp1, tmp2, false);
CommonOps.mult(tmp2, Pi, tmp1);
idMinusA(tmp1);
if (getDeterminant && getEffectiveDimension(iBuffer) == 0) ci = safeDeterminant(tmp1, false);
CommonOps.mult(Pi, tmp1, Pip);
if (getDeterminant && getEffectiveDimension(iBuffer) > 0) ci = safeDeterminant(Pip, false);
<<<<<<<
=======
// return ck;
>>>>>>>
<<<<<<<
double dettot = (ctot.getReturnCode() == NOT_OBSERVED) ? 0 : ctot.getLogDeterminant();
final double logLike = -0.5 * dettot - 0.5 * SS;
=======
double dettot = (ctot.getReturnCode() == NOT_OBSERVED) ? 0 : ctot.getLogDeterminant();
final double logLike =
// - ctot.getEffectiveDimension() * LOG_SQRT_2_PI
// - 0.5 * Math.log(CommonOps.det(VTotal))
// + 0.5 * Math.log(CommonOps.det(PTotal))
- 0.5 * dettot
- 0.5 * SS;
>>>>>>>
double dettot = (ctot.getReturnCode() == NOT_OBSERVED) ? 0 : ctot.getLogDeterminant();
final double logLike = -0.5 * dettot - 0.5 * SS;
<<<<<<<
System.err.println("\n SS:" + SS);
System.err.println("det:" + dettot);
System.err.println("remainder:" + remainder);
System.err.println("likelihood" + (logLike + remainder));
=======
System.err.println("\n SS:" + SS);
System.err.println("det:" + dettot);
System.err.println("remainder:" + remainder);
System.err.println("likelihood" + (logLike + remainder));
// if (incrementOuterProducts) {
// System.err.println("Outer-products:" + wrap(outerProducts, dimTrait * dimTrait * trait, dimTrait, dimTrait));
// }
>>>>>>>
System.err.println("\n SS:" + SS);
System.err.println("det:" + dettot);
System.err.println("remainder:" + remainder);
System.err.println("likelihood" + (logLike + remainder));
<<<<<<<
double[] vectorPMk;
=======
double[] vectorPMk;
private int[] partialsDimData;
>>>>>>>
double[] vectorPMk; |
<<<<<<<
import com.wikia.webdriver.common.core.drivers.Browser;
import com.wikia.webdriver.common.core.helpers.Emulator;
=======
import com.wikia.webdriver.common.core.url.Page;
>>>>>>>
import com.wikia.webdriver.common.core.drivers.Browser;
import com.wikia.webdriver.common.core.helpers.Emulator;
import com.wikia.webdriver.common.core.url.Page; |
<<<<<<<
@Test(groups = "MercurySpotifyWidgetTest_004")
@Execute(onWikia = "mercuryautomationtesting")
public void MercurySpotifyWidgetTest_004_areLoadedOnFirstVisitDirectlyFromUrl() {
SpotifyWidgetPageObject spotifyWidget = new SpotifyWidgetPageObject(driver);
spotifyWidget
.create(2)
.navigate(wikiURL);
Assertion.assertTrue(spotifyWidget.areLoadedOnMercury(), MercuryMessages.INVISIBLE_MSG);
}
=======
@Test(groups = "MercurySpotifyWidgetTest_005")
@Execute(onWikia = "mercuryautomationtesting")
public void MercurySpotifyWidgetTest_005_isErrorPresent() {
SpotifyWidgetPageObject spotifyWidget = new SpotifyWidgetPageObject(driver);
spotifyWidget.createIncorrectAndNavigate(wikiURL);
Assertion.assertTrue(spotifyWidget.isErrorPresent(), MercuryMessages.INVISIBLE_MSG);
}
>>>>>>>
@Test(groups = "MercurySpotifyWidgetTest_004")
@Execute(onWikia = "mercuryautomationtesting")
public void MercurySpotifyWidgetTest_004_areLoadedOnFirstVisitDirectlyFromUrl() {
SpotifyWidgetPageObject spotifyWidget = new SpotifyWidgetPageObject(driver);
spotifyWidget
.create(2)
.navigate(wikiURL);
Assertion.assertTrue(spotifyWidget.areLoadedOnMercury(), MercuryMessages.INVISIBLE_MSG);
}
@Test(groups = "MercurySpotifyWidgetTest_005")
@Execute(onWikia = "mercuryautomationtesting")
public void MercurySpotifyWidgetTest_005_isErrorPresent() {
SpotifyWidgetPageObject spotifyWidget = new SpotifyWidgetPageObject(driver);
spotifyWidget.createIncorrectAndNavigate(wikiURL);
Assertion.assertTrue(spotifyWidget.isErrorPresent(), MercuryMessages.INVISIBLE_MSG);
} |
<<<<<<<
import org.openqa.selenium.WebElement;
=======
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
>>>>>>>
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
<<<<<<<
public boolean areLoadedOnMercury() {
boolean result = areTagsLoadedOnMercury();
PageObjectLogging.log(getTagName(), MercuryMessages.VISIBLE_MSG, result);
return result;
}
public boolean areLoadedOnOasis() {
boolean result = areTagsLoadedOnOasis();
PageObjectLogging.log(getTagName(), MercuryMessages.VISIBLE_MSG, result);
return result;
}
public boolean isWidgetVisible(WebElement widgetIframe, WebElement widgetBody) {
if (!isElementVisible(widgetIframe)) {
return false;
}
driver.switchTo().frame(widgetIframe);
boolean result = isElementVisible(widgetBody);
driver.switchTo().parentFrame();
return result;
}
=======
public WidgetPageObject createIncorrectAndNavigate(String wikiURL) {
return createIncorrect().navigate(wikiURL);
}
public boolean isErrorPresent() {
boolean result = isElementVisible(error) && error.getText().equals(getErrorMessage());
PageObjectLogging.log(getTagName(), MercuryMessages.VISIBLE_MSG, result);
return result;
}
>>>>>>>
public boolean areLoadedOnMercury() {
boolean result = areTagsLoadedOnMercury();
PageObjectLogging.log(getTagName(), MercuryMessages.VISIBLE_MSG, result);
return result;
}
public boolean areLoadedOnOasis() {
boolean result = areTagsLoadedOnOasis();
PageObjectLogging.log(getTagName(), MercuryMessages.VISIBLE_MSG, result);
return result;
}
public boolean isWidgetVisible(WebElement widgetIframe, WebElement widgetBody) {
if (!isElementVisible(widgetIframe)) {
return false;
}
driver.switchTo().frame(widgetIframe);
boolean result = isElementVisible(widgetBody);
driver.switchTo().parentFrame();
return result;
}
public WidgetPageObject createIncorrectAndNavigate(String wikiURL) {
return createIncorrect().navigate(wikiURL);
}
public boolean isErrorPresent() {
boolean result = isElementVisible(error) && error.getText().equals(getErrorMessage());
PageObjectLogging.log(getTagName(), MercuryMessages.VISIBLE_MSG, result);
return result;
} |
<<<<<<<
private CrossWikiSearchProvider() {
}
@DataProvider
public static final Object[][] getExactMatchQueries() {
return new Object[][]{
{
"call of duty", "Call of Duty Wiki", "VIDEO GAMES"
}, {
"call-of-duty", "Call of Duty Wiki", "VIDEO GAMES"
}, {
"call_of_duty", "Call of Duty Wiki", "VIDEO GAMES"
}, {
"callofduty", "Call of Duty Wiki", "VIDEO GAMES"
}, {
"cod", "Call of Duty Wiki", "VIDEO GAMES"
},
};
}
=======
>>>>>>>
private CrossWikiSearchProvider() {
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.