Java Code Examples for org.junit.Ignore

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project 4308Cirrus, under directory /tendril-domain/src/test/java/edu/colorado/cs/cirrus/domain/model/.

Source file: DeviceActionQueryTest.java

  31 
vote

@Ignore("Looks like tendril dropped this one") @Test public void canDeserializeDeviceActionQuery9(){
  Serializer serializer=new Persister();
  File source=new File("src/test/resources/QueryDeviceAction9.xml");
  try {
    DeviceActionQuery exampleUser=serializer.read(DeviceActionQuery.class,source);
    System.err.println(exampleUser);
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail();
  }
}
 

Example 2

From project activemq-apollo, under directory /apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/transport/.

Source file: VMTransportTest.java

  31 
vote

@Ignore @Test() public void autoCreateBroker() throws Exception {
  Transport connect=TransportFactory.connect("vm://test1");
  connect.setDispatchQueue(Dispatch.createQueue());
  RunnableCountDownLatch cd=new RunnableCountDownLatch(1);
  connect.start(cd);
  cd.await();
  assertNotNull(connect);
  cd=new RunnableCountDownLatch(1);
  connect.stop(cd);
  cd.await();
}
 

Example 3

From project addis, under directory /application/src/test/java/org/drugis/addis/entities/.

Source file: DomainManagerTest.java

  31 
vote

@Test @Ignore public void testSaveLoadXml() throws IOException, ClassNotFoundException {
  ExampleData.initDefaultData(d_manager.getDomain());
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  d_manager.saveXMLDomain(bos);
  Domain domain=d_manager.getDomain();
  d_manager.resetDomain();
  ByteArrayInputStream bis=new ByteArrayInputStream(bos.toByteArray());
  d_manager.loadXMLDomain(bis,2);
  assertDomainEquals(domain,d_manager.getDomain());
}
 

Example 4

From project aether-core, under directory /aether-connector-asynchttpclient/src/test/java/org/eclipse/aether/connector/async/.

Source file: PutTest.java

  30 
vote

@Test @Ignore("https://issues.sonatype.org/browse/AHC-5") public void testArtifactWithZeroBytesFile() throws Exception {
  String content="";
  addExpectation("gid/aid/version/aid-version-classifier.extension",content);
  addExpectation("gid/aid/version/aid-version-classifier.extension.sha1",sha1(content));
  addExpectation("gid/aid/version/aid-version-classifier.extension.md5",md5(content));
  Artifact artifact=artifact(content);
  ArtifactUpload up=new ArtifactUpload(artifact,artifact.getFile());
  List<ArtifactUpload> uploads=Arrays.asList(up);
  connector().put(uploads,null);
  ArtifactTransferException ex=up.getException();
  assertNull(ex != null ? ex.getMessage() : "",ex);
  assertExpectations();
}
 

Example 5

From project AirCastingAndroidClient, under directory /src/test/java/pl/llp/aircasting/model/.

Source file: SessionManagerTest.java

  30 
vote

@Ignore("Fix session persistence") @Test public void shouldStopASession(){
  ProgressListener listener=mock(ProgressListener.class);
  triggerMeasurement(11);
  sessionManager.finishSession(listener);
  verify(sessionManager.audioReader,never()).stop();
  verify(sessionManager.locationHelper).stop();
  verify(sessionManager.sessionRepository).save(Mockito.any(Session.class),eq(listener));
  assertThat(sessionManager.isSessionStarted(),equalTo(false));
}
 

Example 6

From project ANNIS, under directory /annis-service/src/test/java/annis/dao/.

Source file: TestSpringAnnisDao.java

  30 
vote

@SuppressWarnings("unchecked") @Ignore public void listCorpusByName(){
  final List<String> CORPUS_NAMES=mock(List.class);
  ListCorpusByNameDaoHelper listCorpusByNameDaoHelper=mock(ListCorpusByNameDaoHelper.class);
  simpleAnnisDao.setListCorpusByNameDaoHelper(listCorpusByNameDaoHelper);
  when(listCorpusByNameDaoHelper.createSql(anyList())).thenReturn(SQL);
  List<Long> wtf=simpleJdbcTemplate.query(anyString(),any(ListCorpusByNameDaoHelper.class));
  when(wtf).thenReturn(CORPUS_LIST);
  assertThat(simpleAnnisDao.mapCorpusNamesToIds(CORPUS_NAMES),is(CORPUS_LIST));
  verify(listCorpusByNameDaoHelper).createSql(CORPUS_NAMES);
  verify(simpleJdbcTemplate).query(SQL,listCorpusByNameDaoHelper);
}
 

Example 7

From project apollo, under directory /injector/src/test/java/com/bskyb/cg/environments/hash/.

Source file: TestPersistentHash.java

  30 
vote

@Test @Ignore public void testRemove(){
  try {
    resultPersistentHash.remove("key6");
    assertEquals(resultPersistentHash.size(),messagePersistentHash.size() - 1);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
 

Example 8

From project aranea, under directory /server/src/test/java/no/dusken/aranea/admin/security/.

Source file: TestRoleHiearchy.java

  29 
vote

/** 
 * Test what happens when the setup Ansv. red > *red is tried
 */
@Test @Ignore public void testRoleHiearchyAstericsBehavior(){
  GrantedAuthority maskinist=new GrantedAuthorityImpl("maskinist");
  RoleHierarchyImpl testhierachy=new RoleHierarchyImpl();
  testhierachy.setHierarchy("maskinist > ansvred " + "ansvred > *red" + "nyhetsred > nyhet"+ "kulturred > kultur");
  Collection<GrantedAuthority> reachable=hierachy.getReachableGrantedAuthorities(new LinkedList<GrantedAuthority>(Arrays.asList(maskinist)));
  Assert.notNull(reachable,"reachable was null");
  for (  GrantedAuthority ga : reachable) {
    if (ga.getAuthority().equals("kulturred")) {
      return;
    }
  }
  fail("*red not matched");
}
 

Example 9

From project Archimedes, under directory /br.org.archimedes.core.tests/test/br/org/archimedes/gui/opengl/.

Source file: OpenGLWrapperTest.java

  29 
vote

@Ignore @Test public void testAddDrawingContext(){
  Drawing drawing=new Drawing("Drawing");
  GLCanvas canvas=new GLCanvas(new Shell(),SWT.NO_BACKGROUND,new GLData());
  try {
    openGL.addDrawingCanvas(null,null);
    fail("Should not catch this exception.");
  }
 catch (  NullArgumentException e) {
    assertTrue(true);
  }
  try {
    openGL.addDrawingCanvas(drawing,null);
    fail("Should not catch this exception.");
  }
 catch (  NullArgumentException e) {
    assertTrue(true);
  }
  try {
    openGL.addDrawingCanvas(null,canvas);
    fail("Should not catch this exception.");
  }
 catch (  NullArgumentException e) {
    assertTrue(true);
  }
  try {
    openGL.addDrawingCanvas(drawing,canvas);
    Map<Drawing,GLCanvas> map=openGL.getDrawingCanvas();
    assertTrue("The drawing should be in the map!",map.containsKey(drawing));
    assertTrue("The drawing should be associated to the context.",map.get(drawing).equals(canvas));
  }
 catch (  NullArgumentException e) {
    fail("Should not catch this exception.");
  }
}
 

Example 10

From project arquillian-core, under directory /config/impl-base/src/test/java/org/jboss/arquillian/config/descriptor/impl/.

Source file: ArquillianDescriptorTestCase.java

  29 
vote

@Test @Ignore public void shouldBeAbleToAddContainerWithDependencies() throws Exception {
  desc=create().container(CONTAINER_NAME_1).dependency(DEPENDENCY_1).dependency(DEPENDENCY_2).exportAsString();
  assertXPath(desc,"/arquillian/container/dependencies/dependency",DEPENDENCY_1,DEPENDENCY_2);
  ArquillianDescriptor descriptor=create(desc);
  Assert.assertEquals(1,descriptor.getContainers().size());
  Assert.assertEquals(CONTAINER_NAME_1,descriptor.getContainers().get(0).getContainerName());
  Assert.assertEquals(DEPENDENCY_1,descriptor.getContainers().get(0).getDependencies().get(0));
  Assert.assertEquals(DEPENDENCY_2,descriptor.getContainers().get(0).getDependencies().get(1));
}
 

Example 11

From project arquillian-extension-jacoco, under directory /src/test/java/org/jboss/arquillian/extension/jacoco/test/.

Source file: CoverageDataTestCase.java

  29 
vote

@Test @Ignore public void generateReport() throws Exception {
  ExecutionDataReader reader=new ExecutionDataReader(new FileInputStream(new File("target/coverage.data")));
  ExecutionDataStore store=new ExecutionDataStore();
  SessionInfoStore sessionStore=new SessionInfoStore();
  reader.setExecutionDataVisitor(store);
  reader.setSessionInfoVisitor(sessionStore);
  reader.read();
  CoverageBuilder builder=new CoverageBuilder();
  Analyzer analyzer=new Analyzer(store,builder);
  for (  ExecutionData testData : store.getContents()) {
    System.out.println("analyzingClasses " + analyzer.analyzeAll(new File("target/test-classes/" + testData.getName() + ".class")));
  }
  System.out.println("analyzingClasses " + analyzer.analyzeAll(new File("target/classes")));
}
 

Example 12

From project astyanax, under directory /src/test/java/com/netflix/astyanax/connectionpool/impl/.

Source file: BaseConnectionPoolTest.java

  29 
vote

@Test @Ignore public void testThrashingTimeout(){
  ConnectionPool<TestClient> pool=createPool();
  pool.addHost(new Host("127.0.0.1",TestHostType.THRASHING_TIMEOUT.ordinal()),true);
  for (int i=0; i < 100; i++) {
    try {
      think(1);
      pool.executeWithFailover(dummyOperation,RunOnce.get());
    }
 catch (    OperationException e) {
      LOG.info(e.getMessage());
    }
catch (    ConnectionException e) {
      LOG.info(e.getMessage());
    }
  }
}
 

Example 13

From project atlas, under directory /src/test/java/com/ning/atlas/components/.

Source file: TestSSHKeyPairGenerator.java

  29 
vote

@Test @Ignore public void testFoo() throws Exception {
  Process p=new ProcessBuilder("ssh-keygen","-b","1024","-t","rsa","-f","/tmp/foo").start();
  int exit=p.waitFor();
  if (exit != 0) {
    System.out.println(CharStreams.toString(new InputStreamReader(p.getInputStream())));
    System.out.println(CharStreams.toString(new InputStreamReader(p.getErrorStream())));
  }
}
 

Example 14

From project avro, under directory /lang/java/ipc/src/test/java/org/apache/avro/ipc/.

Source file: TestNettyServerWithCallbacks.java

  29 
vote

@Ignore @Test public void performanceTest() throws Exception {
  final int threadCount=8;
  final long runTimeMillis=10 * 1000L;
  ExecutorService threadPool=Executors.newFixedThreadPool(threadCount);
  System.out.println("Running performance test for " + runTimeMillis + "ms...");
  final AtomicLong rpcCount=new AtomicLong(0L);
  final AtomicBoolean runFlag=new AtomicBoolean(true);
  final CountDownLatch startLatch=new CountDownLatch(threadCount);
  for (int ii=0; ii < threadCount; ii++) {
    threadPool.submit(new Runnable(){
      @Override public void run(){
        try {
          startLatch.countDown();
          startLatch.await(2,TimeUnit.SECONDS);
          while (runFlag.get()) {
            rpcCount.incrementAndGet();
            Assert.assertEquals("Hello, World!",simpleClient.hello("World!"));
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
);
  }
  startLatch.await(2,TimeUnit.SECONDS);
  Thread.sleep(runTimeMillis);
  runFlag.set(false);
  threadPool.shutdown();
  Assert.assertTrue("Timed out shutting down thread pool",threadPool.awaitTermination(2,TimeUnit.SECONDS));
  System.out.println("Completed " + rpcCount.get() + " RPCs in "+ runTimeMillis+ "ms => "+ (((double)rpcCount.get() / (double)runTimeMillis) * 1000)+ " RPCs/sec, "+ ((double)runTimeMillis / (double)rpcCount.get())+ " ms/RPC.");
}
 

Example 15

From project aws-tasks, under directory /src/it/java/datameer/awstasks/ant/ec2/.

Source file: AntFileExecutionTest.java

  29 
vote

@Test @Ignore public void execute_build_test_xml() throws Exception {
  String command="ant -f build.test.xml test-ec2";
  Process process=Runtime.getRuntime().exec(command);
  BufferedReader stdError=new BufferedReader(new InputStreamReader(process.getErrorStream()));
  String line;
  while ((line=stdError.readLine()) != null) {
    System.out.println(line);
  }
  int exitCode=process.waitFor();
  assertEquals(command + " failed",0,exitCode);
}
 

Example 16

From project baseunits, under directory /src/test/java/example/socialSecurityBenefits/.

Source file: SocialSecurityBenefitExample.java

  29 
vote

/** 
 * Example.
 */
@Test @Ignore public void testExcessEarnings(){
  CalendarInterval y1979=CalendarInterval.year(1979);
  CalendarDate birthday72=CalendarDate.from(1979,7,15);
  assertTrue(y1979.includes(birthday72));
  Money exemptMonthlyEarnings=Money.dollars(375);
  Money exemptAnnualEarnings=exemptMonthlyEarnings.times(12);
  assertEquals(Money.dollars(4500),exemptAnnualEarnings);
}
 

Example 17

From project bdb-index, under directory /src/test/java/org/neo4j/index/bdbje/.

Source file: TestBerkeley.java

  29 
vote

@Test @Ignore public void fullRelationshipIndex() throws Exception {
  Map<String,String> config=new HashMap<String,String>(BerkeleyDbIndexImplementation.DEFAULT_CONFIG);
  config.put("FullIndex","true");
  Index<Relationship> index=graphDb().index().forRelationships("fastR",config);
  Assert.assertEquals(RelationshipIndexFullImpl.class.getName(),index.getClass().getName());
  RelationshipType rType=new RelationshipTypeImpl("test");
  Node node1=graphDb().createNode();
  Node node2=graphDb().createNode();
  Relationship r1=node1.createRelationshipTo(node2,rType);
  index.add(r1,"name","Mattias");
  index.add(r1,"r_osm_id",Integer.valueOf(123));
  assertContains(index.get("name","Mattias"),r1);
  assertContains(index.get("r_osm_id",Integer.valueOf(123)),r1);
  restartTx();
  assertContains(index.get("name","Mattias"),r1);
  assertContains(index.get("r_osm_id",Integer.valueOf(123)),r1);
  Relationship r2=node1.createRelationshipTo(node2,rType);
  index.add(r2,"name","Mattias");
  assertContains(index.get("name","Mattias"),r1,r2);
  restartTx();
  assertContains(index.get("name","Mattias"),r1,r2);
  assertContains(index.get("name","Mattias"),r1,r2);
  index.remove(r1,"name","Mattias");
  assertContains(index.get("name","Mattias"),r1,r2);
  restartTx();
  assertContains(index.get("name","Mattias"),r2);
  index.remove(r2,"name","Mattias");
  assertContains(index.get("name","Mattias"),r2);
  r2.delete();
  r1.delete();
  node1.delete();
  node2.delete();
}
 

Example 18

From project beam-meris-icol, under directory /src/test/java/org/esa/beam/meris/icol/graphgen/.

Source file: GraphGenTest.java

  29 
vote

@Test @Ignore public void test1() throws IOException {
  final DummyOp op=new DummyOp();
  final Product s=createSourceProduct("s");
  op.setSourceProduct(s);
  final Product t=op.getTargetProduct();
  final GraphGen graphGen=new GraphGen();
  MyHandler handler=new MyHandler();
  graphGen.generateGraph(t,handler);
  assertEquals(read("GraphGenTest_test1.graphml"),handler.xml.toString());
}
 

Example 19

From project Betfair-Trickle, under directory /src/test/java/uk/co/onehp/trickle/dao/.

Source file: HibernateBetDaoCustomT.java

  29 
vote

@Ignore public static void main(final String[] args){
  final ApplicationContext applicationContext=new ClassPathXmlApplicationContext("classpath:/spring-trickle.xml");
  final BetDao betDao=(BetDao)applicationContext.getBean("betDao");
  final RaceDao raceDao=(RaceDao)applicationContext.getBean("raceDao");
  final Race race=new Race(867,"Race",new LocalDateTime(2012,2,22,19,19,0),"meeting");
  final Horse horse=new Horse();
  horse.setRunnerId(441);
  horse.setRaceId(867);
  horse.setRace(race);
  race.addHorse(horse);
  final Strategy strategy1=new Strategy();
  strategy1.setBetSecondsBeforeStartTime(Lists.newArrayList(120,270,600));
  final Strategy strategy2=new Strategy();
  strategy2.setBetSecondsBeforeStartTime(Lists.newArrayList(120,270,700));
  raceDao.saveOrUpdate(race);
  final Bet bet1=new Bet(horse,strategy1);
  betDao.saveOrUpdate(bet1);
  final Bet bet2=new Bet(horse,strategy2);
  betDao.saveOrUpdate(bet2);
  System.out.println(betDao.getBetsToPlace());
}
 

Example 20

From project big-data-plugin, under directory /test-src/org/pentaho/di/ui/job/entries/oozie/.

Source file: OozieJobExecutorControllerTest.java

  29 
vote

@Ignore @Test public void testSyncModel_advanced_removedProp() throws Exception {
  OozieJobExecutorConfig config=getGoodConfig();
  controller.setConfig(config);
  Properties props=OozieJobExecutorJobEntry.getProperties(config,new Variables());
  controller.syncModel();
  controller.setJobEntryMode(JobEntryMode.ADVANCED_LIST);
  controller.variablesTree.setSelectedRows(new int[]{0});
  controller.removeProperty();
  controller.syncModel();
  assertTrue(controller.isAdvancedArgumentsChanged());
  assertEquals(props.size() - 1,controller.getAdvancedArguments().size());
}
 

Example 21

From project bigger-tests, under directory /lucene-index/src/test/java/org/neo4j/index/impl/lucene/.

Source file: TestBatchInsertion.java

  29 
vote

@Ignore @Test public void testInsertionSpeed(){
  BatchInserter inserter=new BatchInserterImpl(new File(PATH,"3").getAbsolutePath());
  BatchInserterIndexProvider provider=new LuceneBatchInserterIndexProvider(inserter);
  BatchInserterIndex index=provider.nodeIndex("yeah",EXACT_CONFIG);
  index.setCacheCapacity("key",1000000);
  long t=currentTimeMillis();
  for (int i=0; i < 1000000; i++) {
    Map<String,Object> properties=map("key","value" + i);
    long id=inserter.createNode(properties);
    index.add(id,properties);
  }
  System.out.println("insert:" + (currentTimeMillis() - t));
  index.flush();
  t=currentTimeMillis();
  for (int i=0; i < 1000000; i++) {
    count((Iterator<Long>)index.get("key","value" + i));
  }
  System.out.println("get:" + (currentTimeMillis() - t));
}
 

Example 22

From project blacktie, under directory /jatmibroker-xatmi/src/test/java/org/jboss/narayana/blacktie/jatmibroker/core/transport/.

Source file: NamingServiceClient.java

  29 
vote

@Ignore public void test() throws InvalidName {
  String[] args=new String[2];
  args[0]="-ORBInitRef";
  args[1]="NameService=corbaloc::localhost:3528/NameService";
  Properties props=new Properties();
  props.put("org.omg.CORBA.ORBInitialPort","3528");
  props.put("org.omg.CORBA.ORBInitialHost","localhost");
  ORB orb=ORB.init(args,props);
  NamingContextExt nc=NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
  BindingListHolder bl=new BindingListHolder();
  BindingIteratorHolder blIt=new BindingIteratorHolder();
  nc.list(1000,bl,blIt);
  Binding bindings[]=bl.value;
  List<String> toResolve=new ArrayList<String>();
  toResolve.add("TransactionManagerService");
  for (int i=0; i < bindings.length; i++) {
    int lastIx=bindings[i].binding_name.length - 1;
    if (bindings[i].binding_type == BindingType.ncontext) {
      log.info("Context: " + bindings[i].binding_name[lastIx].id);
    }
 else {
      log.info("Object: " + bindings[i].binding_name[lastIx].id);
    }
    toResolve.remove(bindings[i].binding_name[lastIx].id);
  }
  assertTrue(toResolve.isEmpty());
}
 

Example 23

From project blueprint-namespaces, under directory /blueprint/blueprint-ns-itests/src/test/java/org/apache/aries/blueprint/ns/itests/.

Source file: SampleTest.java

  29 
vote

@Test @Ignore public void namespace_usage_with_version_range_picks_highest_version(BundleContext ctx) throws Exception {
  try {
    installBundle(ctx,"nstest.list_1.0.0",makeCollectionHandler(ListHandlerActivator.class,"1.0.0"));
    installBundle(ctx,"nstest.list_1.0.1",makeCollectionHandler(ListHandlerActivator.class,"1.0.1"));
    installBundle(ctx,"nstest.list_1.0.2",makeCollectionHandler(ListHandlerActivator.class,"1.0.2"));
    installBundle(ctx,"nstest.list_1.1.0",makeCollectionHandler(LinkedListHandlerActivator.class,"1.1.0"));
    installBundle(ctx,"nstest.list_1.0.3",makeCollectionHandler(ListHandlerActivator.class,"1.0.3"));
    installBundle(ctx,"nstest.sample",makeCollectionTestBundle(""));
    assertTrue(waitForBlueprint(ctx,"nstest.sample").getComponentInstance("mylist") instanceof LinkedList);
  }
  finally {
    cleanup();
  }
}
 

Example 24

From project bonecp, under directory /bonecp/src/test/java/com/jolbox/bonecp/.

Source file: TestMemorizeTransactionProxy.java

  29 
vote

/** 
 * @throws ClassNotFoundException
 * @throws SQLException
 */
@Test @Ignore public void testHSQLDB() throws ClassNotFoundException, SQLException {
  Class.forName("org.hsqldb.jdbcDriver");
  this.config.setTransactionRecoveryEnabled(true);
  this.config.setJdbcUrl("jdbc:hsqldb:mem");
  this.config.setUsername("sa");
  this.config.setPassword("");
  this.config.setMinConnectionsPerPartition(1);
  this.config.setMaxConnectionsPerPartition(1);
  this.config.setAcquireRetryAttempts(1);
  this.config.setAcquireRetryDelayInMs(1);
  this.config.setStatementsCacheSize(100);
  this.config.setReleaseHelperThreads(0);
  this.config.setTransactionRecoveryEnabled(true);
  BoneCP pool=new BoneCP(this.config);
  Connection c=pool.getConnection();
  Statement st=c.createStatement();
  try {
    st.execute("CREATE TABLE foo(id INTEGER)");
  }
 catch (  SQLException e) {
  }
  PreparedStatement ps=c.prepareStatement("insert into foo(id) values (1)");
  try {
    ps.execute();
    ps.close();
    st.execute("alter table foo");
  }
 catch (  SQLException e) {
  }
  PreparedStatement ps2=c.prepareStatement("insert into foo(id) values (1)");
  ps2.execute();
}
 

Example 25

From project bulk-builder-plugin, under directory /src/test/java/org/jenkinsci/plugins/bulkbuilder/.

Source file: BulkBuilderActionTest.java

  29 
vote

@Ignore("HTMLUnit is struggling to find submit button") @Test public void atestFormSubmitBuildAll() throws Exception {
  HtmlPage page=new WebClient().goTo("/bulkbuilder");
  HtmlForm form=page.getFormByName("builder");
  List<HtmlRadioButtonInput> radioButtons=form.getRadioButtonsByName("build");
  for (  HtmlRadioButtonInput radioButton : radioButtons) {
    if (radioButton.getValueAttribute().equalsIgnoreCase("all")) {
      radioButton.setChecked(true);
    }
  }
  HtmlButton submitButton=form.getButtonByCaption("Build!");
  FreeStyleProject project1=createFreeStyleProject("project1");
  FreeStyleProject project2=createFreeStyleProject("project2");
  Page click=submitButton.click();
  assertEquals(2,action.getQueueSize());
}
 

Example 26

From project camel-beanstalk, under directory /src/test/java/com/osinka/camel/beanstalk/.

Source file: EndpointTest.java

  29 
vote

@Test @Ignore("Apache Camel bug CAMEL-4857") public void testTubes(){
  BeanstalkEndpoint endpoint=context.getEndpoint("beanstalk:host:11303/tube1+tube%2B+tube%3F?command=kick",BeanstalkEndpoint.class);
  assertNotNull("Beanstalk endpoint",endpoint);
  assertEquals("Command",BeanstalkComponent.COMMAND_KICK,endpoint.command);
  assertEquals("Host","host",endpoint.conn.host);
  assertArrayEquals("Tubes",new String[]{"tube1","tube+","tube?"},endpoint.conn.tubes);
}
 

Example 27

From project candlepin, under directory /src/test/java/org/candlepin/client/.

Source file: CandlepinConnectionTest.java

  29 
vote

@Ignore("needs mock connection to test with") @Test public void connect(){
  CandlepinConnection conn=new CandlepinConnection(new Config());
  Credentials creds=new UsernamePasswordCredentials("admin","admin");
  OwnerClient client=conn.connect(OwnerClient.class,creds,"http://localhost:8080/candlepin/");
  ClientResponse<Owner> resp=client.replicateOwner("admin");
  assertNotNull(resp);
  assertEquals(200,resp.getStatus());
  Owner o=resp.getEntity();
  assertNotNull(o);
  System.out.println(o);
}
 

Example 28

From project capedwarf-blue, under directory /memcache/src/test/java/org/jboss/test/capedwarf/memcache/.

Source file: MemcacheStatisticsTestCase.java

  29 
vote

@Test @Ignore("enable JMX stats for cache") public void testHitAndMissCount(){
  service.put("key1","value1");
  assertEquals(0,service.getStatistics().getHitCount());
  assertEquals(0,service.getStatistics().getMissCount());
  service.get("key1");
  assertEquals(1,service.getStatistics().getHitCount());
  assertEquals(0,service.getStatistics().getMissCount());
  service.get("key2");
  assertEquals(1,service.getStatistics().getHitCount());
  assertEquals(1,service.getStatistics().getMissCount());
}
 

Example 29

From project cascading, under directory /src/test/cascading/.

Source file: RegressionPipesPlatformTest.java

  29 
vote

@Ignore public void testDupeHeadNames() throws Exception {
  if (true)   return;
  Tap source=getPlatform().getTextFile(inputFileJoined);
  Tap sink=getPlatform().getTextFile(getOutputPath("unknown"),SinkMode.REPLACE);
  Pipe lhs=new Pipe("test");
  lhs=new Each(lhs,new Fields("line"),new RegexSplitter(" "));
  Pipe rhs=new Pipe("test");
  rhs=new Each(rhs,new Fields("line"),new RegexSplitter(" "));
  Pipe group=new GroupBy(Pipe.pipes(lhs,rhs),Fields.size(3));
  try {
    getPlatform().getFlowConnector().connect(source,sink,group);
    fail("did not fail on dupe head names");
  }
 catch (  Exception exception) {
  }
}
 

Example 30

From project cdk, under directory /generator/src/test/java/org/richfaces/cdk/apt/processors/.

Source file: BehaviorProcessorTest.java

  29 
vote

@Test @Ignore public void testProcess() throws Exception {
  expect(componentElement.getAnnotation(JsfBehavior.class)).andStubReturn(behaviorAnnotation);
  expect(behaviorAnnotation.id()).andReturn(MY_BEHAVIOR);
  expect(componentElement.getQualifiedName()).andReturn(name);
  expect(componentElement.getModifiers()).andReturn(Collections.singleton(Modifier.ABSTRACT));
  expect(componentElement.getQualifiedName()).andReturn(name).atLeastOnce();
  expect(behaviorAnnotation.generate()).andReturn("foo.Bar");
  expect(behaviorAnnotation.tag()).andReturn(new Tag[]{tag});
  expect(behaviorAnnotation.attributes()).andReturn(new String[]{});
  expect(behaviorAnnotation.description()).andReturn(this.description);
  expect(tag.handler()).andStubReturn("");
  utils.visitSupertypes((TypeElement)anyObject(),(SuperTypeVisitor)anyObject());
  expectLastCall();
  expect(utils.getBeanPropertiesAnnotatedWith(eq(Attribute.class),(TypeElement)anyObject())).andReturn(Collections.<BeanProperty>emptySet());
  expect(utils.getDocComment((TypeElement)anyObject())).andStubReturn(null);
  replay(log,utils,componentElement,jaxb,conventions,behaviorAnnotation,tag,name);
  processor.process(componentElement,library);
  verify(log,utils,componentElement,jaxb,conventions,behaviorAnnotation,tag,name);
  Collection<BehaviorModel> behaviors=library.getBehaviors();
  assertEquals(1,behaviors.size());
  for (  BehaviorModel model : behaviors) {
    FacesId id=model.getId();
    if (id != null) {
      assertEquals(MY_BEHAVIOR,id.toString());
    }
  }
}
 

Example 31

From project ceres, under directory /ceres-site/src/test/java/com/bc/ceres/site/.

Source file: HtmlModuleGeneratorTest.java

  29 
vote

@Ignore @Test public void testParsing() throws IOException, CoreException, URISyntaxException, SAXException, ParserConfigurationException {
  final String someResource=getClass().getResource("dummy_resource").getFile();
  final String resourceDir=new File(someResource).getParent();
  URL repositoryUrl=new URL("http://www.brockmann-consult.de/beam/software/repositories/4.7/");
  final File dest=new File(resourceDir + File.separator + "testGeneration.html");
  PrintWriter pw=new PrintWriter(dest);
  log.setLevel(Level.OFF);
  RepositoryScanner moduleScanner=new RepositoryScanner(log,repositoryUrl,ProxyConfig.NULL);
  Module[] modules=moduleScanner.scan(ProgressMonitor.NULL);
  HtmlGenerator generator=new PageDecoratorGenerator(new MultiplePassGenerator(new HtmlGenerator[]{htmlModuleGenerator}));
  generator.generate(pw,modules,repositoryUrl.toString());
  pw.close();
}
 

Example 32

From project ceylon-module-resolver, under directory /testsuite/src/test/java/com/redhat/ceylon/test/smoke/test/.

Source file: HerdTestCase.java

  29 
vote

@Test @Ignore("Required Herd running locally") public void testHerdAndRepoSearchPaged2() throws Exception {
  ModuleDetails[] expected=new ModuleDetails[]{new ModuleDetails("ceylon.collection","A module for collections \"foo\" `hehe` < 3\n\n    some code `with` \"stuff\" < ?? &lt; &#32; &#x32; 2\n\nboo","Apache Software License",set("St?phane ?pardaud"),set("0.3.0")),new ModuleDetails("ceylon.language",null,null,set(),set("0.1"))};
  ModuleSearchResult results=testSearchResults("",Type.JVM,expected,0L,2L,getDualRepositoryManager());
  long[] pagingInfo=results.getNextPagingInfo();
  Assert.assertNotNull(pagingInfo);
  Assert.assertEquals(2,pagingInfo.length);
  Assert.assertEquals(0,pagingInfo[0]);
  Assert.assertEquals(2,pagingInfo[1]);
  expected=new ModuleDetails[]{new ModuleDetails("com.acme.helloworld","The classic Hello World module","Public domain",set("Stef Epardaud"),set("1.0.0","1.0.2","1.0.3")),new ModuleDetails("fr.epardaud.collections",null,null,set(),set("0.1","0.2")),new ModuleDetails("fr.epardaud.iop",null,null,set(),set("0.1")),new ModuleDetails("fr.epardaud.json",null,null,set(),set("0.1")),new ModuleDetails("fr.epardaud.net",null,null,set(),set("0.2")),new ModuleDetails("fr.epardaud.test",null,null,set(),set("0.1"))};
  results=testSearchResults("",Type.JVM,expected,2L,6L,getDualRepositoryManager(),pagingInfo);
  pagingInfo=results.getNextPagingInfo();
  Assert.assertNotNull(pagingInfo);
  Assert.assertEquals(2,pagingInfo.length);
  Assert.assertEquals(1,pagingInfo[0]);
  Assert.assertEquals(8,pagingInfo[1]);
  expected=new ModuleDetails[]{new ModuleDetails("hello",null,null,set(),set("1.0.0")),new ModuleDetails("moduletest",null,null,set(),set("0.1")),new ModuleDetails("org.apache.commons.httpclient",null,null,set(),set("3.1")),new ModuleDetails("org.jboss.acme",null,null,set(),set("1.0.0.Final")),new ModuleDetails("test-jar",null,null,set(),set("0.1"))};
  testSearchResults("",Type.JVM,expected,8L,null,getDualRepositoryManager(),pagingInfo);
}
 

Example 33

From project ceylon-runtime, under directory /testsuite/src/test/java/org/jboss/ceylon/test/modules/repo/test/.

Source file: RepositoryTestCase.java

  29 
vote

@Test @Ignore public void testMultipleRepositories() throws Throwable {
  List<String> extra=new ArrayList<String>();
  extra.add(Constants.CEYLON_ARGUMENT_PREFIX + Argument.REPOSITORY.toString());
  extra.add(getAlternative().getPath());
  extra.add(Constants.CEYLON_ARGUMENT_PREFIX + Argument.REPOSITORY.toString());
  extra.add(getRepo().getPath());
  extra.add(Constants.CEYLON_ARGUMENT_PREFIX + Argument.RUN.toString());
  extra.add("moduletest.helloworld");
  execute("moduletest/0.1",extra);
}
 

Example 34

From project cloudify, under directory /dsl/src/test/java/org/cloudifysource/dsl/.

Source file: CloudParserTest.java

  29 
vote

@Ignore @Test public void testCloudParser() throws Exception {
  org.cloudifysource.dsl.cloud.Cloud cloud=ServiceReader.readCloud(new File(SIMPLE_CLOUD_PATH));
  assertNotNull(cloud);
  assertNotNull(cloud.getProvider());
  assertNotNull(cloud.getTemplates());
  assertNotNull(cloud.getUser());
  assertNotNull(cloud.getTemplates().size() > 0);
  assertNotNull(cloud.getTemplates().get("SMALL_LINUX"));
}
 

Example 35

From project coala, under directory /modules/coala-communication/src/test/java/org/openehealth/coala/converter/.

Source file: PXSDateConverterTest.java

  29 
vote

/** 
 * Tests for correct conversion from String to Date Test method for  {@link org.openehealth.coala.util.PXSDateConverter#stringToDate(java.lang.String)}.
 */
@Test @Ignore public void testStringToDate(){
  Date pxsDate=pxsDateConverter.stringToDate(referenceStringLong);
  assertTrue(pxsDate.getTime() == referenceDateLong.getTime());
  pxsDate=pxsDateConverter.stringToDate(referenceStringShort);
  assertTrue(pxsDate.equals(referenceDateShort));
}
 

Example 36

From project Collections, under directory /src/test/java/vanilla/java/collections/.

Source file: ClassNodeTest.java

  29 
vote

@Test @Ignore public void test() throws IOException {
  for (  Class clazz : new Class[]{HandTypesArrayList.class,HandTypesAllocation.class,HandTypesElement.class,HandTypesImpl.class}) {
    ClassReader cr=new ClassReader(clazz.getName());
    StringWriter sw=new StringWriter();
    ASMifierClassVisitor cv=new ASMifierClassVisitor(new PrintWriter(sw));
    cr.accept(cv,0);
    String text=sw.toString();
    System.out.println(text.replaceAll("\"vanilla/java/collections/hand/HandTypes","name + \"").replaceAll("Lvanilla/java/collections/hand/HandTypes","L\" + name + \"").replaceAll("\"vanilla/java/collections/HandTypes\"","name").replaceAll("Lvanilla/java/collections/HandTypes;","L\" + name + \";").replaceAll("\"vanilla/java/collections/","collections + \"").replaceAll("Lvanilla/java/collections/","L\" + collections + \""));
  }
}
 

Example 37

From project components, under directory /camel/camel-core/src/test/java/org/switchyard/component/camel/deploy/.

Source file: CamelActivatorTest.java

  29 
vote

@Ignore @Test public void startStop() throws Exception {
  final MockHandler mockHandler=_testKit.registerInOnlyService("SimpleCamelService");
  final CamelActivator activator=getCamelActivator();
  final CamelContext camelContext=activator.getCamelContext();
  final ProducerTemplate producerTemplate=camelContext.createProducerTemplate();
  producerTemplate.sendBody("direct://input","dummy payload");
  assertOneMessage(mockHandler,"dummy payload");
  try {
    producerTemplate.sendBody("direct://input2","dummy payload");
    Assert.fail("Expected CamelExecutionException.");
  }
 catch (  CamelExecutionException e) {
  }
  producerTemplate.sendBody("direct://input","dummy payload");
  assertOneMessage(mockHandler,"dummy payload");
}
 

Example 38

From project components-ness-hbase, under directory /src/test/java/com/nesscomputing/hbase/spill/.

Source file: SpilledFileTester.java

  29 
vote

@Ignore public void testSimple() throws Exception {
  final File file=new File("/tmp/log-c37ec4b4-a495-4256-b3b1-f2b25f83821e-00797.spilled");
  final SpilledFile spilledFile=new SpilledFile(file);
  Assert.assertEquals(1,spilledFile.getVersion());
  int count=spilledFile.getElements();
  final List<Put> data=spilledFile.load();
  Assert.assertEquals(count,data.size());
}
 

Example 39

From project components-ness-jackson, under directory /src/test/java/com/nesscomputing/jackson/.

Source file: TestNessJacksonModule.java

  29 
vote

@Ignore @Test public void testSafeToMultiplyInject(){
  final Injector injector=Guice.createInjector(Stage.PRODUCTION,ConfigModule.forTesting(),new NessJacksonModule(),new AbstractModule(){
    @Override protected void configure(){
      install(new NessJacksonModule());
    }
  }
);
  final ObjectMapper mapper=injector.getInstance(ObjectMapper.class);
  Assert.assertNotNull(mapper);
}
 

Example 40

From project constretto-core, under directory /constretto-spring/src/test/java/org/constretto/spring/assembly/.

Source file: AssemblyWithConcreteClassesTest.java

  29 
vote

@Test @Ignore("Fix this. This really should work") public void injectionUsingConstrettoWithRecognizedEnvironmentAutowiringConcreteClassThatDoNotImplementAnInterface(){
class MyConsumer {
    @Autowired PureTestClazz pureTestClazz;
  }
  setProperty(ASSEMBLY_KEY,"stub");
  ApplicationContext ctx=loadContextAndInjectWithConstretto();
  MyConsumer consumer=new MyConsumer();
  ctx.getAutowireCapableBeanFactory().autowireBean(consumer);
  Assert.assertEquals(consumer.pureTestClazz.getClass(),PureTestClazz.class);
}
 

Example 41

From project Core_2, under directory /project-model-maven-tests/src/test/java/org/jboss/forge/maven/facets/.

Source file: MavenDependencyFacetTest.java

  29 
vote

@Test @Ignore public void testDoResolveVersions() throws Exception {
  Project project=getProject();
  DependencyFacet deps=project.getFacet(DependencyFacet.class);
  List<Dependency> versions=deps.resolveAvailableVersions("com.ocpsoft:prettyfaces-jsf2");
  assertTrue(versions.size() > 4);
}
 

Example 42

From project core_3, under directory /src/test/java/org/animotron/games/.

Source file: DescriptionLogicTest.java

  29 
vote

@Test @Ignore public void famaly() throws Throwable {
  new JExpression(_(DEF._,"woman"),_(AN._,"person"),_(AN._,"female"));
  new JExpression(_(DEF._,"man"),_(AN._,"person"));
  new JExpression(_(DEF._,"mother"),_(AN._,"woman"),_(AN._,"child",_(AN._,"person")));
  new JExpression(_(DEF._,"father"),_(AN._,"man"),_(AN._,"child",_(AN._,"person")));
  new JExpression(_(DEF._,"parent"),_(AN._,"mother"),_(AN._,"father"));
  new JExpression(_(DEF._,"grandmother"),_(AN._,"mother"),_(AN._,"child",_(AN._,"parent")));
  new JExpression(_(DEF._,"motherWith3Children"),_(ANY._,"mother",_(GE._,_(COUNT._,"child"),value(3))));
  new JExpression(_(DEF._,"motherWithoutDaughter"),_(ANY._,"mother"));
  new JExpression(_(DEF._,"wife"),_(AN._,"woman",_(AN._,"husband",_(AN._,"man"))));
  new JExpression(_(DEF._,"personA"),_(AN._,"man"));
  new JExpression(_(DEF._,"personB"),_(AN._,"woman"),_(AN._,"child",_(AN._,"personA")));
  JExpression a=new JExpression(_(DEF._,"a"),_(AN._,"Question",_(AN._,"mother",_(AN._,"personB"))));
  assertAnimoResult(a,"def a the yes.");
}
 

Example 43

From project cp-openrdf-utils, under directory /test/src/com/clarkparsia/openrdf/query/sparql/.

Source file: TestQueryUtils.java

  29 
vote

@Test @Ignore("We're producing the correct answer, but assertAlgebraEquals is brittle enough that we can't check it") public void testBuilderWithFilterAndOptional() throws Exception {
  String aQuery="PREFIX  dc:  <http://purl.org/dc/elements/1.1/>\n" + "PREFIX  ns:  <http://example.org/ns#>\n" + "SELECT  ?title ?price\n"+ "WHERE   { ?x dc:title ?title .\n"+ "			?x dc:subject ?subject .\n"+ "			FILTER (?price < 300).\n"+ "			FILTER (?price > 0 && ?price != 10).\n"+ "          OPTIONAL { ?x ns:price ?price . ?x ns:discount ?d. FILTER (?price < 30). FILTER (bound(?d)) }\n"+ "        }";
  QueryBuilder<ParsedTupleQuery> aBuilder=QueryBuilderFactory.select();
  aBuilder.addProjectionVar("title","price").group().atom("x",DC.ontology().title,"title").atom("x",DC.ontology().subject,"subject").filter("price",Compare.CompareOp.LT,ValueFactoryImpl.getInstance().createLiteral(300)).filter().and(ValueExprFactory.gt("price",ValueFactoryImpl.getInstance().createLiteral(0)),ValueExprFactory.ne("price",ValueFactoryImpl.getInstance().createLiteral(10))).optional().atom("x",ValueFactoryImpl.getInstance().createURI("http://example.org/ns#price"),"price").atom("x",ValueFactoryImpl.getInstance().createURI("http://example.org/ns#discount"),"d").filter("price",Compare.CompareOp.LT,ValueFactoryImpl.getInstance().createLiteral(30)).filter().bound("d");
  assertAlgebraEquals(parse(aQuery),aBuilder.query());
}
 

Example 44

From project crammer, under directory /src/test/java/uk/ac/ebi/ena/sra/cram/encoding/.

Source file: ArithCodec1Test.java

  29 
vote

@Test @Ignore public void test1() throws IOException {
  DiByteFrequencies f=new DiByteFrequencies();
  f.add((byte)1,(byte)1,1);
  f.add((byte)1,(byte)2,2);
  f.add((byte)2,(byte)2,3);
  ArithCodec1 codec=new ArithCodec1(f.getFrequencies(),f.getValues());
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  BitOutputStream bos=new DefaultBitOutputStream(baos);
  byte[] bytes=new byte[]{1,1,2,2};
  codec.write(bos,bytes);
  bos.flush();
  byte[] buf=baos.toByteArray();
  ByteArrayInputStream bais=new ByteArrayInputStream(buf);
  BitInputStream bis=new LongBufferBitInputStream(bais);
  assertThat(codec.read(bis,bytes.length),equalTo(bytes));
}
 

Example 45

From project culvert, under directory /hive-culvert-handler/src/test/java/com/bah/culvert/.

Source file: CulvertOutputFormatTest.java

  29 
vote

@Ignore(value="Filed as bug. #375") @Test public void testBasicOperation() throws Throwable {
  CulvertOutputFormat format=new CulvertOutputFormat();
  JobConf conf=new JobConf();
  Client.setDatabaseAdapter(conf,InMemoryDB.class);
  Properties tblProps=CulvertHiveUtils.confToProps(conf);
  InMemoryDB db=new InMemoryDB();
  CColumn col=new CColumn("foo".getBytes(),"bar".getBytes());
  db.create("baz",Arrays.asList(col));
  CulvertHiveUtils.setCulvertConfigurationIsEmbedded(tblProps,true);
  CulvertHiveUtils.setCulvertTable(tblProps,"baz");
  final int[] i={0};
  Progressable progress=new Progressable(){
    @Override public void progress(){
      i[0]++;
    }
  }
;
  RecordWriter writer=format.getHiveRecordWriter(conf,null,Put.class,true,tblProps,progress);
  writer.write(new Put(new CKeyValue("a".getBytes(),"b".getBytes(),"c".getBytes(),"d".getBytes())));
  Assert.assertEquals(1,i[0]);
  SeekingCurrentIterator it=db.getTableAdapter("baz").get(new Get(new CRange("a".getBytes())));
  Assert.assertTrue("Iterator should have a next value",it.hasNext());
  Result next=it.next();
  Assert.assertTrue("Result row should be 'a' byte equivalent",Arrays.equals("a".getBytes(),next.getRecordId()));
  Assert.assertTrue("Result should be ",Arrays.equals("d".getBytes(),next.getValue("b".getBytes(),"c".getBytes()).getValue()));
}
 

Example 46

From project curator, under directory /curator-x-zkclient-bridge/src/test/java/org/I0Itec/zkclient/.

Source file: AbstractConnectionTest.java

  29 
vote

@Test @Ignore("I don't understand this test -JZ") public void testSequentials() throws KeeperException, InterruptedException {
  String sequentialPath=_connection.create("/a",new byte[0],CreateMode.EPHEMERAL_SEQUENTIAL);
  int firstSequential=Integer.parseInt(sequentialPath.substring(2));
  assertEquals("/a" + ZkPathUtil.leadingZeros(firstSequential++,10),sequentialPath);
  assertEquals("/a" + ZkPathUtil.leadingZeros(firstSequential++,10),_connection.create("/a",new byte[0],CreateMode.EPHEMERAL_SEQUENTIAL));
  assertEquals("/a" + ZkPathUtil.leadingZeros(firstSequential++,10),_connection.create("/a",new byte[0],CreateMode.PERSISTENT_SEQUENTIAL));
  assertEquals("/b" + ZkPathUtil.leadingZeros(firstSequential++,10),_connection.create("/b",new byte[0],CreateMode.EPHEMERAL_SEQUENTIAL));
  assertEquals("/b" + ZkPathUtil.leadingZeros(firstSequential++,10),_connection.create("/b",new byte[0],CreateMode.PERSISTENT_SEQUENTIAL));
  assertEquals("/a" + ZkPathUtil.leadingZeros(firstSequential++,10),_connection.create("/a",new byte[0],CreateMode.EPHEMERAL_SEQUENTIAL));
}
 

Example 47

From project derric, under directory /test/org/derric_lang/validator/.

Source file: TestInterpretValidatorInputStreamImpl.java

  29 
vote

@Ignore("Enable when runtime library supports non-byte aligned multi-byte values.") @Test public void readUnsignedByteIntegersAcrossBytes() throws IOException {
  Assert.assertEquals(2,_input.unsigned().readInteger(3));
  Assert.assertEquals(87,_input.unsigned().readInteger(7));
  Assert.assertEquals(45,_input.unsigned().readInteger(7));
  Assert.assertEquals(26,_input.unsigned().readInteger(6));
  Assert.assertEquals(1,_input.unsigned().readInteger(5));
  Assert.assertEquals(13,_input.unsigned().readInteger(4));
}
 

Example 48

From project descriptors, under directory /metadata-parser/src/test/java/org/jboss/shrinkwrap/descriptor/metadata/filter/.

Source file: SimpleContentFilterTestCase.java

  29 
vote

/** 
 * SimpleContent as used for text only types are not supported at the moment!
 */
@Test @Ignore public void testSimpleContent() throws Exception {
  final boolean isLogging=false;
  final String xmlFragment="<xs:schema xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" >" + "   <xs:element name=\"shoesize\">" + "      <xs:complexType>"+ "         <xs:simpleContent>"+ "            <xs:extension base=\"xs:integer\">"+ "               <xs:attribute name=\"country\" type=\"xs:string\" />"+ "            </xs:extension>"+ "         </xs:simpleContent>"+ "      </xs:complexType>"+ "   </xs:element>"+ "</xs:schema>";
  final Metadata metadata=DomTestUtil.parse(xmlFragment,isLogging);
  Assert.assertEquals("shoesize",metadata.getClassList().get(0).getName(),"shoesize");
  final List<MetadataElement> e=metadata.getClassList().get(0).getElements();
  DomTestUtil.assertElement(e.get(0),"<xs:element name=\"shoesize\" type=\"text\">");
  DomTestUtil.assertClassAttribute(e.get(1),"<xs:attribute name=\"country\" type=\"xs:string\" />");
}
 

Example 49

From project dozer, under directory /core/src/test/java/org/dozer/functional_tests/builder/.

Source file: MapMappingTest.java

  29 
vote

@Test @Ignore("Backwards mapping does not work") public void shouldMapEmbeddedList(){
  beanMapper.addMapping(new BeanMappingBuilder(){
    @Override protected void configure(){
      mapping(Map.class,ListContainer.class).fields(this_().mapKey("embedded"),"list",collectionStrategy(true,RelationshipType.NON_CUMULATIVE));
    }
  }
);
  HashMap<String,Object> map=new HashMap<String,Object>();
  List<String> list=new ArrayList<String>();
  list.add("A");
  map.put("embedded",list);
  ListContainer container=new ListContainer();
  beanMapper.map(map,container);
  assertEquals(1,container.getList().size());
  assertEquals("A",container.getList().get(0));
  HashMap<String,Object> copy=new HashMap<String,Object>();
  beanMapper.map(container,copy);
  assertEquals(map,copy);
}
 

Example 50

From project drools-chance, under directory /drools-chance-core/src/test/java/org/drools/chance/distribution/belief/.

Source file: TBMStrategyFactoryTest.java

  29 
vote

@Test @Ignore public void testCommonality(){
  assertEquals(0.35,tbm.getCommonality("B","A").getValue(),1e-16);
  assertEquals(0.35,tbm.getCommonality("A","B").getValue(),1e-16);
  assertEquals(0.55,tbm.getCommonality("A").getValue(),1e-16);
  assertEquals(0.15,tbm.getCommonality("B","C","D").getValue(),1e-16);
  assertEquals(0.15,tbm.getCommonality("C","D","B").getValue(),1e-16);
  assertEquals(0.15,tbm.getCommonality("C","B","D").getValue(),1e-16);
  assertEquals(0.5,tbm.getCommonality("C","D").getValue(),1e-16);
  assertEquals(0.5,tbm.getCommonality("D","C").getValue(),1e-16);
  assertEquals(1.0,tbm.getCommonality("D","C","B","A").getValue(),1e-16);
  System.out.println(tbm);
}
 

Example 51

From project drools-mas, under directory /drools-mas-util/src/test/java/org/drools/mas/.

Source file: TestACLMessage.java

  29 
vote

@Test @Ignore public void testSerializeDeserializeArray(){
  XStream json=new XStream(new JettisonMappedXmlDriver());
  Object[] test=new Object[]{new String("aaa"),new Integer(233),new String("bbb"),new String("aaa")};
  String js=json.toXML(test);
  Object o=json.fromXML(js);
  Object[] rec=(Object[])o;
  assertEquals("aaa",rec[0]);
  assertEquals(new Integer(233),rec[1]);
  assertEquals("bbb",rec[2]);
  assertEquals("aaa",rec[3]);
}
 

Example 52

From project drools-semantics, under directory /src/test/java/org/drools/semantics/lang/dl/.

Source file: DL_2_ModelGenerationTest.java

  29 
vote

@Test @Ignore public void testPropertiesGenerationInternal(){
  KnowledgeBase kbase=KnowledgeBaseFactory.newKnowledgeBase();
  StatefulKnowledgeSession kSession=kbase.newStatefulKnowledgeSession();
  String source="DLex6.manchester";
  org.drools.io.Resource res=ResourceFactory.newClassPathResource(source);
  factory.setInferenceStrategy(DLFactory.INFERENCE_STRATEGY.INTERNAL);
  OntoModel results=factory.buildModel("ex6",res,kSession);
  ModelCompiler compiler=ModelCompilerFactory.newModelCompiler(ModelFactory.CompileTarget.DRL);
  DRLModel drlModel=(DRLModel)compiler.compile(results);
  check(results,drlModel);
}
 

Example 53

From project droolsjbpm-integration, under directory /drools-camel/src/test/java/org/drools/camel/component/.

Source file: BatchTest.java

  29 
vote

@Test @Ignore public void testInsertObjectWithDeclaredFact() throws Exception {
  String str="";
  str+="package org.foo \n";
  str+="declare Whee \n\ttype: String\n\tprice: Integer\n\toldPrice: Integer\nend\n";
  str+="rule rule1 \n";
  str+="  when \n";
  str+="    $c : Whee() \n";
  str+=" \n";
  str+="  then \n";
  str+="    $c.setPrice( $c.getPrice() + 5 ); \n";
  str+="end\n";
  StatefulKnowledgeSession ksession=getStatefulKnowledgeSession(ResourceFactory.newByteArrayResource(str.getBytes()));
  setExec(ksession);
  ExecutionResults results=null;
  String outXml=null;
  ClassLoader orig=null;
  ClassLoader cl=((InternalRuleBase)((StatefulKnowledgeSessionImpl)ksession).getRuleBase()).getRootClassLoader();
  try {
    orig=Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(cl);
    outXml=execContent("testInsertObjectWithDeclaredFact.in.1");
    results=unmarshalOutXml(outXml,ExecutionResults.class);
  }
  finally {
    Thread.currentThread().setContextClassLoader(orig);
  }
  FactHandle factHandle=(FactHandle)results.getFactHandle("outStilton");
  Object object=results.getValue("outStilton");
  assertEquals("org.foo.Whee",object.getClass().getName());
  assertXMLEqual(getContent("testInsertObjectWithDeclaredFact.expected.1",factHandle.toExternalForm()),outXml);
}
 

Example 54

From project droolsjbpm-tools, under directory /drools-eclipse/org.drools.eclipse.test/src/test/java/org/drools/eclipse/editors/completion/.

Source file: CompletionContextTest.java

  29 
vote

@Test @Ignore public void testCheckLHSLocationDetermination_INSIDE_CONDITION_ARGUMENT12(){
  String input="rule MyRule \n" + "    when \n" + "        Class ( property in ";
  Location location=new CompletionContext(input).getLocation();
  assertEquals(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT,location.getType());
  assertEquals("Class",location.getProperty(Location.LOCATION_PROPERTY_CLASS_NAME));
  assertEquals("property",location.getProperty(Location.LOCATION_PROPERTY_PROPERTY_NAME));
  assertEquals("in",location.getProperty(Location.LOCATION_PROPERTY_OPERATOR));
}