Package honeycrm.server.test.small.dyn.hotreload

Examples of honeycrm.server.test.small.dyn.hotreload.ResourceStore


    assertTrue(p.matcher("honeycrm/server/test/small/DynamicallyLoadedClass.class").matches());
  }

  public void testDynamicLoadingFromJarFileWithOneClass() {
    try {
      ResourceStore r = new ResourceStore(db, "Classes");
      r.put(store.getBytecodeMapFromJarInputStream(new FileInputStream(FILE)));
     
      InterceptClassLoader loader = new InterceptClassLoader(getClass().getClassLoader(), Pattern.compile(PATTERN), Arrays.asList(new DatastoreClassLoaderDelegate(r)));
     
      Class c = loader.loadClass("honeycrm.server.test.small.DynamicallyLoadedClass", true);
      //assertTrue(c.newInstance() instanceof Plugin);
View Full Code Here


    }
  }
 
  public void testDynamicLoadingFromJarFileWithTwoClasses() {
    try {
      ResourceStore r = new ResourceStore(db, "Classes");
      InterceptClassLoader loader = new InterceptClassLoader(getClass().getClassLoader(), Pattern.compile(PATTERN), Arrays.asList(new DatastoreClassLoaderDelegate(r)));
     
      r.put(store.getBytecodeMapFromJarInputStream(new FileInputStream(FILE2)));
     
      Class c = loader.loadClass("honeycrm.server.test.small.DynamicallyLoadedClass");
      // assertTrue(c.getInterfaces()[0].equals(Plugin.class));
      // Plugin p = (Plugin) c.newInstance();
      // assertEquals("42", p.request());
View Full Code Here

    super.setUp();
    db = DatastoreServiceFactory.getDatastoreService();
  }

  public void testSimplePut() {
    ResourceStore r = new ResourceStore(db, "Classes");

    final byte[] bytes = new byte[] { 1 };

    r.put("foo/bar", bytes);
    assertTrue(Arrays.equals(bytes, r.get("foo/bar")));
  }
View Full Code Here

    assertTrue(Arrays.equals(bytes, r.get("foo/bar")));
  }

  public void testPutJarFile() {
    try {
      ResourceStore r = new ResourceStore(db, "Classes");
      r.put(store.getBytecodeMapFromJarInputStream(new FileInputStream(FILE)));
      assertNotNull(r.get("honeycrm.server.test.small.DynamicallyLoadedClass"));
    } catch (Exception e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here

TOP

Related Classes of honeycrm.server.test.small.dyn.hotreload.ResourceStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.