com.google.gwt.core.shared.GwtIncompatible Java Examples

The following examples show how to use com.google.gwt.core.shared.GwtIncompatible. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestDOM.java    From vertxui with GNU General Public License v3.0 5 votes vote down vote up
@GwtIncompatible
@Before
public void before() {
	// for correct stacktrace decoding, we need the debug info.
	boolean debug = true;

	// Convert to javascript
	VertxUI.with(this.getClass(), null, debug, true);

	// Start the headless browser
	jBrowser = new JBrowserDriver(Settings.builder().logJavascript(true).build());
	jBrowser.get("file:///" + new File(VertxUI.getTargetFolder(debug) + "/index.html").getAbsolutePath());
}
 
Example #2
Source File: TestDOM.java    From vertxui with GNU General Public License v3.0 5 votes vote down vote up
@GwtIncompatible
@After
public void after() {
	if (jBrowser != null) {
		jBrowser.quit();
	}
}
 
Example #3
Source File: ThrowableTester.java    From gwt-jackson with Apache License 2.0 5 votes vote down vote up
@GwtIncompatible
public void testDeserializeIllegalArgumentException( ObjectReaderTester<RemoteThrowable> reader ) {
    RemoteThrowable throwable = reader.read( ILLEGAL_ARGUMENT_EXCEPTION_JSON );
    assertEquals( "" +
            "java.lang.IllegalArgumentException: Var cannot be null.\n" +
            "\tat com.Class0.method0(Class0.java:0)\n" +
            "\tat com.Class1.method1(Class1.java:1)\n" +
            "Caused by: java.lang.NullPointerException\n", ExceptionUtils.getStackTrace( throwable ) );
}
 
Example #4
Source File: ThrowableTester.java    From gwt-jackson with Apache License 2.0 5 votes vote down vote up
@GwtIncompatible
public void testDeserializeCustomException( ObjectReaderTester<RemoteThrowable> reader ) {
    RemoteThrowable throwable = reader.read( CUSTOM_EXCEPTION_JSON );
    assertEquals( "" +
            "com.github.nmorel.gwtjackson.remotelogging.shared.CustomException: My custom exception.\n" +
            "\tat com.Class2.method2(Class2.java:2)\n" +
            "\tat com.Class3.method3(Class3.java:3)\n" +
            "Caused by: java.lang.IllegalArgumentException: Var cannot be null.\n" +
            "\tat com.Class0.method0(Class0.java:0)\n" +
            "\tat com.Class1.method1(Class1.java:1)\n" +
            "Caused by: java.lang.NullPointerException\n", ExceptionUtils.getStackTrace( throwable ) );
}
 
Example #5
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Key.create(parent, Blah.class, id) is easier to type than new Key<Blah>(parent, Blah.class, id)
 */
@GwtIncompatible
public static <T> Key<T> create( Key<?> parent, Class<? extends T> kindClass, long id ) {
    throw new UnsupportedOperationException();
}
 
Example #6
Source File: Ref.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a Ref from a registered pojo entity
 */
@GwtIncompatible
public static <T> Ref<T> create( T value ) {
    throw new UnsupportedOperationException();
}
 
Example #7
Source File: Ref.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Key.create(Blah.class, id) is easier to type than new Key<Blah>(Blah.class, id)
 */
@GwtIncompatible
public static <T> Ref<T> create( Key<T> key ) {
    throw new UnsupportedOperationException();
}
 
Example #8
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Reconstitute a Key from a web safe string.  This can be generated with getString()/toWebSafeString()
 * or KeyFactory.stringToKey().
 */
@GwtIncompatible
private Key( String webSafe ) {
    throw new UnsupportedOperationException();
}
 
Example #9
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Create a key with a parent and a String name
 */
@GwtIncompatible
private Key( Key<?> parent, Class<? extends T> kindClass, String name ) {
    throw new UnsupportedOperationException();
}
 
Example #10
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Create a key with a parent and a long id
 */
@GwtIncompatible
private Key( Key<?> parent, Class<? extends T> kindClass, long id ) {
    throw new UnsupportedOperationException();
}
 
Example #11
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Create a key with a String name
 */
@GwtIncompatible
private Key( Class<? extends T> kindClass, String name ) {
    throw new UnsupportedOperationException();
}
 
Example #12
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Create a key with a long id
 */
@GwtIncompatible
private Key( Class<? extends T> kindClass, long id ) {
    throw new UnsupportedOperationException();
}
 
Example #13
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Create a key from a registered POJO entity.
 */
@GwtIncompatible
public static <T> Key<T> create( T pojo ) {
    throw new UnsupportedOperationException();
}
 
Example #14
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * This is an alias for Key.create(String) which exists for JAX-RS compliance.
 */
@GwtIncompatible
public static <T> Key<T> valueOf( String webSafeString ) {
    throw new UnsupportedOperationException();
}
 
Example #15
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Key.create(webSafeString) is easier to type than new Key<Blah>(webSafeString)
 */
@GwtIncompatible
public static <T> Key<T> create( String webSafeString ) {
    throw new UnsupportedOperationException();
}
 
Example #16
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Key.create(parent, Blah.class, name) is easier to type than new Key<Blah>(parent, Blah.class, name)
 */
@GwtIncompatible
public static <T> Key<T> create( Key<?> parent, Class<? extends T> kindClass, String name ) {
    throw new UnsupportedOperationException();
}
 
Example #17
Source File: ViewTestWithDom.java    From vertxui with GNU General Public License v3.0 4 votes vote down vote up
@GwtIncompatible
@Test
public void test() throws Exception {
	runJS(testNumber);
}
 
Example #18
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Key.create(Blah.class, name) is easier to type than new Key<Blah>(Blah.class, name)
 */
@GwtIncompatible
public static <T> Key<T> create( Class<? extends T> kindClass, String name ) {
    throw new UnsupportedOperationException();
}
 
Example #19
Source File: Key.java    From gwt-jackson with Apache License 2.0 4 votes vote down vote up
/**
 * Key.create(Blah.class, id) is easier to type than new Key<Blah>(Blah.class, id)
 */
@GwtIncompatible
public static <T> Key<T> create( Class<? extends T> kindClass, long id ) {
    throw new UnsupportedOperationException();
}
 
Example #20
Source File: FluentRenderer.java    From vertxui with GNU General Public License v3.0 4 votes vote down vote up
@GwtIncompatible
@Test
public void aTest() throws Exception {
	runJS(1);
	runJS(2);
}
 
Example #21
Source File: FluentInnerRendering.java    From vertxui with GNU General Public License v3.0 4 votes vote down vote up
@GwtIncompatible
@Test
public void test() throws Exception {
	runJS(3);
}
 
Example #22
Source File: TestDOM.java    From vertxui with GNU General Public License v3.0 4 votes vote down vote up
@GwtIncompatible
public void runJS(int which) throws Exception {
	try {
		String error = (String) jBrowser.executeScript("return window.asserty(" + which + ");");
		if (error == null) {
			return; // OK
		}

		// find symbolmap-file
		Optional<File> symbolMap = Stream
				.of(new File(VertxUI.getTargetFolder(true) + "/WEB-INF/deploy/a/symbolMaps").listFiles())
				.filter(f -> f.getName().endsWith(".symbolMap")).findFirst();
		if (symbolMap.isPresent() == false) {
			// no symbolmap file, is OK but less readable
			throw new Exception(error);
		}

		// Read it
		List<String> maps = IOUtils.readLines(new FileReader(symbolMap.get()));

		// Apply
		String[] errors = error.split("\n");
		Exception exception = new Exception(errors[0]);
		List<StackTraceElement> stacks = new ArrayList<>();
		boolean skippingStart = true;
		for (int x = 1; x < errors.length; x++) {
			int find = errors[x].indexOf("@");
			if (find == -1) { // garbage
				continue;
			}
			String fileAndMethod = errors[x].substring(0, find);
			Optional<String> line = maps.stream().filter(l -> l.startsWith(fileAndMethod)).findFirst();
			if (line.isPresent() == false) { // garbage
				continue;
			}
			String[] lne = line.get().split(",");

			// skipping the first few 'getting outside javascript'
			if (lne[2].equals("java.lang.AssertionError")) {
				skippingStart = false;
				continue;
			} else if (skippingStart) {
				continue;
			}
			StackTraceElement stack = new StackTraceElement(lne[2], lne[3], lne[4], Integer.parseInt(lne[5]));
			stacks.add(stack);
		}
		exception.setStackTrace(stacks.toArray(new StackTraceElement[0]));
		throw exception;
	} finally {
		// unfortunately jBrowser doesn't react on a runtime shutdown hook,
		// otherwise we could just recycle the jBrowser....
	}
}
 
Example #23
Source File: AnotherTest.java    From vertxui with GNU General Public License v3.0 4 votes vote down vote up
@GwtIncompatible
@Test
public void test() throws Exception {
	runJS(3);
}
 
Example #24
Source File: TestjUnitWithDom.java    From vertxui with GNU General Public License v3.0 4 votes vote down vote up
@GwtIncompatible
@Test
public void test() throws Exception {
	runJS(testNumber);
	System.out.println("This runs in Java");
}