repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
Terasology/Cities | src/main/java/org/terasology/cities/deco/ColumnDecoration.java | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
| import com.google.common.base.Preconditions;
import org.joml.Vector3i;
import org.joml.Vector3ic;
import org.terasology.cities.BlockType;
import org.terasology.engine.math.Side;
import java.util.List; | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
// Path: src/main/java/org/terasology/cities/deco/ColumnDecoration.java
import com.google.common.base.Preconditions;
import org.joml.Vector3i;
import org.joml.Vector3ic;
import org.terasology.cities... | private final List<BlockType> blocks; |
Terasology/Cities | src/main/java/org/terasology/cities/raster/ImageRasterTarget.java | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
//
// Path: src/main/java/org/terasology/cities/DefaultBlockType.java
// public enum DefaultBlockType implements BlockType {
//
// /**
// * Air
// */
// AIR,
//
// /**
// ... | import com.google.common.base.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.cities.BlockType;
import org.terasology.cities.DefaultBlockType;
import org.terasology.engine.math.Side;
import org.terasology.engine.world.block.BlockArea;
import org.terasology.engine.world.block.Blo... | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
//
// Path: src/main/java/org/terasology/cities/DefaultBlockType.java
// public enum DefaultBlockType implements BlockType {
//
// /**
// * Air
// */
// AIR,
//
// /**
// ... | private final Function<BlockType, Color> blockColor; |
Terasology/Cities | src/main/java/org/terasology/cities/raster/ImageRasterTarget.java | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
//
// Path: src/main/java/org/terasology/cities/DefaultBlockType.java
// public enum DefaultBlockType implements BlockType {
//
// /**
// * Air
// */
// AIR,
//
// /**
// ... | import com.google.common.base.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.cities.BlockType;
import org.terasology.cities.DefaultBlockType;
import org.terasology.engine.math.Side;
import org.terasology.engine.world.block.BlockArea;
import org.terasology.engine.world.block.Blo... | int lz = z - wz;
// TODO: remove
final boolean debugging = true;
final boolean warnOnly = true;
if (debugging) {
boolean xOk = lx >= 0 && lx < image.getWidth();
boolean yOk = y >= getMinHeight() && y < getMaxHeight();
boolean zOk = lz >= 0 && ... | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
//
// Path: src/main/java/org/terasology/cities/DefaultBlockType.java
// public enum DefaultBlockType implements BlockType {
//
// /**
// * Air
// */
// AIR,
//
// /**
// ... | if (type == DefaultBlockType.AIR) { |
Terasology/Cities | src/main/java/org/terasology/cities/window/RectWindow.java | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
//
// Path: src/main/java/org/terasology/cities/DefaultBlockType.java
// public enum DefaultBlockType implements BlockType {
//
// /**
// * Air
// */
// AIR,
//
// /**
// ... | import org.terasology.cities.BlockType;
import org.terasology.cities.DefaultBlockType;
import org.terasology.commonworld.Orientation;
import org.terasology.engine.world.block.BlockArea;
import org.terasology.engine.world.block.BlockAreac; | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
//
// Path: src/main/java/org/terasology/cities/DefaultBlockType.java
// public enum DefaultBlockType implements BlockType {
//
// /**
// * Air
// */
// AIR,
//
// /**
// ... | private BlockType blockType; |
Terasology/Cities | src/main/java/org/terasology/cities/window/RectWindow.java | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
//
// Path: src/main/java/org/terasology/cities/DefaultBlockType.java
// public enum DefaultBlockType implements BlockType {
//
// /**
// * Air
// */
// AIR,
//
// /**
// ... | import org.terasology.cities.BlockType;
import org.terasology.cities.DefaultBlockType;
import org.terasology.commonworld.Orientation;
import org.terasology.engine.world.block.BlockArea;
import org.terasology.engine.world.block.BlockAreac; | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
//
// Path: src/main/java/org/terasology/cities/DefaultBlockType.java
// public enum DefaultBlockType implements BlockType {
//
// /**
// * Air
// */
// AIR,
//
// /**
// ... | this(orientation, area, baseHeight, topHeight, DefaultBlockType.AIR); |
Terasology/Cities | src/main/java/org/terasology/cities/bldg/SimpleRoundHouse.java | // Path: src/main/java/org/terasology/cities/model/roof/ConicRoof.java
// public class ConicRoof extends AbstractRoof {
//
// private int pitch;
// private Circlef area;
//
//
// /**
// * @param center
// * @param radius
// * @param baseHeight
// * @param pitch
// */
// publi... | import org.joml.Vector2ic;
import org.terasology.cities.model.roof.ConicRoof;
import org.terasology.commonworld.Orientation;
import org.terasology.joml.geom.Circlef; | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/model/roof/ConicRoof.java
// public class ConicRoof extends AbstractRoof {
//
// private int pitch;
// private Circlef area;
//
//
// /**
// * @param center
// * @param radius
// * @param baseHeight
// * @param pitch
// */
// publi... | new ConicRoof(center, radius + 1, baseHeight + wallHeight, 1), |
Terasology/Cities | src/main/java/org/terasology/cities/raster/ChunkRasterTarget.java | // Path: src/main/java/org/terasology/cities/BlockTheme.java
// public final class BlockTheme implements Function<BlockType, Block> {
//
// private static final Logger logger = LoggerFactory.getLogger(BlockTheme.class);
//
// private final Map<BlockType, Block> blockMap;
// private final Map<BlockType, Bl... | import com.google.common.base.Preconditions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.cities.BlockTheme;
import org.terasology.cities.BlockType;
import org.terasology.engine.math.Side;
import org.terasology.engine.world.block.Block;
import org.terasology.engine.world.block.BlockAre... | // Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.cities.raster;
/**
* Converts model elements into blocks of of a chunk
*/
public class ChunkRasterTarget implements RasterTarget {
private static final Logger logger = LoggerFactory.getLogger(ChunkRaster... | // Path: src/main/java/org/terasology/cities/BlockTheme.java
// public final class BlockTheme implements Function<BlockType, Block> {
//
// private static final Logger logger = LoggerFactory.getLogger(BlockTheme.class);
//
// private final Map<BlockType, Block> blockMap;
// private final Map<BlockType, Bl... | private final BlockTheme blockTheme; |
Terasology/Cities | src/main/java/org/terasology/cities/bldg/AbstractBuildingPart.java | // Path: src/main/java/org/terasology/cities/deco/Decoration.java
// public interface Decoration {
// // empty
// }
//
// Path: src/main/java/org/terasology/cities/door/Door.java
// public interface Door {
// // empty marker interface
// }
//
// Path: src/main/java/org/terasology/cities/model/roof/Roof.java
/... | import com.google.common.collect.Sets;
import org.terasology.cities.deco.Decoration;
import org.terasology.cities.door.Door;
import org.terasology.cities.model.roof.Roof;
import org.terasology.cities.window.Window;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set; | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/deco/Decoration.java
// public interface Decoration {
// // empty
// }
//
// Path: src/main/java/org/terasology/cities/door/Door.java
// public interface Door {
// // empty marker interface
// }
//
// Path: src/main/java/org/terasology/cities/model/roof/Roof.java
/... | private final Set<Door> doors = Sets.newHashSet(); |
Terasology/Cities | src/main/java/org/terasology/cities/bldg/AbstractBuildingPart.java | // Path: src/main/java/org/terasology/cities/deco/Decoration.java
// public interface Decoration {
// // empty
// }
//
// Path: src/main/java/org/terasology/cities/door/Door.java
// public interface Door {
// // empty marker interface
// }
//
// Path: src/main/java/org/terasology/cities/model/roof/Roof.java
/... | import com.google.common.collect.Sets;
import org.terasology.cities.deco.Decoration;
import org.terasology.cities.door.Door;
import org.terasology.cities.model.roof.Roof;
import org.terasology.cities.window.Window;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set; | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/deco/Decoration.java
// public interface Decoration {
// // empty
// }
//
// Path: src/main/java/org/terasology/cities/door/Door.java
// public interface Door {
// // empty marker interface
// }
//
// Path: src/main/java/org/terasology/cities/model/roof/Roof.java
/... | private final Set<Decoration> decorations = new HashSet<>(); |
Terasology/Cities | src/main/java/org/terasology/cities/bldg/AbstractBuildingPart.java | // Path: src/main/java/org/terasology/cities/deco/Decoration.java
// public interface Decoration {
// // empty
// }
//
// Path: src/main/java/org/terasology/cities/door/Door.java
// public interface Door {
// // empty marker interface
// }
//
// Path: src/main/java/org/terasology/cities/model/roof/Roof.java
/... | import com.google.common.collect.Sets;
import org.terasology.cities.deco.Decoration;
import org.terasology.cities.door.Door;
import org.terasology.cities.model.roof.Roof;
import org.terasology.cities.window.Window;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set; | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/deco/Decoration.java
// public interface Decoration {
// // empty
// }
//
// Path: src/main/java/org/terasology/cities/door/Door.java
// public interface Door {
// // empty marker interface
// }
//
// Path: src/main/java/org/terasology/cities/model/roof/Roof.java
/... | private final Roof roof; |
Terasology/Cities | src/main/java/org/terasology/cities/deco/SingleBlockDecoration.java | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
| import org.joml.Vector3i;
import org.joml.Vector3ic;
import org.terasology.cities.BlockType;
import org.terasology.engine.math.Side; | /*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | // Path: src/main/java/org/terasology/cities/BlockType.java
// public interface BlockType {
// // empty marker
// }
// Path: src/main/java/org/terasology/cities/deco/SingleBlockDecoration.java
import org.joml.Vector3i;
import org.joml.Vector3ic;
import org.terasology.cities.BlockType;
import org.terasology.engine... | private BlockType type; |
compomics/jsparklines | src/main/java/no/uib/jsparklines/extra/ChromosomeTableCellRenderer.java | // Path: src/main/java/no/uib/jsparklines/data/Chromosome.java
// public class Chromosome implements Comparable<Chromosome>, Serializable {
//
// /**
// * The version UID for Serialization/Deserialization compatibility.
// */
// static final long serialVersionUID = 2505328876343336528L;
// ... | import java.awt.Color;
import java.awt.Component;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import no.uib.jsparklines.data.Chromosome; |
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JComponent c = (JComponent) new DefaultTableCellRenderer().getTableCellRendererComponent(table, value,
isSelected, hasFocus, row, column);
... | // Path: src/main/java/no/uib/jsparklines/data/Chromosome.java
// public class Chromosome implements Comparable<Chromosome>, Serializable {
//
// /**
// * The version UID for Serialization/Deserialization compatibility.
// */
// static final long serialVersionUID = 2505328876343336528L;
// ... | if (value != null && value instanceof Chromosome) { |
compomics/jsparklines | src/main/java/no/uib/jsparklines/renderers/JSparklinesMultiIntervalChartTableCellRenderer.java | // Path: src/main/java/no/uib/jsparklines/renderers/util/GradientColorCoding.java
// public enum ColorGradient {
//
// /**
// * Red via black to green.
// */
// RedBlackGreen,
// /**
// * Green via black to red.
// */
// GreenBlackRed,
// /**
// * Green via black to blue.... | import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.util.ArrayList;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.... | */
public void showReferenceLine(boolean showReferenceLine) {
this.showReferenceLine = showReferenceLine;
}
/**
* If true, a black reference line is shown in the middle of the plot.
*
* @param showReferenceLine if true, a reference line is shown in the
* middle of the plot
... | // Path: src/main/java/no/uib/jsparklines/renderers/util/GradientColorCoding.java
// public enum ColorGradient {
//
// /**
// * Red via black to green.
// */
// RedBlackGreen,
// /**
// * Green via black to red.
// */
// GreenBlackRed,
// /**
// * Green via black to blue.... | public void setGradientColoring(ColorGradient colorGradient) { |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/UtilTestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/windivert/DeployHandler.java
// public class DeployHandler {
//
// public static int BUFFER_SIZE = 512;
//
//
// /**
// * Copies all bytes from source to sink streams.
// *
// * @param source The source stream to copy from.
// * @param... | import com.github.ffalcinelli.jdivert.windivert.DeployHandler;
import org.junit.Test;
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.parseHexBinary;
import static com.github.ffalcinelli.jdivert.Util.printHexBinary;
import static org.junit.Assert.*; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/windivert/DeployHandler.java
// public class DeployHandler {
//
// public static int BUFFER_SIZE = 512;
//
//
// /**
// * Copies all bytes from source to sink streams.
// *
// * @param source The source stream to copy from.
// * @param... | assertNotNull(new DeployHandler()); |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/headers/UDPIPv4TestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static byte[] parseHexBinary(String s) {
// final int len = s.length();
//
// // "111" is not a valid hex encoding.
// if (len % 2 != 0)
// throw new IllegalArgumentException("hexBinary needs to be even-length: " + s);
//
//... | import org.junit.Before;
import org.junit.Test;
import static com.github.ffalcinelli.jdivert.Enums.Protocol.UDP;
import static com.github.ffalcinelli.jdivert.Util.parseHexBinary;
import static org.junit.Assert.*; | udp.setSrcPort(50000);
assertEquals(50000, udp.getSrcPort());
assertTrue(udp.toString().contains("srcPort=" + 50000));
}
@Test
public void dstPort() {
assertEquals(53, udp.getDstPort());
udp.setDstPort(50000);
assertEquals(50000, udp.getDstPort());
as... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static byte[] parseHexBinary(String s) {
// final int len = s.length();
//
// // "111" is not a valid hex encoding.
// if (len % 2 != 0)
// throw new IllegalArgumentException("hexBinary needs to be even-length: " + s);
//
//... | assertArrayEquals(parseHexBinary(payload), udp.getData()); |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/PacketTestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/exceptions/WinDivertException.java
// public class WinDivertException extends Exception {
// protected int code;
// protected String message;
// protected LastErrorException lee;
//
// public WinDivertException(int code) {
// this(code, Kern... | import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.*;
import com.github.ffalcinelli.jdivert.exceptions.WinDivertException;
import com.github.ffalcinelli.jdivert.windivert.WinDivertAddress;
import com.sun.jna.platform.win32.WinDef;
import org.junit.Before;
import org.junit.Test;
import ja... | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/exceptions/WinDivertException.java
// public class WinDivertException extends Exception {
// protected int code;
// protected String message;
// protected LastErrorException lee;
//
// public WinDivertException(int code) {
// this(code, Kern... | WinDivertAddress addr; |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/PacketTestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/exceptions/WinDivertException.java
// public class WinDivertException extends Exception {
// protected int code;
// protected String message;
// protected LastErrorException lee;
//
// public WinDivertException(int code) {
// this(code, Kern... | import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.*;
import com.github.ffalcinelli.jdivert.exceptions.WinDivertException;
import com.github.ffalcinelli.jdivert.windivert.WinDivertAddress;
import com.sun.jna.platform.win32.WinDef;
import org.junit.Before;
import org.junit.Test;
import ja... | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/exceptions/WinDivertException.java
// public class WinDivertException extends Exception {
// protected int code;
// protected String message;
// protected LastErrorException lee;
//
// public WinDivertException(int code) {
// this(code, Kern... | raw = parseHexBinary("45000051476040008006f005c0a856a936f274fdd84201bb0876cfd0c19f9320501800ff8dba0000170303" + |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Icmpv4.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static String printHexBinary(ByteBuffer data) {
// return printHexBinary(getBytesAtOffset(data, 0, data.capacity()));
// }
| import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.printHexBinary; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static String printHexBinary(ByteBuffer data) {
// return printHexBinary(getBytesAtOffset(data, 0, data.capacity()));
// }
// Path: src/main/java/com/github/ffalcinelli/jdivert/headers/Icmpv4.java
import java.nio.ByteBuffer;
import static c... | , printHexBinary(getRestOfHeader()) |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Icmpv6.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static String printHexBinary(ByteBuffer data) {
// return printHexBinary(getBytesAtOffset(data, 0, data.capacity()));
// }
| import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.printHexBinary; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static String printHexBinary(ByteBuffer data) {
// return printHexBinary(getBytesAtOffset(data, 0, data.capacity()));
// }
// Path: src/main/java/com/github/ffalcinelli/jdivert/headers/Icmpv6.java
import java.nio.ByteBuffer;
import static c... | , printHexBinary(getMessageBody()) |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/headers/UDPIPv6TestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static byte[] parseHexBinary(String s) {
// final int len = s.length();
//
// // "111" is not a valid hex encoding.
// if (len % 2 != 0)
// throw new IllegalArgumentException("hexBinary needs to be even-length: " + s);
//
//... | import org.junit.Before;
import org.junit.Test;
import static com.github.ffalcinelli.jdivert.Enums.Protocol.UDP;
import static com.github.ffalcinelli.jdivert.Util.parseHexBinary;
import static org.junit.Assert.*; | public void buildHeadersBis() {
Header[] headers = Header.buildHeaders(rawData);
assertEquals(udp, headers[1]);
}
@Test
public void srcPort() {
assertEquals(srcPort, udp.getSrcPort());
udp.setSrcPort(50000);
assertEquals(50000, udp.getSrcPort());
assertTr... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static byte[] parseHexBinary(String s) {
// final int len = s.length();
//
// // "111" is not a valid hex encoding.
// if (len % 2 != 0)
// throw new IllegalArgumentException("hexBinary needs to be even-length: " + s);
//
//... | assertArrayEquals(parseHexBinary(payload), udp.getData()); |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/headers/IPTestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | import org.junit.Before;
import org.junit.Test;
import java.nio.ByteBuffer;
import java.util.Arrays;
import static com.github.ffalcinelli.jdivert.Enums.Protocol;
import static com.github.ffalcinelli.jdivert.Util.parseHexBinary;
import static org.junit.Assert.*; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | protected Protocol protocol; |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/headers/IPTestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | import org.junit.Before;
import org.junit.Test;
import java.nio.ByteBuffer;
import java.util.Arrays;
import static com.github.ffalcinelli.jdivert.Enums.Protocol;
import static com.github.ffalcinelli.jdivert.Util.parseHexBinary;
import static org.junit.Assert.*; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | rawData = parseHexBinary(rawDataHexString); |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Ip.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Enums.Protocol; | return null;
}
}
public void setDstAddr(T address) {
setInetAddressAtOffset(dstAddrOffset, address);
}
public String getSrcAddrStr() {
InetAddress address = getSrcAddr();
return address != null ? address.getHostAddress() : null;
}
public void setSrc... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | public abstract Protocol getNextHeaderProtocol(); |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Icmp.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// return value & 0x0000ffff;
// }
| import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.unsigned; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// return value & 0x0000ffff;
// }
// Path: src/main/java/com/github/ffalcinelli/jdivert/headers/Icmp.java
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.unsigned;
/*
* Cop... | return unsigned(raw.getShort(start + 2)); |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/LiveCaptureTestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/exceptions/WinDivertException.java
// public class WinDivertException extends Exception {
// protected int code;
// protected String message;
// protected LastErrorException lee;
//
// public WinDivertException(int code) {
// this(code, Kern... | import com.github.ffalcinelli.jdivert.exceptions.WinDivertException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.*;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import static com.github.ffalcinelli.jdivert.headers.Tcp.Flag.FIN;
import stat... | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/exceptions/WinDivertException.java
// public class WinDivertException extends Exception {
// protected int code;
// protected String message;
// protected LastErrorException lee;
//
// public WinDivertException(int code) {
// this(code, Kern... | public void passThrough() throws WinDivertException, InterruptedException { |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Ipv6.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | import java.net.Inet6Address;
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Enums.Protocol;
import static com.github.ffalcinelli.jdivert.Util.unsigned; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | public Protocol getNextHeaderProtocol() { |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Ipv6.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | import java.net.Inet6Address;
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Enums.Protocol;
import static com.github.ffalcinelli.jdivert.Util.unsigned; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | return unsigned(raw.getShort(4)); |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Udp.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static String printHexBinary(ByteBuffer data) {
// return printHexBinary(getBytesAtOffset(data, 0, data.capacity()));
// }
//
// Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// ... | import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.printHexBinary;
import static com.github.ffalcinelli.jdivert.Util.unsigned; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static String printHexBinary(ByteBuffer data) {
// return printHexBinary(getBytesAtOffset(data, 0, data.capacity()));
// }
//
// Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// ... | return unsigned(raw.getShort(start + 4)); |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Udp.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static String printHexBinary(ByteBuffer data) {
// return printHexBinary(getBytesAtOffset(data, 0, data.capacity()));
// }
//
// Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// ... | import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.printHexBinary;
import static com.github.ffalcinelli.jdivert.Util.unsigned; | }
public int getChecksum() {
return unsigned(raw.getShort(start + 6));
}
public void setChecksum(int cksum) {
raw.putShort(start + 6, (short) cksum);
}
@Override
public int getHeaderLength() {
return 8;
}
public byte[] getData() {
return getBytesAt... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static String printHexBinary(ByteBuffer data) {
// return printHexBinary(getBytesAtOffset(data, 0, data.capacity()));
// }
//
// Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// ... | , printHexBinary(getData()) |
ffalcinelli/jdivert | src/test/java/com/github/ffalcinelli/jdivert/WinDivertTestCase.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/exceptions/WinDivertException.java
// public class WinDivertException extends Exception {
// protected int code;
// protected String message;
// protected LastErrorException lee;
//
// public WinDivertException(int code) {
// this(code, Kern... | import com.github.ffalcinelli.jdivert.exceptions.WinDivertException;
import org.junit.After;
import org.junit.Test;
import java.util.Random;
import static com.github.ffalcinelli.jdivert.Enums.Flag.*;
import static com.github.ffalcinelli.jdivert.Enums.Layer.NETWORK;
import static org.junit.Assert.*; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/exceptions/WinDivertException.java
// public class WinDivertException extends Exception {
// protected int code;
// protected String message;
// protected LastErrorException lee;
//
// public WinDivertException(int code) {
// this(code, Kern... | public void open() throws WinDivertException { |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Ipv4.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | import java.net.Inet4Address;
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Enums.Protocol;
import static com.github.ffalcinelli.jdivert.Util.unsigned;
import static com.github.ffalcinelli.jdivert.Util.zeroPadArray; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | return unsigned(raw.getShort(2)); |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Ipv4.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | import java.net.Inet4Address;
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Enums.Protocol;
import static com.github.ffalcinelli.jdivert.Util.unsigned;
import static com.github.ffalcinelli.jdivert.Util.zeroPadArray; | }
public int getIHL() {
return (raw.get(0) & 0x0F);
}
public void setIHL(int length) {
byte first = (byte) (getVersion() << 4);
byte second = (byte) (length & 0x0F);
raw.put(0, (byte) (first | second));
}
public int getTotalLength() {
return unsigned(r... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | public Protocol getNextHeaderProtocol() { |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Ipv4.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | import java.net.Inet4Address;
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Enums.Protocol;
import static com.github.ffalcinelli.jdivert.Util.unsigned;
import static com.github.ffalcinelli.jdivert.Util.zeroPadArray; | }
public int getChecksum() {
return unsigned(raw.getShort(10));
}
public void setChecksum(int cksum) {
raw.putShort(10, (short) cksum);
}
public boolean is(Flag flag) {
return getFlag(6, flag.ordinal() + 5);
}
public void set(Flag flag, boolean value) {
... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Enums.java
// public enum Protocol {
// HOPOPT(0), ICMP(1), TCP(6), UDP(17), ROUTING(43), FRAGMENT(44), AH(51), ICMPV6(58), NONE(59), DSTOPTS(60);
// private int value;
//
// Protocol(int value) {
// this.value = value;
// }
//
// publi... | setBytesAtOffset(20, delta, zeroPadArray(options, delta)); |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Transport.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// return value & 0x0000ffff;
// }
| import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.unsigned; | /*
* Copyright (c) Fabio Falcinelli 2016.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// return value & 0x0000ffff;
// }
// Path: src/main/java/com/github/ffalcinelli/jdivert/headers/Transport.java
import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.unsigned;
/*
... | return unsigned(raw.getShort(start)); |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Tcp.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// return value & 0x0000ffff;
// }
//
// Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static byte[] zeroPadArray(byte[] source, int size) {
// byte[] data = new byte[size];
// ... | import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.unsigned;
import static com.github.ffalcinelli.jdivert.Util.zeroPadArray;
import static com.github.ffalcinelli.jdivert.headers.Tcp.Flag.NS; | raw.put(start + 12, (byte) ((getDataOffset() << 4) | (reserved << 1) | (is(NS) ? 0x01 : 0x00)));
}
public boolean is(Flag flag) {
if (flag == NS) {
return getFlag(start + 12, 0);
} else {
//Starts by 8 since NS belongs to the previous byte
return getF... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// return value & 0x0000ffff;
// }
//
// Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static byte[] zeroPadArray(byte[] source, int size) {
// byte[] data = new byte[size];
// ... | return unsigned(raw.getShort(start + 14)); |
ffalcinelli/jdivert | src/main/java/com/github/ffalcinelli/jdivert/headers/Tcp.java | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// return value & 0x0000ffff;
// }
//
// Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static byte[] zeroPadArray(byte[] source, int size) {
// byte[] data = new byte[size];
// ... | import java.nio.ByteBuffer;
import static com.github.ffalcinelli.jdivert.Util.unsigned;
import static com.github.ffalcinelli.jdivert.Util.zeroPadArray;
import static com.github.ffalcinelli.jdivert.headers.Tcp.Flag.NS; | raw.putShort(start + 14, (short) windowSize);
}
public int getChecksum() {
return unsigned(raw.getShort(start + 16));
}
public void setChecksum(int cksum) {
raw.putShort(start + 16, (short) cksum);
}
public int getUrgentPointer() {
return unsigned(raw.getShort(... | // Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static int unsigned(short value) {
// return value & 0x0000ffff;
// }
//
// Path: src/main/java/com/github/ffalcinelli/jdivert/Util.java
// public static byte[] zeroPadArray(byte[] source, int size) {
// byte[] data = new byte[size];
// ... | setBytesAtOffset(start + 20, delta, zeroPadArray(options, delta)); |
MSaifAsif/sample-skeleton-projects | web-api/RESTEasy/src/test/java/com/sample/tests/TestUtils.java | // Path: web-api/RESTEasy/src/main/java/com/sample/utilities/TransformationUtils.java
// public class TransformationUtils {
//
// private TransformationUtils() {
// // Dont init
// }
//
// /**
// * Get sum of bytes
// *
// * @return
// */
// public static String getSumOfByt... | import com.sample.utilities.TransformationUtils;
import org.junit.Test;
import static org.junit.Assert.assertNotNull; | package com.sample.tests;
public class TestUtils {
@Test
public void testRandomMethod() { | // Path: web-api/RESTEasy/src/main/java/com/sample/utilities/TransformationUtils.java
// public class TransformationUtils {
//
// private TransformationUtils() {
// // Dont init
// }
//
// /**
// * Get sum of bytes
// *
// * @return
// */
// public static String getSumOfByt... | assertNotNull(TransformationUtils.getSumOfBytes()); |
MSaifAsif/sample-skeleton-projects | datastore/sql/JPA/src/main/java/com/jpa/dao/GenericHibernateDAO.java | // Path: datastore/sql/JPA/src/main/java/com/jpa/util/HibernateUtil.java
// @SuppressWarnings({"unchecked", "rawtypes", "unused"})
// public class HibernateUtil {
//
// private static final Logger log = Logger.getLogger(HibernateUtil.class);
//
// /*
// * Since we will be using annotated classes, it is b... | import com.jpa.util.HibernateUtil;
import org.apache.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.LockOptions;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Example;
import java.io.Serializable;
import... | package com.jpa.dao;
/**
* Default implementation. All hail !
*
* @param <T>
* @param <ID>
* @author msaif
*/
@SuppressWarnings({"unchecked", "unused"})
public abstract class GenericHibernateDAO<T, ID extends Serializable>
implements GenericDAO<T, ID> {
private static final Logger log = Logger.get... | // Path: datastore/sql/JPA/src/main/java/com/jpa/util/HibernateUtil.java
// @SuppressWarnings({"unchecked", "rawtypes", "unused"})
// public class HibernateUtil {
//
// private static final Logger log = Logger.getLogger(HibernateUtil.class);
//
// /*
// * Since we will be using annotated classes, it is b... | session = HibernateUtil.getSessionFactory().getCurrentSession(); |
MSaifAsif/sample-skeleton-projects | web-api/SparkHelloWorld/src/main/java/com/sample/get/GetRequests.java | // Path: web-api/SparkHelloWorld/src/main/java/com/sample/interfaces/SumFunctionalI.java
// public interface SumFunctionalI {
//
// /**
// * Returns the sum of two {@link Number}s
// * Implementation has been kept default to maintain the functional state of the interface
// *
// * @param numA
/... | import com.sample.interfaces.SumFunctionalI;
import org.apache.log4j.Logger;
import java.util.Map;
import static spark.Spark.get; | package com.sample.get;
public class GetRequests {
private static final Logger log = Logger.getLogger(GetRequests.class);
/**
* Sample get request to print a greeting on the browser
*/
public static void greet() {
get("/helloWorld", (arg0, arg1) -> "This is from the Get method. Hello... | // Path: web-api/SparkHelloWorld/src/main/java/com/sample/interfaces/SumFunctionalI.java
// public interface SumFunctionalI {
//
// /**
// * Returns the sum of two {@link Number}s
// * Implementation has been kept default to maintain the functional state of the interface
// *
// * @param numA
/... | SumFunctionalI functionalI = (String tokenA, String tokenB) -> tokenA + tokenB; |
MSaifAsif/sample-skeleton-projects | mvc/Servlet30HelloWorld/src/main/java/com/sample/listeners/SessionListener.java | // Path: mvc/Servlet30HelloWorld/src/main/java/com/sample/dynamic/CalculatorServlet.java
// public class CalculatorServlet extends HttpServlet {
// private static final long serialVersionUID = -2237206745594453412L;
// private static final Logger log = Logger.getLogger(CalculatorServlet.class);
//
// @Over... | import com.sample.dynamic.CalculatorServlet;
import org.apache.log4j.Logger;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletRegistration;
import javax.servlet.annotation.WebListener; | package com.sample.listeners;
/**
* Application Lifecycle Listener implementation class SessionListener
*/
@WebListener
public class SessionListener implements ServletContextListener {
private static final Logger log = Logger.getLogger(SessionListener.class);
/**
* @see ServletContextListener#contex... | // Path: mvc/Servlet30HelloWorld/src/main/java/com/sample/dynamic/CalculatorServlet.java
// public class CalculatorServlet extends HttpServlet {
// private static final long serialVersionUID = -2237206745594453412L;
// private static final Logger log = Logger.getLogger(CalculatorServlet.class);
//
// @Over... | ServletRegistration registrar = sc.addServlet("calc", CalculatorServlet.class); |
MSaifAsif/sample-skeleton-projects | testing/unit-testing/junit4/src/test/java/com/sample/one/SampleOneTest.java | // Path: testing/unit-testing/junit4/src/main/java/com/sample/one/SampleOne.java
// static class InnerSample {
// private int i;
//
// public InnerSample(int i) {
// this.i = i;
// }
//
// public int getSquare() {
// if (this.i < 0) {
// return -1;
// } else {
// ... | import com.sample.one.SampleOne.InnerSample;
import org.junit.Test; | package com.sample.one;
/**
* Test cases for the utility methods
*/
public class SampleOneTest {
@Test
public void testOne() {
SampleOne one = new SampleOne();
one.getSum(1, 0);
}
@Test
public void testTwo() {
SampleOne one = new SampleOne();
one.getSum(0, 1);
... | // Path: testing/unit-testing/junit4/src/main/java/com/sample/one/SampleOne.java
// static class InnerSample {
// private int i;
//
// public InnerSample(int i) {
// this.i = i;
// }
//
// public int getSquare() {
// if (this.i < 0) {
// return -1;
// } else {
// ... | InnerSample inner = new InnerSample(1); |
MSaifAsif/sample-skeleton-projects | mvc/WicketHelloWorld/src/main/java/com/sample/one/apps/Application.java | // Path: mvc/WicketHelloWorld/src/main/java/com/sample/one/pages/GreetingsPage.java
// public class GreetingsPage extends WebPage {
//
// public GreetingsPage(final PageParameters pageParameters) {
// /*
// * Renders an attribute named 'greetingmessage'
// */
// add(new Label("gre... | import com.sample.one.pages.GreetingsPage;
import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication; | package com.sample.one.apps;
/**
* Entry point of the application.
*
* @author saifasif
*/
public class Application extends WebApplication {
@Override
public Class<? extends Page> getHomePage() { | // Path: mvc/WicketHelloWorld/src/main/java/com/sample/one/pages/GreetingsPage.java
// public class GreetingsPage extends WebPage {
//
// public GreetingsPage(final PageParameters pageParameters) {
// /*
// * Renders an attribute named 'greetingmessage'
// */
// add(new Label("gre... | return GreetingsPage.class; |
MSaifAsif/sample-skeleton-projects | mvc/Servlet30HelloWorld/src/main/java/com/sample/servlets/StartupServlet.java | // Path: mvc/Servlet30HelloWorld/src/main/java/com/sample/utils/ServletConstants.java
// public class ServletConstants {
//
// private ServletConstants() {
// // Don't init
// }
//
// /**
// * Generate a new session ID
// *
// * @return
// */
// public static String getNewS... | import com.sample.utils.ServletConstants;
import org.apache.log4j.Logger;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; | package com.sample.servlets;
/**
* A startup servlet that will have its init method
* called as soon as the container attempts to load the application
* <p>
* The purpose of this servlet is to add a few params to the
* application context
*
* @author saifasif
*/
@WebServlet(loadOnStartup = 1, value = "/start... | // Path: mvc/Servlet30HelloWorld/src/main/java/com/sample/utils/ServletConstants.java
// public class ServletConstants {
//
// private ServletConstants() {
// // Don't init
// }
//
// /**
// * Generate a new session ID
// *
// * @return
// */
// public static String getNewS... | getServletConfig().getServletContext().setAttribute("sessionID", ServletConstants.getNewSessionID()); |
MSaifAsif/sample-skeleton-projects | web-api/Pippo/src/main/java/com/sample/pippo/Init.java | // Path: web-api/Pippo/src/main/java/com/sample/pippo/basic/App.java
// public class App extends Application {
//
// @Override
// protected void onInit() {
// GET("/", routeContext -> {
// routeContext.send("Hello World");
// });
// }
//
// }
| import com.sample.pippo.basic.App;
import org.apache.log4j.BasicConfigurator;
import ro.pippo.core.Pippo; | package com.sample.pippo;
/**
* @author saifasif
*/
public class Init {
public static void main(String[] args) {
BasicConfigurator.configure(); | // Path: web-api/Pippo/src/main/java/com/sample/pippo/basic/App.java
// public class App extends Application {
//
// @Override
// protected void onInit() {
// GET("/", routeContext -> {
// routeContext.send("Hello World");
// });
// }
//
// }
// Path: web-api/Pippo/src/main/j... | Pippo pippo = new Pippo(new App()); |
MSaifAsif/sample-skeleton-projects | web-api/DropwizardHelloWorld/src/main/java/com/skeleton/app/MyApplication.java | // Path: web-api/DropwizardHelloWorld/src/main/java/com/skeleton/config/MyConfiguration.java
// public class MyConfiguration extends Configuration {
//
// @NotEmpty
// private String template;
//
// @NotEmpty
// private String defaultName = "DefaultName";
//
// @JsonProperty
// public String ... | import com.skeleton.config.MyConfiguration;
import com.skeleton.resources.MyResource;
import io.dropwizard.Application;
import io.dropwizard.setup.Environment; | package com.skeleton.app;
/**
* The main entry point of the application
*
* @author saifasif
*/
public class MyApplication extends Application<MyConfiguration> {
public static void main(String[] args) throws Exception {
new MyApplication().run(args);
}
@Override
public void run(MyConfigu... | // Path: web-api/DropwizardHelloWorld/src/main/java/com/skeleton/config/MyConfiguration.java
// public class MyConfiguration extends Configuration {
//
// @NotEmpty
// private String template;
//
// @NotEmpty
// private String defaultName = "DefaultName";
//
// @JsonProperty
// public String ... | final MyResource resource = new MyResource( |
MSaifAsif/sample-skeleton-projects | datastore/sql/Ebean/src/test/java/com/test/human/CrudTest.java | // Path: datastore/sql/Ebean/src/main/java/com/ebean/model/Human.java
// @Entity
// @Table(name = "human")
// public class Human {
//
// private long userId;
// private String firstName;
// private String lastName;
// private String gender;
// private int age;
//
// @Id
// @Column(name = "... | import com.ebean.model.Human;
import io.ebean.Ebean;
import io.ebean.EbeanServer;
import io.ebean.Query;
import org.apache.log4j.BasicConfigurator;
import org.junit.Test;
import static org.junit.Assert.assertNotNull; | package com.test.human;
/**
* @author saifasif
*/
public class CrudTest {
@Test
public void insert_via_server() {
BasicConfigurator.configure(); | // Path: datastore/sql/Ebean/src/main/java/com/ebean/model/Human.java
// @Entity
// @Table(name = "human")
// public class Human {
//
// private long userId;
// private String firstName;
// private String lastName;
// private String gender;
// private int age;
//
// @Id
// @Column(name = "... | Human being = null; |
MSaifAsif/sample-skeleton-projects | web-api/SparkHelloWorld/src/main/java/com/sample/main/MainRunner.java | // Path: web-api/SparkHelloWorld/src/main/java/com/sample/get/GetRequests.java
// public class GetRequests {
//
// private static final Logger log = Logger.getLogger(GetRequests.class);
//
// /**
// * Sample get request to print a greeting on the browser
// */
// public static void greet() {
// ... | import com.sample.get.GetRequests;
import com.sample.post.PostRequests; | package com.sample.main;
/**
* Main runner to deploy the individual services
*
* @author saifasif
*/
public class MainRunner {
public static void main(String[] args) {
// Deploy the get requests | // Path: web-api/SparkHelloWorld/src/main/java/com/sample/get/GetRequests.java
// public class GetRequests {
//
// private static final Logger log = Logger.getLogger(GetRequests.class);
//
// /**
// * Sample get request to print a greeting on the browser
// */
// public static void greet() {
// ... | GetRequests.greet(); |
MSaifAsif/sample-skeleton-projects | web-api/SparkHelloWorld/src/main/java/com/sample/main/MainRunner.java | // Path: web-api/SparkHelloWorld/src/main/java/com/sample/get/GetRequests.java
// public class GetRequests {
//
// private static final Logger log = Logger.getLogger(GetRequests.class);
//
// /**
// * Sample get request to print a greeting on the browser
// */
// public static void greet() {
// ... | import com.sample.get.GetRequests;
import com.sample.post.PostRequests; | package com.sample.main;
/**
* Main runner to deploy the individual services
*
* @author saifasif
*/
public class MainRunner {
public static void main(String[] args) {
// Deploy the get requests
GetRequests.greet();
// Deploy the post requests | // Path: web-api/SparkHelloWorld/src/main/java/com/sample/get/GetRequests.java
// public class GetRequests {
//
// private static final Logger log = Logger.getLogger(GetRequests.class);
//
// /**
// * Sample get request to print a greeting on the browser
// */
// public static void greet() {
// ... | PostRequests.postTest(); |
MSaifAsif/sample-skeleton-projects | datastore/sql/JPA/src/test/java/com/test/insertion/InsertionTest.java | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | import com.jpa.dao.HumanDAO;
import com.jpa.model.Human;
import com.jpa.util.HibernateUtil;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.fail; | package com.test.insertion;
public class InsertionTest {
private static final Logger log = Logger.getLogger(InsertionTest.class);
@BeforeClass
public static void init() {
// For full DEBUG mode, uncomment the following line
// BasicConfigurator.configure();
}
@Test
public v... | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | final Session session = HibernateUtil.getSessionFactory().openSession(); |
MSaifAsif/sample-skeleton-projects | datastore/sql/JPA/src/test/java/com/test/insertion/InsertionTest.java | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | import com.jpa.dao.HumanDAO;
import com.jpa.model.Human;
import com.jpa.util.HibernateUtil;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.fail; | package com.test.insertion;
public class InsertionTest {
private static final Logger log = Logger.getLogger(InsertionTest.class);
@BeforeClass
public static void init() {
// For full DEBUG mode, uncomment the following line
// BasicConfigurator.configure();
}
@Test
public v... | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | HumanDAO humanDAO = new HumanDAO(); |
MSaifAsif/sample-skeleton-projects | datastore/sql/JPA/src/test/java/com/test/insertion/InsertionTest.java | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | import com.jpa.dao.HumanDAO;
import com.jpa.model.Human;
import com.jpa.util.HibernateUtil;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.fail; | package com.test.insertion;
public class InsertionTest {
private static final Logger log = Logger.getLogger(InsertionTest.class);
@BeforeClass
public static void init() {
// For full DEBUG mode, uncomment the following line
// BasicConfigurator.configure();
}
@Test
public v... | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | Human aPerson = new Human(); |
MSaifAsif/sample-skeleton-projects | web-api/DropwizardHelloWorld/src/main/java/com/skeleton/resources/MyResource.java | // Path: web-api/DropwizardHelloWorld/src/main/java/com/skeleton/beans/MyBean.java
// public class MyBean {
//
// private Long id;
// private String someText;
//
// public MyBean(long id, String someText) {
// this.id = id;
// this.someText = someText;
// }
//
// public Long getId... | import com.codahale.metrics.annotation.Timed;
import com.skeleton.beans.MyBean;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicLong; | package com.skeleton.resources;
/**
* The resource class that is mapped to a URL
*
* @author saifasif
*/
@Path("/greet")
@Produces(MediaType.APPLICATION_JSON)
public class MyResource {
private final String template;
private final String defaultName;
private final AtomicLong counter;
public MyRe... | // Path: web-api/DropwizardHelloWorld/src/main/java/com/skeleton/beans/MyBean.java
// public class MyBean {
//
// private Long id;
// private String someText;
//
// public MyBean(long id, String someText) {
// this.id = id;
// this.someText = someText;
// }
//
// public Long getId... | public MyBean sayHello(@QueryParam("name") Optional<String> name) { |
MSaifAsif/sample-skeleton-projects | datastore/sql/JPA/src/test/java/com/test/deletion/DeletionTest.java | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | import com.jpa.dao.HumanDAO;
import com.jpa.model.Human;
import com.jpa.util.HibernateUtil;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.fail; | package com.test.deletion;
public class DeletionTest {
private static final Logger log = Logger.getLogger(DeletionTest.class);
@BeforeClass
public static void init() {
// For full DEBUG mode, uncomment the following line
// BasicConfigurator.configure();
}
@Test
public void... | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | final Session session = HibernateUtil.getSessionFactory().openSession(); |
MSaifAsif/sample-skeleton-projects | datastore/sql/JPA/src/test/java/com/test/deletion/DeletionTest.java | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | import com.jpa.dao.HumanDAO;
import com.jpa.model.Human;
import com.jpa.util.HibernateUtil;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.fail; | package com.test.deletion;
public class DeletionTest {
private static final Logger log = Logger.getLogger(DeletionTest.class);
@BeforeClass
public static void init() {
// For full DEBUG mode, uncomment the following line
// BasicConfigurator.configure();
}
@Test
public void... | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | HumanDAO humanDAO = new HumanDAO(); |
MSaifAsif/sample-skeleton-projects | datastore/sql/JPA/src/test/java/com/test/deletion/DeletionTest.java | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | import com.jpa.dao.HumanDAO;
import com.jpa.model.Human;
import com.jpa.util.HibernateUtil;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.fail; | package com.test.deletion;
public class DeletionTest {
private static final Logger log = Logger.getLogger(DeletionTest.class);
@BeforeClass
public static void init() {
// For full DEBUG mode, uncomment the following line
// BasicConfigurator.configure();
}
@Test
public void... | // Path: datastore/sql/JPA/src/main/java/com/jpa/dao/HumanDAO.java
// public class HumanDAO extends GenericHibernateDAO<Human, Serializable> {
//
// //private Criteria criteria = HibernateUtil.getSession().createCriteria(Human.class);
//
// public Human getAUserByID(long userID) {
// List<Human> resu... | Human aPerson = new Human(); |
MSaifAsif/sample-skeleton-projects | web-api/RESTEasy/src/main/java/com/sample/one/GreetRestService.java | // Path: web-api/RESTEasy/src/main/java/com/sample/utilities/MyBean.java
// public class MyBean {
//
// private int index;
// private String name;
// private long epoch;
// private char gender;
//
// public int getIndex() {
// return index;
// }
//
// public void setIndex(int inde... | import com.sample.utilities.MyBean;
import com.sample.utilities.TransformationUtils;
import org.apache.log4j.Logger;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType; | package com.sample.one;
/**
* The actual rest service that will be exposed to the user with /greet in the URL
*
* @author saifasif
*/
@Path("/greet")
public class GreetRestService extends Application {
private static final Logger log = Logger.getLogger(GreetRestService.class);
/**
* A sample rest ... | // Path: web-api/RESTEasy/src/main/java/com/sample/utilities/MyBean.java
// public class MyBean {
//
// private int index;
// private String name;
// private long epoch;
// private char gender;
//
// public int getIndex() {
// return index;
// }
//
// public void setIndex(int inde... | public MyBean getJsonObj(@PathParam("caller") String caller) { |
MSaifAsif/sample-skeleton-projects | web-api/RESTEasy/src/main/java/com/sample/one/GreetRestService.java | // Path: web-api/RESTEasy/src/main/java/com/sample/utilities/MyBean.java
// public class MyBean {
//
// private int index;
// private String name;
// private long epoch;
// private char gender;
//
// public int getIndex() {
// return index;
// }
//
// public void setIndex(int inde... | import com.sample.utilities.MyBean;
import com.sample.utilities.TransformationUtils;
import org.apache.log4j.Logger;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType; | package com.sample.one;
/**
* The actual rest service that will be exposed to the user with /greet in the URL
*
* @author saifasif
*/
@Path("/greet")
public class GreetRestService extends Application {
private static final Logger log = Logger.getLogger(GreetRestService.class);
/**
* A sample rest ... | // Path: web-api/RESTEasy/src/main/java/com/sample/utilities/MyBean.java
// public class MyBean {
//
// private int index;
// private String name;
// private long epoch;
// private char gender;
//
// public int getIndex() {
// return index;
// }
//
// public void setIndex(int inde... | return TransformationUtils.getObj(caller); |
MSaifAsif/sample-skeleton-projects | web-api/EJBHelloWorld/src/main/java/com/sample/client/StandAloneClient.java | // Path: web-api/EJBHelloWorld/src/main/java/com/sample/beans/SampleBean.java
// @Remote
// public interface SampleBean {
//
// void addEntity(String o);
//
// List<String> getEntity();
//
// }
//
// Path: web-api/EJBHelloWorld/src/main/java/com/sample/entity/IBeanOne.java
// @Remote
// public interface IBe... | import com.sample.beans.SampleBean;
import com.sample.entity.IBeanOne;
import org.apache.log4j.BasicConfigurator;
import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Properties; | package com.sample.client;
/**
* StandALone client to fetch and call methods on the {@link Remote} {@link EJB} objects deployed in the container
*
* @author saifasif
*/
public class StandAloneClient {
public static void main(String[] args) {
BasicConfigurator.configure();
Properties jndiPr... | // Path: web-api/EJBHelloWorld/src/main/java/com/sample/beans/SampleBean.java
// @Remote
// public interface SampleBean {
//
// void addEntity(String o);
//
// List<String> getEntity();
//
// }
//
// Path: web-api/EJBHelloWorld/src/main/java/com/sample/entity/IBeanOne.java
// @Remote
// public interface IBe... | IBeanOne bean = (IBeanOne) ctx.lookup("/EJBHelloWorld/BeanOneImpl!com.sample.entity.IBeanOne"); |
MSaifAsif/sample-skeleton-projects | web-api/EJBHelloWorld/src/main/java/com/sample/client/StandAloneClient.java | // Path: web-api/EJBHelloWorld/src/main/java/com/sample/beans/SampleBean.java
// @Remote
// public interface SampleBean {
//
// void addEntity(String o);
//
// List<String> getEntity();
//
// }
//
// Path: web-api/EJBHelloWorld/src/main/java/com/sample/entity/IBeanOne.java
// @Remote
// public interface IBe... | import com.sample.beans.SampleBean;
import com.sample.entity.IBeanOne;
import org.apache.log4j.BasicConfigurator;
import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Properties; | package com.sample.client;
/**
* StandALone client to fetch and call methods on the {@link Remote} {@link EJB} objects deployed in the container
*
* @author saifasif
*/
public class StandAloneClient {
public static void main(String[] args) {
BasicConfigurator.configure();
Properties jndiPr... | // Path: web-api/EJBHelloWorld/src/main/java/com/sample/beans/SampleBean.java
// @Remote
// public interface SampleBean {
//
// void addEntity(String o);
//
// List<String> getEntity();
//
// }
//
// Path: web-api/EJBHelloWorld/src/main/java/com/sample/entity/IBeanOne.java
// @Remote
// public interface IBe... | SampleBean statelessBean = (SampleBean) ctx.lookup("/EJBHelloWorld/SampleStatelessBean!com.sample.beans.SampleBean"); |
MSaifAsif/sample-skeleton-projects | big-data/MapReduceHelloWorld/src/main/java/com/sample/client/ClientRunner.java | // Path: big-data/MapReduceHelloWorld/src/main/java/com/sample/one/mappers/WordCountMapper.java
// public class WordCountMapper extends Mapper<LongWritable, Text, Text, LongWritable> {
//
// private Text word = new Text();
// private LongWritable count = new LongWritable();
//
// protected void map(LongWr... | import com.sample.one.mappers.WordCountMapper;
import com.sample.one.reducers.WordCountReducer;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapredu... | package com.sample.client;
public class ClientRunner extends Configured implements Tool {
public static void main(String[] args) throws Exception {
int rc = ToolRunner.run(new ClientRunner(), args);
System.exit(rc);
}
@Override
public int run(String[] args) throws Exception {
... | // Path: big-data/MapReduceHelloWorld/src/main/java/com/sample/one/mappers/WordCountMapper.java
// public class WordCountMapper extends Mapper<LongWritable, Text, Text, LongWritable> {
//
// private Text word = new Text();
// private LongWritable count = new LongWritable();
//
// protected void map(LongWr... | job.setMapperClass(WordCountMapper.class); |
MSaifAsif/sample-skeleton-projects | big-data/MapReduceHelloWorld/src/main/java/com/sample/client/ClientRunner.java | // Path: big-data/MapReduceHelloWorld/src/main/java/com/sample/one/mappers/WordCountMapper.java
// public class WordCountMapper extends Mapper<LongWritable, Text, Text, LongWritable> {
//
// private Text word = new Text();
// private LongWritable count = new LongWritable();
//
// protected void map(LongWr... | import com.sample.one.mappers.WordCountMapper;
import com.sample.one.reducers.WordCountReducer;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapredu... | package com.sample.client;
public class ClientRunner extends Configured implements Tool {
public static void main(String[] args) throws Exception {
int rc = ToolRunner.run(new ClientRunner(), args);
System.exit(rc);
}
@Override
public int run(String[] args) throws Exception {
... | // Path: big-data/MapReduceHelloWorld/src/main/java/com/sample/one/mappers/WordCountMapper.java
// public class WordCountMapper extends Mapper<LongWritable, Text, Text, LongWritable> {
//
// private Text word = new Text();
// private LongWritable count = new LongWritable();
//
// protected void map(LongWr... | job.setCombinerClass(WordCountReducer.class); |
MSaifAsif/sample-skeleton-projects | datastore/sql/JPA/src/test/java/com/test/conn/ConnectionTest.java | // Path: datastore/sql/JPA/src/main/java/com/jpa/util/HibernateUtil.java
// @SuppressWarnings({"unchecked", "rawtypes", "unused"})
// public class HibernateUtil {
//
// private static final Logger log = Logger.getLogger(HibernateUtil.class);
//
// /*
// * Since we will be using annotated classes, it is b... | import com.jpa.util.HibernateUtil;
import org.apache.log4j.BasicConfigurator;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.fail; | package com.test.conn;
public class ConnectionTest {
@BeforeClass
public static void init() {
// For full DEBUG mode, uncomment the following line
BasicConfigurator.configure();
}
@Test
public void testHSQLcon() {
try { | // Path: datastore/sql/JPA/src/main/java/com/jpa/util/HibernateUtil.java
// @SuppressWarnings({"unchecked", "rawtypes", "unused"})
// public class HibernateUtil {
//
// private static final Logger log = Logger.getLogger(HibernateUtil.class);
//
// /*
// * Since we will be using annotated classes, it is b... | final Session session = HibernateUtil.getSessionFactory().openSession(); |
MSaifAsif/sample-skeleton-projects | testing/unit-testing/junit5/src/test/java/com/sample/ClassOneTest.java | // Path: testing/unit-testing/junit5/src/main/java/com/sample/ClassOne.java
// static double floatingPointDivision(double a, double b) {
// return a / b;
// }
//
// Path: testing/unit-testing/junit5/src/main/java/com/sample/ClassOne.java
// static double wholeNumberDivision(int a, int b) {
// return a / b;
// ... | import org.junit.jupiter.api.*;
import static com.sample.ClassOne.floatingPointDivision;
import static com.sample.ClassOne.wholeNumberDivision; | package com.sample;
class ClassOneTest {
@BeforeEach
void setUp() {
System.out.println("Setting up Test");
}
@AfterEach
void tearDown() {
System.out.println("Tearing down test");
}
@Test
@DisplayName("Case 1 - Test normal flow")
void testDivisionRegularCase() ... | // Path: testing/unit-testing/junit5/src/main/java/com/sample/ClassOne.java
// static double floatingPointDivision(double a, double b) {
// return a / b;
// }
//
// Path: testing/unit-testing/junit5/src/main/java/com/sample/ClassOne.java
// static double wholeNumberDivision(int a, int b) {
// return a / b;
// ... | double result = floatingPointDivision(2d, 2d); |
MSaifAsif/sample-skeleton-projects | testing/unit-testing/junit5/src/test/java/com/sample/ClassOneTest.java | // Path: testing/unit-testing/junit5/src/main/java/com/sample/ClassOne.java
// static double floatingPointDivision(double a, double b) {
// return a / b;
// }
//
// Path: testing/unit-testing/junit5/src/main/java/com/sample/ClassOne.java
// static double wholeNumberDivision(int a, int b) {
// return a / b;
// ... | import org.junit.jupiter.api.*;
import static com.sample.ClassOne.floatingPointDivision;
import static com.sample.ClassOne.wholeNumberDivision; | package com.sample;
class ClassOneTest {
@BeforeEach
void setUp() {
System.out.println("Setting up Test");
}
@AfterEach
void tearDown() {
System.out.println("Tearing down test");
}
@Test
@DisplayName("Case 1 - Test normal flow")
void testDivisionRegularCase() ... | // Path: testing/unit-testing/junit5/src/main/java/com/sample/ClassOne.java
// static double floatingPointDivision(double a, double b) {
// return a / b;
// }
//
// Path: testing/unit-testing/junit5/src/main/java/com/sample/ClassOne.java
// static double wholeNumberDivision(int a, int b) {
// return a / b;
// ... | double result = wholeNumberDivision(1, 0); |
asebak/embeddedlinux-jvmdebugger-intellij | test/com/atsebak/embeddedlinuxjvm/runner/EmbeddedLinuxJVMConfigurationTypeTest.java | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMConfigurationType.java
// public class EmbeddedLinuxJVMConfigurationType implements ConfigurationType {
// private static final String NAME = "Embedded Linux JVM";
// private static final String DESCRIPTION = EmbeddedLinuxJVMBundle.getString(... | import com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMConfigurationType;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.modules.junit4.PowerMockRunner;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; | package com.atsebak.embeddedlinuxjvm.runner;
@RunWith(PowerMockRunner.class)
public class EmbeddedLinuxJVMConfigurationTypeTest { | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMConfigurationType.java
// public class EmbeddedLinuxJVMConfigurationType implements ConfigurationType {
// private static final String NAME = "Embedded Linux JVM";
// private static final String DESCRIPTION = EmbeddedLinuxJVMBundle.getString(... | private EmbeddedLinuxJVMConfigurationType configurationType = new EmbeddedLinuxJVMConfigurationType(); |
asebak/embeddedlinux-jvmdebugger-intellij | test/com/atsebak/embeddedlinuxjvm/utils/RemoteJdkTest.java | // Path: src/com/atsebak/embeddedlinuxjvm/hal/LinuxHAL.java
// public class LinuxHAL implements HostMachineHAL {
// @Override
// public String getCommandLineName() {
// return "bash";
// }
// }
//
// Path: src/com/atsebak/embeddedlinuxjvm/hal/WindowsHAL.java
// public class WindowsHAL implements Ho... | import com.atsebak.embeddedlinuxjvm.hal.LinuxHAL;
import com.atsebak.embeddedlinuxjvm.hal.WindowsHAL;
import org.junit.Test;
import static org.junit.Assert.assertEquals; | package com.atsebak.embeddedlinuxjvm.utils;
public class RemoteJdkTest {
@Test
public void testGettingCommandLineFromLinux() { | // Path: src/com/atsebak/embeddedlinuxjvm/hal/LinuxHAL.java
// public class LinuxHAL implements HostMachineHAL {
// @Override
// public String getCommandLineName() {
// return "bash";
// }
// }
//
// Path: src/com/atsebak/embeddedlinuxjvm/hal/WindowsHAL.java
// public class WindowsHAL implements Ho... | LinuxHAL linuxHAL = new LinuxHAL(); |
asebak/embeddedlinux-jvmdebugger-intellij | test/com/atsebak/embeddedlinuxjvm/utils/RemoteJdkTest.java | // Path: src/com/atsebak/embeddedlinuxjvm/hal/LinuxHAL.java
// public class LinuxHAL implements HostMachineHAL {
// @Override
// public String getCommandLineName() {
// return "bash";
// }
// }
//
// Path: src/com/atsebak/embeddedlinuxjvm/hal/WindowsHAL.java
// public class WindowsHAL implements Ho... | import com.atsebak.embeddedlinuxjvm.hal.LinuxHAL;
import com.atsebak.embeddedlinuxjvm.hal.WindowsHAL;
import org.junit.Test;
import static org.junit.Assert.assertEquals; | package com.atsebak.embeddedlinuxjvm.utils;
public class RemoteJdkTest {
@Test
public void testGettingCommandLineFromLinux() {
LinuxHAL linuxHAL = new LinuxHAL();
RemoteCommandLine remoteCommandLine = RemoteJdk.setupJVMCommandLine(linuxHAL);
String exePath = remoteCommandLine.getExeP... | // Path: src/com/atsebak/embeddedlinuxjvm/hal/LinuxHAL.java
// public class LinuxHAL implements HostMachineHAL {
// @Override
// public String getCommandLineName() {
// return "bash";
// }
// }
//
// Path: src/com/atsebak/embeddedlinuxjvm/hal/WindowsHAL.java
// public class WindowsHAL implements Ho... | WindowsHAL windowsHAL = new WindowsHAL(); |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/protocol/ssh/jsch/SFTPHandler.java | // Path: src/com/atsebak/embeddedlinuxjvm/console/EmbeddedLinuxJVMConsoleView.java
// public class EmbeddedLinuxJVMConsoleView implements Disposable {
// private static final Class<?>[] IGNORED_CONSOLE_ACTION_TYPES =
// {PreviousOccurenceToolbarAction.class, NextOccurenceToolbarAction.class, ConsoleView... | import com.atsebak.embeddedlinuxjvm.console.EmbeddedLinuxJVMConsoleView;
import com.jcraft.jsch.*;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Vector; | package com.atsebak.embeddedlinuxjvm.protocol.ssh.jsch;
@AllArgsConstructor
@NoArgsConstructor
public class SFTPHandler { | // Path: src/com/atsebak/embeddedlinuxjvm/console/EmbeddedLinuxJVMConsoleView.java
// public class EmbeddedLinuxJVMConsoleView implements Disposable {
// private static final Class<?>[] IGNORED_CONSOLE_ACTION_TYPES =
// {PreviousOccurenceToolbarAction.class, NextOccurenceToolbarAction.class, ConsoleView... | private EmbeddedLinuxJVMConsoleView consoleView; |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/runner/data/EmbeddedLinuxJVMRunnerValidator.java | // Path: src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.java
// public final class EmbeddedLinuxJVMBundle {
//
// @NonNls
// private static final String BUNDLE = "com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle";
// private static Reference<ResourceBundle> ourBundle;
... | import com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle;
import com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMRunConfiguration;
import com.intellij.execution.ExecutionBundle;
import com.intellij.execution.configurations.JavaRunConfigurationModule;
import com.intellij.execution.configurations.... | package com.atsebak.embeddedlinuxjvm.runner.data;
public class EmbeddedLinuxJVMRunnerValidator {
/**
* Validates the PI Settings are Entered Correctly
*
* @param rp
* @throws RuntimeConfigurationException
*/
public static void checkEmbeddedSettings(EmbeddedLinuxJVMRunConfigurationRun... | // Path: src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.java
// public final class EmbeddedLinuxJVMBundle {
//
// @NonNls
// private static final String BUNDLE = "com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle";
// private static Reference<ResourceBundle> ourBundle;
... | throw new RuntimeConfigurationWarning(EmbeddedLinuxJVMBundle.getString("pi.invalid.hostname")); |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/runner/data/EmbeddedLinuxJVMRunnerValidator.java | // Path: src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.java
// public final class EmbeddedLinuxJVMBundle {
//
// @NonNls
// private static final String BUNDLE = "com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle";
// private static Reference<ResourceBundle> ourBundle;
... | import com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle;
import com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMRunConfiguration;
import com.intellij.execution.ExecutionBundle;
import com.intellij.execution.configurations.JavaRunConfigurationModule;
import com.intellij.execution.configurations.... | package com.atsebak.embeddedlinuxjvm.runner.data;
public class EmbeddedLinuxJVMRunnerValidator {
/**
* Validates the PI Settings are Entered Correctly
*
* @param rp
* @throws RuntimeConfigurationException
*/
public static void checkEmbeddedSettings(EmbeddedLinuxJVMRunConfigurationRun... | // Path: src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.java
// public final class EmbeddedLinuxJVMBundle {
//
// @NonNls
// private static final String BUNDLE = "com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle";
// private static Reference<ResourceBundle> ourBundle;
... | public static void checkJavaSettings(EmbeddedLinuxJVMRunConfiguration configuration) throws RuntimeConfigurationException { |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/protocol/ssh/SSHConnectionValidator.java | // Path: src/com/atsebak/embeddedlinuxjvm/protocol/ssh/jsch/EmbeddedSSHClient.java
// @Builder
// public class EmbeddedSSHClient {
// private String username;
// @Nullable
// private String password;
// @Nullable
// private String key;
// private boolean useKey;
// private String hostname;
/... | import com.atsebak.embeddedlinuxjvm.protocol.ssh.jsch.EmbeddedSSHClient;
import com.jcraft.jsch.Session;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.net.InetAddress; | package com.atsebak.embeddedlinuxjvm.protocol.ssh;
@Builder
public class SSHConnectionValidator {
private String ip;
private String username;
@Nullable
private String password;
@Nullable
private String key;
private boolean useKey;
private int port;
/**
* Pings to see if it ... | // Path: src/com/atsebak/embeddedlinuxjvm/protocol/ssh/jsch/EmbeddedSSHClient.java
// @Builder
// public class EmbeddedSSHClient {
// private String username;
// @Nullable
// private String password;
// @Nullable
// private String key;
// private boolean useKey;
// private String hostname;
/... | EmbeddedSSHClient sshClient = EmbeddedSSHClient |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/utils/RemoteCommandLineBuilder.java | // Path: src/com/atsebak/embeddedlinuxjvm/hal/LinuxHAL.java
// public class LinuxHAL implements HostMachineHAL {
// @Override
// public String getCommandLineName() {
// return "bash";
// }
// }
//
// Path: src/com/atsebak/embeddedlinuxjvm/hal/WindowsHAL.java
// public class WindowsHAL implements Ho... | import com.atsebak.embeddedlinuxjvm.hal.LinuxHAL;
import com.atsebak.embeddedlinuxjvm.hal.WindowsHAL;
import com.intellij.execution.CantRunException;
import com.intellij.execution.ExecutionBundle;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.configurations.SimpleJavaPar... | package com.atsebak.embeddedlinuxjvm.utils;
public class RemoteCommandLineBuilder {
public static GeneralCommandLine createFromJavaParameters(final SimpleJavaParameters javaParameters,
final Project project,
... | // Path: src/com/atsebak/embeddedlinuxjvm/hal/LinuxHAL.java
// public class LinuxHAL implements HostMachineHAL {
// @Override
// public String getCommandLineName() {
// return "bash";
// }
// }
//
// Path: src/com/atsebak/embeddedlinuxjvm/hal/WindowsHAL.java
// public class WindowsHAL implements Ho... | return RemoteJdk.setupJVMCommandLine(OSUtils.isWindows() ? new WindowsHAL() : new LinuxHAL()); |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/utils/RemoteCommandLineBuilder.java | // Path: src/com/atsebak/embeddedlinuxjvm/hal/LinuxHAL.java
// public class LinuxHAL implements HostMachineHAL {
// @Override
// public String getCommandLineName() {
// return "bash";
// }
// }
//
// Path: src/com/atsebak/embeddedlinuxjvm/hal/WindowsHAL.java
// public class WindowsHAL implements Ho... | import com.atsebak.embeddedlinuxjvm.hal.LinuxHAL;
import com.atsebak.embeddedlinuxjvm.hal.WindowsHAL;
import com.intellij.execution.CantRunException;
import com.intellij.execution.ExecutionBundle;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.configurations.SimpleJavaPar... | package com.atsebak.embeddedlinuxjvm.utils;
public class RemoteCommandLineBuilder {
public static GeneralCommandLine createFromJavaParameters(final SimpleJavaParameters javaParameters,
final Project project,
... | // Path: src/com/atsebak/embeddedlinuxjvm/hal/LinuxHAL.java
// public class LinuxHAL implements HostMachineHAL {
// @Override
// public String getCommandLineName() {
// return "bash";
// }
// }
//
// Path: src/com/atsebak/embeddedlinuxjvm/hal/WindowsHAL.java
// public class WindowsHAL implements Ho... | return RemoteJdk.setupJVMCommandLine(OSUtils.isWindows() ? new WindowsHAL() : new LinuxHAL()); |
asebak/embeddedlinux-jvmdebugger-intellij | test/com/atsebak/embeddedlinuxjvm/runner/EmbeddedLinuxJVMDebuggerTest.java | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | import com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMRunConfiguration;
import com.intellij.execution.configurations.RunProfile;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
impor... | package com.atsebak.embeddedlinuxjvm.runner;
@RunWith(PowerMockRunner.class)
public class EmbeddedLinuxJVMDebuggerTest {
@Test
public void testGetRunnerId() {
EmbeddedLinuxJVMDebugger debugger = Whitebox.newInstance(EmbeddedLinuxJVMDebugger.class);
String runnerId = debugger.getRunnerId();
... | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | RunProfile profile = Mockito.mock(EmbeddedLinuxJVMRunConfiguration.class); |
asebak/embeddedlinux-jvmdebugger-intellij | test/com/atsebak/embeddedlinuxjvm/runner/EmbeddedLinuxJVMRunnerTest.java | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | import com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMRunConfiguration;
import com.intellij.execution.configurations.RunProfile;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
impor... | package com.atsebak.embeddedlinuxjvm.runner;
@RunWith(PowerMockRunner.class)
public class EmbeddedLinuxJVMRunnerTest {
@Test
public void testGetRunnerId() {
EmbeddedLinuxJVMRunner debugger = Whitebox.newInstance(EmbeddedLinuxJVMRunner.class);
String runnerId = debugger.getRunnerId();
... | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | RunProfile profile = Mockito.mock(EmbeddedLinuxJVMRunConfiguration.class); |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/project/BeagleBoneBlackJavaModuleBuilder.java | // Path: src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.java
// public final class EmbeddedLinuxJVMBundle {
//
// @NonNls
// private static final String BUNDLE = "com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle";
// private static Reference<ResourceBundle> ourBundle;
... | import com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle;
import com.intellij.openapi.project.ProjectType;
import com.intellij.openapi.util.IconLoader;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import java.io.File; | package com.atsebak.embeddedlinuxjvm.project;
public class BeagleBoneBlackJavaModuleBuilder extends RPiJavaModuleBuilder {
private static final ProjectType BBB_PROJECT_TYPE = new ProjectType("BBB_JAVA");
private static final String PROJECT_NAME = "BeagleBone Black";
/**
* The icon displayed in the... | // Path: src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.java
// public final class EmbeddedLinuxJVMBundle {
//
// @NonNls
// private static final String BUNDLE = "com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle";
// private static Reference<ResourceBundle> ourBundle;
... | return EmbeddedLinuxJVMBundle.getString("bbb.project.description"); |
asebak/embeddedlinux-jvmdebugger-intellij | test/com/atsebak/embeddedlinuxjvm/commandline/CommandLineTargetTest.java | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | import com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMRunConfiguration;
import com.atsebak.embeddedlinuxjvm.runner.data.EmbeddedLinuxJVMRunConfigurationRunnerParameters;
import com.intellij.execution.configurations.JavaParameters;
import com.intellij.execution.configurations.ParametersList;
import org.junit.B... | package com.atsebak.embeddedlinuxjvm.commandline;
public class CommandLineTargetTest {
JavaParameters javaParameters = Mockito.mock(JavaParameters.class); | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | EmbeddedLinuxJVMRunConfiguration piRunConfiguration = Mockito.mock(EmbeddedLinuxJVMRunConfiguration.class); |
asebak/embeddedlinux-jvmdebugger-intellij | test/com/atsebak/embeddedlinuxjvm/commandline/CommandLineTargetTest.java | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | import com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMRunConfiguration;
import com.atsebak.embeddedlinuxjvm.runner.data.EmbeddedLinuxJVMRunConfigurationRunnerParameters;
import com.intellij.execution.configurations.JavaParameters;
import com.intellij.execution.configurations.ParametersList;
import org.junit.B... | package com.atsebak.embeddedlinuxjvm.commandline;
public class CommandLineTargetTest {
JavaParameters javaParameters = Mockito.mock(JavaParameters.class);
EmbeddedLinuxJVMRunConfiguration piRunConfiguration = Mockito.mock(EmbeddedLinuxJVMRunConfiguration.class); | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | EmbeddedLinuxJVMRunConfigurationRunnerParameters parameters = new EmbeddedLinuxJVMRunConfigurationRunnerParameters(); |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMConfigurationType.java | // Path: src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.java
// public final class EmbeddedLinuxJVMBundle {
//
// @NonNls
// private static final String BUNDLE = "com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle";
// private static Reference<ResourceBundle> ourBundle;
... | import com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle;
import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationType;
import com.intellij.execution.configurations.ConfigurationTypeUtil;
import com.intellij.execution.configurations.Run... | package com.atsebak.embeddedlinuxjvm.runner.conf;
public class EmbeddedLinuxJVMConfigurationType implements ConfigurationType {
private static final String NAME = "Embedded Linux JVM"; | // Path: src/com/atsebak/embeddedlinuxjvm/localization/EmbeddedLinuxJVMBundle.java
// public final class EmbeddedLinuxJVMBundle {
//
// @NonNls
// private static final String BUNDLE = "com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle";
// private static Reference<ResourceBundle> ourBundle;
... | private static final String DESCRIPTION = EmbeddedLinuxJVMBundle.getString("pi.app.description"); |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/commandline/CommandLineTarget.java | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | import com.atsebak.embeddedlinuxjvm.runner.conf.EmbeddedLinuxJVMRunConfiguration;
import com.intellij.execution.configurations.JavaParameters;
import lombok.Builder;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import java.util.Map; | package com.atsebak.embeddedlinuxjvm.commandline;
@Builder
public class CommandLineTarget {
private final JavaParameters parameters; | // Path: src/com/atsebak/embeddedlinuxjvm/runner/conf/EmbeddedLinuxJVMRunConfiguration.java
// public class EmbeddedLinuxJVMRunConfiguration extends LocatableConfigurationBase implements RunProfileWithCompileBeforeLaunchOption {
// private EmbeddedLinuxJVMRunConfigurationRunnerParameters embeddedLinuxJVMRunConfigur... | private final EmbeddedLinuxJVMRunConfiguration embeddedLinuxJVMRunConfiguration; |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/exporter/sheet/ConsoleExporterTest.java | // Path: src/main/java/org/bbreak/excella/core/SheetData.java
// public class SheetData {
//
// /**
// * シート名
// */
// private String sheetName = null;
//
// /**
// * タグ毎にデータを保持するマップ
// */
// private Map<String, List<Object>> tagValueMap = new HashMap<String, List<Object>>();
//
/... | import java.util.ArrayList;
import java.util.List;
import org.apache.poi.ss.usermodel.Sheet;
import org.bbreak.excella.core.SheetData;
import org.junit.Test; | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/main/java/org/bbreak/excella/core/SheetData.java
// public class SheetData {
//
// /**
// * シート名
// */
// private String sheetName = null;
//
// /**
// * タグ毎にデータを保持するマップ
// */
// private Map<String, List<Object>> tagValueMap = new HashMap<String, List<Object>>();
//
/... | SheetData sheetdata = new SheetData(sheetName); |
excella-core/excella-core | src/main/java/org/bbreak/excella/core/util/TagUtil.java | // Path: src/main/java/org/bbreak/excella/core/tag/TagParser.java
// public abstract class TagParser<RESULT> {
//
// /**
// * パラメータ定義の開始文字
// */
// public static final String TAG_PARAM_PREFIX = "{";
//
// /**
// * パラメータ定義の終了文字
// */
// public static final String TAG_PARAM_SUFFIX = "}... | import java.util.StringTokenizer;
import org.bbreak.excella.core.tag.TagParser;
import java.util.HashMap;
import java.util.Map; | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/main/java/org/bbreak/excella/core/tag/TagParser.java
// public abstract class TagParser<RESULT> {
//
// /**
// * パラメータ定義の開始文字
// */
// public static final String TAG_PARAM_PREFIX = "{";
//
// /**
// * パラメータ定義の終了文字
// */
// public static final String TAG_PARAM_SUFFIX = "}... | StringTokenizer commaTokenizer = new StringTokenizer( paramDef, TagParser.PARAM_DELIM); |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/util/TagUtilTest.java | // Path: src/main/java/org/bbreak/excella/core/tag/TagParser.java
// public abstract class TagParser<RESULT> {
//
// /**
// * パラメータ定義の開始文字
// */
// public static final String TAG_PARAM_PREFIX = "{";
//
// /**
// * パラメータ定義の終了文字
// */
// public static final String TAG_PARAM_SUFFIX = "}... | import org.bbreak.excella.core.tag.TagParser;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import java.util.Map; | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/main/java/org/bbreak/excella/core/tag/TagParser.java
// public abstract class TagParser<RESULT> {
//
// /**
// * パラメータ定義の開始文字
// */
// public static final String TAG_PARAM_PREFIX = "{";
//
// /**
// * パラメータ定義の終了文字
// */
// public static final String TAG_PARAM_SUFFIX = "}... | tag = TagUtil.getTag( tagDef, TagParser.TAG_PARAM_PREFIX); |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/AllTestSuite.java | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | import org.junit.runners.Suite.SuiteClasses;
import org.bbreak.excella.core.exception.ExceptionTestSuite;
import org.bbreak.excella.core.exporter.book.ExporterBookTestSuite;
import org.bbreak.excella.core.exporter.sheet.ExporterSheetTestSuite;
import org.bbreak.excella.core.handler.HandlerTestSuite;
import org.bbreak.e... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | ExceptionTestSuite.class, |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/AllTestSuite.java | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | import org.junit.runners.Suite.SuiteClasses;
import org.bbreak.excella.core.exception.ExceptionTestSuite;
import org.bbreak.excella.core.exporter.book.ExporterBookTestSuite;
import org.bbreak.excella.core.exporter.sheet.ExporterSheetTestSuite;
import org.bbreak.excella.core.handler.HandlerTestSuite;
import org.bbreak.e... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | ExporterBookTestSuite.class, |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/AllTestSuite.java | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | import org.junit.runners.Suite.SuiteClasses;
import org.bbreak.excella.core.exception.ExceptionTestSuite;
import org.bbreak.excella.core.exporter.book.ExporterBookTestSuite;
import org.bbreak.excella.core.exporter.sheet.ExporterSheetTestSuite;
import org.bbreak.excella.core.handler.HandlerTestSuite;
import org.bbreak.e... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | ExporterSheetTestSuite.class, |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/AllTestSuite.java | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | import org.junit.runners.Suite.SuiteClasses;
import org.bbreak.excella.core.exception.ExceptionTestSuite;
import org.bbreak.excella.core.exporter.book.ExporterBookTestSuite;
import org.bbreak.excella.core.exporter.sheet.ExporterSheetTestSuite;
import org.bbreak.excella.core.handler.HandlerTestSuite;
import org.bbreak.e... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | HandlerTestSuite.class, |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/AllTestSuite.java | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | import org.junit.runners.Suite.SuiteClasses;
import org.bbreak.excella.core.exception.ExceptionTestSuite;
import org.bbreak.excella.core.exporter.book.ExporterBookTestSuite;
import org.bbreak.excella.core.exporter.sheet.ExporterSheetTestSuite;
import org.bbreak.excella.core.handler.HandlerTestSuite;
import org.bbreak.e... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | ListenerTestSuite.class, |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/AllTestSuite.java | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | import org.junit.runners.Suite.SuiteClasses;
import org.bbreak.excella.core.exception.ExceptionTestSuite;
import org.bbreak.excella.core.exporter.book.ExporterBookTestSuite;
import org.bbreak.excella.core.exporter.sheet.ExporterSheetTestSuite;
import org.bbreak.excella.core.handler.HandlerTestSuite;
import org.bbreak.e... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | TagTestSuite.class, |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/AllTestSuite.java | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | import org.junit.runners.Suite.SuiteClasses;
import org.bbreak.excella.core.exception.ExceptionTestSuite;
import org.bbreak.excella.core.exporter.book.ExporterBookTestSuite;
import org.bbreak.excella.core.exporter.sheet.ExporterSheetTestSuite;
import org.bbreak.excella.core.handler.HandlerTestSuite;
import org.bbreak.e... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | TagExcel2JavaTestSuite.class, |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/AllTestSuite.java | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | import org.junit.runners.Suite.SuiteClasses;
import org.bbreak.excella.core.exception.ExceptionTestSuite;
import org.bbreak.excella.core.exporter.book.ExporterBookTestSuite;
import org.bbreak.excella.core.exporter.sheet.ExporterSheetTestSuite;
import org.bbreak.excella.core.handler.HandlerTestSuite;
import org.bbreak.e... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/test/java/org/bbreak/excella/core/exception/ExceptionTestSuite.java
// @RunWith(Suite.class)
// @SuiteClasses({
// ExportExceptionTest.class,
// ParseExceptionTest.class
// })
// public class ExceptionTestSuite {
//
// }
//
// Path: src/test/java/org/bbreak/excella/core/exporter/book/ExporterBook... | UtilTestSuite.class |
excella-core/excella-core | src/main/java/org/bbreak/excella/core/exporter/book/BookExporter.java | // Path: src/main/java/org/bbreak/excella/core/BookData.java
// public class BookData {
// /**
// * 解析結果(シート名、シートデータ)を保持するマップ
// */
// private Map<String, SheetData> sheetDataMap = new LinkedHashMap<String, SheetData>();
//
// /**
// * 追加された順序を保持したシート名の一覧
// */
// private List<Strin... | import org.bbreak.excella.core.exception.ExportException;
import org.apache.poi.ss.usermodel.Workbook;
import org.bbreak.excella.core.BookData; | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/main/java/org/bbreak/excella/core/BookData.java
// public class BookData {
// /**
// * 解析結果(シート名、シートデータ)を保持するマップ
// */
// private Map<String, SheetData> sheetDataMap = new LinkedHashMap<String, SheetData>();
//
// /**
// * 追加された順序を保持したシート名の一覧
// */
// private List<Strin... | void export( Workbook book, BookData bookdata) throws ExportException; |
excella-core/excella-core | src/main/java/org/bbreak/excella/core/exporter/book/BookExporter.java | // Path: src/main/java/org/bbreak/excella/core/BookData.java
// public class BookData {
// /**
// * 解析結果(シート名、シートデータ)を保持するマップ
// */
// private Map<String, SheetData> sheetDataMap = new LinkedHashMap<String, SheetData>();
//
// /**
// * 追加された順序を保持したシート名の一覧
// */
// private List<Strin... | import org.bbreak.excella.core.exception.ExportException;
import org.apache.poi.ss.usermodel.Workbook;
import org.bbreak.excella.core.BookData; | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/main/java/org/bbreak/excella/core/BookData.java
// public class BookData {
// /**
// * 解析結果(シート名、シートデータ)を保持するマップ
// */
// private Map<String, SheetData> sheetDataMap = new LinkedHashMap<String, SheetData>();
//
// /**
// * 追加された順序を保持したシート名の一覧
// */
// private List<Strin... | void export( Workbook book, BookData bookdata) throws ExportException; |
excella-core/excella-core | src/main/java/org/bbreak/excella/core/tag/excel2java/ObjectsPropertyParser.java | // Path: src/main/java/org/bbreak/excella/core/exception/ParseException.java
// @SuppressWarnings("serial")
// public class ParseException extends Exception {
//
// /** エラーとなったセル */
// private Cell cell;
//
// /**
// * コンストラクタ
// *
// * @param cell エラーセル
// */
// public ParseExce... | import java.util.Map;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Sheet;
import org.bbreak.excella.core.exception.ParseException; | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | // Path: src/main/java/org/bbreak/excella/core/exception/ParseException.java
// @SuppressWarnings("serial")
// public class ParseException extends Exception {
//
// /** エラーとなったセル */
// private Cell cell;
//
// /**
// * コンストラクタ
// *
// * @param cell エラーセル
// */
// public ParseExce... | public boolean isParse( Sheet sheet, Cell tagCell) throws ParseException { |
yyxhdy/ManyEAs | src/jmetal/operators/crossover/CrossoverFactory.java | // Path: src/jmetal/util/Configuration.java
// public class Configuration implements Serializable {
//
// /**
// * Logger object
// */
// public static Logger logger_ = Logger.getLogger("jMetal");
//
// } // Configuration
//
// Path: src/jmetal/util/JMException.java
// public class JMException extend... | import jmetal.util.JMException;
import java.util.HashMap;
import jmetal.util.Configuration; | // CrossoverFactory.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General P... | // Path: src/jmetal/util/Configuration.java
// public class Configuration implements Serializable {
//
// /**
// * Logger object
// */
// public static Logger logger_ = Logger.getLogger("jMetal");
//
// } // Configuration
//
// Path: src/jmetal/util/JMException.java
// public class JMException extend... | Configuration.logger_.severe("CrossoverFactory.getCrossoverOperator. " + |
yyxhdy/ManyEAs | src/jmetal/encodings/variable/Int.java | // Path: src/jmetal/core/Variable.java
// public abstract class Variable implements Serializable {
//
// /**
// * Creates an exact copy of a <code>Variable</code> object.
// * @return the copy of the object.
// */
// public abstract Variable deepCopy();
//
// /**
// * Gets the double value represen... | import jmetal.util.Configuration;
import jmetal.util.JMException;
import jmetal.util.PseudoRandom;
import jmetal.core.Variable; | public Int(Variable variable) throws JMException{
lowerBound_ = (int)variable.getLowerBound();
upperBound_ = (int)variable.getUpperBound();
value_ = (int)variable.getValue();
} // Int
/**
* Returns the value of the encodings.variable.
* @return the value.
*/
public double getValue() {
return ... | // Path: src/jmetal/core/Variable.java
// public abstract class Variable implements Serializable {
//
// /**
// * Creates an exact copy of a <code>Variable</code> object.
// * @return the copy of the object.
// */
// public abstract Variable deepCopy();
//
// /**
// * Gets the double value represen... | Configuration.logger_.severe("Int.deepCopy.execute: JMException"); |
yyxhdy/ManyEAs | src/jmetal/core/SolutionSet.java | // Path: src/jmetal/util/Configuration.java
// public class Configuration implements Serializable {
//
// /**
// * Logger object
// */
// public static Logger logger_ = Logger.getLogger("jMetal");
//
// } // Configuration
| import java.io.*;
import java.util.*;
import jmetal.util.Configuration; | // SolutionSet.Java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public... | // Path: src/jmetal/util/Configuration.java
// public class Configuration implements Serializable {
//
// /**
// * Logger object
// */
// public static Logger logger_ = Logger.getLogger("jMetal");
//
// } // Configuration
// Path: src/jmetal/core/SolutionSet.java
import java.io.*;
import java.util.*... | Configuration.logger_.severe("The population is full"); |
yyxhdy/ManyEAs | src/jmetal/core/Solution.java | // Path: src/jmetal/encodings/variable/Binary.java
// public class Binary extends Variable {
//
// /**
// * Stores the bits constituting the binary string. It is
// * implemented using a BitSet object
// */
// public BitSet bits_;
//
// /**
// * Store the length of the binary string
// */
// ... | import jmetal.encodings.variable.Binary;
import java.io.Serializable; | public SolutionType getType() {
return type_;
} // getType
/**
* Returns the aggregative value of the solution
*
* @return The aggregative value.
*/
public double getAggregativeValue() {
double value = 0.0;
for (int i = 0; i < numberOfObjectives(); i++) {
value += getObjective(i);
}
return va... | // Path: src/jmetal/encodings/variable/Binary.java
// public class Binary extends Variable {
//
// /**
// * Stores the bits constituting the binary string. It is
// * implemented using a BitSet object
// */
// public BitSet bits_;
//
// /**
// * Store the length of the binary string
// */
// ... | if ((variable_[i].getVariableType() == jmetal.encodings.variable.Binary.class) |
yyxhdy/ManyEAs | src/jmetal/operators/selection/SelectionFactory.java | // Path: src/jmetal/util/Configuration.java
// public class Configuration implements Serializable {
//
// /**
// * Logger object
// */
// public static Logger logger_ = Logger.getLogger("jMetal");
//
// } // Configuration
//
// Path: src/jmetal/util/JMException.java
// public class JMException extend... | import jmetal.util.JMException;
import java.util.HashMap;
import jmetal.util.Configuration; | // WorstSolutionSelection.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser Gen... | // Path: src/jmetal/util/Configuration.java
// public class Configuration implements Serializable {
//
// /**
// * Logger object
// */
// public static Logger logger_ = Logger.getLogger("jMetal");
//
// } // Configuration
//
// Path: src/jmetal/util/JMException.java
// public class JMException extend... | throws JMException { |
yyxhdy/ManyEAs | src/jmetal/operators/selection/SelectionFactory.java | // Path: src/jmetal/util/Configuration.java
// public class Configuration implements Serializable {
//
// /**
// * Logger object
// */
// public static Logger logger_ = Logger.getLogger("jMetal");
//
// } // Configuration
//
// Path: src/jmetal/util/JMException.java
// public class JMException extend... | import jmetal.util.JMException;
import java.util.HashMap;
import jmetal.util.Configuration; | // WorstSolutionSelection.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser Gen... | // Path: src/jmetal/util/Configuration.java
// public class Configuration implements Serializable {
//
// /**
// * Logger object
// */
// public static Logger logger_ = Logger.getLogger("jMetal");
//
// } // Configuration
//
// Path: src/jmetal/util/JMException.java
// public class JMException extend... | Configuration.logger_.severe("Operator '" + name + "' not found "); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.